pyqrack-cpu 1.65.6__tar.gz → 1.66.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of pyqrack-cpu might be problematic. Click here for more details.

Files changed (29) hide show
  1. {pyqrack_cpu-1.65.6 → pyqrack_cpu-1.66.0}/Makefile +1 -1
  2. {pyqrack_cpu-1.65.6/pyqrack_cpu.egg-info → pyqrack_cpu-1.66.0}/PKG-INFO +1 -1
  3. {pyqrack_cpu-1.65.6 → pyqrack_cpu-1.66.0}/pyqrack/qrack_simulator.py +20 -0
  4. {pyqrack_cpu-1.65.6 → pyqrack_cpu-1.66.0}/pyqrack/qrack_system/qrack_system.py +4 -1
  5. {pyqrack_cpu-1.65.6 → pyqrack_cpu-1.66.0/pyqrack_cpu.egg-info}/PKG-INFO +1 -1
  6. {pyqrack_cpu-1.65.6 → pyqrack_cpu-1.66.0}/setup.py +1 -1
  7. {pyqrack_cpu-1.65.6 → pyqrack_cpu-1.66.0}/LICENSE +0 -0
  8. {pyqrack_cpu-1.65.6 → pyqrack_cpu-1.66.0}/MANIFEST.in +0 -0
  9. {pyqrack_cpu-1.65.6 → pyqrack_cpu-1.66.0}/README.md +0 -0
  10. {pyqrack_cpu-1.65.6 → pyqrack_cpu-1.66.0}/pyproject.toml +0 -0
  11. {pyqrack_cpu-1.65.6 → pyqrack_cpu-1.66.0}/pyqrack/__init__.py +0 -0
  12. {pyqrack_cpu-1.65.6 → pyqrack_cpu-1.66.0}/pyqrack/neuron_activation_fn.py +0 -0
  13. {pyqrack_cpu-1.65.6 → pyqrack_cpu-1.66.0}/pyqrack/pauli.py +0 -0
  14. {pyqrack_cpu-1.65.6 → pyqrack_cpu-1.66.0}/pyqrack/qrack_ace_backend.py +0 -0
  15. {pyqrack_cpu-1.65.6 → pyqrack_cpu-1.66.0}/pyqrack/qrack_circuit.py +0 -0
  16. {pyqrack_cpu-1.65.6 → pyqrack_cpu-1.66.0}/pyqrack/qrack_neuron.py +0 -0
  17. {pyqrack_cpu-1.65.6 → pyqrack_cpu-1.66.0}/pyqrack/qrack_neuron_torch_layer.py +0 -0
  18. {pyqrack_cpu-1.65.6 → pyqrack_cpu-1.66.0}/pyqrack/qrack_stabilizer.py +0 -0
  19. {pyqrack_cpu-1.65.6 → pyqrack_cpu-1.66.0}/pyqrack/qrack_system/__init__.py +0 -0
  20. {pyqrack_cpu-1.65.6 → pyqrack_cpu-1.66.0}/pyqrack/quimb_circuit_type.py +0 -0
  21. {pyqrack_cpu-1.65.6 → pyqrack_cpu-1.66.0}/pyqrack/stats/__init__.py +0 -0
  22. {pyqrack_cpu-1.65.6 → pyqrack_cpu-1.66.0}/pyqrack/stats/load_quantized_data.py +0 -0
  23. {pyqrack_cpu-1.65.6 → pyqrack_cpu-1.66.0}/pyqrack/stats/quantize_by_range.py +0 -0
  24. {pyqrack_cpu-1.65.6 → pyqrack_cpu-1.66.0}/pyqrack_cpu.egg-info/SOURCES.txt +0 -0
  25. {pyqrack_cpu-1.65.6 → pyqrack_cpu-1.66.0}/pyqrack_cpu.egg-info/dependency_links.txt +0 -0
  26. {pyqrack_cpu-1.65.6 → pyqrack_cpu-1.66.0}/pyqrack_cpu.egg-info/not-zip-safe +0 -0
  27. {pyqrack_cpu-1.65.6 → pyqrack_cpu-1.66.0}/pyqrack_cpu.egg-info/requires.txt +0 -0
  28. {pyqrack_cpu-1.65.6 → pyqrack_cpu-1.66.0}/pyqrack_cpu.egg-info/top_level.txt +0 -0
  29. {pyqrack_cpu-1.65.6 → pyqrack_cpu-1.66.0}/setup.cfg +0 -0
@@ -18,7 +18,7 @@ help:
18
18
  build-deps:
19
19
  ifneq ($(OS),Windows_NT)
20
20
  ifeq ($(QRACK_PRESENT),)
21
- git clone https://github.com/unitaryfund/qrack.git; cd qrack; git checkout 37d462c76f418b358876ed2d73da70fe19aacd97; cd ..
21
+ git clone https://github.com/unitaryfund/qrack.git; cd qrack; git checkout 5d04b51c373cdd6e033df0189d35fb27f2fc13df; cd ..
22
22
  endif
23
23
  mkdir -p qrack/build
24
24
  ifeq ($(UNAME_S),Linux)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyqrack-cpu
3
- Version: 1.65.6
3
+ Version: 1.66.0
4
4
  Summary: pyqrack - Pure Python vm6502q/qrack Wrapper
5
5
  Home-page: https://github.com/vm6502q/pyqrack
6
6
  Author: Daniel Strano
@@ -2292,6 +2292,26 @@ class QrackSimulator:
2292
2292
  self._throw_if_error()
2293
2293
  return list(probs)
2294
2294
 
2295
+ def out_rdm(self, q):
2296
+ """Get reduced density matrix
2297
+
2298
+ Returns the raw reduced density matrix of the simulator, for the qubit list.
2299
+ Warning: State vector or is not always the internal representation leading
2300
+ to sub-optimal performance of the method.
2301
+
2302
+ Raises:
2303
+ RuntimeError: QrackSimulator raised an exception.
2304
+
2305
+ Returns:
2306
+ flat list structure representing the reduced density matrix.
2307
+ """
2308
+ amp_count = 1 << len(q)
2309
+ sqr_amp_count = amp_count * amp_count
2310
+ flat_rdm = self._qrack_complex_byref([complex(0, 0)] * sqr_amp_count)
2311
+ Qrack.qrack_lib.OutReducedDensityMatrix(self.sid, len(q), self._ulonglong_byref(q), flat_rdm)
2312
+ self._throw_if_error()
2313
+ return [complex(r, i) for r, i in self._pairwise(flat_rdm)]
2314
+
2295
2315
  def prob_all(self, q):
2296
2316
  """Probabilities of all subset permutations
2297
2317
 
@@ -87,19 +87,22 @@ class QrackSystem:
87
87
  CFUNCTYPE(c_ulonglong, c_double, c_double),
88
88
  ]
89
89
 
90
- # These next two methods need to have c_double pointers, if PyQrack is built with fp64.
90
+ # These next few methods need to have c_double pointers, if PyQrack is built with fp64.
91
91
  self.qrack_lib.InKet.restype = None
92
92
  self.qrack_lib.OutKet.restype = None
93
93
  self.qrack_lib.OutProbs.restype = None
94
+ self.qrack_lib.OutReducedDensityMatrix.restype = None
94
95
 
95
96
  if self.fppow < 6:
96
97
  self.qrack_lib.InKet.argtypes = [c_ulonglong, POINTER(c_float)]
97
98
  self.qrack_lib.OutKet.argtypes = [c_ulonglong, POINTER(c_float)]
98
99
  self.qrack_lib.OutProbs.argtypes = [c_ulonglong, POINTER(c_float)]
100
+ self.qrack_lib.OutReducedDensityMatrix.argtypes = [c_ulonglong, c_ulonglong, POINTER(c_ulonglong), POINTER(c_float)]
99
101
  else:
100
102
  self.qrack_lib.InKet.argtypes = [c_ulonglong, POINTER(c_double)]
101
103
  self.qrack_lib.OutKet.argtypes = [c_ulonglong, POINTER(c_double)]
102
104
  self.qrack_lib.OutProbs.argtypes = [c_ulonglong, POINTER(c_double)]
105
+ self.qrack_lib.OutReducedDensityMatrix.argtypes = [c_ulonglong, c_ulonglong, POINTER(c_ulonglong), POINTER(c_double)]
103
106
 
104
107
  self.qrack_lib.init.restype = c_ulonglong
105
108
  self.qrack_lib.init.argtypes = []
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyqrack-cpu
3
- Version: 1.65.6
3
+ Version: 1.66.0
4
4
  Summary: pyqrack - Pure Python vm6502q/qrack Wrapper
5
5
  Home-page: https://github.com/vm6502q/pyqrack
6
6
  Author: Daniel Strano
@@ -7,7 +7,7 @@ from setuptools import setup
7
7
  from setuptools.command.build_py import build_py
8
8
 
9
9
 
10
- VERSION = "1.65.6"
10
+ VERSION = "1.66.0"
11
11
 
12
12
  # Read long description from README.
13
13
  README_PATH = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'README.md')
File without changes
File without changes
File without changes
File without changes