pyqrack-cuda 1.44.14__tar.gz → 1.44.16__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.14/pyqrack_cuda.egg-info → pyqrack_cuda-1.44.16}/PKG-INFO +1 -1
  2. {pyqrack_cuda-1.44.14 → pyqrack_cuda-1.44.16}/pyqrack/qrack_ace_backend.py +21 -22
  3. {pyqrack_cuda-1.44.14 → pyqrack_cuda-1.44.16/pyqrack_cuda.egg-info}/PKG-INFO +1 -1
  4. {pyqrack_cuda-1.44.14 → pyqrack_cuda-1.44.16}/setup.py +1 -1
  5. {pyqrack_cuda-1.44.14 → pyqrack_cuda-1.44.16}/LICENSE +0 -0
  6. {pyqrack_cuda-1.44.14 → pyqrack_cuda-1.44.16}/MANIFEST.in +0 -0
  7. {pyqrack_cuda-1.44.14 → pyqrack_cuda-1.44.16}/Makefile +0 -0
  8. {pyqrack_cuda-1.44.14 → pyqrack_cuda-1.44.16}/README.md +0 -0
  9. {pyqrack_cuda-1.44.14 → pyqrack_cuda-1.44.16}/pyproject.toml +0 -0
  10. {pyqrack_cuda-1.44.14 → pyqrack_cuda-1.44.16}/pyqrack/__init__.py +0 -0
  11. {pyqrack_cuda-1.44.14 → pyqrack_cuda-1.44.16}/pyqrack/neuron_activation_fn.py +0 -0
  12. {pyqrack_cuda-1.44.14 → pyqrack_cuda-1.44.16}/pyqrack/pauli.py +0 -0
  13. {pyqrack_cuda-1.44.14 → pyqrack_cuda-1.44.16}/pyqrack/qrack_circuit.py +0 -0
  14. {pyqrack_cuda-1.44.14 → pyqrack_cuda-1.44.16}/pyqrack/qrack_neuron.py +0 -0
  15. {pyqrack_cuda-1.44.14 → pyqrack_cuda-1.44.16}/pyqrack/qrack_neuron_torch_layer.py +0 -0
  16. {pyqrack_cuda-1.44.14 → pyqrack_cuda-1.44.16}/pyqrack/qrack_simulator.py +0 -0
  17. {pyqrack_cuda-1.44.14 → pyqrack_cuda-1.44.16}/pyqrack/qrack_stabilizer.py +0 -0
  18. {pyqrack_cuda-1.44.14 → pyqrack_cuda-1.44.16}/pyqrack/qrack_system/__init__.py +0 -0
  19. {pyqrack_cuda-1.44.14 → pyqrack_cuda-1.44.16}/pyqrack/qrack_system/qrack_system.py +0 -0
  20. {pyqrack_cuda-1.44.14 → pyqrack_cuda-1.44.16}/pyqrack/quimb_circuit_type.py +0 -0
  21. {pyqrack_cuda-1.44.14 → pyqrack_cuda-1.44.16}/pyqrack/stats/__init__.py +0 -0
  22. {pyqrack_cuda-1.44.14 → pyqrack_cuda-1.44.16}/pyqrack/stats/load_quantized_data.py +0 -0
  23. {pyqrack_cuda-1.44.14 → pyqrack_cuda-1.44.16}/pyqrack/stats/quantize_by_range.py +0 -0
  24. {pyqrack_cuda-1.44.14 → pyqrack_cuda-1.44.16}/pyqrack_cuda.egg-info/SOURCES.txt +0 -0
  25. {pyqrack_cuda-1.44.14 → pyqrack_cuda-1.44.16}/pyqrack_cuda.egg-info/dependency_links.txt +0 -0
  26. {pyqrack_cuda-1.44.14 → pyqrack_cuda-1.44.16}/pyqrack_cuda.egg-info/not-zip-safe +0 -0
  27. {pyqrack_cuda-1.44.14 → pyqrack_cuda-1.44.16}/pyqrack_cuda.egg-info/requires.txt +0 -0
  28. {pyqrack_cuda-1.44.14 → pyqrack_cuda-1.44.16}/pyqrack_cuda.egg-info/top_level.txt +0 -0
  29. {pyqrack_cuda-1.44.14 → pyqrack_cuda-1.44.16}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyqrack-cuda
3
- Version: 1.44.14
3
+ Version: 1.44.16
4
4
  Summary: pyqrack - Pure Python vm6502q/qrack Wrapper
5
5
  Home-page: https://github.com/vm6502q/pyqrack
6
6
  Author: Daniel Strano
@@ -38,8 +38,8 @@ class QrackAceBackend:
38
38
  col_length(int): Qubits per column.
39
39
  """
40
40
 
41
- def __init__(self, qubit_count=-1, alternating_codes=True, toClone=None):
42
- self.sim = toClone.sim.clone() if toClone else QrackSimulator(3 * qubit_count + 1)
41
+ def __init__(self, qubit_count=-1, alternating_codes=True, isTensorNetwork=False, toClone=None):
42
+ self.sim = toClone.sim.clone() if toClone else QrackSimulator(3 * qubit_count + 1, isTensorNetwork=isTensorNetwork)
43
43
  self._ancilla = 3 * qubit_count
44
44
  self._factor_width(qubit_count)
45
45
  self.alternating_codes = alternating_codes
@@ -144,10 +144,18 @@ class QrackAceBackend:
144
144
 
145
145
  row = (hq[0] // 3) // self.row_length
146
146
  even_row = not (row & 1)
147
- single_bit = 2 if (not self.alternating_codes or even_row) else 0
147
+ single_bit = 0
148
+ other_bits = []
149
+ if (not self.alternating_codes or even_row):
150
+ single_bit = 2
151
+ other_bits = [0, 1]
152
+ else:
153
+ single_bit = 0
154
+ other_bits = [1, 2]
148
155
 
149
156
  max_syndrome = max(syndrome)
150
157
  error_bit = syndrome.index(max_syndrome)
158
+ force_syndrome = True
151
159
  if (2 * max_syndrome) >= shots:
152
160
  # There is an error.
153
161
  if error_bit == single_bit:
@@ -155,20 +163,22 @@ class QrackAceBackend:
155
163
  self.sim.x(hq[error_bit])
156
164
  else:
157
165
  # The coherent bits carry the error.
166
+ force_syndrome = False
158
167
  # Form their syndrome.
159
- self.sim.mcx([hq[1]], self._ancilla)
160
- self.sim.mcx([hq[2]], self._ancilla)
168
+ self.sim.mcx([hq[other_bits[0]]], self._ancilla)
169
+ self.sim.mcx([hq[other_bits[1]]], self._ancilla)
161
170
  # Force the syndrome pathological
162
171
  self.sim.force_m(self._ancilla, True)
163
172
  # Reset the ancilla.
164
173
  self.sim.x(self._ancilla)
165
174
  # Correct the bit flip.
166
175
  self.sim.x(hq[error_bit])
167
- elif error_bit != single_bit:
168
- # There is no error.
176
+
177
+ # There is no error.
178
+ if force_syndrome:
169
179
  # Form the syndrome of the coherent bits.
170
- self.sim.mcx([hq[1]], self._ancilla)
171
- self.sim.mcx([hq[2]], self._ancilla)
180
+ self.sim.mcx([hq[other_bits[0]]], self._ancilla)
181
+ self.sim.mcx([hq[other_bits[1]]], self._ancilla)
172
182
  # Force the syndrome non-pathological.
173
183
  self.sim.force_m(self._ancilla, False)
174
184
 
@@ -178,72 +188,64 @@ class QrackAceBackend:
178
188
  self._decode(hq)
179
189
  self.sim.u(hq[0], th, ph, lm)
180
190
  self._encode(hq)
181
- self._correct(lq)
182
191
 
183
192
  def r(self, p, th, lq):
184
193
  hq = self._unpack(lq)
185
194
  self._decode(hq)
186
195
  self.sim.r(p, th, hq[0])
187
196
  self._encode(hq)
188
- self._correct(lq)
189
197
 
190
198
  def s(self, lq):
191
199
  hq = self._unpack(lq)
192
200
  self._decode(hq)
193
201
  self.sim.s(hq[0])
194
202
  self._encode(hq)
195
- self._correct(lq)
196
203
 
197
204
  def adjs(self, lq):
198
205
  hq = self._unpack(lq)
199
206
  self._decode(hq)
200
207
  self.sim.adjs(hq[0])
201
208
  self._encode(hq)
202
- self._correct(lq)
203
209
 
204
210
  def x(self, lq):
205
211
  hq = self._unpack(lq)
206
212
  self._decode(hq)
207
213
  self.sim.x(hq[0])
208
214
  self._encode(hq)
209
- self._correct(lq)
210
215
 
211
216
  def y(self, lq):
212
217
  hq = self._unpack(lq)
213
218
  self._decode(hq)
214
219
  self.sim.y(hq[0])
215
220
  self._encode(hq)
216
- self._correct(lq)
217
221
 
218
222
  def z(self, lq):
219
223
  hq = self._unpack(lq)
220
224
  self._decode(hq)
221
225
  self.sim.z(hq[0])
222
226
  self._encode(hq)
223
- self._correct(lq)
224
227
 
225
228
  def h(self, lq):
226
229
  hq = self._unpack(lq)
227
230
  self._decode(hq)
228
231
  self.sim.h(hq[0])
229
232
  self._encode(hq)
230
- self._correct(lq)
231
233
 
232
234
  def t(self, lq):
233
235
  hq = self._unpack(lq)
234
236
  self._decode(hq)
235
237
  self.sim.t(hq[0])
236
238
  self._encode(hq)
237
- self._correct(lq)
238
239
 
239
240
  def adjt(self, lq):
240
241
  hq = self._unpack(lq)
241
242
  self._decode(hq)
242
243
  self.sim.adjt(hq[0])
243
244
  self._encode(hq)
244
- self._correct(lq)
245
245
 
246
246
  def _cpauli(self, lq1, lq2, anti, pauli):
247
+ self._correct(lq1)
248
+
247
249
  gate = None
248
250
  shadow = None
249
251
  if pauli == Pauli.PauliX:
@@ -291,9 +293,6 @@ class QrackAceBackend:
291
293
  gate([hq1[1]], hq2[1])
292
294
  gate([hq1[2]], hq2[2])
293
295
 
294
- self._correct(lq1)
295
- self._correct(lq2)
296
-
297
296
 
298
297
  def cx(self, lq1, lq2):
299
298
  self._cpauli(lq1, lq2, False, Pauli.PauliX)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyqrack-cuda
3
- Version: 1.44.14
3
+ Version: 1.44.16
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.14"
10
+ VERSION = "1.44.16"
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