pyqrack-cuda 1.49.6__tar.gz → 1.49.9__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.49.6/pyqrack_cuda.egg-info → pyqrack_cuda-1.49.9}/PKG-INFO +1 -1
- {pyqrack_cuda-1.49.6 → pyqrack_cuda-1.49.9}/pyqrack/qrack_ace_backend.py +32 -16
- {pyqrack_cuda-1.49.6 → pyqrack_cuda-1.49.9/pyqrack_cuda.egg-info}/PKG-INFO +1 -1
- {pyqrack_cuda-1.49.6 → pyqrack_cuda-1.49.9}/setup.py +1 -1
- {pyqrack_cuda-1.49.6 → pyqrack_cuda-1.49.9}/LICENSE +0 -0
- {pyqrack_cuda-1.49.6 → pyqrack_cuda-1.49.9}/MANIFEST.in +0 -0
- {pyqrack_cuda-1.49.6 → pyqrack_cuda-1.49.9}/Makefile +0 -0
- {pyqrack_cuda-1.49.6 → pyqrack_cuda-1.49.9}/README.md +0 -0
- {pyqrack_cuda-1.49.6 → pyqrack_cuda-1.49.9}/pyproject.toml +0 -0
- {pyqrack_cuda-1.49.6 → pyqrack_cuda-1.49.9}/pyqrack/__init__.py +0 -0
- {pyqrack_cuda-1.49.6 → pyqrack_cuda-1.49.9}/pyqrack/neuron_activation_fn.py +0 -0
- {pyqrack_cuda-1.49.6 → pyqrack_cuda-1.49.9}/pyqrack/pauli.py +0 -0
- {pyqrack_cuda-1.49.6 → pyqrack_cuda-1.49.9}/pyqrack/qrack_circuit.py +0 -0
- {pyqrack_cuda-1.49.6 → pyqrack_cuda-1.49.9}/pyqrack/qrack_neuron.py +0 -0
- {pyqrack_cuda-1.49.6 → pyqrack_cuda-1.49.9}/pyqrack/qrack_neuron_torch_layer.py +0 -0
- {pyqrack_cuda-1.49.6 → pyqrack_cuda-1.49.9}/pyqrack/qrack_simulator.py +0 -0
- {pyqrack_cuda-1.49.6 → pyqrack_cuda-1.49.9}/pyqrack/qrack_stabilizer.py +0 -0
- {pyqrack_cuda-1.49.6 → pyqrack_cuda-1.49.9}/pyqrack/qrack_system/__init__.py +0 -0
- {pyqrack_cuda-1.49.6 → pyqrack_cuda-1.49.9}/pyqrack/qrack_system/qrack_system.py +0 -0
- {pyqrack_cuda-1.49.6 → pyqrack_cuda-1.49.9}/pyqrack/quimb_circuit_type.py +0 -0
- {pyqrack_cuda-1.49.6 → pyqrack_cuda-1.49.9}/pyqrack/stats/__init__.py +0 -0
- {pyqrack_cuda-1.49.6 → pyqrack_cuda-1.49.9}/pyqrack/stats/load_quantized_data.py +0 -0
- {pyqrack_cuda-1.49.6 → pyqrack_cuda-1.49.9}/pyqrack/stats/quantize_by_range.py +0 -0
- {pyqrack_cuda-1.49.6 → pyqrack_cuda-1.49.9}/pyqrack_cuda.egg-info/SOURCES.txt +0 -0
- {pyqrack_cuda-1.49.6 → pyqrack_cuda-1.49.9}/pyqrack_cuda.egg-info/dependency_links.txt +0 -0
- {pyqrack_cuda-1.49.6 → pyqrack_cuda-1.49.9}/pyqrack_cuda.egg-info/not-zip-safe +0 -0
- {pyqrack_cuda-1.49.6 → pyqrack_cuda-1.49.9}/pyqrack_cuda.egg-info/requires.txt +0 -0
- {pyqrack_cuda-1.49.6 → pyqrack_cuda-1.49.9}/pyqrack_cuda.egg-info/top_level.txt +0 -0
- {pyqrack_cuda-1.49.6 → pyqrack_cuda-1.49.9}/setup.cfg +0 -0
@@ -212,6 +212,12 @@ class QrackAceBackend:
|
|
212
212
|
self.sim.mcx([hq[0]], hq[1])
|
213
213
|
self._cx_shadow(hq[0], hq[2])
|
214
214
|
|
215
|
+
def _encode_decode_1qb(self, lq, hq):
|
216
|
+
if not self.alternating_codes or not ((lq // self.row_length) & 1):
|
217
|
+
self.sim.mcx([hq[0]], hq[1])
|
218
|
+
else:
|
219
|
+
self.sim.mcx([hq[2]], hq[1])
|
220
|
+
|
215
221
|
def _correct(self, lq):
|
216
222
|
if not self._is_init[lq]:
|
217
223
|
return
|
@@ -340,12 +346,15 @@ class QrackAceBackend:
|
|
340
346
|
|
341
347
|
if not math.isclose(ph, -lm) and not math.isclose(abs(ph), math.pi / 2):
|
342
348
|
# Produces/destroys superposition
|
343
|
-
self.
|
344
|
-
|
349
|
+
if self._is_init[lq]:
|
350
|
+
self._correct_if_like_h(th, lq)
|
351
|
+
self._encode_decode_1qb(lq, hq)
|
345
352
|
self.sim.u(hq[0], th, ph, lm)
|
346
|
-
|
347
|
-
|
348
|
-
|
353
|
+
self.sim.u(hq[2], th, ph, lm)
|
354
|
+
if self._is_init[lq]:
|
355
|
+
self._encode_decode_1qb(lq, hq)
|
356
|
+
else:
|
357
|
+
self._encode(lq, hq)
|
349
358
|
else:
|
350
359
|
# Shouldn't produce/destroy superposition
|
351
360
|
for b in hq:
|
@@ -361,7 +370,7 @@ class QrackAceBackend:
|
|
361
370
|
th -= 2 * math.pi
|
362
371
|
while th <= -math.pi:
|
363
372
|
th += 2 * math.pi
|
364
|
-
if p == Pauli.PauliY:
|
373
|
+
if self._is_init[lq] and (p == Pauli.PauliY):
|
365
374
|
self._correct_if_like_h(th, lq)
|
366
375
|
|
367
376
|
if (p == Pauli.PauliZ) or math.isclose(abs(th), math.pi):
|
@@ -370,11 +379,14 @@ class QrackAceBackend:
|
|
370
379
|
self.sim.r(p, th, b)
|
371
380
|
else:
|
372
381
|
# Produces/destroys superposition
|
373
|
-
self.
|
382
|
+
if self._is_init[lq]:
|
383
|
+
self._encode_decode_1qb(lq, hq)
|
374
384
|
self.sim.r(p, th, hq[0])
|
375
|
-
|
376
|
-
|
377
|
-
|
385
|
+
self.sim.r(p, th, hq[2])
|
386
|
+
if self._is_init[lq]:
|
387
|
+
self._encode_decode_1qb(lq, hq)
|
388
|
+
else:
|
389
|
+
self._encode(lq, hq)
|
378
390
|
|
379
391
|
def h(self, lq):
|
380
392
|
hq = self._unpack(lq)
|
@@ -382,11 +394,15 @@ class QrackAceBackend:
|
|
382
394
|
self.sim.h(hq[0])
|
383
395
|
return
|
384
396
|
|
385
|
-
self.
|
397
|
+
if self._is_init[lq]:
|
398
|
+
self._correct(lq)
|
399
|
+
self._encode_decode_1qb(lq, hq)
|
386
400
|
self.sim.h(hq[0])
|
387
|
-
|
388
|
-
|
389
|
-
|
401
|
+
self.sim.h(hq[2])
|
402
|
+
if self._is_init[lq]:
|
403
|
+
self._encode_decode_1qb(lq, hq)
|
404
|
+
else:
|
405
|
+
self._encode(lq, hq)
|
390
406
|
|
391
407
|
def s(self, lq):
|
392
408
|
hq = self._unpack(lq)
|
@@ -1103,7 +1119,7 @@ class QrackAceBackend:
|
|
1103
1119
|
if self._coupling_map:
|
1104
1120
|
return self._coupling_map
|
1105
1121
|
|
1106
|
-
coupling_map =
|
1122
|
+
coupling_map = set()
|
1107
1123
|
rows, cols = self.row_length, self.col_length
|
1108
1124
|
|
1109
1125
|
# Map each column index to its full list of logical qubit indices
|
@@ -1131,7 +1147,7 @@ class QrackAceBackend:
|
|
1131
1147
|
for r in range(0, rows):
|
1132
1148
|
b = logical_index(r, c)
|
1133
1149
|
if a != b:
|
1134
|
-
coupling_map.
|
1150
|
+
coupling_map.add((a, b))
|
1135
1151
|
|
1136
1152
|
self._coupling_map = sorted(coupling_map)
|
1137
1153
|
|
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
|