pyqrack-cuda 1.44.2__tar.gz → 1.44.4__tar.gz

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.
Files changed (30) hide show
  1. {pyqrack_cuda-1.44.2/pyqrack_cuda.egg-info → pyqrack_cuda-1.44.4}/PKG-INFO +1 -1
  2. {pyqrack_cuda-1.44.2 → pyqrack_cuda-1.44.4}/pyqrack/qrack_ace_backend.py +32 -8
  3. pyqrack_cuda-1.44.4/pyqrack/qrack_system/qrack_lib/libqrack_pinvoke.so +0 -0
  4. {pyqrack_cuda-1.44.2 → pyqrack_cuda-1.44.4/pyqrack_cuda.egg-info}/PKG-INFO +1 -1
  5. {pyqrack_cuda-1.44.2 → pyqrack_cuda-1.44.4}/pyqrack_cuda.egg-info/SOURCES.txt +1 -0
  6. {pyqrack_cuda-1.44.2 → pyqrack_cuda-1.44.4}/setup.py +1 -1
  7. {pyqrack_cuda-1.44.2 → pyqrack_cuda-1.44.4}/LICENSE +0 -0
  8. {pyqrack_cuda-1.44.2 → pyqrack_cuda-1.44.4}/MANIFEST.in +0 -0
  9. {pyqrack_cuda-1.44.2 → pyqrack_cuda-1.44.4}/Makefile +0 -0
  10. {pyqrack_cuda-1.44.2 → pyqrack_cuda-1.44.4}/README.md +0 -0
  11. {pyqrack_cuda-1.44.2 → pyqrack_cuda-1.44.4}/pyproject.toml +0 -0
  12. {pyqrack_cuda-1.44.2 → pyqrack_cuda-1.44.4}/pyqrack/__init__.py +0 -0
  13. {pyqrack_cuda-1.44.2 → pyqrack_cuda-1.44.4}/pyqrack/neuron_activation_fn.py +0 -0
  14. {pyqrack_cuda-1.44.2 → pyqrack_cuda-1.44.4}/pyqrack/pauli.py +0 -0
  15. {pyqrack_cuda-1.44.2 → pyqrack_cuda-1.44.4}/pyqrack/qrack_circuit.py +0 -0
  16. {pyqrack_cuda-1.44.2 → pyqrack_cuda-1.44.4}/pyqrack/qrack_neuron.py +0 -0
  17. {pyqrack_cuda-1.44.2 → pyqrack_cuda-1.44.4}/pyqrack/qrack_neuron_torch_layer.py +0 -0
  18. {pyqrack_cuda-1.44.2 → pyqrack_cuda-1.44.4}/pyqrack/qrack_simulator.py +0 -0
  19. {pyqrack_cuda-1.44.2 → pyqrack_cuda-1.44.4}/pyqrack/qrack_stabilizer.py +0 -0
  20. {pyqrack_cuda-1.44.2 → pyqrack_cuda-1.44.4}/pyqrack/qrack_system/__init__.py +0 -0
  21. {pyqrack_cuda-1.44.2 → pyqrack_cuda-1.44.4}/pyqrack/qrack_system/qrack_system.py +0 -0
  22. {pyqrack_cuda-1.44.2 → pyqrack_cuda-1.44.4}/pyqrack/quimb_circuit_type.py +0 -0
  23. {pyqrack_cuda-1.44.2 → pyqrack_cuda-1.44.4}/pyqrack/stats/__init__.py +0 -0
  24. {pyqrack_cuda-1.44.2 → pyqrack_cuda-1.44.4}/pyqrack/stats/load_quantized_data.py +0 -0
  25. {pyqrack_cuda-1.44.2 → pyqrack_cuda-1.44.4}/pyqrack/stats/quantize_by_range.py +0 -0
  26. {pyqrack_cuda-1.44.2 → pyqrack_cuda-1.44.4}/pyqrack_cuda.egg-info/dependency_links.txt +0 -0
  27. {pyqrack_cuda-1.44.2 → pyqrack_cuda-1.44.4}/pyqrack_cuda.egg-info/not-zip-safe +0 -0
  28. {pyqrack_cuda-1.44.2 → pyqrack_cuda-1.44.4}/pyqrack_cuda.egg-info/requires.txt +0 -0
  29. {pyqrack_cuda-1.44.2 → pyqrack_cuda-1.44.4}/pyqrack_cuda.egg-info/top_level.txt +0 -0
  30. {pyqrack_cuda-1.44.2 → pyqrack_cuda-1.44.4}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyqrack-cuda
3
- Version: 1.44.2
3
+ Version: 1.44.4
4
4
  Summary: pyqrack - Pure Python vm6502q/qrack Wrapper
5
5
  Home-page: https://github.com/vm6502q/pyqrack
6
6
  Author: Daniel Strano
@@ -26,12 +26,10 @@ class QrackAceBackend:
26
26
  This back end uses elided repetition code on a nearest-neighbor topology to emulate
27
27
  a utility-scale superconducting chip quantum computer in very little memory.
28
28
 
29
- The backend was originally designed assuming a 2D qubit grid like 2019 Sycamore.
30
- However, it quickly became apparent that users can basically design their own
31
- connectivity topologies, without breaking the concept. (Not all will work equally well.)
32
-
33
29
  Attributes:
34
30
  sim(QrackSimulator): Corresponding simulator.
31
+ row_length(int): Qubits per row.
32
+ col_length(int): Qubits per column.
35
33
  """
36
34
 
37
35
  def __init__(
@@ -40,7 +38,17 @@ class QrackAceBackend:
40
38
  toClone=None
41
39
  ):
42
40
  self.sim = toClone.sim.clone() if toClone else QrackSimulator(3 * qubit_count)
41
+ self._factor_width(qubit_count)
42
+
43
43
 
44
+ def _factor_width(self, width):
45
+ col_len = math.floor(math.sqrt(width))
46
+ while (((width // col_len) * col_len) != width):
47
+ col_len -= 1
48
+ row_len = width // col_len
49
+
50
+ self.col_length = col_len
51
+ self.row_length = row_len
44
52
 
45
53
  def _ct_pair_prob(self, q1, q2):
46
54
  p1 = self.sim.prob(q1)
@@ -93,7 +101,9 @@ class QrackAceBackend:
93
101
 
94
102
 
95
103
  def _encode(self, hq, reverse = False):
96
- if reverse:
104
+ row = (hq[0] // 3) // self.row_length
105
+ even_row = not (row & 1)
106
+ if even_row == reverse:
97
107
  self._cx_shadow(hq[0], hq[1])
98
108
  self.sim.mcx([hq[1]], hq[2])
99
109
  else:
@@ -102,7 +112,9 @@ class QrackAceBackend:
102
112
 
103
113
 
104
114
  def _decode(self, hq, reverse = False):
105
- if reverse:
115
+ row = (hq[0] // 3) // self.row_length
116
+ even_row = not (row & 1)
117
+ if even_row == reverse:
106
118
  self.sim.mcx([hq[1]], hq[2])
107
119
  self._cx_shadow(hq[0], hq[1])
108
120
  else:
@@ -182,16 +194,20 @@ class QrackAceBackend:
182
194
 
183
195
  def _cpauli(self, lq1, lq2, anti, pauli):
184
196
  gate = None
197
+ shadow = None
185
198
  if pauli == Pauli.PauliX:
186
199
  gate = self.sim.macx if anti else self.sim.mcx
200
+ shadow = self._anti_cx_shadow if anti else self._cx_shadow
187
201
  elif pauli == Pauli.PauliY:
188
202
  gate = self.sim.macy if anti else self.sim.mcy
203
+ shadow = self._anti_cy_shadow if anti else self._cy_shadow
189
204
  elif pauli == Pauli.PauliZ:
190
205
  gate = self.sim.macz if anti else self.sim.mcz
206
+ shadow = self._anti_cz_shadow if anti else self._cz_shadow
191
207
  else:
192
208
  return
193
209
 
194
- if (lq2 == (lq1 + 1)) or (lq1 == (lq2 + 1)):
210
+ if lq2 == (lq1 + 1):
195
211
  hq1 = self._unpack(lq1, True)
196
212
  hq2 = self._unpack(lq2, False)
197
213
  self._decode(hq1, True)
@@ -199,11 +215,19 @@ class QrackAceBackend:
199
215
  gate([hq1[0]], hq2[0])
200
216
  self._encode(hq2, False)
201
217
  self._encode(hq1, True)
218
+ elif lq1 == (lq2 + 1):
219
+ hq2 = self._unpack(lq2, True)
220
+ hq1 = self._unpack(lq1, False)
221
+ self._decode(hq2, True)
222
+ self._decode(hq1, False)
223
+ gate([hq1[0]], hq2[0])
224
+ self._encode(hq1, False)
225
+ self._encode(hq2, True)
202
226
  else:
203
227
  hq1 = self._unpack(lq1)
204
228
  hq2 = self._unpack(lq2)
205
229
  gate([hq1[0]], hq2[0])
206
- gate([hq1[1]], hq2[1])
230
+ shadow(hq1[1], hq2[1])
207
231
  gate([hq1[2]], hq2[2])
208
232
 
209
233
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyqrack-cuda
3
- Version: 1.44.2
3
+ Version: 1.44.4
4
4
  Summary: pyqrack - Pure Python vm6502q/qrack Wrapper
5
5
  Home-page: https://github.com/vm6502q/pyqrack
6
6
  Author: Daniel Strano
@@ -16,6 +16,7 @@ pyqrack/qrack_stabilizer.py
16
16
  pyqrack/quimb_circuit_type.py
17
17
  pyqrack/qrack_system/__init__.py
18
18
  pyqrack/qrack_system/qrack_system.py
19
+ pyqrack/qrack_system/qrack_lib/libqrack_pinvoke.so
19
20
  pyqrack/stats/__init__.py
20
21
  pyqrack/stats/load_quantized_data.py
21
22
  pyqrack/stats/quantize_by_range.py
@@ -7,7 +7,7 @@ from setuptools import setup
7
7
  from setuptools.command.build_py import build_py
8
8
 
9
9
 
10
- VERSION = "1.44.2"
10
+ VERSION = "1.44.4"
11
11
 
12
12
  # Read long description from README.
13
13
  README_PATH = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'README.md')
File without changes
File without changes
File without changes
File without changes
File without changes