pyqrack-cuda 1.44.16__tar.gz → 1.44.18__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.16/pyqrack_cuda.egg-info → pyqrack_cuda-1.44.18}/PKG-INFO +1 -1
  2. {pyqrack_cuda-1.44.16 → pyqrack_cuda-1.44.18}/pyqrack/qrack_ace_backend.py +23 -1
  3. {pyqrack_cuda-1.44.16 → pyqrack_cuda-1.44.18/pyqrack_cuda.egg-info}/PKG-INFO +1 -1
  4. {pyqrack_cuda-1.44.16 → pyqrack_cuda-1.44.18}/setup.py +1 -1
  5. {pyqrack_cuda-1.44.16 → pyqrack_cuda-1.44.18}/LICENSE +0 -0
  6. {pyqrack_cuda-1.44.16 → pyqrack_cuda-1.44.18}/MANIFEST.in +0 -0
  7. {pyqrack_cuda-1.44.16 → pyqrack_cuda-1.44.18}/Makefile +0 -0
  8. {pyqrack_cuda-1.44.16 → pyqrack_cuda-1.44.18}/README.md +0 -0
  9. {pyqrack_cuda-1.44.16 → pyqrack_cuda-1.44.18}/pyproject.toml +0 -0
  10. {pyqrack_cuda-1.44.16 → pyqrack_cuda-1.44.18}/pyqrack/__init__.py +0 -0
  11. {pyqrack_cuda-1.44.16 → pyqrack_cuda-1.44.18}/pyqrack/neuron_activation_fn.py +0 -0
  12. {pyqrack_cuda-1.44.16 → pyqrack_cuda-1.44.18}/pyqrack/pauli.py +0 -0
  13. {pyqrack_cuda-1.44.16 → pyqrack_cuda-1.44.18}/pyqrack/qrack_circuit.py +0 -0
  14. {pyqrack_cuda-1.44.16 → pyqrack_cuda-1.44.18}/pyqrack/qrack_neuron.py +0 -0
  15. {pyqrack_cuda-1.44.16 → pyqrack_cuda-1.44.18}/pyqrack/qrack_neuron_torch_layer.py +0 -0
  16. {pyqrack_cuda-1.44.16 → pyqrack_cuda-1.44.18}/pyqrack/qrack_simulator.py +0 -0
  17. {pyqrack_cuda-1.44.16 → pyqrack_cuda-1.44.18}/pyqrack/qrack_stabilizer.py +0 -0
  18. {pyqrack_cuda-1.44.16 → pyqrack_cuda-1.44.18}/pyqrack/qrack_system/__init__.py +0 -0
  19. {pyqrack_cuda-1.44.16 → pyqrack_cuda-1.44.18}/pyqrack/qrack_system/qrack_system.py +0 -0
  20. {pyqrack_cuda-1.44.16 → pyqrack_cuda-1.44.18}/pyqrack/quimb_circuit_type.py +0 -0
  21. {pyqrack_cuda-1.44.16 → pyqrack_cuda-1.44.18}/pyqrack/stats/__init__.py +0 -0
  22. {pyqrack_cuda-1.44.16 → pyqrack_cuda-1.44.18}/pyqrack/stats/load_quantized_data.py +0 -0
  23. {pyqrack_cuda-1.44.16 → pyqrack_cuda-1.44.18}/pyqrack/stats/quantize_by_range.py +0 -0
  24. {pyqrack_cuda-1.44.16 → pyqrack_cuda-1.44.18}/pyqrack_cuda.egg-info/SOURCES.txt +0 -0
  25. {pyqrack_cuda-1.44.16 → pyqrack_cuda-1.44.18}/pyqrack_cuda.egg-info/dependency_links.txt +0 -0
  26. {pyqrack_cuda-1.44.16 → pyqrack_cuda-1.44.18}/pyqrack_cuda.egg-info/not-zip-safe +0 -0
  27. {pyqrack_cuda-1.44.16 → pyqrack_cuda-1.44.18}/pyqrack_cuda.egg-info/requires.txt +0 -0
  28. {pyqrack_cuda-1.44.16 → pyqrack_cuda-1.44.18}/pyqrack_cuda.egg-info/top_level.txt +0 -0
  29. {pyqrack_cuda-1.44.16 → pyqrack_cuda-1.44.18}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyqrack-cuda
3
- Version: 1.44.16
3
+ Version: 1.44.18
4
4
  Summary: pyqrack - Pure Python vm6502q/qrack Wrapper
5
5
  Home-page: https://github.com/vm6502q/pyqrack
6
6
  Author: Daniel Strano
@@ -154,10 +154,10 @@ class QrackAceBackend:
154
154
  other_bits = [1, 2]
155
155
 
156
156
  max_syndrome = max(syndrome)
157
- error_bit = syndrome.index(max_syndrome)
158
157
  force_syndrome = True
159
158
  if (2 * max_syndrome) >= shots:
160
159
  # There is an error.
160
+ error_bit = syndrome.index(max_syndrome)
161
161
  if error_bit == single_bit:
162
162
  # The stand-alone bit carries the error.
163
163
  self.sim.x(hq[error_bit])
@@ -182,14 +182,35 @@ class QrackAceBackend:
182
182
  # Force the syndrome non-pathological.
183
183
  self.sim.force_m(self._ancilla, False)
184
184
 
185
+ def _correct_if_like_h(self, th, lq):
186
+ while th > math.pi:
187
+ th -= 2 * math.pi
188
+ while th <= -math.pi:
189
+ th += 2 * math.pi
190
+ th = abs(th)
191
+ if (th >= (math.pi / 4)) and (th < (3 * math.pi / 4)):
192
+ self._correct(lq)
193
+
185
194
 
186
195
  def u(self, th, ph, lm, lq):
196
+ while ph > math.pi:
197
+ ph -= 2 * math.pi
198
+ while ph <= -math.pi:
199
+ ph += 2 * math.pi
200
+ while lm > math.pi:
201
+ lm -= 2 * math.pi
202
+ while lm <= -math.pi:
203
+ lm += 2 * math.pi
204
+ if not math.isclose(ph, -lm) and not math.isclose(abs(ph), math.pi / 2):
205
+ self._correct_if_like_h(th, lq)
187
206
  hq = self._unpack(lq)
188
207
  self._decode(hq)
189
208
  self.sim.u(hq[0], th, ph, lm)
190
209
  self._encode(hq)
191
210
 
192
211
  def r(self, p, th, lq):
212
+ if p == Pauli.PauliY:
213
+ self._correct_if_like_h(th, lq)
193
214
  hq = self._unpack(lq)
194
215
  self._decode(hq)
195
216
  self.sim.r(p, th, hq[0])
@@ -226,6 +247,7 @@ class QrackAceBackend:
226
247
  self._encode(hq)
227
248
 
228
249
  def h(self, lq):
250
+ self._correct(lq)
229
251
  hq = self._unpack(lq)
230
252
  self._decode(hq)
231
253
  self.sim.h(hq[0])
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyqrack-cuda
3
- Version: 1.44.16
3
+ Version: 1.44.18
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.16"
10
+ VERSION = "1.44.18"
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