pyqrack-cpu-complex128 2.19.2__tar.gz → 2.19.3__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_cpu_complex128-2.19.2/pyqrack_cpu_complex128.egg-info → pyqrack_cpu_complex128-2.19.3}/PKG-INFO +1 -1
  2. {pyqrack_cpu_complex128-2.19.2 → pyqrack_cpu_complex128-2.19.3}/pyqrack/qrack_ace_backend.py +31 -13
  3. {pyqrack_cpu_complex128-2.19.2 → pyqrack_cpu_complex128-2.19.3/pyqrack_cpu_complex128.egg-info}/PKG-INFO +1 -1
  4. {pyqrack_cpu_complex128-2.19.2 → pyqrack_cpu_complex128-2.19.3}/setup.py +1 -1
  5. {pyqrack_cpu_complex128-2.19.2 → pyqrack_cpu_complex128-2.19.3}/LICENSE +0 -0
  6. {pyqrack_cpu_complex128-2.19.2 → pyqrack_cpu_complex128-2.19.3}/MANIFEST.in +0 -0
  7. {pyqrack_cpu_complex128-2.19.2 → pyqrack_cpu_complex128-2.19.3}/Makefile +0 -0
  8. {pyqrack_cpu_complex128-2.19.2 → pyqrack_cpu_complex128-2.19.3}/README.md +0 -0
  9. {pyqrack_cpu_complex128-2.19.2 → pyqrack_cpu_complex128-2.19.3}/pyproject.toml +0 -0
  10. {pyqrack_cpu_complex128-2.19.2 → pyqrack_cpu_complex128-2.19.3}/pyqrack/__init__.py +0 -0
  11. {pyqrack_cpu_complex128-2.19.2 → pyqrack_cpu_complex128-2.19.3}/pyqrack/neuron_activation_fn.py +0 -0
  12. {pyqrack_cpu_complex128-2.19.2 → pyqrack_cpu_complex128-2.19.3}/pyqrack/pauli.py +0 -0
  13. {pyqrack_cpu_complex128-2.19.2 → pyqrack_cpu_complex128-2.19.3}/pyqrack/qrack_circuit.py +0 -0
  14. {pyqrack_cpu_complex128-2.19.2 → pyqrack_cpu_complex128-2.19.3}/pyqrack/qrack_near_clifford_qec_backend.py +0 -0
  15. {pyqrack_cpu_complex128-2.19.2 → pyqrack_cpu_complex128-2.19.3}/pyqrack/qrack_neuron.py +0 -0
  16. {pyqrack_cpu_complex128-2.19.2 → pyqrack_cpu_complex128-2.19.3}/pyqrack/qrack_neuron_torch_layer.py +0 -0
  17. {pyqrack_cpu_complex128-2.19.2 → pyqrack_cpu_complex128-2.19.3}/pyqrack/qrack_simulator.py +0 -0
  18. {pyqrack_cpu_complex128-2.19.2 → pyqrack_cpu_complex128-2.19.3}/pyqrack/qrack_stabilizer.py +0 -0
  19. {pyqrack_cpu_complex128-2.19.2 → pyqrack_cpu_complex128-2.19.3}/pyqrack/qrack_system/__init__.py +0 -0
  20. {pyqrack_cpu_complex128-2.19.2 → pyqrack_cpu_complex128-2.19.3}/pyqrack/qrack_system/qrack_system.py +0 -0
  21. {pyqrack_cpu_complex128-2.19.2 → pyqrack_cpu_complex128-2.19.3}/pyqrack/quimb_circuit_type.py +0 -0
  22. {pyqrack_cpu_complex128-2.19.2 → pyqrack_cpu_complex128-2.19.3}/pyqrack/stats/__init__.py +0 -0
  23. {pyqrack_cpu_complex128-2.19.2 → pyqrack_cpu_complex128-2.19.3}/pyqrack/stats/load_quantized_data.py +0 -0
  24. {pyqrack_cpu_complex128-2.19.2 → pyqrack_cpu_complex128-2.19.3}/pyqrack/stats/quantize_by_range.py +0 -0
  25. {pyqrack_cpu_complex128-2.19.2 → pyqrack_cpu_complex128-2.19.3}/pyqrack_cpu_complex128.egg-info/SOURCES.txt +0 -0
  26. {pyqrack_cpu_complex128-2.19.2 → pyqrack_cpu_complex128-2.19.3}/pyqrack_cpu_complex128.egg-info/dependency_links.txt +0 -0
  27. {pyqrack_cpu_complex128-2.19.2 → pyqrack_cpu_complex128-2.19.3}/pyqrack_cpu_complex128.egg-info/not-zip-safe +0 -0
  28. {pyqrack_cpu_complex128-2.19.2 → pyqrack_cpu_complex128-2.19.3}/pyqrack_cpu_complex128.egg-info/requires.txt +0 -0
  29. {pyqrack_cpu_complex128-2.19.2 → pyqrack_cpu_complex128-2.19.3}/pyqrack_cpu_complex128.egg-info/top_level.txt +0 -0
  30. {pyqrack_cpu_complex128-2.19.2 → pyqrack_cpu_complex128-2.19.3}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyqrack-cpu-complex128
3
- Version: 2.19.2
3
+ Version: 2.19.3
4
4
  Summary: pyqrack - Pure Python vm6502q/qrack Wrapper
5
5
  Home-page: https://github.com/vm6502q/pyqrack
6
6
  Author: Daniel Strano
@@ -633,6 +633,7 @@ class QrackAceBackend:
633
633
  def _cz_shadow(self, q1, q2):
634
634
  p1 = self.sim[q1[0]].prob(q1[1]) if isinstance(q1, tuple) else q1.prob()
635
635
  p2 = self.sim[q2[0]].prob(q2[1]) if isinstance(q2, tuple) else q2.prob()
636
+ target = q2
636
637
 
637
638
  # 0/1-BALANCE FIX: a near-tie (both readings within epsilon of each
638
639
  # other -- the ORDINARY case for a maximally-mixed control paired
@@ -655,8 +656,9 @@ class QrackAceBackend:
655
656
  # changed the deterministic outcome). When the readings are
656
657
  # NOT tied, the existing decisive-threshold logic is unambiguous
657
658
  # and unchanged.
658
- if abs(p1 - p2) <= self._epsilon:
659
+ if (abs(p1 - 0.5) <= self._epsilon) and (abs(p2 - 0.5) <= self._epsilon):
659
660
  apply = random.random() < 0.5
661
+ target = q1 if (random.random() < 0.5) else q2
660
662
  else:
661
663
  # Symmetric-in-control-vs-target CZ shadow, by design: pick
662
664
  # whichever of p1/p2 is more DECISIVE (further from 0.5, i.e.
@@ -670,16 +672,18 @@ class QrackAceBackend:
670
672
  # the control's actual value.
671
673
  d1 = abs(p1 - 0.5)
672
674
  d2 = abs(p2 - 0.5)
673
- decisive = p1 if d1 >= d2 else p2
675
+ if d1 >= d2:
676
+ decisive = p1
677
+ else:
678
+ decisive = p2
679
+ target = q1
674
680
  apply = decisive >= (0.5 - self._epsilon)
675
681
 
676
- # The Z gate always targets q2 (the actual shadow target) --
677
- # never q1 (the control) -- per the earlier phase-kickback fix.
678
682
  if apply:
679
- if isinstance(q2, tuple):
680
- self.sim[q2[0]].z(q2[1])
683
+ if isinstance(target, tuple):
684
+ self.sim[target[0]].z(target[1])
681
685
  else:
682
- q2.z()
686
+ target.z()
683
687
 
684
688
  def _qec_x(self, c):
685
689
  if isinstance(c, tuple):
@@ -717,17 +721,31 @@ class QrackAceBackend:
717
721
  self._anti_shadow_wrap(c, t, self._cz_shadow)
718
722
 
719
723
  def _cx_shadow(self, c, t):
720
- self._qec_h(t)
721
- self._cz_shadow(c, t)
722
- self._qec_h(t)
724
+ p = self.sim[c[0]].prob(c[1]) if isinstance(c, tuple) else c.prob()
725
+ if abs(p - 0.5) <= self._epsilon:
726
+ apply = random.random() < 0.5
727
+ else:
728
+ apply = p > 0.5
729
+ if apply:
730
+ if isinstance(t, tuple):
731
+ self.sim[t[0]].x(t[1])
732
+ else:
733
+ t.x()
723
734
 
724
735
  def _anti_cx_shadow(self, c, t):
725
736
  self._anti_shadow_wrap(c, t, self._cx_shadow)
726
737
 
727
738
  def _cy_shadow(self, c, t):
728
- self._qec_adjs(t)
729
- self._cx_shadow(c, t)
730
- self._qec_s(t)
739
+ p = self.sim[c[0]].prob(c[1]) if isinstance(c, tuple) else c.prob()
740
+ if abs(p - 0.5) <= self._epsilon:
741
+ apply = random.random() < 0.5
742
+ else:
743
+ apply = p > 0.5
744
+ if apply:
745
+ if isinstance(t, tuple):
746
+ self.sim[t[0]].y(t[1])
747
+ else:
748
+ t.y()
731
749
 
732
750
  def _anti_cy_shadow(self, c, t):
733
751
  self._anti_shadow_wrap(c, t, self._cy_shadow)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyqrack-cpu-complex128
3
- Version: 2.19.2
3
+ Version: 2.19.3
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 = "2.19.2"
10
+ VERSION = "2.19.3"
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')