pyqrack-cuda 1.44.4__tar.gz → 1.44.6__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.4 → pyqrack_cuda-1.44.6}/Makefile +5 -5
- {pyqrack_cuda-1.44.4/pyqrack_cuda.egg-info → pyqrack_cuda-1.44.6}/PKG-INFO +1 -1
- {pyqrack_cuda-1.44.4 → pyqrack_cuda-1.44.6}/pyqrack/qrack_ace_backend.py +16 -4
- {pyqrack_cuda-1.44.4 → pyqrack_cuda-1.44.6/pyqrack_cuda.egg-info}/PKG-INFO +1 -1
- {pyqrack_cuda-1.44.4 → pyqrack_cuda-1.44.6}/setup.py +1 -1
- {pyqrack_cuda-1.44.4 → pyqrack_cuda-1.44.6}/LICENSE +0 -0
- {pyqrack_cuda-1.44.4 → pyqrack_cuda-1.44.6}/MANIFEST.in +0 -0
- {pyqrack_cuda-1.44.4 → pyqrack_cuda-1.44.6}/README.md +0 -0
- {pyqrack_cuda-1.44.4 → pyqrack_cuda-1.44.6}/pyproject.toml +0 -0
- {pyqrack_cuda-1.44.4 → pyqrack_cuda-1.44.6}/pyqrack/__init__.py +0 -0
- {pyqrack_cuda-1.44.4 → pyqrack_cuda-1.44.6}/pyqrack/neuron_activation_fn.py +0 -0
- {pyqrack_cuda-1.44.4 → pyqrack_cuda-1.44.6}/pyqrack/pauli.py +0 -0
- {pyqrack_cuda-1.44.4 → pyqrack_cuda-1.44.6}/pyqrack/qrack_circuit.py +0 -0
- {pyqrack_cuda-1.44.4 → pyqrack_cuda-1.44.6}/pyqrack/qrack_neuron.py +0 -0
- {pyqrack_cuda-1.44.4 → pyqrack_cuda-1.44.6}/pyqrack/qrack_neuron_torch_layer.py +0 -0
- {pyqrack_cuda-1.44.4 → pyqrack_cuda-1.44.6}/pyqrack/qrack_simulator.py +0 -0
- {pyqrack_cuda-1.44.4 → pyqrack_cuda-1.44.6}/pyqrack/qrack_stabilizer.py +0 -0
- {pyqrack_cuda-1.44.4 → pyqrack_cuda-1.44.6}/pyqrack/qrack_system/__init__.py +0 -0
- {pyqrack_cuda-1.44.4 → pyqrack_cuda-1.44.6}/pyqrack/qrack_system/qrack_lib/libqrack_pinvoke.so +0 -0
- {pyqrack_cuda-1.44.4 → pyqrack_cuda-1.44.6}/pyqrack/qrack_system/qrack_system.py +0 -0
- {pyqrack_cuda-1.44.4 → pyqrack_cuda-1.44.6}/pyqrack/quimb_circuit_type.py +0 -0
- {pyqrack_cuda-1.44.4 → pyqrack_cuda-1.44.6}/pyqrack/stats/__init__.py +0 -0
- {pyqrack_cuda-1.44.4 → pyqrack_cuda-1.44.6}/pyqrack/stats/load_quantized_data.py +0 -0
- {pyqrack_cuda-1.44.4 → pyqrack_cuda-1.44.6}/pyqrack/stats/quantize_by_range.py +0 -0
- {pyqrack_cuda-1.44.4 → pyqrack_cuda-1.44.6}/pyqrack_cuda.egg-info/SOURCES.txt +0 -0
- {pyqrack_cuda-1.44.4 → pyqrack_cuda-1.44.6}/pyqrack_cuda.egg-info/dependency_links.txt +0 -0
- {pyqrack_cuda-1.44.4 → pyqrack_cuda-1.44.6}/pyqrack_cuda.egg-info/not-zip-safe +0 -0
- {pyqrack_cuda-1.44.4 → pyqrack_cuda-1.44.6}/pyqrack_cuda.egg-info/requires.txt +0 -0
- {pyqrack_cuda-1.44.4 → pyqrack_cuda-1.44.6}/pyqrack_cuda.egg-info/top_level.txt +0 -0
- {pyqrack_cuda-1.44.4 → pyqrack_cuda-1.44.6}/setup.cfg +0 -0
@@ -18,21 +18,21 @@ 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 8999c54595a4c750faff116462423bfb0a3abd38; cd ..
|
22
22
|
endif
|
23
23
|
mkdir -p qrack/build
|
24
24
|
ifeq ($(UNAME_S),Linux)
|
25
25
|
ifeq ($(UNAME_P),x86_64)
|
26
|
-
cd qrack/build; cmake -DENABLE_RDRAND=OFF -DENABLE_DEVRAND=ON -DENABLE_OPENCL=OFF -DENABLE_CUDA=ON -DQBCAPPOW=8 ..; make
|
26
|
+
cd qrack/build; cmake -DENABLE_RDRAND=OFF -DENABLE_DEVRAND=ON -DENABLE_OPENCL=OFF -DENABLE_CUDA=ON -DQBCAPPOW=8 ..; make qrack_pinvoke
|
27
27
|
else
|
28
|
-
cd qrack/build; cmake -DENABLE_RDRAND=OFF -DENABLE_DEVRAND=ON -DENABLE_COMPLEX_X2=OFF -DENABLE_SSE3=OFF -DENABLE_OPENCL=OFF -DENABLE_CUDA=ON -DQBCAPPOW=8 ..; make
|
28
|
+
cd qrack/build; cmake -DENABLE_RDRAND=OFF -DENABLE_DEVRAND=ON -DENABLE_COMPLEX_X2=OFF -DENABLE_SSE3=OFF -DENABLE_OPENCL=OFF -DENABLE_CUDA=ON -DQBCAPPOW=8 ..; make qrack_pinvoke
|
29
29
|
endif
|
30
30
|
endif
|
31
31
|
ifeq ($(UNAME_S),Darwin)
|
32
32
|
ifeq ($(UNAME_P),x86_64)
|
33
|
-
cd qrack/build; cmake -DENABLE_OPENCL=OFF -DENABLE_CUDA=ON -DQBCAPPOW=8 ..; make
|
33
|
+
cd qrack/build; cmake -DENABLE_OPENCL=OFF -DENABLE_CUDA=ON -DQBCAPPOW=8 ..; make qrack_pinvoke
|
34
34
|
else
|
35
|
-
cd qrack/build; cmake -DENABLE_RDRAND=OFF -DENABLE_COMPLEX_X2=OFF -DENABLE_SSE3=OFF -DENABLE_OPENCL=OFF -DENABLE_CUDA=ON -DQBCAPPOW=8 ..; make
|
35
|
+
cd qrack/build; cmake -DENABLE_RDRAND=OFF -DENABLE_COMPLEX_X2=OFF -DENABLE_SSE3=OFF -DENABLE_OPENCL=OFF -DENABLE_CUDA=ON -DQBCAPPOW=8 ..; make qrack_pinvoke
|
36
36
|
endif
|
37
37
|
endif
|
38
38
|
endif
|
@@ -24,10 +24,17 @@ 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
|
+
|
29
|
+
The backend was originally designed assuming a 2D qubit grid like 2019 Sycamore.
|
30
|
+
However, it quickly became apparent that users can basically design their own
|
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.")
|
28
34
|
|
29
35
|
Attributes:
|
30
36
|
sim(QrackSimulator): Corresponding simulator.
|
37
|
+
alternating_codes(bool): Alternate repetition code elision by index?
|
31
38
|
row_length(int): Qubits per row.
|
32
39
|
col_length(int): Qubits per column.
|
33
40
|
"""
|
@@ -35,10 +42,12 @@ class QrackAceBackend:
|
|
35
42
|
def __init__(
|
36
43
|
self,
|
37
44
|
qubit_count=-1,
|
45
|
+
alternating_codes=True,
|
38
46
|
toClone=None
|
39
47
|
):
|
40
48
|
self.sim = toClone.sim.clone() if toClone else QrackSimulator(3 * qubit_count)
|
41
49
|
self._factor_width(qubit_count)
|
50
|
+
self.alternating_codes = alternating_codes
|
42
51
|
|
43
52
|
|
44
53
|
def _factor_width(self, width):
|
@@ -103,7 +112,7 @@ class QrackAceBackend:
|
|
103
112
|
def _encode(self, hq, reverse = False):
|
104
113
|
row = (hq[0] // 3) // self.row_length
|
105
114
|
even_row = not (row & 1)
|
106
|
-
if even_row == reverse:
|
115
|
+
if ((not self.alternating_codes) and reverse) or (even_row == reverse):
|
107
116
|
self._cx_shadow(hq[0], hq[1])
|
108
117
|
self.sim.mcx([hq[1]], hq[2])
|
109
118
|
else:
|
@@ -114,7 +123,7 @@ class QrackAceBackend:
|
|
114
123
|
def _decode(self, hq, reverse = False):
|
115
124
|
row = (hq[0] // 3) // self.row_length
|
116
125
|
even_row = not (row & 1)
|
117
|
-
if even_row == reverse:
|
126
|
+
if ((not self.alternating_codes) and reverse) or (even_row == reverse):
|
118
127
|
self.sim.mcx([hq[1]], hq[2])
|
119
128
|
self._cx_shadow(hq[0], hq[1])
|
120
129
|
else:
|
@@ -227,7 +236,10 @@ class QrackAceBackend:
|
|
227
236
|
hq1 = self._unpack(lq1)
|
228
237
|
hq2 = self._unpack(lq2)
|
229
238
|
gate([hq1[0]], hq2[0])
|
230
|
-
|
239
|
+
if self.alternating_codes:
|
240
|
+
shadow(hq1[1], hq2[1])
|
241
|
+
else:
|
242
|
+
gate([hq1[1]], hq2[1])
|
231
243
|
gate([hq1[2]], hq2[2])
|
232
244
|
|
233
245
|
|
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
|
{pyqrack_cuda-1.44.4 → pyqrack_cuda-1.44.6}/pyqrack/qrack_system/qrack_lib/libqrack_pinvoke.so
RENAMED
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
|