pyqrack-cpu 1.65.6__py3-none-win_amd64.whl → 1.66.0__py3-none-win_amd64.whl
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.
- pyqrack/qrack_simulator.py +20 -0
- pyqrack/qrack_system/qrack_lib/qrack_pinvoke.dll +0 -0
- pyqrack/qrack_system/qrack_system.py +4 -1
- {pyqrack_cpu-1.65.6.dist-info → pyqrack_cpu-1.66.0.dist-info}/METADATA +1 -1
- {pyqrack_cpu-1.65.6.dist-info → pyqrack_cpu-1.66.0.dist-info}/RECORD +8 -8
- {pyqrack_cpu-1.65.6.dist-info → pyqrack_cpu-1.66.0.dist-info}/LICENSE +0 -0
- {pyqrack_cpu-1.65.6.dist-info → pyqrack_cpu-1.66.0.dist-info}/WHEEL +0 -0
- {pyqrack_cpu-1.65.6.dist-info → pyqrack_cpu-1.66.0.dist-info}/top_level.txt +0 -0
pyqrack/qrack_simulator.py
CHANGED
|
@@ -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
|
|
|
Binary file
|
|
@@ -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 = []
|
|
@@ -5,17 +5,17 @@ pyqrack/qrack_ace_backend.py,sha256=rBQC9M5FnABOqGVKxtu-YhK8Uzu-CT0P5XGD5dViHzU,
|
|
|
5
5
|
pyqrack/qrack_circuit.py,sha256=QK2dtPYurdXuw-efVq7lYz40_480NxCejXhOVwBGkXs,20122
|
|
6
6
|
pyqrack/qrack_neuron.py,sha256=a3F0hduVvXZi9aXsY0du5hBFXpMq_R5UHHDOv2-YtFM,9305
|
|
7
7
|
pyqrack/qrack_neuron_torch_layer.py,sha256=OhNSldzaqLaMoNBkin68j8QWOOiuZCQJDZPgSDRI2Fk,6330
|
|
8
|
-
pyqrack/qrack_simulator.py,sha256=
|
|
8
|
+
pyqrack/qrack_simulator.py,sha256=gh8_Eedw6srSPQ7hZC4m33-gatY_WGhHDvg3QzyZdA0,149269
|
|
9
9
|
pyqrack/qrack_stabilizer.py,sha256=AJe7dfFcxFKyig3tjWXw0UKhXer5Wl9QNvjNNqlOL5M,2182
|
|
10
10
|
pyqrack/quimb_circuit_type.py,sha256=iC0CCpZBGhziFC8-uBCH43Mi29uvVUrtBG6W9YBlyps,638
|
|
11
11
|
pyqrack/qrack_system/__init__.py,sha256=PUterej-xpA4BqFmiBrQCMeTQlsRf-K8Dxnwp-iVvUQ,343
|
|
12
|
-
pyqrack/qrack_system/qrack_system.py,sha256=
|
|
13
|
-
pyqrack/qrack_system/qrack_lib/qrack_pinvoke.dll,sha256=
|
|
12
|
+
pyqrack/qrack_system/qrack_system.py,sha256=mkuEkW5ffgYgpE4dgqdMYIP0hRWEBM-IwjqJ_yh70-o,44735
|
|
13
|
+
pyqrack/qrack_system/qrack_lib/qrack_pinvoke.dll,sha256=kSZlpzjquAXtkTuI13G6HCz79IQqFW3mAWmd9s_li6A,1785344
|
|
14
14
|
pyqrack/stats/__init__.py,sha256=hI715MGW7D4mDYhUFpRI4ZLsynYDO4tN-rjsuuYbG6Q,282
|
|
15
15
|
pyqrack/stats/load_quantized_data.py,sha256=_1w9BPrZNreP0wOAyaAZHdEGKoGiI7tMeFD9P3eyJC0,1219
|
|
16
16
|
pyqrack/stats/quantize_by_range.py,sha256=0eBIqByIxa4vfm4fQGZLAMGR9y8raxde3e5rvUWJ_dQ,2326
|
|
17
|
-
pyqrack_cpu-1.
|
|
18
|
-
pyqrack_cpu-1.
|
|
19
|
-
pyqrack_cpu-1.
|
|
20
|
-
pyqrack_cpu-1.
|
|
21
|
-
pyqrack_cpu-1.
|
|
17
|
+
pyqrack_cpu-1.66.0.dist-info/LICENSE,sha256=IdAVedmFOPQtHi_XeEI9OhJwUuwlT6tCJwrT55zAn3w,1090
|
|
18
|
+
pyqrack_cpu-1.66.0.dist-info/METADATA,sha256=5jKCODUWqRhuM0wcpaF_hOIxF37TJq7Vr1aGyVaYClY,6035
|
|
19
|
+
pyqrack_cpu-1.66.0.dist-info/WHEEL,sha256=JMWfR_Dj7ISokcwe0cBhCfK6JKnIi-ZX11L6d_ntt6o,98
|
|
20
|
+
pyqrack_cpu-1.66.0.dist-info/top_level.txt,sha256=YE_3q9JTGRLMilNg2tGP1y7uU-Dx8PDao2OhwoIbv8E,8
|
|
21
|
+
pyqrack_cpu-1.66.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|