pyqrack-cpu-complex128 2.22.3__tar.gz → 2.22.4__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.22.3/pyqrack_cpu_complex128.egg-info → pyqrack_cpu_complex128-2.22.4}/PKG-INFO +1 -1
  2. {pyqrack_cpu_complex128-2.22.3 → pyqrack_cpu_complex128-2.22.4}/pyqrack/qrack_ace_backend.py +59 -6
  3. {pyqrack_cpu_complex128-2.22.3 → pyqrack_cpu_complex128-2.22.4/pyqrack_cpu_complex128.egg-info}/PKG-INFO +1 -1
  4. {pyqrack_cpu_complex128-2.22.3 → pyqrack_cpu_complex128-2.22.4}/setup.py +1 -1
  5. {pyqrack_cpu_complex128-2.22.3 → pyqrack_cpu_complex128-2.22.4}/LICENSE +0 -0
  6. {pyqrack_cpu_complex128-2.22.3 → pyqrack_cpu_complex128-2.22.4}/MANIFEST.in +0 -0
  7. {pyqrack_cpu_complex128-2.22.3 → pyqrack_cpu_complex128-2.22.4}/Makefile +0 -0
  8. {pyqrack_cpu_complex128-2.22.3 → pyqrack_cpu_complex128-2.22.4}/README.md +0 -0
  9. {pyqrack_cpu_complex128-2.22.3 → pyqrack_cpu_complex128-2.22.4}/pyproject.toml +0 -0
  10. {pyqrack_cpu_complex128-2.22.3 → pyqrack_cpu_complex128-2.22.4}/pyqrack/__init__.py +0 -0
  11. {pyqrack_cpu_complex128-2.22.3 → pyqrack_cpu_complex128-2.22.4}/pyqrack/neuron_activation_fn.py +0 -0
  12. {pyqrack_cpu_complex128-2.22.3 → pyqrack_cpu_complex128-2.22.4}/pyqrack/pauli.py +0 -0
  13. {pyqrack_cpu_complex128-2.22.3 → pyqrack_cpu_complex128-2.22.4}/pyqrack/qrack_circuit.py +0 -0
  14. {pyqrack_cpu_complex128-2.22.3 → pyqrack_cpu_complex128-2.22.4}/pyqrack/qrack_near_clifford_qec_backend.py +0 -0
  15. {pyqrack_cpu_complex128-2.22.3 → pyqrack_cpu_complex128-2.22.4}/pyqrack/qrack_neuron.py +0 -0
  16. {pyqrack_cpu_complex128-2.22.3 → pyqrack_cpu_complex128-2.22.4}/pyqrack/qrack_neuron_torch_layer.py +0 -0
  17. {pyqrack_cpu_complex128-2.22.3 → pyqrack_cpu_complex128-2.22.4}/pyqrack/qrack_simulator.py +0 -0
  18. {pyqrack_cpu_complex128-2.22.3 → pyqrack_cpu_complex128-2.22.4}/pyqrack/qrack_stabilizer.py +0 -0
  19. {pyqrack_cpu_complex128-2.22.3 → pyqrack_cpu_complex128-2.22.4}/pyqrack/qrack_system/__init__.py +0 -0
  20. {pyqrack_cpu_complex128-2.22.3 → pyqrack_cpu_complex128-2.22.4}/pyqrack/qrack_system/qrack_system.py +0 -0
  21. {pyqrack_cpu_complex128-2.22.3 → pyqrack_cpu_complex128-2.22.4}/pyqrack/quimb_circuit_type.py +0 -0
  22. {pyqrack_cpu_complex128-2.22.3 → pyqrack_cpu_complex128-2.22.4}/pyqrack/stats/__init__.py +0 -0
  23. {pyqrack_cpu_complex128-2.22.3 → pyqrack_cpu_complex128-2.22.4}/pyqrack/stats/load_quantized_data.py +0 -0
  24. {pyqrack_cpu_complex128-2.22.3 → pyqrack_cpu_complex128-2.22.4}/pyqrack/stats/quantize_by_range.py +0 -0
  25. {pyqrack_cpu_complex128-2.22.3 → pyqrack_cpu_complex128-2.22.4}/pyqrack_cpu_complex128.egg-info/SOURCES.txt +0 -0
  26. {pyqrack_cpu_complex128-2.22.3 → pyqrack_cpu_complex128-2.22.4}/pyqrack_cpu_complex128.egg-info/dependency_links.txt +0 -0
  27. {pyqrack_cpu_complex128-2.22.3 → pyqrack_cpu_complex128-2.22.4}/pyqrack_cpu_complex128.egg-info/not-zip-safe +0 -0
  28. {pyqrack_cpu_complex128-2.22.3 → pyqrack_cpu_complex128-2.22.4}/pyqrack_cpu_complex128.egg-info/requires.txt +0 -0
  29. {pyqrack_cpu_complex128-2.22.3 → pyqrack_cpu_complex128-2.22.4}/pyqrack_cpu_complex128.egg-info/top_level.txt +0 -0
  30. {pyqrack_cpu_complex128-2.22.3 → pyqrack_cpu_complex128-2.22.4}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyqrack-cpu-complex128
3
- Version: 2.22.3
3
+ Version: 2.22.4
4
4
  Summary: pyqrack - Pure Python vm6502q/qrack Wrapper
5
5
  Home-page: https://github.com/vm6502q/pyqrack
6
6
  Author: Daniel Strano
@@ -1713,16 +1713,69 @@ class QrackAceBackend:
1713
1713
  else:
1714
1714
  bits = [self.force_m(a, False) for a in ancs]
1715
1715
 
1716
+ # Map each participant to the SPECIFIC physical replica
1717
+ # of hq1 its own syndrome actually covers -- anc1 is
1718
+ # patch A (hq1[0]), anc1c is always the crossbar
1719
+ # (hq1[2], by construction), and anc1b is whichever of
1720
+ # hq1's replicas lives in hq2's own patch (found by sim
1721
+ # id rather than assumed to be a fixed index, since
1722
+ # corner qubits have patch replicas at indices 1, 3, and
1723
+ # 4). This can legitimately be absent: hq1 and hq2 may
1724
+ # share no common patch at all for an arbitrary (non-
1725
+ # adjacent) logical coupling -- confirmed directly
1726
+ # (hq1=[(2,1),(3,0),(4,2)] coupled to hq2=[(1,1)], no
1727
+ # overlap) -- in which case there is no single physical
1728
+ # replica to target for that participant specifically.
1729
+ replicas = [hq1[0]]
1730
+ if anc1b is not None:
1731
+ replicas.append(next((r for r in hq1 if r[0] == hq2[0][0]), None))
1732
+ if anc1c is not None:
1733
+ replicas.append(hq1[2])
1734
+
1735
+ # Majority vote decides whether the LOGICAL value itself
1736
+ # genuinely flipped (updating the LHV shadow, same as the
1737
+ # transversal self.x(lq1) used to do unconditionally);
1738
+ # any minority participant is still individually
1739
+ # corrected below regardless, since ITS replica is wrong
1740
+ # either way -- it just isn't treated as evidence the
1741
+ # logical value moved, the same way a repetition code's
1742
+ # decoded value doesn't change just because one physical
1743
+ # bit needed fixing.
1716
1744
  is_flipped = False
1717
- best_p = -1.0
1745
+ n_flipped = sum(1 for b in bits if b)
1746
+ if (n_flipped << 1) > len(ancs):
1747
+ is_flipped = True
1748
+ lhv = self._lhv.get(lq1)
1749
+ if lhv is not None:
1750
+ lhv.x()
1751
+
1718
1752
  for i, a in enumerate(ancs):
1719
1753
  if bits[i]:
1720
1754
  self.x(a)
1721
- if probs[i] > best_p:
1722
- best_p = probs[i]
1723
- if best_p >= 0.0:
1724
- self.x(lq1)
1725
- is_flipped = True
1755
+ # Targeted, single-replica correction rather than
1756
+ # a transversal self.x(lq1): these replicas are a
1757
+ # pseudo-repetition code for lq1, and a
1758
+ # participant flipping means THAT PHYSICAL COPY
1759
+ # is the one in error, not the logical value as a
1760
+ # whole. Flipping every replica transversally is
1761
+ # only ever correct by coincidence when all
1762
+ # participants agree -- on a genuine minority
1763
+ # disagreement it would "fix" the actual error
1764
+ # while simultaneously breaking the (correct)
1765
+ # majority replicas that were never wrong. Fixing
1766
+ # per-replica is correct in the agreeing case too
1767
+ # (each flipped participant's own replica still
1768
+ # gets corrected), so this applies unconditionally,
1769
+ # not just when a disagreement is detected. Falls
1770
+ # back to the transversal correction only when no
1771
+ # single hq1 replica corresponds to this
1772
+ # participant at all (see the no-overlap case
1773
+ # above).
1774
+ b = replicas[i]
1775
+ if b is not None:
1776
+ self.sim[b[0]].x(b[1])
1777
+ else:
1778
+ self.x(lq1)
1726
1779
  else:
1727
1780
  anc_sim, anc_idx = self._qubits[anc1][0]
1728
1781
  p = self.sim[anc_sim].prob(anc_idx)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyqrack-cpu-complex128
3
- Version: 2.22.3
3
+ Version: 2.22.4
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.22.3"
10
+ VERSION = "2.22.4"
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')