pyqrack-cuda 1.44.21__tar.gz → 1.44.23__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.21/pyqrack_cuda.egg-info → pyqrack_cuda-1.44.23}/PKG-INFO +1 -1
  2. {pyqrack_cuda-1.44.21 → pyqrack_cuda-1.44.23}/pyqrack/qrack_ace_backend.py +30 -6
  3. {pyqrack_cuda-1.44.21 → pyqrack_cuda-1.44.23/pyqrack_cuda.egg-info}/PKG-INFO +1 -1
  4. {pyqrack_cuda-1.44.21 → pyqrack_cuda-1.44.23}/setup.py +1 -1
  5. {pyqrack_cuda-1.44.21 → pyqrack_cuda-1.44.23}/LICENSE +0 -0
  6. {pyqrack_cuda-1.44.21 → pyqrack_cuda-1.44.23}/MANIFEST.in +0 -0
  7. {pyqrack_cuda-1.44.21 → pyqrack_cuda-1.44.23}/Makefile +0 -0
  8. {pyqrack_cuda-1.44.21 → pyqrack_cuda-1.44.23}/README.md +0 -0
  9. {pyqrack_cuda-1.44.21 → pyqrack_cuda-1.44.23}/pyproject.toml +0 -0
  10. {pyqrack_cuda-1.44.21 → pyqrack_cuda-1.44.23}/pyqrack/__init__.py +0 -0
  11. {pyqrack_cuda-1.44.21 → pyqrack_cuda-1.44.23}/pyqrack/neuron_activation_fn.py +0 -0
  12. {pyqrack_cuda-1.44.21 → pyqrack_cuda-1.44.23}/pyqrack/pauli.py +0 -0
  13. {pyqrack_cuda-1.44.21 → pyqrack_cuda-1.44.23}/pyqrack/qrack_circuit.py +0 -0
  14. {pyqrack_cuda-1.44.21 → pyqrack_cuda-1.44.23}/pyqrack/qrack_neuron.py +0 -0
  15. {pyqrack_cuda-1.44.21 → pyqrack_cuda-1.44.23}/pyqrack/qrack_neuron_torch_layer.py +0 -0
  16. {pyqrack_cuda-1.44.21 → pyqrack_cuda-1.44.23}/pyqrack/qrack_simulator.py +0 -0
  17. {pyqrack_cuda-1.44.21 → pyqrack_cuda-1.44.23}/pyqrack/qrack_stabilizer.py +0 -0
  18. {pyqrack_cuda-1.44.21 → pyqrack_cuda-1.44.23}/pyqrack/qrack_system/__init__.py +0 -0
  19. {pyqrack_cuda-1.44.21 → pyqrack_cuda-1.44.23}/pyqrack/qrack_system/qrack_system.py +0 -0
  20. {pyqrack_cuda-1.44.21 → pyqrack_cuda-1.44.23}/pyqrack/quimb_circuit_type.py +0 -0
  21. {pyqrack_cuda-1.44.21 → pyqrack_cuda-1.44.23}/pyqrack/stats/__init__.py +0 -0
  22. {pyqrack_cuda-1.44.21 → pyqrack_cuda-1.44.23}/pyqrack/stats/load_quantized_data.py +0 -0
  23. {pyqrack_cuda-1.44.21 → pyqrack_cuda-1.44.23}/pyqrack/stats/quantize_by_range.py +0 -0
  24. {pyqrack_cuda-1.44.21 → pyqrack_cuda-1.44.23}/pyqrack_cuda.egg-info/SOURCES.txt +0 -0
  25. {pyqrack_cuda-1.44.21 → pyqrack_cuda-1.44.23}/pyqrack_cuda.egg-info/dependency_links.txt +0 -0
  26. {pyqrack_cuda-1.44.21 → pyqrack_cuda-1.44.23}/pyqrack_cuda.egg-info/not-zip-safe +0 -0
  27. {pyqrack_cuda-1.44.21 → pyqrack_cuda-1.44.23}/pyqrack_cuda.egg-info/requires.txt +0 -0
  28. {pyqrack_cuda-1.44.21 → pyqrack_cuda-1.44.23}/pyqrack_cuda.egg-info/top_level.txt +0 -0
  29. {pyqrack_cuda-1.44.21 → pyqrack_cuda-1.44.23}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyqrack-cuda
3
- Version: 1.44.21
3
+ Version: 1.44.23
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,26 @@ 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])
107
- self.sim.mcx([hq[1]], hq[2])
108
+ if self._is_init[lq]:
109
+ self._cx_shadow(hq[0], hq[1])
110
+ self.sim.mcx([hq[1]], hq[2])
111
+ else:
112
+ self.sim.mcx([hq[2]], hq[1])
108
113
  else:
109
114
  self.sim.mcx([hq[0]], hq[1])
110
- self._cx_shadow(hq[1], hq[2])
115
+ if self._is_init[lq]:
116
+ self._cx_shadow(hq[1], hq[2])
117
+ self._is_init[lq] = True
111
118
 
112
119
  def _decode(self, hq, reverse=False):
113
- row = (hq[0] // 3) // self.row_length
120
+ lq = hq[0] // 3
121
+ if not self._is_init[lq]:
122
+ return
123
+ row = lq // self.row_length
114
124
  even_row = not (row & 1)
115
125
  if ((not self.alternating_codes) and reverse) or (even_row == reverse):
116
126
  self.sim.mcx([hq[1]], hq[2])
@@ -206,6 +216,8 @@ class QrackAceBackend:
206
216
  self._correct_if_like_h(th, lq)
207
217
  self._decode(hq)
208
218
  self.sim.u(hq[0], th, ph, lm)
219
+ if not self._is_init[lq]:
220
+ self.sim.u(hq[2], th, ph, lm)
209
221
  self._encode(hq)
210
222
  else:
211
223
  for b in hq:
@@ -225,6 +237,8 @@ class QrackAceBackend:
225
237
  else:
226
238
  self._decode(hq)
227
239
  self.sim.r(p, th, hq[0])
240
+ if not self._is_init[lq]:
241
+ self.sim.r(p, th, hq[2])
228
242
  self._encode(hq)
229
243
 
230
244
  def h(self, lq):
@@ -232,6 +246,8 @@ class QrackAceBackend:
232
246
  hq = self._unpack(lq)
233
247
  self._decode(hq)
234
248
  self.sim.h(hq[0])
249
+ if not self._is_init[lq]:
250
+ self.sim.h(hq[2])
235
251
  self._encode(hq)
236
252
 
237
253
  def s(self, lq):
@@ -271,7 +287,6 @@ class QrackAceBackend:
271
287
 
272
288
  def _cpauli(self, lq1, lq2, anti, pauli):
273
289
  self._correct(lq1)
274
-
275
290
  gate = None
276
291
  shadow = None
277
292
  if pauli == Pauli.PauliX:
@@ -286,6 +301,13 @@ class QrackAceBackend:
286
301
  else:
287
302
  return
288
303
 
304
+ if not self._is_init[lq1]:
305
+ gate([hq1[0]], hq2[0])
306
+ gate([hq1[1]], hq2[1])
307
+ gate([hq1[2]], hq2[2])
308
+
309
+ return
310
+
289
311
  lq1_col = lq1 // self.row_length
290
312
  lq1_row = lq1 % self.row_length
291
313
  lq2_col = lq2 // self.row_length
@@ -370,6 +392,8 @@ class QrackAceBackend:
370
392
  if bits[i] != result:
371
393
  self.sim.x(hq[i])
372
394
 
395
+ self._is_init[lq] = False
396
+
373
397
  return result
374
398
 
375
399
  def m_all(self):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyqrack-cuda
3
- Version: 1.44.21
3
+ Version: 1.44.23
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.21"
10
+ VERSION = "1.44.23"
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