pyqrack-cpu 1.66.8__py3-none-manylinux_2_39_x86_64.whl → 1.68.0__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.

Potentially problematic release.


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

@@ -2132,9 +2132,7 @@ class QrackSimulator:
2132
2132
  def decompose(self, q):
2133
2133
  """Decompose system
2134
2134
 
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.
2135
+ Factorize a set of contiguous bits with minimal fidelity loss.
2138
2136
 
2139
2137
  Args:
2140
2138
  q: qubit id
@@ -2144,7 +2142,7 @@ class QrackSimulator:
2144
2142
  RuntimeError: QrackSimulator with isTensorNetwork=True option cannot decompose()! (Turn off just this option, in the constructor.)
2145
2143
 
2146
2144
  Returns:
2147
- State of the systems.
2145
+ Decomposed subsystem simulator.
2148
2146
  """
2149
2147
  if self.is_tensor_network:
2150
2148
  raise RuntimeError(
@@ -2161,10 +2159,8 @@ class QrackSimulator:
2161
2159
  def dispose(self, q):
2162
2160
  """Dispose qubits
2163
2161
 
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.
2162
+ Factorize a set of contiguous bits with minimal fidelity loss,
2163
+ and discard the separable bits.
2168
2164
 
2169
2165
  Args:
2170
2166
  q: qubit
@@ -2172,9 +2168,6 @@ class QrackSimulator:
2172
2168
  Raises:
2173
2169
  RuntimeError: QrackSimulator raised an exception.
2174
2170
  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
2171
  """
2179
2172
  if self.is_tensor_network:
2180
2173
  raise RuntimeError(
@@ -2312,6 +2305,52 @@ class QrackSimulator:
2312
2305
  self._throw_if_error()
2313
2306
  return [complex(r, i) for r, i in self._pairwise(flat_rdm)]
2314
2307
 
2308
+ def highest_prob_perm(self):
2309
+ """Get the permutation (bit string) with the highest probability
2310
+
2311
+ Returns the single highest-probability bit string in the Hilbert space
2312
+
2313
+ Raises:
2314
+ RuntimeError: QrackSimulator raised an exception.
2315
+
2316
+ Returns:
2317
+ Highest probability dimension index
2318
+ """
2319
+ num_q = self.num_qubits()
2320
+ num_words = (num_q + 63) // 64
2321
+ _r = (ctypes.c_ulonglong * num_words)()
2322
+ Qrack.qrack_lib.HighestProbAll(self.sid, _r)
2323
+ self._throw_if_error()
2324
+ r = 0
2325
+ for w in range(num_words):
2326
+ r <<= 64
2327
+ r |= _r[w]
2328
+ return r
2329
+
2330
+ def highest_n_prob_perm(self, n):
2331
+ """Get the top n permutations (bit strings) with the highest probability
2332
+
2333
+ Returns the top n highest-probability bit strings in the Hilbert space
2334
+
2335
+ Raises:
2336
+ RuntimeError: QrackSimulator raised an exception.
2337
+
2338
+ Returns:
2339
+ Top n highest probability dimension indices
2340
+ """
2341
+ num_q = self.num_qubits()
2342
+ num_words = (num_q + 63) // 64
2343
+ _r = (ctypes.c_ulonglong * (num_words * n))()
2344
+ Qrack.qrack_lib.HighestProbAllN(self.sid, n, _r)
2345
+ self._throw_if_error()
2346
+ r = [0] * n
2347
+ for i in range(n):
2348
+ r[i] = 0
2349
+ for w in range(num_words):
2350
+ r[i] <<= 64
2351
+ r[i] |= _r[(i * num_words) + w]
2352
+ return r
2353
+
2315
2354
  def prob_all(self, q):
2316
2355
  """Probabilities of all subset permutations
2317
2356
 
@@ -158,6 +158,12 @@ class QrackSystem:
158
158
 
159
159
  # pseudo-quantum
160
160
 
161
+ self.qrack_lib.HighestProbAll.restype = None
162
+ self.qrack_lib.HighestProbAll.argtypes = [c_ulonglong, POINTER(c_ulonglong)]
163
+
164
+ self.qrack_lib.HighestProbAllN.restype = None
165
+ self.qrack_lib.HighestProbAllN.argtypes = [c_ulonglong, c_ulonglong, POINTER(c_ulonglong)]
166
+
161
167
  self.qrack_lib.ProbAll.restype = None
162
168
  if self.fppow == 5:
163
169
  self.qrack_lib.ProbAll.argtypes = [
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyqrack-cpu
3
- Version: 1.66.8
3
+ Version: 1.68.0
4
4
  Summary: pyqrack - Pure Python vm6502q/qrack Wrapper
5
5
  Home-page: https://github.com/vm6502q/pyqrack
6
6
  Author: Daniel Strano
@@ -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=permYKozj_perr9RWfSagq291KKxOydl6Oi0zMn3ujY,144812
8
+ pyqrack/qrack_simulator.py,sha256=Ji1djQcZ6AFk5K3H6Y6TKQ6DNjnOh0XoClwlPYm2j90,145981
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=9tMZNt6MwRhn3ko_Ey1nOojO_omKDSt0weaFWTkAnro,43391
12
+ pyqrack/qrack_system/qrack_system.py,sha256=qWtnWAIUdTlz7xavsEj8krd_3cVv_36KHex5jn-6kKs,43684
13
13
  pyqrack/qrack_system/qrack_cl_precompile/qrack_cl_precompile,sha256=Yt1YxAOJ9vqlndghgIIXrosZEE3AZDG7eNpsmVUqBr4,16392
14
- pyqrack/qrack_system/qrack_lib/libqrack_pinvoke.so,sha256=odom_a6hBQEfARE-4jKX4uumDiFlUz4sgukAkMNLYaA,3709264
15
- pyqrack/qrack_system/qrack_lib/libqrack_pinvoke.so.9.25.8,sha256=odom_a6hBQEfARE-4jKX4uumDiFlUz4sgukAkMNLYaA,3709264
14
+ pyqrack/qrack_system/qrack_lib/libqrack_pinvoke.so,sha256=RBmmAlrFk9zKXUd3FZlXGLRFHmzdfQD3emZYAeE41d8,3732104
15
+ pyqrack/qrack_system/qrack_lib/libqrack_pinvoke.so.9.27.0,sha256=RBmmAlrFk9zKXUd3FZlXGLRFHmzdfQD3emZYAeE41d8,3732104
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-1.66.8.dist-info/licenses/LICENSE,sha256=HxB-7SaWTuewAk1nz-3_3FUD6QhgX73kNT_taKVUTq8,1069
20
- pyqrack_cpu-1.66.8.dist-info/METADATA,sha256=a1o2s7rBu0Y6kn2ItVUmzWh8bWH4Ods4CEuQrTxQ2rs,6181
21
- pyqrack_cpu-1.66.8.dist-info/WHEEL,sha256=k8EuOMBHdXsN9XSTE5LrpwS4FtdLkoSlyO_7W-lE_zg,109
22
- pyqrack_cpu-1.66.8.dist-info/top_level.txt,sha256=YE_3q9JTGRLMilNg2tGP1y7uU-Dx8PDao2OhwoIbv8E,8
23
- pyqrack_cpu-1.66.8.dist-info/RECORD,,
19
+ pyqrack_cpu-1.68.0.dist-info/licenses/LICENSE,sha256=HxB-7SaWTuewAk1nz-3_3FUD6QhgX73kNT_taKVUTq8,1069
20
+ pyqrack_cpu-1.68.0.dist-info/METADATA,sha256=ywP_dsd98kFsWjd-GEX4QLeSt-B86n6euEyZrUob08g,6181
21
+ pyqrack_cpu-1.68.0.dist-info/WHEEL,sha256=k8EuOMBHdXsN9XSTE5LrpwS4FtdLkoSlyO_7W-lE_zg,109
22
+ pyqrack_cpu-1.68.0.dist-info/top_level.txt,sha256=YE_3q9JTGRLMilNg2tGP1y7uU-Dx8PDao2OhwoIbv8E,8
23
+ pyqrack_cpu-1.68.0.dist-info/RECORD,,