pyqrack 1.65.6__tar.gz → 1.66.6__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 might be problematic. Click here for more details.
- {pyqrack-1.65.6 → pyqrack-1.66.6}/Makefile +3 -1
- {pyqrack-1.65.6/pyqrack.egg-info → pyqrack-1.66.6}/PKG-INFO +1 -1
- {pyqrack-1.65.6 → pyqrack-1.66.6}/pyproject.toml +1 -2
- {pyqrack-1.65.6 → pyqrack-1.66.6}/pyqrack/qrack_simulator.py +20 -0
- {pyqrack-1.65.6 → pyqrack-1.66.6}/pyqrack/qrack_system/qrack_system.py +4 -1
- {pyqrack-1.65.6 → pyqrack-1.66.6/pyqrack.egg-info}/PKG-INFO +1 -1
- {pyqrack-1.65.6 → pyqrack-1.66.6}/setup.py +2 -2
- {pyqrack-1.65.6 → pyqrack-1.66.6}/LICENSE +0 -0
- {pyqrack-1.65.6 → pyqrack-1.66.6}/MANIFEST.in +0 -0
- {pyqrack-1.65.6 → pyqrack-1.66.6}/README.md +0 -0
- {pyqrack-1.65.6 → pyqrack-1.66.6}/pyqrack/__init__.py +0 -0
- {pyqrack-1.65.6 → pyqrack-1.66.6}/pyqrack/neuron_activation_fn.py +0 -0
- {pyqrack-1.65.6 → pyqrack-1.66.6}/pyqrack/pauli.py +0 -0
- {pyqrack-1.65.6 → pyqrack-1.66.6}/pyqrack/qrack_ace_backend.py +0 -0
- {pyqrack-1.65.6 → pyqrack-1.66.6}/pyqrack/qrack_circuit.py +0 -0
- {pyqrack-1.65.6 → pyqrack-1.66.6}/pyqrack/qrack_neuron.py +0 -0
- {pyqrack-1.65.6 → pyqrack-1.66.6}/pyqrack/qrack_neuron_torch_layer.py +0 -0
- {pyqrack-1.65.6 → pyqrack-1.66.6}/pyqrack/qrack_stabilizer.py +0 -0
- {pyqrack-1.65.6 → pyqrack-1.66.6}/pyqrack/qrack_system/__init__.py +0 -0
- {pyqrack-1.65.6 → pyqrack-1.66.6}/pyqrack/quimb_circuit_type.py +0 -0
- {pyqrack-1.65.6 → pyqrack-1.66.6}/pyqrack/stats/__init__.py +0 -0
- {pyqrack-1.65.6 → pyqrack-1.66.6}/pyqrack/stats/load_quantized_data.py +0 -0
- {pyqrack-1.65.6 → pyqrack-1.66.6}/pyqrack/stats/quantize_by_range.py +0 -0
- {pyqrack-1.65.6 → pyqrack-1.66.6}/pyqrack.egg-info/SOURCES.txt +0 -0
- {pyqrack-1.65.6 → pyqrack-1.66.6}/pyqrack.egg-info/dependency_links.txt +0 -0
- {pyqrack-1.65.6 → pyqrack-1.66.6}/pyqrack.egg-info/not-zip-safe +0 -0
- {pyqrack-1.65.6 → pyqrack-1.66.6}/pyqrack.egg-info/requires.txt +0 -0
- {pyqrack-1.65.6 → pyqrack-1.66.6}/pyqrack.egg-info/top_level.txt +0 -0
- {pyqrack-1.65.6 → pyqrack-1.66.6}/setup.cfg +0 -0
|
@@ -16,9 +16,11 @@ help:
|
|
|
16
16
|
|
|
17
17
|
.PHONY: build-deps
|
|
18
18
|
build-deps:
|
|
19
|
+
rm -rf pyqrack/qrack_system/qrack_lib
|
|
20
|
+
rm -rf pyqrack/qrack_system/qrack_cl_precompile
|
|
19
21
|
ifneq ($(OS),Windows_NT)
|
|
20
22
|
ifeq ($(QRACK_PRESENT),)
|
|
21
|
-
git clone https://github.com/unitaryfund/qrack.git; cd qrack; git checkout
|
|
23
|
+
git clone https://github.com/unitaryfund/qrack.git; cd qrack; git checkout 774f880e3d7a1b3d447e5414388e2f5d72f3a1f0; cd ..
|
|
22
24
|
endif
|
|
23
25
|
mkdir -p qrack/build
|
|
24
26
|
ifeq ($(UNAME_S),Linux)
|
|
@@ -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
|
|
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 = []
|
|
@@ -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.
|
|
10
|
+
VERSION = "1.66.6"
|
|
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')
|
|
@@ -68,7 +68,7 @@ setup(
|
|
|
68
68
|
],
|
|
69
69
|
keywords="pyqrack qrack simulator quantum gpu",
|
|
70
70
|
install_requires=[],
|
|
71
|
-
setup_requires=[
|
|
71
|
+
setup_requires=[],
|
|
72
72
|
extras_require={
|
|
73
73
|
"dev": [
|
|
74
74
|
"pytest>=7.3.1",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|