pyqrack-cuda 1.51.0__tar.gz → 1.52.0__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 (29) hide show
  1. {pyqrack_cuda-1.51.0/pyqrack_cuda.egg-info → pyqrack_cuda-1.52.0}/PKG-INFO +1 -1
  2. {pyqrack_cuda-1.51.0 → pyqrack_cuda-1.52.0}/pyqrack/qrack_ace_backend.py +25 -22
  3. {pyqrack_cuda-1.51.0 → pyqrack_cuda-1.52.0/pyqrack_cuda.egg-info}/PKG-INFO +1 -1
  4. {pyqrack_cuda-1.51.0 → pyqrack_cuda-1.52.0}/setup.py +1 -1
  5. {pyqrack_cuda-1.51.0 → pyqrack_cuda-1.52.0}/LICENSE +0 -0
  6. {pyqrack_cuda-1.51.0 → pyqrack_cuda-1.52.0}/MANIFEST.in +0 -0
  7. {pyqrack_cuda-1.51.0 → pyqrack_cuda-1.52.0}/Makefile +0 -0
  8. {pyqrack_cuda-1.51.0 → pyqrack_cuda-1.52.0}/README.md +0 -0
  9. {pyqrack_cuda-1.51.0 → pyqrack_cuda-1.52.0}/pyproject.toml +0 -0
  10. {pyqrack_cuda-1.51.0 → pyqrack_cuda-1.52.0}/pyqrack/__init__.py +0 -0
  11. {pyqrack_cuda-1.51.0 → pyqrack_cuda-1.52.0}/pyqrack/neuron_activation_fn.py +0 -0
  12. {pyqrack_cuda-1.51.0 → pyqrack_cuda-1.52.0}/pyqrack/pauli.py +0 -0
  13. {pyqrack_cuda-1.51.0 → pyqrack_cuda-1.52.0}/pyqrack/qrack_circuit.py +0 -0
  14. {pyqrack_cuda-1.51.0 → pyqrack_cuda-1.52.0}/pyqrack/qrack_neuron.py +0 -0
  15. {pyqrack_cuda-1.51.0 → pyqrack_cuda-1.52.0}/pyqrack/qrack_neuron_torch_layer.py +0 -0
  16. {pyqrack_cuda-1.51.0 → pyqrack_cuda-1.52.0}/pyqrack/qrack_simulator.py +0 -0
  17. {pyqrack_cuda-1.51.0 → pyqrack_cuda-1.52.0}/pyqrack/qrack_stabilizer.py +0 -0
  18. {pyqrack_cuda-1.51.0 → pyqrack_cuda-1.52.0}/pyqrack/qrack_system/__init__.py +0 -0
  19. {pyqrack_cuda-1.51.0 → pyqrack_cuda-1.52.0}/pyqrack/qrack_system/qrack_system.py +0 -0
  20. {pyqrack_cuda-1.51.0 → pyqrack_cuda-1.52.0}/pyqrack/quimb_circuit_type.py +0 -0
  21. {pyqrack_cuda-1.51.0 → pyqrack_cuda-1.52.0}/pyqrack/stats/__init__.py +0 -0
  22. {pyqrack_cuda-1.51.0 → pyqrack_cuda-1.52.0}/pyqrack/stats/load_quantized_data.py +0 -0
  23. {pyqrack_cuda-1.51.0 → pyqrack_cuda-1.52.0}/pyqrack/stats/quantize_by_range.py +0 -0
  24. {pyqrack_cuda-1.51.0 → pyqrack_cuda-1.52.0}/pyqrack_cuda.egg-info/SOURCES.txt +0 -0
  25. {pyqrack_cuda-1.51.0 → pyqrack_cuda-1.52.0}/pyqrack_cuda.egg-info/dependency_links.txt +0 -0
  26. {pyqrack_cuda-1.51.0 → pyqrack_cuda-1.52.0}/pyqrack_cuda.egg-info/not-zip-safe +0 -0
  27. {pyqrack_cuda-1.51.0 → pyqrack_cuda-1.52.0}/pyqrack_cuda.egg-info/requires.txt +0 -0
  28. {pyqrack_cuda-1.51.0 → pyqrack_cuda-1.52.0}/pyqrack_cuda.egg-info/top_level.txt +0 -0
  29. {pyqrack_cuda-1.51.0 → pyqrack_cuda-1.52.0}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyqrack-cuda
3
- Version: 1.51.0
3
+ Version: 1.52.0
4
4
  Summary: pyqrack - Pure Python vm6502q/qrack Wrapper
5
5
  Home-page: https://github.com/vm6502q/pyqrack
6
6
  Author: Daniel Strano
@@ -35,8 +35,7 @@ class QrackAceBackend:
35
35
 
36
36
  The backend was originally designed assuming an (orbifolded) 2D qubit grid like 2019 Sycamore.
37
37
  However, it quickly became apparent that users can basically design their own connectivity topologies,
38
- without breaking the concept. (Not all will work equally well.) For maximum flexibility, set
39
- "alternating_codes=False". (For best performance on Sycamore-like topologies,leave it "True.")
38
+ without breaking the concept. (Not all will work equally well.)
40
39
 
41
40
  Consider distributing the different "patches" to different GPUs with self.sim[sim_id].set_device(gpu_id)!
42
41
  (If you have 3+ patches, maybe your discrete GPU can do multiple patches in the time it takes an Intel HD
@@ -44,7 +43,6 @@ class QrackAceBackend:
44
43
 
45
44
  Attributes:
46
45
  sim(QrackSimulator): Array of simulators corresponding to "patches" between boundary rows.
47
- alternating_codes(bool): Alternate repetition code elision by index?
48
46
  row_length(int): Qubits per row.
49
47
  col_length(int): Qubits per column.
50
48
  long_range_columns(int): How many ideal rows between QEC boundary rows?
@@ -54,7 +52,6 @@ class QrackAceBackend:
54
52
  self,
55
53
  qubit_count=1,
56
54
  long_range_columns=-1,
57
- alternating_codes=True,
58
55
  reverse_row_and_col=False,
59
56
  isTensorNetwork=False,
60
57
  isStabilizerHybrid=False,
@@ -72,7 +69,6 @@ class QrackAceBackend:
72
69
  long_range_columns = 3 if (self.row_length % 3) == 1 else 2
73
70
  self.long_range_columns = long_range_columns
74
71
 
75
- self.alternating_codes = alternating_codes
76
72
  self._coupling_map = None
77
73
 
78
74
  # If there's only one or zero "False" columns,
@@ -100,24 +96,24 @@ class QrackAceBackend:
100
96
  self._qubit_dict[tot_qubits] = (sim_id, sim_counts[sim_id])
101
97
  tot_qubits += 1
102
98
  sim_counts[sim_id] += 1
103
- elif not self.alternating_codes or not (r & 1):
104
- self._qubit_dict[tot_qubits] = (sim_id, sim_counts[sim_id])
105
- tot_qubits += 1
106
- sim_counts[sim_id] += 1
107
- sim_id = (sim_id + 1) % sim_count
99
+ elif (r & 1):
108
100
  for _ in range(2):
109
101
  self._qubit_dict[tot_qubits] = (sim_id, sim_counts[sim_id])
110
102
  tot_qubits += 1
111
103
  sim_counts[sim_id] += 1
104
+ sim_id = (sim_id + 1) % sim_count
105
+ self._qubit_dict[tot_qubits] = (sim_id, sim_counts[sim_id])
106
+ tot_qubits += 1
107
+ sim_counts[sim_id] += 1
112
108
  else:
109
+ self._qubit_dict[tot_qubits] = (sim_id, sim_counts[sim_id])
110
+ tot_qubits += 1
111
+ sim_counts[sim_id] += 1
112
+ sim_id = (sim_id + 1) % sim_count
113
113
  for _ in range(2):
114
114
  self._qubit_dict[tot_qubits] = (sim_id, sim_counts[sim_id])
115
115
  tot_qubits += 1
116
116
  sim_counts[sim_id] += 1
117
- sim_id = (sim_id + 1) % sim_count
118
- self._qubit_dict[tot_qubits] = (sim_id, sim_counts[sim_id])
119
- tot_qubits += 1
120
- sim_counts[sim_id] += 1
121
117
 
122
118
  self.sim = []
123
119
  for i in range(sim_count):
@@ -738,16 +734,23 @@ class QrackAceBackend:
738
734
  result = 0
739
735
  # Randomize the order of measurement to amortize error.
740
736
  # However, locality of collapse matters:
741
- # always measure across rows, and by row directionality.
742
- rows = list(range(self.col_length))
743
- random.shuffle(rows)
744
- for lq_row in rows:
737
+ # measure in row pairs, and always across rows,
738
+ # and by row directionality.
739
+ row_pairs = list(range((self.col_length + 1) // 2))
740
+ random.shuffle(row_pairs)
741
+ for row_pair in row_pairs:
745
742
  col_offset = random.randint(0, self.row_length - 1)
746
- col_reverse = self.alternating_codes and (lq_row & 1)
743
+ lq_row = row_pair << 1
744
+ for c in range(self.row_length):
745
+ lq_col = (c + col_offset) % self.row_length
746
+ lq = lq_row * self.row_length + lq_col
747
+ if self.m(lq):
748
+ result |= 1 << lq
749
+ lq_row += 1
750
+ if lq_row == self.col_length:
751
+ continue
747
752
  for c in range(self.row_length):
748
- lq_col = (
749
- ((self.row_length - (c + 1)) if col_reverse else c) + col_offset
750
- ) % self.row_length
753
+ lq_col = ((self.row_length - (c + 1)) + col_offset) % self.row_length
751
754
  lq = lq_row * self.row_length + lq_col
752
755
  if self.m(lq):
753
756
  result |= 1 << lq
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyqrack-cuda
3
- Version: 1.51.0
3
+ Version: 1.52.0
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 = "1.51.0"
10
+ VERSION = "1.52.0"
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')
File without changes
File without changes
File without changes
File without changes
File without changes