pyqrack-cuda 1.44.3__tar.gz → 1.44.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.
- {pyqrack_cuda-1.44.3 → pyqrack_cuda-1.44.5}/Makefile +1 -1
- {pyqrack_cuda-1.44.3/pyqrack_cuda.egg-info → pyqrack_cuda-1.44.5}/PKG-INFO +1 -1
- {pyqrack_cuda-1.44.3 → pyqrack_cuda-1.44.5}/pyqrack/qrack_ace_backend.py +32 -4
- pyqrack_cuda-1.44.5/pyqrack/qrack_system/qrack_lib/libqrack_pinvoke.so +0 -0
- {pyqrack_cuda-1.44.3 → pyqrack_cuda-1.44.5/pyqrack_cuda.egg-info}/PKG-INFO +1 -1
- {pyqrack_cuda-1.44.3 → pyqrack_cuda-1.44.5}/pyqrack_cuda.egg-info/SOURCES.txt +1 -0
- {pyqrack_cuda-1.44.3 → pyqrack_cuda-1.44.5}/setup.py +1 -1
- {pyqrack_cuda-1.44.3 → pyqrack_cuda-1.44.5}/LICENSE +0 -0
- {pyqrack_cuda-1.44.3 → pyqrack_cuda-1.44.5}/MANIFEST.in +0 -0
- {pyqrack_cuda-1.44.3 → pyqrack_cuda-1.44.5}/README.md +0 -0
- {pyqrack_cuda-1.44.3 → pyqrack_cuda-1.44.5}/pyproject.toml +0 -0
- {pyqrack_cuda-1.44.3 → pyqrack_cuda-1.44.5}/pyqrack/__init__.py +0 -0
- {pyqrack_cuda-1.44.3 → pyqrack_cuda-1.44.5}/pyqrack/neuron_activation_fn.py +0 -0
- {pyqrack_cuda-1.44.3 → pyqrack_cuda-1.44.5}/pyqrack/pauli.py +0 -0
- {pyqrack_cuda-1.44.3 → pyqrack_cuda-1.44.5}/pyqrack/qrack_circuit.py +0 -0
- {pyqrack_cuda-1.44.3 → pyqrack_cuda-1.44.5}/pyqrack/qrack_neuron.py +0 -0
- {pyqrack_cuda-1.44.3 → pyqrack_cuda-1.44.5}/pyqrack/qrack_neuron_torch_layer.py +0 -0
- {pyqrack_cuda-1.44.3 → pyqrack_cuda-1.44.5}/pyqrack/qrack_simulator.py +0 -0
- {pyqrack_cuda-1.44.3 → pyqrack_cuda-1.44.5}/pyqrack/qrack_stabilizer.py +0 -0
- {pyqrack_cuda-1.44.3 → pyqrack_cuda-1.44.5}/pyqrack/qrack_system/__init__.py +0 -0
- {pyqrack_cuda-1.44.3 → pyqrack_cuda-1.44.5}/pyqrack/qrack_system/qrack_system.py +0 -0
- {pyqrack_cuda-1.44.3 → pyqrack_cuda-1.44.5}/pyqrack/quimb_circuit_type.py +0 -0
- {pyqrack_cuda-1.44.3 → pyqrack_cuda-1.44.5}/pyqrack/stats/__init__.py +0 -0
- {pyqrack_cuda-1.44.3 → pyqrack_cuda-1.44.5}/pyqrack/stats/load_quantized_data.py +0 -0
- {pyqrack_cuda-1.44.3 → pyqrack_cuda-1.44.5}/pyqrack/stats/quantize_by_range.py +0 -0
- {pyqrack_cuda-1.44.3 → pyqrack_cuda-1.44.5}/pyqrack_cuda.egg-info/dependency_links.txt +0 -0
- {pyqrack_cuda-1.44.3 → pyqrack_cuda-1.44.5}/pyqrack_cuda.egg-info/not-zip-safe +0 -0
- {pyqrack_cuda-1.44.3 → pyqrack_cuda-1.44.5}/pyqrack_cuda.egg-info/requires.txt +0 -0
- {pyqrack_cuda-1.44.3 → pyqrack_cuda-1.44.5}/pyqrack_cuda.egg-info/top_level.txt +0 -0
- {pyqrack_cuda-1.44.3 → pyqrack_cuda-1.44.5}/setup.cfg +0 -0
@@ -18,7 +18,7 @@ help:
|
|
18
18
|
build-deps:
|
19
19
|
ifneq ($(OS),Windows_NT)
|
20
20
|
ifeq ($(QRACK_PRESENT),)
|
21
|
-
git clone https://github.com/unitaryfund/qrack.git; cd qrack; git checkout
|
21
|
+
git clone https://github.com/unitaryfund/qrack.git; cd qrack; git checkout 87cf2078438f931afadd74d5f8abaaf933c01c6d; cd ..
|
22
22
|
endif
|
23
23
|
mkdir -p qrack/build
|
24
24
|
ifeq ($(UNAME_S),Linux)
|
@@ -24,24 +24,41 @@ class QrackAceBackend:
|
|
24
24
|
"""A back end for elided quantum error correction
|
25
25
|
|
26
26
|
This back end uses elided repetition code on a nearest-neighbor topology to emulate
|
27
|
-
a utility-scale superconducting chip quantum computer in very little memory.
|
27
|
+
a utility-scale superconducting chip quantum computer in very little memory.4
|
28
28
|
|
29
29
|
The backend was originally designed assuming a 2D qubit grid like 2019 Sycamore.
|
30
30
|
However, it quickly became apparent that users can basically design their own
|
31
31
|
connectivity topologies, without breaking the concept. (Not all will work equally well.)
|
32
|
+
For maximum flexibility, set "alternating_codes=False". (For best performance on
|
33
|
+
Sycamore-like topologies, leave it "True.")
|
32
34
|
|
33
35
|
Attributes:
|
34
36
|
sim(QrackSimulator): Corresponding simulator.
|
37
|
+
alternating_codes(bool): Alternate repetition code elision by index?
|
38
|
+
row_length(int): Qubits per row.
|
39
|
+
col_length(int): Qubits per column.
|
35
40
|
"""
|
36
41
|
|
37
42
|
def __init__(
|
38
43
|
self,
|
39
44
|
qubit_count=-1,
|
45
|
+
alternating_codes=True,
|
40
46
|
toClone=None
|
41
47
|
):
|
42
48
|
self.sim = toClone.sim.clone() if toClone else QrackSimulator(3 * qubit_count)
|
49
|
+
self._factor_width(qubit_count)
|
50
|
+
self.alternating_codes = alternating_codes
|
43
51
|
|
44
52
|
|
53
|
+
def _factor_width(self, width):
|
54
|
+
col_len = math.floor(math.sqrt(width))
|
55
|
+
while (((width // col_len) * col_len) != width):
|
56
|
+
col_len -= 1
|
57
|
+
row_len = width // col_len
|
58
|
+
|
59
|
+
self.col_length = col_len
|
60
|
+
self.row_length = row_len
|
61
|
+
|
45
62
|
def _ct_pair_prob(self, q1, q2):
|
46
63
|
p1 = self.sim.prob(q1)
|
47
64
|
p2 = self.sim.prob(q2)
|
@@ -93,7 +110,9 @@ class QrackAceBackend:
|
|
93
110
|
|
94
111
|
|
95
112
|
def _encode(self, hq, reverse = False):
|
96
|
-
|
113
|
+
row = (hq[0] // 3) // self.row_length
|
114
|
+
even_row = not (row & 1)
|
115
|
+
if ((not self.alternating_codes) and reverse) or (even_row == reverse):
|
97
116
|
self._cx_shadow(hq[0], hq[1])
|
98
117
|
self.sim.mcx([hq[1]], hq[2])
|
99
118
|
else:
|
@@ -102,7 +121,9 @@ class QrackAceBackend:
|
|
102
121
|
|
103
122
|
|
104
123
|
def _decode(self, hq, reverse = False):
|
105
|
-
|
124
|
+
row = (hq[0] // 3) // self.row_length
|
125
|
+
even_row = not (row & 1)
|
126
|
+
if ((not self.alternating_codes) and reverse) or (even_row == reverse):
|
106
127
|
self.sim.mcx([hq[1]], hq[2])
|
107
128
|
self._cx_shadow(hq[0], hq[1])
|
108
129
|
else:
|
@@ -182,12 +203,16 @@ class QrackAceBackend:
|
|
182
203
|
|
183
204
|
def _cpauli(self, lq1, lq2, anti, pauli):
|
184
205
|
gate = None
|
206
|
+
shadow = None
|
185
207
|
if pauli == Pauli.PauliX:
|
186
208
|
gate = self.sim.macx if anti else self.sim.mcx
|
209
|
+
shadow = self._anti_cx_shadow if anti else self._cx_shadow
|
187
210
|
elif pauli == Pauli.PauliY:
|
188
211
|
gate = self.sim.macy if anti else self.sim.mcy
|
212
|
+
shadow = self._anti_cy_shadow if anti else self._cy_shadow
|
189
213
|
elif pauli == Pauli.PauliZ:
|
190
214
|
gate = self.sim.macz if anti else self.sim.mcz
|
215
|
+
shadow = self._anti_cz_shadow if anti else self._cz_shadow
|
191
216
|
else:
|
192
217
|
return
|
193
218
|
|
@@ -211,7 +236,10 @@ class QrackAceBackend:
|
|
211
236
|
hq1 = self._unpack(lq1)
|
212
237
|
hq2 = self._unpack(lq2)
|
213
238
|
gate([hq1[0]], hq2[0])
|
214
|
-
|
239
|
+
if self.alternating_codes:
|
240
|
+
shadow(hq1[1], hq2[1])
|
241
|
+
else:
|
242
|
+
gate([hq1[1]], hq2[1])
|
215
243
|
gate([hq1[2]], hq2[2])
|
216
244
|
|
217
245
|
|
Binary file
|
@@ -16,6 +16,7 @@ pyqrack/qrack_stabilizer.py
|
|
16
16
|
pyqrack/quimb_circuit_type.py
|
17
17
|
pyqrack/qrack_system/__init__.py
|
18
18
|
pyqrack/qrack_system/qrack_system.py
|
19
|
+
pyqrack/qrack_system/qrack_lib/libqrack_pinvoke.so
|
19
20
|
pyqrack/stats/__init__.py
|
20
21
|
pyqrack/stats/load_quantized_data.py
|
21
22
|
pyqrack/stats/quantize_by_range.py
|
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
|