pyqrack-cuda 1.44.21__tar.gz → 1.44.22__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.21/pyqrack_cuda.egg-info → pyqrack_cuda-1.44.22}/PKG-INFO +1 -1
- {pyqrack_cuda-1.44.21 → pyqrack_cuda-1.44.22}/pyqrack/qrack_ace_backend.py +27 -5
- {pyqrack_cuda-1.44.21 → pyqrack_cuda-1.44.22/pyqrack_cuda.egg-info}/PKG-INFO +1 -1
- {pyqrack_cuda-1.44.21 → pyqrack_cuda-1.44.22}/setup.py +1 -1
- {pyqrack_cuda-1.44.21 → pyqrack_cuda-1.44.22}/LICENSE +0 -0
- {pyqrack_cuda-1.44.21 → pyqrack_cuda-1.44.22}/MANIFEST.in +0 -0
- {pyqrack_cuda-1.44.21 → pyqrack_cuda-1.44.22}/Makefile +0 -0
- {pyqrack_cuda-1.44.21 → pyqrack_cuda-1.44.22}/README.md +0 -0
- {pyqrack_cuda-1.44.21 → pyqrack_cuda-1.44.22}/pyproject.toml +0 -0
- {pyqrack_cuda-1.44.21 → pyqrack_cuda-1.44.22}/pyqrack/__init__.py +0 -0
- {pyqrack_cuda-1.44.21 → pyqrack_cuda-1.44.22}/pyqrack/neuron_activation_fn.py +0 -0
- {pyqrack_cuda-1.44.21 → pyqrack_cuda-1.44.22}/pyqrack/pauli.py +0 -0
- {pyqrack_cuda-1.44.21 → pyqrack_cuda-1.44.22}/pyqrack/qrack_circuit.py +0 -0
- {pyqrack_cuda-1.44.21 → pyqrack_cuda-1.44.22}/pyqrack/qrack_neuron.py +0 -0
- {pyqrack_cuda-1.44.21 → pyqrack_cuda-1.44.22}/pyqrack/qrack_neuron_torch_layer.py +0 -0
- {pyqrack_cuda-1.44.21 → pyqrack_cuda-1.44.22}/pyqrack/qrack_simulator.py +0 -0
- {pyqrack_cuda-1.44.21 → pyqrack_cuda-1.44.22}/pyqrack/qrack_stabilizer.py +0 -0
- {pyqrack_cuda-1.44.21 → pyqrack_cuda-1.44.22}/pyqrack/qrack_system/__init__.py +0 -0
- {pyqrack_cuda-1.44.21 → pyqrack_cuda-1.44.22}/pyqrack/qrack_system/qrack_system.py +0 -0
- {pyqrack_cuda-1.44.21 → pyqrack_cuda-1.44.22}/pyqrack/quimb_circuit_type.py +0 -0
- {pyqrack_cuda-1.44.21 → pyqrack_cuda-1.44.22}/pyqrack/stats/__init__.py +0 -0
- {pyqrack_cuda-1.44.21 → pyqrack_cuda-1.44.22}/pyqrack/stats/load_quantized_data.py +0 -0
- {pyqrack_cuda-1.44.21 → pyqrack_cuda-1.44.22}/pyqrack/stats/quantize_by_range.py +0 -0
- {pyqrack_cuda-1.44.21 → pyqrack_cuda-1.44.22}/pyqrack_cuda.egg-info/SOURCES.txt +0 -0
- {pyqrack_cuda-1.44.21 → pyqrack_cuda-1.44.22}/pyqrack_cuda.egg-info/dependency_links.txt +0 -0
- {pyqrack_cuda-1.44.21 → pyqrack_cuda-1.44.22}/pyqrack_cuda.egg-info/not-zip-safe +0 -0
- {pyqrack_cuda-1.44.21 → pyqrack_cuda-1.44.22}/pyqrack_cuda.egg-info/requires.txt +0 -0
- {pyqrack_cuda-1.44.21 → pyqrack_cuda-1.44.22}/pyqrack_cuda.egg-info/top_level.txt +0 -0
- {pyqrack_cuda-1.44.21 → pyqrack_cuda-1.44.22}/setup.cfg +0 -0
@@ -43,6 +43,7 @@ class QrackAceBackend:
|
|
43
43
|
self._ancilla = 3 * qubit_count
|
44
44
|
self._factor_width(qubit_count)
|
45
45
|
self.alternating_codes = alternating_codes
|
46
|
+
self._is_init = [False] * qubit_count
|
46
47
|
|
47
48
|
def _factor_width(self, width):
|
48
49
|
col_len = math.floor(math.sqrt(width))
|
@@ -100,17 +101,24 @@ class QrackAceBackend:
|
|
100
101
|
)
|
101
102
|
|
102
103
|
def _encode(self, hq, reverse=False):
|
103
|
-
|
104
|
+
lq = hq[0] // 3
|
105
|
+
row = lq // self.row_length
|
104
106
|
even_row = not (row & 1)
|
105
107
|
if ((not self.alternating_codes) and reverse) or (even_row == reverse):
|
106
|
-
self.
|
108
|
+
if self._is_init[lq]:
|
109
|
+
self._cx_shadow(hq[0], hq[1])
|
107
110
|
self.sim.mcx([hq[1]], hq[2])
|
108
111
|
else:
|
109
112
|
self.sim.mcx([hq[0]], hq[1])
|
110
|
-
self.
|
113
|
+
if self._is_init[lq]:
|
114
|
+
self._cx_shadow(hq[1], hq[2])
|
115
|
+
self._is_init[lq] = True
|
111
116
|
|
112
117
|
def _decode(self, hq, reverse=False):
|
113
|
-
|
118
|
+
lq = hq[0] // 3
|
119
|
+
if not self._is_init[lq]:
|
120
|
+
return
|
121
|
+
row = lq // self.row_length
|
114
122
|
even_row = not (row & 1)
|
115
123
|
if ((not self.alternating_codes) and reverse) or (even_row == reverse):
|
116
124
|
self.sim.mcx([hq[1]], hq[2])
|
@@ -206,6 +214,8 @@ class QrackAceBackend:
|
|
206
214
|
self._correct_if_like_h(th, lq)
|
207
215
|
self._decode(hq)
|
208
216
|
self.sim.u(hq[0], th, ph, lm)
|
217
|
+
if not self._is_init[lq]:
|
218
|
+
self.sim.u(hq[2], th, ph, lm)
|
209
219
|
self._encode(hq)
|
210
220
|
else:
|
211
221
|
for b in hq:
|
@@ -225,6 +235,8 @@ class QrackAceBackend:
|
|
225
235
|
else:
|
226
236
|
self._decode(hq)
|
227
237
|
self.sim.r(p, th, hq[0])
|
238
|
+
if not self._is_init[lq]:
|
239
|
+
self.sim.r(p, th, hq[2])
|
228
240
|
self._encode(hq)
|
229
241
|
|
230
242
|
def h(self, lq):
|
@@ -232,6 +244,8 @@ class QrackAceBackend:
|
|
232
244
|
hq = self._unpack(lq)
|
233
245
|
self._decode(hq)
|
234
246
|
self.sim.h(hq[0])
|
247
|
+
if not self._is_init[lq]:
|
248
|
+
self.sim.h(hq[2])
|
235
249
|
self._encode(hq)
|
236
250
|
|
237
251
|
def s(self, lq):
|
@@ -271,7 +285,6 @@ class QrackAceBackend:
|
|
271
285
|
|
272
286
|
def _cpauli(self, lq1, lq2, anti, pauli):
|
273
287
|
self._correct(lq1)
|
274
|
-
|
275
288
|
gate = None
|
276
289
|
shadow = None
|
277
290
|
if pauli == Pauli.PauliX:
|
@@ -286,6 +299,13 @@ class QrackAceBackend:
|
|
286
299
|
else:
|
287
300
|
return
|
288
301
|
|
302
|
+
if not self._is_init[lq1]:
|
303
|
+
gate([hq1[0]], hq2[0])
|
304
|
+
gate([hq1[1]], hq2[1])
|
305
|
+
gate([hq1[2]], hq2[2])
|
306
|
+
|
307
|
+
return
|
308
|
+
|
289
309
|
lq1_col = lq1 // self.row_length
|
290
310
|
lq1_row = lq1 % self.row_length
|
291
311
|
lq2_col = lq2 // self.row_length
|
@@ -370,6 +390,8 @@ class QrackAceBackend:
|
|
370
390
|
if bits[i] != result:
|
371
391
|
self.sim.x(hq[i])
|
372
392
|
|
393
|
+
self._is_init[lq] = False
|
394
|
+
|
373
395
|
return result
|
374
396
|
|
375
397
|
def m_all(self):
|
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
|