pyqrack-cpu-complex128 1.67.0__py3-none-win_amd64.whl → 1.71.1__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.
@@ -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
- Decompose the given qubit out of the system.
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
- State of the systems.
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
- Minimally decompose a set of contiguous bits from the separably
2165
- composed unit, and discard the separable bits.
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(
@@ -2334,6 +2329,30 @@ class QrackSimulator:
2334
2329
  r |= _r[w]
2335
2330
  return r
2336
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
+
2337
2356
  def prob_all(self, q):
2338
2357
  """Probabilities of all subset permutations
2339
2358
 
@@ -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
@@ -161,6 +162,9 @@ class QrackSystem:
161
162
  self.qrack_lib.HighestProbAll.restype = None
162
163
  self.qrack_lib.HighestProbAll.argtypes = [c_ulonglong, POINTER(c_ulonglong)]
163
164
 
165
+ self.qrack_lib.HighestProbAllN.restype = None
166
+ self.qrack_lib.HighestProbAllN.argtypes = [c_ulonglong, c_ulonglong, POINTER(c_ulonglong)]
167
+
164
168
  self.qrack_lib.ProbAll.restype = None
165
169
  if self.fppow == 5:
166
170
  self.qrack_lib.ProbAll.argtypes = [
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pyqrack-cpu-complex128
3
- Version: 1.67.0
3
+ Version: 1.71.1
4
4
  Summary: pyqrack - Pure Python vm6502q/qrack Wrapper
5
5
  Home-page: https://github.com/vm6502q/pyqrack
6
6
  Author: Daniel Strano
@@ -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=wJlDH2CwtciEYRv3Aj0voJUUnsWlVjwhJ8aD60JMAr8,149950
8
+ pyqrack/qrack_simulator.py,sha256=PVQeAShMWC6XikUwSeEwgDmfcBxNp9kHx43uqSqMWIk,150528
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=ns-Rd5cVQLNQqppKi38-wmTJ_107kSqjc0oS8HJypww,44877
13
- pyqrack/qrack_system/qrack_lib/qrack_pinvoke.dll,sha256=Zq1p1i5HvB06Zam-R9daTFTD20PySJitGerYADuLO5s,1793024
12
+ pyqrack/qrack_system/qrack_system.py,sha256=qrJ9hVQ28unEvrpYh-pZZQl9E7xXPammusFjk_eJmfI,45070
13
+ pyqrack/qrack_system/qrack_lib/qrack_pinvoke.dll,sha256=DbefqkoN-iRFzK_JHssCc5HudDZ4VG09n01WaXAG4kk,2052096
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_complex128-1.67.0.dist-info/LICENSE,sha256=IdAVedmFOPQtHi_XeEI9OhJwUuwlT6tCJwrT55zAn3w,1090
18
- pyqrack_cpu_complex128-1.67.0.dist-info/METADATA,sha256=NiizzTdE4IcPKJXfd0Uje76jSiCLv09RMtNOSsgU0Wg,6112
19
- pyqrack_cpu_complex128-1.67.0.dist-info/WHEEL,sha256=JMWfR_Dj7ISokcwe0cBhCfK6JKnIi-ZX11L6d_ntt6o,98
20
- pyqrack_cpu_complex128-1.67.0.dist-info/top_level.txt,sha256=YE_3q9JTGRLMilNg2tGP1y7uU-Dx8PDao2OhwoIbv8E,8
21
- pyqrack_cpu_complex128-1.67.0.dist-info/RECORD,,
17
+ pyqrack_cpu_complex128-1.71.1.dist-info/LICENSE,sha256=IdAVedmFOPQtHi_XeEI9OhJwUuwlT6tCJwrT55zAn3w,1090
18
+ pyqrack_cpu_complex128-1.71.1.dist-info/METADATA,sha256=lSQTzQVkrWRq00N0vZwcSogGodggLyC3aLvvYFjoP2o,6112
19
+ pyqrack_cpu_complex128-1.71.1.dist-info/WHEEL,sha256=JMWfR_Dj7ISokcwe0cBhCfK6JKnIi-ZX11L6d_ntt6o,98
20
+ pyqrack_cpu_complex128-1.71.1.dist-info/top_level.txt,sha256=YE_3q9JTGRLMilNg2tGP1y7uU-Dx8PDao2OhwoIbv8E,8
21
+ pyqrack_cpu_complex128-1.71.1.dist-info/RECORD,,