pyqrack-cpu-complex128 1.66.7__py3-none-manylinux_2_39_x86_64.whl → 1.70.2__py3-none-manylinux_2_39_x86_64.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.
- pyqrack/qrack_simulator.py +52 -11
- pyqrack/qrack_system/qrack_lib/libqrack_pinvoke.so +0 -0
- pyqrack/qrack_system/qrack_lib/libqrack_pinvoke.so.9.29.2 +0 -0
- pyqrack/qrack_system/qrack_system.py +9 -2
- {pyqrack_cpu_complex128-1.66.7.dist-info → pyqrack_cpu_complex128-1.70.2.dist-info}/METADATA +1 -1
- {pyqrack_cpu_complex128-1.66.7.dist-info → pyqrack_cpu_complex128-1.70.2.dist-info}/RECORD +9 -9
- pyqrack/qrack_system/qrack_lib/libqrack_pinvoke.so.9.25.7 +0 -0
- {pyqrack_cpu_complex128-1.66.7.dist-info → pyqrack_cpu_complex128-1.70.2.dist-info}/WHEEL +0 -0
- {pyqrack_cpu_complex128-1.66.7.dist-info → pyqrack_cpu_complex128-1.70.2.dist-info}/licenses/LICENSE +0 -0
- {pyqrack_cpu_complex128-1.66.7.dist-info → pyqrack_cpu_complex128-1.70.2.dist-info}/top_level.txt +0 -0
pyqrack/qrack_simulator.py
CHANGED
|
@@ -60,6 +60,7 @@ class QrackSimulator:
|
|
|
60
60
|
isHostPointer=(
|
|
61
61
|
True if os.environ.get("PYQRACK_HOST_POINTER_DEFAULT_ON") else False
|
|
62
62
|
),
|
|
63
|
+
isSparse=False,
|
|
63
64
|
noise=0,
|
|
64
65
|
pyzxCircuit=None,
|
|
65
66
|
qiskitCircuit=None,
|
|
@@ -99,6 +100,7 @@ class QrackSimulator:
|
|
|
99
100
|
isCpuGpuHybrid,
|
|
100
101
|
isOpenCL,
|
|
101
102
|
isHostPointer,
|
|
103
|
+
isSparse
|
|
102
104
|
)
|
|
103
105
|
|
|
104
106
|
self._throw_if_error()
|
|
@@ -2132,9 +2134,7 @@ class QrackSimulator:
|
|
|
2132
2134
|
def decompose(self, q):
|
|
2133
2135
|
"""Decompose system
|
|
2134
2136
|
|
|
2135
|
-
|
|
2136
|
-
Warning: The qubit subsystem state must be separable, or the behavior
|
|
2137
|
-
of this method is undefined.
|
|
2137
|
+
Factorize a set of contiguous bits with minimal fidelity loss.
|
|
2138
2138
|
|
|
2139
2139
|
Args:
|
|
2140
2140
|
q: qubit id
|
|
@@ -2144,7 +2144,7 @@ class QrackSimulator:
|
|
|
2144
2144
|
RuntimeError: QrackSimulator with isTensorNetwork=True option cannot decompose()! (Turn off just this option, in the constructor.)
|
|
2145
2145
|
|
|
2146
2146
|
Returns:
|
|
2147
|
-
|
|
2147
|
+
Decomposed subsystem simulator.
|
|
2148
2148
|
"""
|
|
2149
2149
|
if self.is_tensor_network:
|
|
2150
2150
|
raise RuntimeError(
|
|
@@ -2161,10 +2161,8 @@ class QrackSimulator:
|
|
|
2161
2161
|
def dispose(self, q):
|
|
2162
2162
|
"""Dispose qubits
|
|
2163
2163
|
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
Warning: The qubit subsystem state must be separable, or the behavior
|
|
2167
|
-
of this method is undefined.
|
|
2164
|
+
Factorize a set of contiguous bits with minimal fidelity loss,
|
|
2165
|
+
and discard the separable bits.
|
|
2168
2166
|
|
|
2169
2167
|
Args:
|
|
2170
2168
|
q: qubit
|
|
@@ -2172,9 +2170,6 @@ class QrackSimulator:
|
|
|
2172
2170
|
Raises:
|
|
2173
2171
|
RuntimeError: QrackSimulator raised an exception.
|
|
2174
2172
|
RuntimeError: QrackSimulator with isTensorNetwork=True option cannot dispose()! (Turn off just this option, in the constructor.)
|
|
2175
|
-
|
|
2176
|
-
Returns:
|
|
2177
|
-
State of the systems.
|
|
2178
2173
|
"""
|
|
2179
2174
|
if self.is_tensor_network:
|
|
2180
2175
|
raise RuntimeError(
|
|
@@ -2312,6 +2307,52 @@ class QrackSimulator:
|
|
|
2312
2307
|
self._throw_if_error()
|
|
2313
2308
|
return [complex(r, i) for r, i in self._pairwise(flat_rdm)]
|
|
2314
2309
|
|
|
2310
|
+
def highest_prob_perm(self):
|
|
2311
|
+
"""Get the permutation (bit string) with the highest probability
|
|
2312
|
+
|
|
2313
|
+
Returns the single highest-probability bit string in the Hilbert space
|
|
2314
|
+
|
|
2315
|
+
Raises:
|
|
2316
|
+
RuntimeError: QrackSimulator raised an exception.
|
|
2317
|
+
|
|
2318
|
+
Returns:
|
|
2319
|
+
Highest probability dimension index
|
|
2320
|
+
"""
|
|
2321
|
+
num_q = self.num_qubits()
|
|
2322
|
+
num_words = (num_q + 63) // 64
|
|
2323
|
+
_r = (ctypes.c_ulonglong * num_words)()
|
|
2324
|
+
Qrack.qrack_lib.HighestProbAll(self.sid, _r)
|
|
2325
|
+
self._throw_if_error()
|
|
2326
|
+
r = 0
|
|
2327
|
+
for w in range(num_words):
|
|
2328
|
+
r <<= 64
|
|
2329
|
+
r |= _r[w]
|
|
2330
|
+
return r
|
|
2331
|
+
|
|
2332
|
+
def highest_n_prob_perm(self, n):
|
|
2333
|
+
"""Get the top n permutations (bit strings) with the highest probability
|
|
2334
|
+
|
|
2335
|
+
Returns the top n highest-probability bit strings in the Hilbert space
|
|
2336
|
+
|
|
2337
|
+
Raises:
|
|
2338
|
+
RuntimeError: QrackSimulator raised an exception.
|
|
2339
|
+
|
|
2340
|
+
Returns:
|
|
2341
|
+
Top n highest probability dimension indices
|
|
2342
|
+
"""
|
|
2343
|
+
num_q = self.num_qubits()
|
|
2344
|
+
num_words = (num_q + 63) // 64
|
|
2345
|
+
_r = (ctypes.c_ulonglong * (num_words * n))()
|
|
2346
|
+
Qrack.qrack_lib.HighestProbAllN(self.sid, n, _r)
|
|
2347
|
+
self._throw_if_error()
|
|
2348
|
+
r = [0] * n
|
|
2349
|
+
for i in range(n):
|
|
2350
|
+
r[i] = 0
|
|
2351
|
+
for w in range(num_words):
|
|
2352
|
+
r[i] <<= 64
|
|
2353
|
+
r[i] |= _r[(i * num_words) + w]
|
|
2354
|
+
return r
|
|
2355
|
+
|
|
2315
2356
|
def prob_all(self, q):
|
|
2316
2357
|
"""Probabilities of all subset permutations
|
|
2317
2358
|
|
|
Binary file
|
|
Binary file
|
|
@@ -111,10 +111,10 @@ class QrackSystem:
|
|
|
111
111
|
self.qrack_lib.get_error.argtypes = [c_ulonglong]
|
|
112
112
|
|
|
113
113
|
self.qrack_lib.init_count.restype = c_ulonglong
|
|
114
|
-
self.qrack_lib.init_count.argtypes = [c_ulonglong, c_bool]
|
|
114
|
+
self.qrack_lib.init_count.argtypes = [c_ulonglong, c_bool, c_bool]
|
|
115
115
|
|
|
116
116
|
self.qrack_lib.init_count_pager.restype = c_ulonglong
|
|
117
|
-
self.qrack_lib.init_count_pager.argtypes = [c_ulonglong, c_bool]
|
|
117
|
+
self.qrack_lib.init_count_pager.argtypes = [c_ulonglong, c_bool, c_bool]
|
|
118
118
|
|
|
119
119
|
self.qrack_lib.init_count_type.restype = c_ulonglong
|
|
120
120
|
self.qrack_lib.init_count_type.argtypes = [
|
|
@@ -129,6 +129,7 @@ class QrackSystem:
|
|
|
129
129
|
c_bool,
|
|
130
130
|
c_bool,
|
|
131
131
|
c_bool,
|
|
132
|
+
c_bool
|
|
132
133
|
]
|
|
133
134
|
|
|
134
135
|
self.qrack_lib.init_count_stabilizer.restype = c_ulonglong
|
|
@@ -158,6 +159,12 @@ class QrackSystem:
|
|
|
158
159
|
|
|
159
160
|
# pseudo-quantum
|
|
160
161
|
|
|
162
|
+
self.qrack_lib.HighestProbAll.restype = None
|
|
163
|
+
self.qrack_lib.HighestProbAll.argtypes = [c_ulonglong, POINTER(c_ulonglong)]
|
|
164
|
+
|
|
165
|
+
self.qrack_lib.HighestProbAllN.restype = None
|
|
166
|
+
self.qrack_lib.HighestProbAllN.argtypes = [c_ulonglong, c_ulonglong, POINTER(c_ulonglong)]
|
|
167
|
+
|
|
161
168
|
self.qrack_lib.ProbAll.restype = None
|
|
162
169
|
if self.fppow == 5:
|
|
163
170
|
self.qrack_lib.ProbAll.argtypes = [
|
|
@@ -5,19 +5,19 @@ pyqrack/qrack_ace_backend.py,sha256=Prw1NhVVt0csbHiJeW8MJI9rl1P1YS63sXM5quoNPrI,
|
|
|
5
5
|
pyqrack/qrack_circuit.py,sha256=vDCKGbcEHJDFUKprjCpWgit8lXFnMrPimKHURD2_Hj4,19538
|
|
6
6
|
pyqrack/qrack_neuron.py,sha256=UiJdjAGB6usjAGHWSosSFCUUeIkhh3MtZbsaxfsIsNw,9043
|
|
7
7
|
pyqrack/qrack_neuron_torch_layer.py,sha256=Bs5BLC2GFevfSpo_jSJ2AZl-hfDRJmzlGN9pFw1CtoQ,6160
|
|
8
|
-
pyqrack/qrack_simulator.py,sha256=
|
|
8
|
+
pyqrack/qrack_simulator.py,sha256=PSrcEIlzCt33WXjoEo5dZdmzx9zR90QI_Dw9LTphjMg,146030
|
|
9
9
|
pyqrack/qrack_stabilizer.py,sha256=O-7VJ9Vw4h25PK_kesSjIqHXGSo8lLrQLIyGgmzG7Co,2124
|
|
10
10
|
pyqrack/quimb_circuit_type.py,sha256=Sk-Tmn38kUYmAkJJ75btWuhYZyTXOOezmowFhfdiGDc,621
|
|
11
11
|
pyqrack/qrack_system/__init__.py,sha256=-oZ9dsb1hixsnrkUJRY_C5DzQ_l6MtifF_Z465BgqV4,334
|
|
12
|
-
pyqrack/qrack_system/qrack_system.py,sha256=
|
|
12
|
+
pyqrack/qrack_system/qrack_system.py,sha256=3NFejSMePILaND-h3bdwRrX-WuhdZj-Uzt-8i90_xQE,43719
|
|
13
13
|
pyqrack/qrack_system/qrack_cl_precompile/qrack_cl_precompile,sha256=Yt1YxAOJ9vqlndghgIIXrosZEE3AZDG7eNpsmVUqBr4,16392
|
|
14
|
-
pyqrack/qrack_system/qrack_lib/libqrack_pinvoke.so,sha256=
|
|
15
|
-
pyqrack/qrack_system/qrack_lib/libqrack_pinvoke.so.9.
|
|
14
|
+
pyqrack/qrack_system/qrack_lib/libqrack_pinvoke.so,sha256=M_0LKmuwKaMZ0dytTZAn_EGGfffzoZpP-iJhzFFepWU,4517232
|
|
15
|
+
pyqrack/qrack_system/qrack_lib/libqrack_pinvoke.so.9.29.2,sha256=M_0LKmuwKaMZ0dytTZAn_EGGfffzoZpP-iJhzFFepWU,4517232
|
|
16
16
|
pyqrack/stats/__init__.py,sha256=Hla85my2fY_roR9lIjGBVpEG7ySOTMwjWa8D6-kgCnY,276
|
|
17
17
|
pyqrack/stats/load_quantized_data.py,sha256=z12u9F7Nt3P-i44nY1xxvso_klS6WIHS3iqq7R2_lqE,1184
|
|
18
18
|
pyqrack/stats/quantize_by_range.py,sha256=UM0_7jJDdQ7g30cR3UQAxkbzkqrmsy1oUfqg0h11FUY,2270
|
|
19
|
-
pyqrack_cpu_complex128-1.
|
|
20
|
-
pyqrack_cpu_complex128-1.
|
|
21
|
-
pyqrack_cpu_complex128-1.
|
|
22
|
-
pyqrack_cpu_complex128-1.
|
|
23
|
-
pyqrack_cpu_complex128-1.
|
|
19
|
+
pyqrack_cpu_complex128-1.70.2.dist-info/licenses/LICENSE,sha256=HxB-7SaWTuewAk1nz-3_3FUD6QhgX73kNT_taKVUTq8,1069
|
|
20
|
+
pyqrack_cpu_complex128-1.70.2.dist-info/METADATA,sha256=IREfHo0IjEzILMenknlMSoy9jN4rafGh76kZ-I3D_fM,6258
|
|
21
|
+
pyqrack_cpu_complex128-1.70.2.dist-info/WHEEL,sha256=k8EuOMBHdXsN9XSTE5LrpwS4FtdLkoSlyO_7W-lE_zg,109
|
|
22
|
+
pyqrack_cpu_complex128-1.70.2.dist-info/top_level.txt,sha256=YE_3q9JTGRLMilNg2tGP1y7uU-Dx8PDao2OhwoIbv8E,8
|
|
23
|
+
pyqrack_cpu_complex128-1.70.2.dist-info/RECORD,,
|
|
Binary file
|
|
File without changes
|
{pyqrack_cpu_complex128-1.66.7.dist-info → pyqrack_cpu_complex128-1.70.2.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|
{pyqrack_cpu_complex128-1.66.7.dist-info → pyqrack_cpu_complex128-1.70.2.dist-info}/top_level.txt
RENAMED
|
File without changes
|