pyqrack-cuda 1.44.15__tar.gz → 1.44.17__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.15/pyqrack_cuda.egg-info → pyqrack_cuda-1.44.17}/PKG-INFO +1 -1
- {pyqrack_cuda-1.44.15 → pyqrack_cuda-1.44.17}/pyqrack/qrack_ace_backend.py +25 -3
- {pyqrack_cuda-1.44.15 → pyqrack_cuda-1.44.17/pyqrack_cuda.egg-info}/PKG-INFO +1 -1
- {pyqrack_cuda-1.44.15 → pyqrack_cuda-1.44.17}/setup.py +1 -1
- {pyqrack_cuda-1.44.15 → pyqrack_cuda-1.44.17}/LICENSE +0 -0
- {pyqrack_cuda-1.44.15 → pyqrack_cuda-1.44.17}/MANIFEST.in +0 -0
- {pyqrack_cuda-1.44.15 → pyqrack_cuda-1.44.17}/Makefile +0 -0
- {pyqrack_cuda-1.44.15 → pyqrack_cuda-1.44.17}/README.md +0 -0
- {pyqrack_cuda-1.44.15 → pyqrack_cuda-1.44.17}/pyproject.toml +0 -0
- {pyqrack_cuda-1.44.15 → pyqrack_cuda-1.44.17}/pyqrack/__init__.py +0 -0
- {pyqrack_cuda-1.44.15 → pyqrack_cuda-1.44.17}/pyqrack/neuron_activation_fn.py +0 -0
- {pyqrack_cuda-1.44.15 → pyqrack_cuda-1.44.17}/pyqrack/pauli.py +0 -0
- {pyqrack_cuda-1.44.15 → pyqrack_cuda-1.44.17}/pyqrack/qrack_circuit.py +0 -0
- {pyqrack_cuda-1.44.15 → pyqrack_cuda-1.44.17}/pyqrack/qrack_neuron.py +0 -0
- {pyqrack_cuda-1.44.15 → pyqrack_cuda-1.44.17}/pyqrack/qrack_neuron_torch_layer.py +0 -0
- {pyqrack_cuda-1.44.15 → pyqrack_cuda-1.44.17}/pyqrack/qrack_simulator.py +0 -0
- {pyqrack_cuda-1.44.15 → pyqrack_cuda-1.44.17}/pyqrack/qrack_stabilizer.py +0 -0
- {pyqrack_cuda-1.44.15 → pyqrack_cuda-1.44.17}/pyqrack/qrack_system/__init__.py +0 -0
- {pyqrack_cuda-1.44.15 → pyqrack_cuda-1.44.17}/pyqrack/qrack_system/qrack_system.py +0 -0
- {pyqrack_cuda-1.44.15 → pyqrack_cuda-1.44.17}/pyqrack/quimb_circuit_type.py +0 -0
- {pyqrack_cuda-1.44.15 → pyqrack_cuda-1.44.17}/pyqrack/stats/__init__.py +0 -0
- {pyqrack_cuda-1.44.15 → pyqrack_cuda-1.44.17}/pyqrack/stats/load_quantized_data.py +0 -0
- {pyqrack_cuda-1.44.15 → pyqrack_cuda-1.44.17}/pyqrack/stats/quantize_by_range.py +0 -0
- {pyqrack_cuda-1.44.15 → pyqrack_cuda-1.44.17}/pyqrack_cuda.egg-info/SOURCES.txt +0 -0
- {pyqrack_cuda-1.44.15 → pyqrack_cuda-1.44.17}/pyqrack_cuda.egg-info/dependency_links.txt +0 -0
- {pyqrack_cuda-1.44.15 → pyqrack_cuda-1.44.17}/pyqrack_cuda.egg-info/not-zip-safe +0 -0
- {pyqrack_cuda-1.44.15 → pyqrack_cuda-1.44.17}/pyqrack_cuda.egg-info/requires.txt +0 -0
- {pyqrack_cuda-1.44.15 → pyqrack_cuda-1.44.17}/pyqrack_cuda.egg-info/top_level.txt +0 -0
- {pyqrack_cuda-1.44.15 → pyqrack_cuda-1.44.17}/setup.cfg +0 -0
@@ -38,8 +38,8 @@ class QrackAceBackend:
|
|
38
38
|
col_length(int): Qubits per column.
|
39
39
|
"""
|
40
40
|
|
41
|
-
def __init__(self, qubit_count=-1, alternating_codes=True, toClone=None):
|
42
|
-
self.sim = toClone.sim.clone() if toClone else QrackSimulator(3 * qubit_count + 1)
|
41
|
+
def __init__(self, qubit_count=-1, alternating_codes=True, isTensorNetwork=False, toClone=None):
|
42
|
+
self.sim = toClone.sim.clone() if toClone else QrackSimulator(3 * qubit_count + 1, isTensorNetwork=isTensorNetwork)
|
43
43
|
self._ancilla = 3 * qubit_count
|
44
44
|
self._factor_width(qubit_count)
|
45
45
|
self.alternating_codes = alternating_codes
|
@@ -154,10 +154,10 @@ class QrackAceBackend:
|
|
154
154
|
other_bits = [1, 2]
|
155
155
|
|
156
156
|
max_syndrome = max(syndrome)
|
157
|
-
error_bit = syndrome.index(max_syndrome)
|
158
157
|
force_syndrome = True
|
159
158
|
if (2 * max_syndrome) >= shots:
|
160
159
|
# There is an error.
|
160
|
+
error_bit = syndrome.index(max_syndrome)
|
161
161
|
if error_bit == single_bit:
|
162
162
|
# The stand-alone bit carries the error.
|
163
163
|
self.sim.x(hq[error_bit])
|
@@ -182,18 +182,39 @@ class QrackAceBackend:
|
|
182
182
|
# Force the syndrome non-pathological.
|
183
183
|
self.sim.force_m(self._ancilla, False)
|
184
184
|
|
185
|
+
def _correct_if_like_h(self, th, lq):
|
186
|
+
while th > math.pi:
|
187
|
+
th -= 2 * math.pi
|
188
|
+
while th <= -math.pi:
|
189
|
+
th += 2 * math.pi
|
190
|
+
th = abs(th)
|
191
|
+
if (th >= (math.pi / 4)) and (th < (3 * math.pi / 4)):
|
192
|
+
self._correct(lq)
|
193
|
+
|
185
194
|
|
186
195
|
def u(self, th, ph, lm, lq):
|
187
196
|
hq = self._unpack(lq)
|
188
197
|
self._decode(hq)
|
189
198
|
self.sim.u(hq[0], th, ph, lm)
|
190
199
|
self._encode(hq)
|
200
|
+
while ph > math.pi:
|
201
|
+
ph -= 2 * math.pi
|
202
|
+
while ph <= -math.pi:
|
203
|
+
ph += 2 * math.pi
|
204
|
+
while lm > math.pi:
|
205
|
+
lm -= 2 * math.pi
|
206
|
+
while lm <= -math.pi:
|
207
|
+
lm += 2 * math.pi
|
208
|
+
if not math.isclose(ph, -lm) and not math.isclose(abs(ph), math.pi / 2):
|
209
|
+
self._correct_if_like_h(th, lq)
|
191
210
|
|
192
211
|
def r(self, p, th, lq):
|
193
212
|
hq = self._unpack(lq)
|
194
213
|
self._decode(hq)
|
195
214
|
self.sim.r(p, th, hq[0])
|
196
215
|
self._encode(hq)
|
216
|
+
if p == Pauli.PauliY:
|
217
|
+
self._correct_if_like_h(th, lq)
|
197
218
|
|
198
219
|
def s(self, lq):
|
199
220
|
hq = self._unpack(lq)
|
@@ -230,6 +251,7 @@ class QrackAceBackend:
|
|
230
251
|
self._decode(hq)
|
231
252
|
self.sim.h(hq[0])
|
232
253
|
self._encode(hq)
|
254
|
+
self._correct(lq)
|
233
255
|
|
234
256
|
def t(self, lq):
|
235
257
|
hq = self._unpack(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
|