pyqrack-cuda-complex128 2.2.0__tar.gz → 2.2.2__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_cuda_complex128-2.2.0 → pyqrack_cuda_complex128-2.2.2}/Makefile +1 -1
  2. {pyqrack_cuda_complex128-2.2.0/pyqrack_cuda_complex128.egg-info → pyqrack_cuda_complex128-2.2.2}/PKG-INFO +1 -1
  3. {pyqrack_cuda_complex128-2.2.0 → pyqrack_cuda_complex128-2.2.2}/pyqrack/qrack_ace_backend.py +37 -24
  4. {pyqrack_cuda_complex128-2.2.0 → pyqrack_cuda_complex128-2.2.2/pyqrack_cuda_complex128.egg-info}/PKG-INFO +1 -1
  5. {pyqrack_cuda_complex128-2.2.0 → pyqrack_cuda_complex128-2.2.2}/setup.py +1 -1
  6. {pyqrack_cuda_complex128-2.2.0 → pyqrack_cuda_complex128-2.2.2}/LICENSE +0 -0
  7. {pyqrack_cuda_complex128-2.2.0 → pyqrack_cuda_complex128-2.2.2}/MANIFEST.in +0 -0
  8. {pyqrack_cuda_complex128-2.2.0 → pyqrack_cuda_complex128-2.2.2}/README.md +0 -0
  9. {pyqrack_cuda_complex128-2.2.0 → pyqrack_cuda_complex128-2.2.2}/pyproject.toml +0 -0
  10. {pyqrack_cuda_complex128-2.2.0 → pyqrack_cuda_complex128-2.2.2}/pyqrack/__init__.py +0 -0
  11. {pyqrack_cuda_complex128-2.2.0 → pyqrack_cuda_complex128-2.2.2}/pyqrack/neuron_activation_fn.py +0 -0
  12. {pyqrack_cuda_complex128-2.2.0 → pyqrack_cuda_complex128-2.2.2}/pyqrack/pauli.py +0 -0
  13. {pyqrack_cuda_complex128-2.2.0 → pyqrack_cuda_complex128-2.2.2}/pyqrack/qrack_circuit.py +0 -0
  14. {pyqrack_cuda_complex128-2.2.0 → pyqrack_cuda_complex128-2.2.2}/pyqrack/qrack_near_clifford_qec_backend.py +0 -0
  15. {pyqrack_cuda_complex128-2.2.0 → pyqrack_cuda_complex128-2.2.2}/pyqrack/qrack_neuron.py +0 -0
  16. {pyqrack_cuda_complex128-2.2.0 → pyqrack_cuda_complex128-2.2.2}/pyqrack/qrack_neuron_torch_layer.py +0 -0
  17. {pyqrack_cuda_complex128-2.2.0 → pyqrack_cuda_complex128-2.2.2}/pyqrack/qrack_simulator.py +0 -0
  18. {pyqrack_cuda_complex128-2.2.0 → pyqrack_cuda_complex128-2.2.2}/pyqrack/qrack_stabilizer.py +0 -0
  19. {pyqrack_cuda_complex128-2.2.0 → pyqrack_cuda_complex128-2.2.2}/pyqrack/qrack_system/__init__.py +0 -0
  20. {pyqrack_cuda_complex128-2.2.0 → pyqrack_cuda_complex128-2.2.2}/pyqrack/qrack_system/qrack_system.py +0 -0
  21. {pyqrack_cuda_complex128-2.2.0 → pyqrack_cuda_complex128-2.2.2}/pyqrack/quimb_circuit_type.py +0 -0
  22. {pyqrack_cuda_complex128-2.2.0 → pyqrack_cuda_complex128-2.2.2}/pyqrack/stats/__init__.py +0 -0
  23. {pyqrack_cuda_complex128-2.2.0 → pyqrack_cuda_complex128-2.2.2}/pyqrack/stats/load_quantized_data.py +0 -0
  24. {pyqrack_cuda_complex128-2.2.0 → pyqrack_cuda_complex128-2.2.2}/pyqrack/stats/quantize_by_range.py +0 -0
  25. {pyqrack_cuda_complex128-2.2.0 → pyqrack_cuda_complex128-2.2.2}/pyqrack_cuda_complex128.egg-info/SOURCES.txt +0 -0
  26. {pyqrack_cuda_complex128-2.2.0 → pyqrack_cuda_complex128-2.2.2}/pyqrack_cuda_complex128.egg-info/dependency_links.txt +0 -0
  27. {pyqrack_cuda_complex128-2.2.0 → pyqrack_cuda_complex128-2.2.2}/pyqrack_cuda_complex128.egg-info/not-zip-safe +0 -0
  28. {pyqrack_cuda_complex128-2.2.0 → pyqrack_cuda_complex128-2.2.2}/pyqrack_cuda_complex128.egg-info/requires.txt +0 -0
  29. {pyqrack_cuda_complex128-2.2.0 → pyqrack_cuda_complex128-2.2.2}/pyqrack_cuda_complex128.egg-info/top_level.txt +0 -0
  30. {pyqrack_cuda_complex128-2.2.0 → pyqrack_cuda_complex128-2.2.2}/setup.cfg +0 -0
@@ -30,7 +30,7 @@ build-deps:
30
30
  rm -rf pyqrack/qrack_system/qrack_cl_precompile
31
31
  ifneq ($(OS),Windows_NT)
32
32
  ifeq ($(QRACK_PRESENT),)
33
- git clone https://github.com/unitaryfund/qrack.git; cd qrack; git checkout 4d603e03c8f8dc7ee60e0438042b53a1343443be; cd ..
33
+ git clone https://github.com/unitaryfund/qrack.git; cd qrack; git checkout ccb9cca0726e48c598696b51a66fb984ff8ab0f1; cd ..
34
34
  endif
35
35
  mkdir -p qrack/build
36
36
  ifeq ($(UNAME_S),Linux)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyqrack-cuda-complex128
3
- Version: 2.2.0
3
+ Version: 2.2.2
4
4
  Summary: pyqrack - Pure Python vm6502q/qrack Wrapper
5
5
  Home-page: https://github.com/vm6502q/pyqrack
6
6
  Author: Daniel Strano
@@ -326,14 +326,18 @@ class QrackAceBackend:
326
326
  )
327
327
  )
328
328
 
329
- # You can still "monkey-patch" this, after the constructor.
330
- if "QRACK_QUNIT_SEPARABILITY_THRESHOLD" not in os.environ:
331
- # (1 - 1 / sqrt(2)) / 4 (but empirically tuned)
332
- self.sim[i].set_sdrp(0.073223304703363119)
329
+ # You can still call "set_sdrp," after the constructor.
330
+ # if "QRACK_QUNIT_SEPARABILITY_THRESHOLD" not in os.environ:
331
+ # # (1 - 1 / sqrt(2)) / 4 (but empirically tuned)
332
+ # self.sim[i].set_sdrp(0.073223304703363119)
333
333
 
334
334
  def clone(self):
335
335
  return QrackAceBackend(to_clone=self)
336
336
 
337
+ def set_sdrp(self, sdrp):
338
+ for sim in self.sim:
339
+ sim.set_sdrp(sdrp)
340
+
337
341
  def measure_shots_consensus(self, q, s, n_instances=3, threshold=0.1):
338
342
  # Consensus measurement across n_instances independent clones.
339
343
  #
@@ -590,7 +594,12 @@ class QrackAceBackend:
590
594
  )
591
595
  / 7
592
596
  )
593
- result = ((prms + (1 - qrms)) / 2) >= 0.5
597
+ eff_prob = (prms + (1 - qrms)) / 2
598
+ result = (
599
+ (random.random() < 0.5)
600
+ if (eff_prob - 0.5) == 0.0
601
+ else (eff_prob > 0.5)
602
+ )
594
603
  syndrome = (
595
604
  [1 - p[0], 1 - p[1], 1 - p[2], 1 - p[3], 1 - p[4]]
596
605
  if result
@@ -639,7 +648,12 @@ class QrackAceBackend:
639
648
  # Balancing suggestion from Elara (the custom OpenAI GPT)
640
649
  prms = math.sqrt((p[0] ** 2 + p[1] ** 2 + p[2] ** 2) / 3)
641
650
  qrms = math.sqrt(((1 - p[0]) ** 2 + (1 - p[1]) ** 2 + (1 - p[2]) ** 2) / 3)
642
- result = ((prms + (1 - qrms)) / 2) >= 0.5
651
+ eff_prob = (prms + (1 - qrms)) / 2
652
+ result = (
653
+ (random.random() < 0.5)
654
+ if (eff_prob - 0.5) == 0.0
655
+ else (eff_prob > 0.5)
656
+ )
643
657
  syndrome = [1 - p[0], 1 - p[1], 1 - p[2]] if result else [p[0], p[1], p[2]]
644
658
  for q in range(3):
645
659
  if syndrome[q] > (0.5 + self._epsilon):
@@ -1125,12 +1139,12 @@ class QrackAceBackend:
1125
1139
  else:
1126
1140
  self.sim[b[0]].force_m(b[1], result)
1127
1141
 
1128
- b = hq[1]
1142
+ b = hq[lhv]
1129
1143
  b.reset()
1130
1144
  if result:
1131
1145
  b.x()
1132
1146
 
1133
- return c
1147
+ return result
1134
1148
 
1135
1149
  def m_all(self):
1136
1150
  # Randomize the order of measurement to amortize error.
@@ -1495,22 +1509,25 @@ class QrackAceBackend:
1495
1509
  return self._coupling_map
1496
1510
 
1497
1511
  coupling_map = set()
1498
- rows, cols = self._row_length, self._col_length
1512
+ # self._row_length is the number of qubits per row (the row's span,
1513
+ # i.e. the column count); self._col_length is the number of rows.
1514
+ num_rows, num_cols = self._col_length, self._row_length
1499
1515
 
1500
- # Map each column index to its full list of logical qubit indices
1516
+ # Row-major logical index, strided by the actual row span.
1501
1517
  def logical_index(row, col):
1502
- return row * cols + col
1518
+ return row * num_cols + col
1503
1519
 
1504
- for col in range(cols):
1505
- connected_cols, _ = self._get_connected(col, False)
1506
- for row in range(rows):
1507
- connected_rows, _ = self._get_connected(row, False)
1520
+ for row in range(num_rows):
1521
+ connected_rows, _ = self._get_connected(row, True)
1522
+ for col in range(num_cols):
1523
+ connected_cols, _ = self._get_connected(col, False)
1508
1524
  a = logical_index(row, col)
1509
- for c in connected_cols:
1510
- for r in connected_rows:
1525
+ for r in connected_rows:
1526
+ for c in connected_cols:
1511
1527
  b = logical_index(r, c)
1512
1528
  if a != b:
1513
1529
  coupling_map.add((a, b))
1530
+ coupling_map.add((b, a))
1514
1531
 
1515
1532
  self._coupling_map = sorted(coupling_map)
1516
1533
 
@@ -1524,9 +1541,11 @@ class QrackAceBackend:
1524
1541
  )
1525
1542
  noise_model = NoiseModel()
1526
1543
 
1527
- # Single-qubit depolarizing only on boundary qubits
1528
1544
  boundary_qubits = set()
1529
1545
  for a, b in self.get_logical_coupling_map():
1546
+ if a > b:
1547
+ #Skip duplicates
1548
+ continue
1530
1549
  col_a = a % self._row_length
1531
1550
  col_b = b % self._row_length
1532
1551
  is_long_a = self._is_col_long_range[col_a]
@@ -1537,12 +1556,6 @@ class QrackAceBackend:
1537
1556
  if not is_long_b:
1538
1557
  boundary_qubits.add(b)
1539
1558
 
1540
- for q in boundary_qubits:
1541
- for gate in ["u", "u1", "u2", "u3", "h", "x", "y", "z",
1542
- "s", "sdg", "t", "tdg", "rx", "ry", "rz"]:
1543
- noise_model.add_quantum_error(
1544
- depolarizing_error(x, 1), gate, [q])
1545
-
1546
1559
  # Two-qubit depolarizing on boundary-crossing and boundary-adjacent gates
1547
1560
  for a, b in self.get_logical_coupling_map():
1548
1561
  col_a = a % self._row_length
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyqrack-cuda-complex128
3
- Version: 2.2.0
3
+ Version: 2.2.2
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.2.0"
10
+ VERSION = "2.2.2"
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')