pyqrack-cuda 1.51.0__tar.gz → 1.52.1__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.
- {pyqrack_cuda-1.51.0/pyqrack_cuda.egg-info → pyqrack_cuda-1.52.1}/PKG-INFO +1 -1
- {pyqrack_cuda-1.51.0 → pyqrack_cuda-1.52.1}/pyqrack/qrack_ace_backend.py +27 -33
- {pyqrack_cuda-1.51.0 → pyqrack_cuda-1.52.1/pyqrack_cuda.egg-info}/PKG-INFO +1 -1
- {pyqrack_cuda-1.51.0 → pyqrack_cuda-1.52.1}/setup.py +1 -1
- {pyqrack_cuda-1.51.0 → pyqrack_cuda-1.52.1}/LICENSE +0 -0
- {pyqrack_cuda-1.51.0 → pyqrack_cuda-1.52.1}/MANIFEST.in +0 -0
- {pyqrack_cuda-1.51.0 → pyqrack_cuda-1.52.1}/Makefile +0 -0
- {pyqrack_cuda-1.51.0 → pyqrack_cuda-1.52.1}/README.md +0 -0
- {pyqrack_cuda-1.51.0 → pyqrack_cuda-1.52.1}/pyproject.toml +0 -0
- {pyqrack_cuda-1.51.0 → pyqrack_cuda-1.52.1}/pyqrack/__init__.py +0 -0
- {pyqrack_cuda-1.51.0 → pyqrack_cuda-1.52.1}/pyqrack/neuron_activation_fn.py +0 -0
- {pyqrack_cuda-1.51.0 → pyqrack_cuda-1.52.1}/pyqrack/pauli.py +0 -0
- {pyqrack_cuda-1.51.0 → pyqrack_cuda-1.52.1}/pyqrack/qrack_circuit.py +0 -0
- {pyqrack_cuda-1.51.0 → pyqrack_cuda-1.52.1}/pyqrack/qrack_neuron.py +0 -0
- {pyqrack_cuda-1.51.0 → pyqrack_cuda-1.52.1}/pyqrack/qrack_neuron_torch_layer.py +0 -0
- {pyqrack_cuda-1.51.0 → pyqrack_cuda-1.52.1}/pyqrack/qrack_simulator.py +0 -0
- {pyqrack_cuda-1.51.0 → pyqrack_cuda-1.52.1}/pyqrack/qrack_stabilizer.py +0 -0
- {pyqrack_cuda-1.51.0 → pyqrack_cuda-1.52.1}/pyqrack/qrack_system/__init__.py +0 -0
- {pyqrack_cuda-1.51.0 → pyqrack_cuda-1.52.1}/pyqrack/qrack_system/qrack_system.py +0 -0
- {pyqrack_cuda-1.51.0 → pyqrack_cuda-1.52.1}/pyqrack/quimb_circuit_type.py +0 -0
- {pyqrack_cuda-1.51.0 → pyqrack_cuda-1.52.1}/pyqrack/stats/__init__.py +0 -0
- {pyqrack_cuda-1.51.0 → pyqrack_cuda-1.52.1}/pyqrack/stats/load_quantized_data.py +0 -0
- {pyqrack_cuda-1.51.0 → pyqrack_cuda-1.52.1}/pyqrack/stats/quantize_by_range.py +0 -0
- {pyqrack_cuda-1.51.0 → pyqrack_cuda-1.52.1}/pyqrack_cuda.egg-info/SOURCES.txt +0 -0
- {pyqrack_cuda-1.51.0 → pyqrack_cuda-1.52.1}/pyqrack_cuda.egg-info/dependency_links.txt +0 -0
- {pyqrack_cuda-1.51.0 → pyqrack_cuda-1.52.1}/pyqrack_cuda.egg-info/not-zip-safe +0 -0
- {pyqrack_cuda-1.51.0 → pyqrack_cuda-1.52.1}/pyqrack_cuda.egg-info/requires.txt +0 -0
- {pyqrack_cuda-1.51.0 → pyqrack_cuda-1.52.1}/pyqrack_cuda.egg-info/top_level.txt +0 -0
- {pyqrack_cuda-1.51.0 → pyqrack_cuda-1.52.1}/setup.cfg +0 -0
@@ -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.)
|
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
|
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):
|
@@ -350,15 +346,6 @@ class QrackAceBackend:
|
|
350
346
|
# Force the syndrome non-pathological.
|
351
347
|
self.sim[ancilla_sim].force_m(ancilla, False)
|
352
348
|
|
353
|
-
def _correct_if_like_h(self, th, lq):
|
354
|
-
while th > math.pi:
|
355
|
-
th -= 2 * math.pi
|
356
|
-
while th <= -math.pi:
|
357
|
-
th += 2 * math.pi
|
358
|
-
th = abs(th)
|
359
|
-
if not math.isclose(th, 0):
|
360
|
-
self._correct(lq)
|
361
|
-
|
362
349
|
def u(self, lq, th, ph, lm):
|
363
350
|
hq = self._unpack(lq)
|
364
351
|
if len(hq) < 2:
|
@@ -383,7 +370,7 @@ class QrackAceBackend:
|
|
383
370
|
b = hq[2]
|
384
371
|
self.sim[b[0]].u(b[1], th, ph, lm)
|
385
372
|
self._encode_decode(lq, hq)
|
386
|
-
self.
|
373
|
+
self._correct(lq)
|
387
374
|
else:
|
388
375
|
# Shouldn't produce/destroy superposition
|
389
376
|
for b in hq:
|
@@ -412,7 +399,7 @@ class QrackAceBackend:
|
|
412
399
|
b = hq[2]
|
413
400
|
self.sim[b[0]].r(p, th, b[1])
|
414
401
|
self._encode_decode(lq, hq)
|
415
|
-
self.
|
402
|
+
self._correct(lq)
|
416
403
|
|
417
404
|
def h(self, lq):
|
418
405
|
hq = self._unpack(lq)
|
@@ -738,16 +725,23 @@ class QrackAceBackend:
|
|
738
725
|
result = 0
|
739
726
|
# Randomize the order of measurement to amortize error.
|
740
727
|
# However, locality of collapse matters:
|
741
|
-
#
|
742
|
-
|
743
|
-
|
744
|
-
|
728
|
+
# measure in row pairs, and always across rows,
|
729
|
+
# and by row directionality.
|
730
|
+
row_pairs = list(range((self.col_length + 1) // 2))
|
731
|
+
random.shuffle(row_pairs)
|
732
|
+
for row_pair in row_pairs:
|
745
733
|
col_offset = random.randint(0, self.row_length - 1)
|
746
|
-
|
734
|
+
lq_row = row_pair << 1
|
735
|
+
for c in range(self.row_length):
|
736
|
+
lq_col = (c + col_offset) % self.row_length
|
737
|
+
lq = lq_row * self.row_length + lq_col
|
738
|
+
if self.m(lq):
|
739
|
+
result |= 1 << lq
|
740
|
+
lq_row += 1
|
741
|
+
if lq_row == self.col_length:
|
742
|
+
continue
|
747
743
|
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
|
744
|
+
lq_col = ((self.row_length - (c + 1)) + col_offset) % self.row_length
|
751
745
|
lq = lq_row * self.row_length + lq_col
|
752
746
|
if self.m(lq):
|
753
747
|
result |= 1 << lq
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|