pyqrack-complex128 2.26.2__tar.gz → 2.26.5__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_complex128-2.26.2/pyqrack_complex128.egg-info → pyqrack_complex128-2.26.5}/PKG-INFO +1 -1
  2. {pyqrack_complex128-2.26.2 → pyqrack_complex128-2.26.5}/pyqrack/qrack_ace_backend.py +26 -29
  3. {pyqrack_complex128-2.26.2 → pyqrack_complex128-2.26.5/pyqrack_complex128.egg-info}/PKG-INFO +1 -1
  4. {pyqrack_complex128-2.26.2 → pyqrack_complex128-2.26.5}/setup.py +1 -1
  5. {pyqrack_complex128-2.26.2 → pyqrack_complex128-2.26.5}/LICENSE +0 -0
  6. {pyqrack_complex128-2.26.2 → pyqrack_complex128-2.26.5}/MANIFEST.in +0 -0
  7. {pyqrack_complex128-2.26.2 → pyqrack_complex128-2.26.5}/Makefile +0 -0
  8. {pyqrack_complex128-2.26.2 → pyqrack_complex128-2.26.5}/README.md +0 -0
  9. {pyqrack_complex128-2.26.2 → pyqrack_complex128-2.26.5}/pyproject.toml +0 -0
  10. {pyqrack_complex128-2.26.2 → pyqrack_complex128-2.26.5}/pyqrack/__init__.py +0 -0
  11. {pyqrack_complex128-2.26.2 → pyqrack_complex128-2.26.5}/pyqrack/neuron_activation_fn.py +0 -0
  12. {pyqrack_complex128-2.26.2 → pyqrack_complex128-2.26.5}/pyqrack/pauli.py +0 -0
  13. {pyqrack_complex128-2.26.2 → pyqrack_complex128-2.26.5}/pyqrack/qrack_circuit.py +0 -0
  14. {pyqrack_complex128-2.26.2 → pyqrack_complex128-2.26.5}/pyqrack/qrack_near_clifford_qec_backend.py +0 -0
  15. {pyqrack_complex128-2.26.2 → pyqrack_complex128-2.26.5}/pyqrack/qrack_neuron.py +0 -0
  16. {pyqrack_complex128-2.26.2 → pyqrack_complex128-2.26.5}/pyqrack/qrack_neuron_torch_layer.py +0 -0
  17. {pyqrack_complex128-2.26.2 → pyqrack_complex128-2.26.5}/pyqrack/qrack_simulator.py +0 -0
  18. {pyqrack_complex128-2.26.2 → pyqrack_complex128-2.26.5}/pyqrack/qrack_stabilizer.py +0 -0
  19. {pyqrack_complex128-2.26.2 → pyqrack_complex128-2.26.5}/pyqrack/qrack_system/__init__.py +0 -0
  20. {pyqrack_complex128-2.26.2 → pyqrack_complex128-2.26.5}/pyqrack/qrack_system/qrack_system.py +0 -0
  21. {pyqrack_complex128-2.26.2 → pyqrack_complex128-2.26.5}/pyqrack/quimb_circuit_type.py +0 -0
  22. {pyqrack_complex128-2.26.2 → pyqrack_complex128-2.26.5}/pyqrack/stats/__init__.py +0 -0
  23. {pyqrack_complex128-2.26.2 → pyqrack_complex128-2.26.5}/pyqrack/stats/load_quantized_data.py +0 -0
  24. {pyqrack_complex128-2.26.2 → pyqrack_complex128-2.26.5}/pyqrack/stats/quantize_by_range.py +0 -0
  25. {pyqrack_complex128-2.26.2 → pyqrack_complex128-2.26.5}/pyqrack_complex128.egg-info/SOURCES.txt +0 -0
  26. {pyqrack_complex128-2.26.2 → pyqrack_complex128-2.26.5}/pyqrack_complex128.egg-info/dependency_links.txt +0 -0
  27. {pyqrack_complex128-2.26.2 → pyqrack_complex128-2.26.5}/pyqrack_complex128.egg-info/not-zip-safe +0 -0
  28. {pyqrack_complex128-2.26.2 → pyqrack_complex128-2.26.5}/pyqrack_complex128.egg-info/requires.txt +0 -0
  29. {pyqrack_complex128-2.26.2 → pyqrack_complex128-2.26.5}/pyqrack_complex128.egg-info/top_level.txt +0 -0
  30. {pyqrack_complex128-2.26.2 → pyqrack_complex128-2.26.5}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyqrack-complex128
3
- Version: 2.26.2
3
+ Version: 2.26.5
4
4
  Summary: pyqrack - Pure Python vm6502q/qrack Wrapper
5
5
  Home-page: https://github.com/vm6502q/pyqrack
6
6
  Author: Daniel Strano
@@ -1389,7 +1389,6 @@ class QrackAceBackend:
1389
1389
  sim_id, idx1 = hq1[i]
1390
1390
  gate_fn, shadow_fn = self._get_gate(pauli, anti, sim_id)
1391
1391
  _, idx2 = hq2[i]
1392
- self.sim[sim_id].swap(idx1, idx2)
1393
1392
  gate_fn([idx1], idx2)
1394
1393
  return
1395
1394
 
@@ -1436,6 +1435,10 @@ class QrackAceBackend:
1436
1435
  self.cx(lq1, anc2)
1437
1436
  self._in_gadget_capture = False
1438
1437
 
1438
+ if not self._in_gadget_capture:
1439
+ self._correct(lq1)
1440
+ self._correct(lq2)
1441
+
1439
1442
  # A target replica (q2) that shares a simulator with ANY control
1440
1443
  # replica in qb1 is going to receive a REAL, exact gate from that
1441
1444
  # control at some point in the loop below (the `b1[0] == b2[0]`
@@ -1488,6 +1491,12 @@ class QrackAceBackend:
1488
1491
  shadow_fn(b1, b2)
1489
1492
  shadow_targets.append(b2)
1490
1493
 
1494
+ if not self._in_gadget_capture:
1495
+ if pauli != Pauli.PauliZ:
1496
+ self._correct(lq2, False, pauli != Pauli.PauliX)
1497
+ if pauli != Pauli.PauliX:
1498
+ self._correct(lq2, True)
1499
+
1491
1500
  if anc2 is not None:
1492
1501
  self._in_gadget_capture = True
1493
1502
  # XOR check
@@ -1534,15 +1543,17 @@ class QrackAceBackend:
1534
1543
  lq1_lr = len(hq1) == 1
1535
1544
  lq2_lr = len(hq2) == 1
1536
1545
 
1537
- if not self._in_gadget_capture:
1538
- self._correct(lq1)
1539
- self._correct(lq2)
1540
-
1541
1546
  t2 = [lq2]
1542
1547
  anc1 = None
1543
1548
  if self.is_boundary_repetition_code and (not self._in_gadget_capture) and lq1_lr and (not lq2_lr):
1544
1549
  # Encode:
1545
- anc1 = self._rep_code_ancilla_lq[hq1[0][0]]
1550
+ anc_sim = hq1[0][0]
1551
+ t_sims = {y[0] for y in hq2 if y[0] >= 0}
1552
+ for x in hq1:
1553
+ if x[0] in t_sims:
1554
+ anc_sim = x[0]
1555
+ break
1556
+ anc1 = self._detect_ancilla2_lq[anc_sim]
1546
1557
  self._in_gadget_capture = True
1547
1558
  self.cx(lq2, anc1)
1548
1559
  self._in_gadget_capture = False
@@ -1599,14 +1610,6 @@ class QrackAceBackend:
1599
1610
  if b:
1600
1611
  self.x(anc1)
1601
1612
 
1602
- if self._in_gadget_capture:
1603
- return
1604
-
1605
- if pauli != Pauli.PauliZ:
1606
- self._correct(lq2, False, pauli != Pauli.PauliX)
1607
- if pauli != Pauli.PauliX:
1608
- self._correct(lq2, True)
1609
-
1610
1613
  def cx(self, lq1, lq2):
1611
1614
  self._cpauli(lq1, lq2, False, Pauli.PauliX)
1612
1615
 
@@ -2873,7 +2876,7 @@ class QrackAceBackend:
2873
2876
  return tgt
2874
2877
 
2875
2878
  # Designed by Dan, Elara (ChatGPT), and (Anthropic) Claude:
2876
- def create_noise_model(self, x=0.5, y=0.5):
2879
+ def create_noise_model(self, x=0.25, y=0.25):
2877
2880
  if not _IS_QISKIT_AER_AVAILABLE:
2878
2881
  raise RuntimeError(
2879
2882
  "Before trying to run_qiskit_circuit() with QrackAceBackend, you must install Qiskit Aer!"
@@ -2881,17 +2884,10 @@ class QrackAceBackend:
2881
2884
  noise_model = NoiseModel()
2882
2885
 
2883
2886
  def _uncommon_sim_fraction(lq1, lq2):
2884
- sims1 = [qb[0] for qb in self._qubits[lq1]]
2885
- sims2 = [qb[0] for qb in self._qubits[lq2]]
2886
- n = 0
2887
- for s in sims1:
2888
- if s not in sims2:
2889
- n += 1
2890
- for s in sims2:
2891
- if s not in sims1:
2892
- n += 1
2893
-
2894
- return n / (len(sims1) + len(sims2))
2887
+ sims1 = {qb[0] for qb in self._qubits[lq1]}
2888
+ sims2 = {qb[0] for qb in self._qubits[lq2]}
2889
+
2890
+ return len(sims1 ^ sims2) / len(sims1.union(sims2))
2895
2891
 
2896
2892
  coupling_map = self.get_logical_coupling_map()
2897
2893
 
@@ -2947,6 +2943,7 @@ class QrackAceBackend:
2947
2943
 
2948
2944
  sp = (1 - self._sdrp / 2) ** c
2949
2945
  p = (1 - x) ** u
2946
+ d = 1 - ((1 - y) ** u)
2950
2947
 
2951
2948
  # cx/cy/cz: single-qubit, TARGET-only error, with the gate's
2952
2949
  # own generator as the Pauli type -- derived directly from
@@ -2971,7 +2968,7 @@ class QrackAceBackend:
2971
2968
  # anc2 verifying b) are structurally live exactly when a
2972
2969
  # itself is boundary -- see the comment above this loop.
2973
2970
  # Damp accordingly.
2974
- p_shadow_ccz *= y
2971
+ p_shadow_ccz *= d
2975
2972
  noise_model.add_quantum_error(
2976
2973
  pauli_error([("ZI", p_shadow_ccz), ("II", 1 - p_shadow_ccz)]), "cz", [a, b]
2977
2974
  )
@@ -3057,7 +3054,7 @@ class QrackAceBackend:
3057
3054
  if (is_a_simple != is_b_simple) and has_match:
3058
3055
  p_net_swap = 2 * p * (1 - p)
3059
3056
  if self.is_error_detection:
3060
- p_net_swap *= y
3057
+ p_net_swap *= d
3061
3058
  if is_a_simple:
3062
3059
  # a is bulk, b is boundary -> error lands on b
3063
3060
  noise_model.add_quantum_error(
@@ -3108,7 +3105,7 @@ class QrackAceBackend:
3108
3105
  # from a different gate (the now-protected native
3109
3106
  # swap, not
3110
3107
  # this cz component).
3111
- p_cz *= y
3108
+ p_cz *= d
3112
3109
  p_net_iswap = p_net_swap * (1 - p_cz) + p_cz * (1 - p_net_swap)
3113
3110
  if is_a_simple:
3114
3111
  terms = [("II", 1 - p_net_iswap), ("ZI", p_net_iswap)]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyqrack-complex128
3
- Version: 2.26.2
3
+ Version: 2.26.5
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.26.2"
10
+ VERSION = "2.26.5"
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')