pyqrack-cpu 1.67.0__py3-none-win_amd64.whl → 1.68.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.

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(
@@ -2334,6 +2327,30 @@ class QrackSimulator:
2334
2327
  r |= _r[w]
2335
2328
  return r
2336
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
+
2337
2354
  def prob_all(self, q):
2338
2355
  """Probabilities of all subset permutations
2339
2356
 
@@ -161,6 +161,9 @@ class QrackSystem:
161
161
  self.qrack_lib.HighestProbAll.restype = None
162
162
  self.qrack_lib.HighestProbAll.argtypes = [c_ulonglong, POINTER(c_ulonglong)]
163
163
 
164
+ self.qrack_lib.HighestProbAllN.restype = None
165
+ self.qrack_lib.HighestProbAllN.argtypes = [c_ulonglong, c_ulonglong, POINTER(c_ulonglong)]
166
+
164
167
  self.qrack_lib.ProbAll.restype = None
165
168
  if self.fppow == 5:
166
169
  self.qrack_lib.ProbAll.argtypes = [
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pyqrack-cpu
3
- Version: 1.67.0
3
+ Version: 1.68.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=vN0QZoobomH3zNJ9AGhOJTj6bTATs5XIJIVZOU-z70Y,150477
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=awLaJOUz90BJI_FkSZs_qQhAyVl2Cd6t0TDE2B_UlrQ,44877
13
- pyqrack/qrack_system/qrack_lib/qrack_pinvoke.dll,sha256=ukVJCnZ_McNEpxYEPMI4l4CvXi5hbdLHCbzbk5CkGRM,1793024
12
+ pyqrack/qrack_system/qrack_system.py,sha256=QG1MjQbKhd6dGz1N_Pz--ZSY-gXks3Ug6p16chWWzNU,45034
13
+ pyqrack/qrack_system/qrack_lib/qrack_pinvoke.dll,sha256=8XdBvUqycqCsxNnB_Ja0I0YipAZHCWOPtWdEpusx-xU,1795584
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.67.0.dist-info/LICENSE,sha256=IdAVedmFOPQtHi_XeEI9OhJwUuwlT6tCJwrT55zAn3w,1090
18
- pyqrack_cpu-1.67.0.dist-info/METADATA,sha256=8K-i43gSjYXouqLbObsmfrFx0DdO65odjSgZ_rStsZk,6035
19
- pyqrack_cpu-1.67.0.dist-info/WHEEL,sha256=JMWfR_Dj7ISokcwe0cBhCfK6JKnIi-ZX11L6d_ntt6o,98
20
- pyqrack_cpu-1.67.0.dist-info/top_level.txt,sha256=YE_3q9JTGRLMilNg2tGP1y7uU-Dx8PDao2OhwoIbv8E,8
21
- pyqrack_cpu-1.67.0.dist-info/RECORD,,
17
+ pyqrack_cpu-1.68.1.dist-info/LICENSE,sha256=IdAVedmFOPQtHi_XeEI9OhJwUuwlT6tCJwrT55zAn3w,1090
18
+ pyqrack_cpu-1.68.1.dist-info/METADATA,sha256=bjSK0EUMkLZTp2y1gNaAmKUYXfRavCLaXp81ndcvQ5Y,6035
19
+ pyqrack_cpu-1.68.1.dist-info/WHEEL,sha256=JMWfR_Dj7ISokcwe0cBhCfK6JKnIi-ZX11L6d_ntt6o,98
20
+ pyqrack_cpu-1.68.1.dist-info/top_level.txt,sha256=YE_3q9JTGRLMilNg2tGP1y7uU-Dx8PDao2OhwoIbv8E,8
21
+ pyqrack_cpu-1.68.1.dist-info/RECORD,,