pyqrack-complex128 2.26.1__tar.gz → 2.26.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 (33) hide show
  1. {pyqrack_complex128-2.26.1/pyqrack_complex128.egg-info → pyqrack_complex128-2.26.4}/PKG-INFO +1 -1
  2. {pyqrack_complex128-2.26.1 → pyqrack_complex128-2.26.4}/pyqrack/qrack_ace_backend.py +30 -21
  3. {pyqrack_complex128-2.26.1 → pyqrack_complex128-2.26.4/pyqrack_complex128.egg-info}/PKG-INFO +1 -1
  4. {pyqrack_complex128-2.26.1 → pyqrack_complex128-2.26.4}/pyqrack_complex128.egg-info/SOURCES.txt +0 -3
  5. {pyqrack_complex128-2.26.1 → pyqrack_complex128-2.26.4}/setup.py +1 -1
  6. pyqrack_complex128-2.26.1/pyqrack/qrack_system/qrack_cl_precompile/qrack_cl_precompile +0 -0
  7. pyqrack_complex128-2.26.1/pyqrack/qrack_system/qrack_lib/libqrack_pinvoke.so +0 -0
  8. pyqrack_complex128-2.26.1/pyqrack/qrack_system/qrack_lib/libqrack_pinvoke.so.10.13.1 +0 -0
  9. {pyqrack_complex128-2.26.1 → pyqrack_complex128-2.26.4}/LICENSE +0 -0
  10. {pyqrack_complex128-2.26.1 → pyqrack_complex128-2.26.4}/MANIFEST.in +0 -0
  11. {pyqrack_complex128-2.26.1 → pyqrack_complex128-2.26.4}/Makefile +0 -0
  12. {pyqrack_complex128-2.26.1 → pyqrack_complex128-2.26.4}/README.md +0 -0
  13. {pyqrack_complex128-2.26.1 → pyqrack_complex128-2.26.4}/pyproject.toml +0 -0
  14. {pyqrack_complex128-2.26.1 → pyqrack_complex128-2.26.4}/pyqrack/__init__.py +0 -0
  15. {pyqrack_complex128-2.26.1 → pyqrack_complex128-2.26.4}/pyqrack/neuron_activation_fn.py +0 -0
  16. {pyqrack_complex128-2.26.1 → pyqrack_complex128-2.26.4}/pyqrack/pauli.py +0 -0
  17. {pyqrack_complex128-2.26.1 → pyqrack_complex128-2.26.4}/pyqrack/qrack_circuit.py +0 -0
  18. {pyqrack_complex128-2.26.1 → pyqrack_complex128-2.26.4}/pyqrack/qrack_near_clifford_qec_backend.py +0 -0
  19. {pyqrack_complex128-2.26.1 → pyqrack_complex128-2.26.4}/pyqrack/qrack_neuron.py +0 -0
  20. {pyqrack_complex128-2.26.1 → pyqrack_complex128-2.26.4}/pyqrack/qrack_neuron_torch_layer.py +0 -0
  21. {pyqrack_complex128-2.26.1 → pyqrack_complex128-2.26.4}/pyqrack/qrack_simulator.py +0 -0
  22. {pyqrack_complex128-2.26.1 → pyqrack_complex128-2.26.4}/pyqrack/qrack_stabilizer.py +0 -0
  23. {pyqrack_complex128-2.26.1 → pyqrack_complex128-2.26.4}/pyqrack/qrack_system/__init__.py +0 -0
  24. {pyqrack_complex128-2.26.1 → pyqrack_complex128-2.26.4}/pyqrack/qrack_system/qrack_system.py +0 -0
  25. {pyqrack_complex128-2.26.1 → pyqrack_complex128-2.26.4}/pyqrack/quimb_circuit_type.py +0 -0
  26. {pyqrack_complex128-2.26.1 → pyqrack_complex128-2.26.4}/pyqrack/stats/__init__.py +0 -0
  27. {pyqrack_complex128-2.26.1 → pyqrack_complex128-2.26.4}/pyqrack/stats/load_quantized_data.py +0 -0
  28. {pyqrack_complex128-2.26.1 → pyqrack_complex128-2.26.4}/pyqrack/stats/quantize_by_range.py +0 -0
  29. {pyqrack_complex128-2.26.1 → pyqrack_complex128-2.26.4}/pyqrack_complex128.egg-info/dependency_links.txt +0 -0
  30. {pyqrack_complex128-2.26.1 → pyqrack_complex128-2.26.4}/pyqrack_complex128.egg-info/not-zip-safe +0 -0
  31. {pyqrack_complex128-2.26.1 → pyqrack_complex128-2.26.4}/pyqrack_complex128.egg-info/requires.txt +0 -0
  32. {pyqrack_complex128-2.26.1 → pyqrack_complex128-2.26.4}/pyqrack_complex128.egg-info/top_level.txt +0 -0
  33. {pyqrack_complex128-2.26.1 → pyqrack_complex128-2.26.4}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyqrack-complex128
3
- Version: 2.26.1
3
+ Version: 2.26.4
4
4
  Summary: pyqrack - Pure Python vm6502q/qrack Wrapper
5
5
  Home-page: https://github.com/vm6502q/pyqrack
6
6
  Author: Daniel Strano
@@ -1384,6 +1384,15 @@ class QrackAceBackend:
1384
1384
  def _apply_coupling(self, pauli, anti, qb1, hq1, qb2, hq2, lq1_lr, lq1=None, lq2=None):
1385
1385
  shadow_targets = []
1386
1386
 
1387
+ if len(hq1) == len(hq2) and all(hq1[i][0] == hq2[i][0] for i in range(len(hq1))):
1388
+ for i in range(len(hq1)):
1389
+ sim_id, idx1 = hq1[i]
1390
+ gate_fn, shadow_fn = self._get_gate(pauli, anti, sim_id)
1391
+ _, idx2 = hq2[i]
1392
+ self.sim[sim_id].swap(idx1, idx2)
1393
+ gate_fn([idx1], idx2)
1394
+ return
1395
+
1387
1396
  # Logical-level error-detection gadget: an earlier version of this
1388
1397
  # also captured lq1's own logical value into a dedicated ancilla
1389
1398
  # (via a nested cx()), on the theory that the shadow-coupling
@@ -1410,7 +1419,7 @@ class QrackAceBackend:
1410
1419
  # a lq2-invariant check for that gate family, same reasoning as
1411
1420
  # the single-replica CZ dual-check elsewhere.
1412
1421
  anc2 = None
1413
- if self.is_error_detection and not self._in_gadget_capture and (len(hq1) > 1):
1422
+ if self.is_error_detection and (not self._in_gadget_capture) and (len(hq2) > 1):
1414
1423
  anc_sim = hq1[0][0]
1415
1424
  t_sims = {y[0] for y in hq2 if y[0] >= 0}
1416
1425
  for x in hq1:
@@ -1533,7 +1542,13 @@ class QrackAceBackend:
1533
1542
  anc1 = None
1534
1543
  if self.is_boundary_repetition_code and (not self._in_gadget_capture) and lq1_lr and (not lq2_lr):
1535
1544
  # Encode:
1536
- anc1 = self._rep_code_ancilla_lq[hq1[0][0]]
1545
+ anc_sim = hq1[0][0]
1546
+ t_sims = {y[0] for y in hq2 if y[0] >= 0}
1547
+ for x in hq1:
1548
+ if x[0] in t_sims:
1549
+ anc_sim = x[0]
1550
+ break
1551
+ anc1 = self._detect_ancilla2_lq[anc_sim]
1537
1552
  self._in_gadget_capture = True
1538
1553
  self.cx(lq2, anc1)
1539
1554
  self._in_gadget_capture = False
@@ -1810,9 +1825,6 @@ class QrackAceBackend:
1810
1825
  hq1 = self._unpack(lq1)
1811
1826
  hq2 = self._unpack(lq2)
1812
1827
 
1813
- sims1 = {r[0] for r in hq1}
1814
- sims2 = {r[0] for r in hq2}
1815
-
1816
1828
  # Fast/exact path: every replica of lq1 lines up, position-for-
1817
1829
  # position, with the corresponding replica of lq2 on the SAME
1818
1830
  # underlying simulator. A native swap() there is pure index
@@ -1852,6 +1864,9 @@ class QrackAceBackend:
1852
1864
  # with or without this call).
1853
1865
  return
1854
1866
 
1867
+ sims1 = {r[0] for r in hq1}
1868
+ sims2 = {r[0] for r in hq2}
1869
+
1855
1870
  if sims1.isdisjoint(sims2):
1856
1871
  # Once fully resolved, the swap itself is nothing but a
1857
1872
  # reference exchange: self._qubits[lq] is a reference to the
@@ -2022,7 +2037,7 @@ class QrackAceBackend:
2022
2037
  # bulk on this path (the len(hqt) > 1 case returns earlier,
2023
2038
  # above) and nothing else in this method uses that array anymore.
2024
2039
  anc_and = None
2025
- if self.is_error_detection and not self._in_gadget_capture and ((len(hq1) > 1) or (len(hq2) > 1) or (len(hqt) > 1)):
2040
+ if self.is_error_detection and not self._in_gadget_capture and (len(hqt) > 1):
2026
2041
  found = False
2027
2042
  anc_sim = hq1[0][0]
2028
2043
  t_sims = {y[0] for y in hqt if y[0] >= 0}
@@ -2864,7 +2879,7 @@ class QrackAceBackend:
2864
2879
  return tgt
2865
2880
 
2866
2881
  # Designed by Dan, Elara (ChatGPT), and (Anthropic) Claude:
2867
- def create_noise_model(self, x=0.5, y=0.5):
2882
+ def create_noise_model(self, x=0.25, y=0.25):
2868
2883
  if not _IS_QISKIT_AER_AVAILABLE:
2869
2884
  raise RuntimeError(
2870
2885
  "Before trying to run_qiskit_circuit() with QrackAceBackend, you must install Qiskit Aer!"
@@ -2872,17 +2887,10 @@ class QrackAceBackend:
2872
2887
  noise_model = NoiseModel()
2873
2888
 
2874
2889
  def _uncommon_sim_fraction(lq1, lq2):
2875
- sims1 = [qb[0] for qb in self._qubits[lq1]]
2876
- sims2 = [qb[0] for qb in self._qubits[lq2]]
2877
- n = 0
2878
- for s in sims1:
2879
- if s not in sims2:
2880
- n += 1
2881
- for s in sims2:
2882
- if s not in sims1:
2883
- n += 1
2884
-
2885
- return n / (len(sims1) + len(sims2))
2890
+ sims1 = {qb[0] for qb in self._qubits[lq1]}
2891
+ sims2 = {qb[0] for qb in self._qubits[lq2]}
2892
+
2893
+ return len(sims1 ^ sims2) / len(sims1.union(sims2))
2886
2894
 
2887
2895
  coupling_map = self.get_logical_coupling_map()
2888
2896
 
@@ -2938,6 +2946,7 @@ class QrackAceBackend:
2938
2946
 
2939
2947
  sp = (1 - self._sdrp / 2) ** c
2940
2948
  p = (1 - x) ** u
2949
+ d = 1 - ((1 - y) ** u)
2941
2950
 
2942
2951
  # cx/cy/cz: single-qubit, TARGET-only error, with the gate's
2943
2952
  # own generator as the Pauli type -- derived directly from
@@ -2962,7 +2971,7 @@ class QrackAceBackend:
2962
2971
  # anc2 verifying b) are structurally live exactly when a
2963
2972
  # itself is boundary -- see the comment above this loop.
2964
2973
  # Damp accordingly.
2965
- p_shadow_ccz *= y
2974
+ p_shadow_ccz *= d
2966
2975
  noise_model.add_quantum_error(
2967
2976
  pauli_error([("ZI", p_shadow_ccz), ("II", 1 - p_shadow_ccz)]), "cz", [a, b]
2968
2977
  )
@@ -3048,7 +3057,7 @@ class QrackAceBackend:
3048
3057
  if (is_a_simple != is_b_simple) and has_match:
3049
3058
  p_net_swap = 2 * p * (1 - p)
3050
3059
  if self.is_error_detection:
3051
- p_net_swap *= y
3060
+ p_net_swap *= d
3052
3061
  if is_a_simple:
3053
3062
  # a is bulk, b is boundary -> error lands on b
3054
3063
  noise_model.add_quantum_error(
@@ -3099,7 +3108,7 @@ class QrackAceBackend:
3099
3108
  # from a different gate (the now-protected native
3100
3109
  # swap, not
3101
3110
  # this cz component).
3102
- p_cz *= y
3111
+ p_cz *= d
3103
3112
  p_net_iswap = p_net_swap * (1 - p_cz) + p_cz * (1 - p_net_swap)
3104
3113
  if is_a_simple:
3105
3114
  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.1
3
+ Version: 2.26.4
4
4
  Summary: pyqrack - Pure Python vm6502q/qrack Wrapper
5
5
  Home-page: https://github.com/vm6502q/pyqrack
6
6
  Author: Daniel Strano
@@ -17,9 +17,6 @@ pyqrack/qrack_stabilizer.py
17
17
  pyqrack/quimb_circuit_type.py
18
18
  pyqrack/qrack_system/__init__.py
19
19
  pyqrack/qrack_system/qrack_system.py
20
- pyqrack/qrack_system/qrack_cl_precompile/qrack_cl_precompile
21
- pyqrack/qrack_system/qrack_lib/libqrack_pinvoke.so
22
- pyqrack/qrack_system/qrack_lib/libqrack_pinvoke.so.10.13.1
23
20
  pyqrack/stats/__init__.py
24
21
  pyqrack/stats/load_quantized_data.py
25
22
  pyqrack/stats/quantize_by_range.py
@@ -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.1"
10
+ VERSION = "2.26.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')