pyqrack-cuda 1.44.20__tar.gz → 1.44.22__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 (29) hide show
  1. {pyqrack_cuda-1.44.20/pyqrack_cuda.egg-info → pyqrack_cuda-1.44.22}/PKG-INFO +1 -1
  2. {pyqrack_cuda-1.44.20 → pyqrack_cuda-1.44.22}/pyqrack/qrack_ace_backend.py +29 -5
  3. {pyqrack_cuda-1.44.20 → pyqrack_cuda-1.44.22/pyqrack_cuda.egg-info}/PKG-INFO +1 -1
  4. {pyqrack_cuda-1.44.20 → pyqrack_cuda-1.44.22}/setup.py +1 -1
  5. {pyqrack_cuda-1.44.20 → pyqrack_cuda-1.44.22}/LICENSE +0 -0
  6. {pyqrack_cuda-1.44.20 → pyqrack_cuda-1.44.22}/MANIFEST.in +0 -0
  7. {pyqrack_cuda-1.44.20 → pyqrack_cuda-1.44.22}/Makefile +0 -0
  8. {pyqrack_cuda-1.44.20 → pyqrack_cuda-1.44.22}/README.md +0 -0
  9. {pyqrack_cuda-1.44.20 → pyqrack_cuda-1.44.22}/pyproject.toml +0 -0
  10. {pyqrack_cuda-1.44.20 → pyqrack_cuda-1.44.22}/pyqrack/__init__.py +0 -0
  11. {pyqrack_cuda-1.44.20 → pyqrack_cuda-1.44.22}/pyqrack/neuron_activation_fn.py +0 -0
  12. {pyqrack_cuda-1.44.20 → pyqrack_cuda-1.44.22}/pyqrack/pauli.py +0 -0
  13. {pyqrack_cuda-1.44.20 → pyqrack_cuda-1.44.22}/pyqrack/qrack_circuit.py +0 -0
  14. {pyqrack_cuda-1.44.20 → pyqrack_cuda-1.44.22}/pyqrack/qrack_neuron.py +0 -0
  15. {pyqrack_cuda-1.44.20 → pyqrack_cuda-1.44.22}/pyqrack/qrack_neuron_torch_layer.py +0 -0
  16. {pyqrack_cuda-1.44.20 → pyqrack_cuda-1.44.22}/pyqrack/qrack_simulator.py +0 -0
  17. {pyqrack_cuda-1.44.20 → pyqrack_cuda-1.44.22}/pyqrack/qrack_stabilizer.py +0 -0
  18. {pyqrack_cuda-1.44.20 → pyqrack_cuda-1.44.22}/pyqrack/qrack_system/__init__.py +0 -0
  19. {pyqrack_cuda-1.44.20 → pyqrack_cuda-1.44.22}/pyqrack/qrack_system/qrack_system.py +0 -0
  20. {pyqrack_cuda-1.44.20 → pyqrack_cuda-1.44.22}/pyqrack/quimb_circuit_type.py +0 -0
  21. {pyqrack_cuda-1.44.20 → pyqrack_cuda-1.44.22}/pyqrack/stats/__init__.py +0 -0
  22. {pyqrack_cuda-1.44.20 → pyqrack_cuda-1.44.22}/pyqrack/stats/load_quantized_data.py +0 -0
  23. {pyqrack_cuda-1.44.20 → pyqrack_cuda-1.44.22}/pyqrack/stats/quantize_by_range.py +0 -0
  24. {pyqrack_cuda-1.44.20 → pyqrack_cuda-1.44.22}/pyqrack_cuda.egg-info/SOURCES.txt +0 -0
  25. {pyqrack_cuda-1.44.20 → pyqrack_cuda-1.44.22}/pyqrack_cuda.egg-info/dependency_links.txt +0 -0
  26. {pyqrack_cuda-1.44.20 → pyqrack_cuda-1.44.22}/pyqrack_cuda.egg-info/not-zip-safe +0 -0
  27. {pyqrack_cuda-1.44.20 → pyqrack_cuda-1.44.22}/pyqrack_cuda.egg-info/requires.txt +0 -0
  28. {pyqrack_cuda-1.44.20 → pyqrack_cuda-1.44.22}/pyqrack_cuda.egg-info/top_level.txt +0 -0
  29. {pyqrack_cuda-1.44.20 → pyqrack_cuda-1.44.22}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyqrack-cuda
3
- Version: 1.44.20
3
+ Version: 1.44.22
4
4
  Summary: pyqrack - Pure Python vm6502q/qrack Wrapper
5
5
  Home-page: https://github.com/vm6502q/pyqrack
6
6
  Author: Daniel Strano
@@ -43,6 +43,7 @@ class QrackAceBackend:
43
43
  self._ancilla = 3 * qubit_count
44
44
  self._factor_width(qubit_count)
45
45
  self.alternating_codes = alternating_codes
46
+ self._is_init = [False] * qubit_count
46
47
 
47
48
  def _factor_width(self, width):
48
49
  col_len = math.floor(math.sqrt(width))
@@ -100,17 +101,24 @@ class QrackAceBackend:
100
101
  )
101
102
 
102
103
  def _encode(self, hq, reverse=False):
103
- row = (hq[0] // 3) // self.row_length
104
+ lq = hq[0] // 3
105
+ row = lq // self.row_length
104
106
  even_row = not (row & 1)
105
107
  if ((not self.alternating_codes) and reverse) or (even_row == reverse):
106
- self._cx_shadow(hq[0], hq[1])
108
+ if self._is_init[lq]:
109
+ self._cx_shadow(hq[0], hq[1])
107
110
  self.sim.mcx([hq[1]], hq[2])
108
111
  else:
109
112
  self.sim.mcx([hq[0]], hq[1])
110
- self._cx_shadow(hq[1], hq[2])
113
+ if self._is_init[lq]:
114
+ self._cx_shadow(hq[1], hq[2])
115
+ self._is_init[lq] = True
111
116
 
112
117
  def _decode(self, hq, reverse=False):
113
- row = (hq[0] // 3) // self.row_length
118
+ lq = hq[0] // 3
119
+ if not self._is_init[lq]:
120
+ return
121
+ row = lq // self.row_length
114
122
  even_row = not (row & 1)
115
123
  if ((not self.alternating_codes) and reverse) or (even_row == reverse):
116
124
  self.sim.mcx([hq[1]], hq[2])
@@ -206,6 +214,8 @@ class QrackAceBackend:
206
214
  self._correct_if_like_h(th, lq)
207
215
  self._decode(hq)
208
216
  self.sim.u(hq[0], th, ph, lm)
217
+ if not self._is_init[lq]:
218
+ self.sim.u(hq[2], th, ph, lm)
209
219
  self._encode(hq)
210
220
  else:
211
221
  for b in hq:
@@ -225,6 +235,8 @@ class QrackAceBackend:
225
235
  else:
226
236
  self._decode(hq)
227
237
  self.sim.r(p, th, hq[0])
238
+ if not self._is_init[lq]:
239
+ self.sim.r(p, th, hq[2])
228
240
  self._encode(hq)
229
241
 
230
242
  def h(self, lq):
@@ -232,6 +244,8 @@ class QrackAceBackend:
232
244
  hq = self._unpack(lq)
233
245
  self._decode(hq)
234
246
  self.sim.h(hq[0])
247
+ if not self._is_init[lq]:
248
+ self.sim.h(hq[2])
235
249
  self._encode(hq)
236
250
 
237
251
  def s(self, lq):
@@ -271,7 +285,6 @@ class QrackAceBackend:
271
285
 
272
286
  def _cpauli(self, lq1, lq2, anti, pauli):
273
287
  self._correct(lq1)
274
-
275
288
  gate = None
276
289
  shadow = None
277
290
  if pauli == Pauli.PauliX:
@@ -286,6 +299,13 @@ class QrackAceBackend:
286
299
  else:
287
300
  return
288
301
 
302
+ if not self._is_init[lq1]:
303
+ gate([hq1[0]], hq2[0])
304
+ gate([hq1[1]], hq2[1])
305
+ gate([hq1[2]], hq2[2])
306
+
307
+ return
308
+
289
309
  lq1_col = lq1 // self.row_length
290
310
  lq1_row = lq1 % self.row_length
291
311
  lq2_col = lq2 // self.row_length
@@ -294,6 +314,7 @@ class QrackAceBackend:
294
314
  hq1 = None
295
315
  hq2 = None
296
316
  if (lq2_col == lq1_col) and (((lq1_row + 1) % self.row_length) == lq2_row):
317
+ self._correct(lq2)
297
318
  hq1 = self._unpack(lq1, True)
298
319
  hq2 = self._unpack(lq2, False)
299
320
  self._decode(hq1, True)
@@ -302,6 +323,7 @@ class QrackAceBackend:
302
323
  self._encode(hq2, False)
303
324
  self._encode(hq1, True)
304
325
  elif (lq1_col == lq2_col) and (((lq2_row + 1) % self.row_length) == lq1_row):
326
+ self._correct(lq2)
305
327
  hq2 = self._unpack(lq2, True)
306
328
  hq1 = self._unpack(lq1, False)
307
329
  self._decode(hq2, True)
@@ -368,6 +390,8 @@ class QrackAceBackend:
368
390
  if bits[i] != result:
369
391
  self.sim.x(hq[i])
370
392
 
393
+ self._is_init[lq] = False
394
+
371
395
  return result
372
396
 
373
397
  def m_all(self):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyqrack-cuda
3
- Version: 1.44.20
3
+ Version: 1.44.22
4
4
  Summary: pyqrack - Pure Python vm6502q/qrack Wrapper
5
5
  Home-page: https://github.com/vm6502q/pyqrack
6
6
  Author: Daniel Strano
@@ -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.20"
10
+ VERSION = "1.44.22"
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