pyqrack-cuda 1.54.4__tar.gz → 1.54.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.54.4/pyqrack_cuda.egg-info → pyqrack_cuda-1.54.5}/PKG-INFO +1 -1
- {pyqrack_cuda-1.54.4 → pyqrack_cuda-1.54.5}/pyqrack/qrack_ace_backend.py +24 -10
- {pyqrack_cuda-1.54.4 → pyqrack_cuda-1.54.5/pyqrack_cuda.egg-info}/PKG-INFO +1 -1
- {pyqrack_cuda-1.54.4 → pyqrack_cuda-1.54.5}/setup.py +1 -1
- {pyqrack_cuda-1.54.4 → pyqrack_cuda-1.54.5}/LICENSE +0 -0
- {pyqrack_cuda-1.54.4 → pyqrack_cuda-1.54.5}/MANIFEST.in +0 -0
- {pyqrack_cuda-1.54.4 → pyqrack_cuda-1.54.5}/Makefile +0 -0
- {pyqrack_cuda-1.54.4 → pyqrack_cuda-1.54.5}/README.md +0 -0
- {pyqrack_cuda-1.54.4 → pyqrack_cuda-1.54.5}/pyproject.toml +0 -0
- {pyqrack_cuda-1.54.4 → pyqrack_cuda-1.54.5}/pyqrack/__init__.py +0 -0
- {pyqrack_cuda-1.54.4 → pyqrack_cuda-1.54.5}/pyqrack/neuron_activation_fn.py +0 -0
- {pyqrack_cuda-1.54.4 → pyqrack_cuda-1.54.5}/pyqrack/pauli.py +0 -0
- {pyqrack_cuda-1.54.4 → pyqrack_cuda-1.54.5}/pyqrack/qrack_circuit.py +0 -0
- {pyqrack_cuda-1.54.4 → pyqrack_cuda-1.54.5}/pyqrack/qrack_neuron.py +0 -0
- {pyqrack_cuda-1.54.4 → pyqrack_cuda-1.54.5}/pyqrack/qrack_neuron_torch_layer.py +0 -0
- {pyqrack_cuda-1.54.4 → pyqrack_cuda-1.54.5}/pyqrack/qrack_simulator.py +0 -0
- {pyqrack_cuda-1.54.4 → pyqrack_cuda-1.54.5}/pyqrack/qrack_stabilizer.py +0 -0
- {pyqrack_cuda-1.54.4 → pyqrack_cuda-1.54.5}/pyqrack/qrack_system/__init__.py +0 -0
- {pyqrack_cuda-1.54.4 → pyqrack_cuda-1.54.5}/pyqrack/qrack_system/qrack_system.py +0 -0
- {pyqrack_cuda-1.54.4 → pyqrack_cuda-1.54.5}/pyqrack/quimb_circuit_type.py +0 -0
- {pyqrack_cuda-1.54.4 → pyqrack_cuda-1.54.5}/pyqrack/stats/__init__.py +0 -0
- {pyqrack_cuda-1.54.4 → pyqrack_cuda-1.54.5}/pyqrack/stats/load_quantized_data.py +0 -0
- {pyqrack_cuda-1.54.4 → pyqrack_cuda-1.54.5}/pyqrack/stats/quantize_by_range.py +0 -0
- {pyqrack_cuda-1.54.4 → pyqrack_cuda-1.54.5}/pyqrack_cuda.egg-info/SOURCES.txt +0 -0
- {pyqrack_cuda-1.54.4 → pyqrack_cuda-1.54.5}/pyqrack_cuda.egg-info/dependency_links.txt +0 -0
- {pyqrack_cuda-1.54.4 → pyqrack_cuda-1.54.5}/pyqrack_cuda.egg-info/not-zip-safe +0 -0
- {pyqrack_cuda-1.54.4 → pyqrack_cuda-1.54.5}/pyqrack_cuda.egg-info/requires.txt +0 -0
- {pyqrack_cuda-1.54.4 → pyqrack_cuda-1.54.5}/pyqrack_cuda.egg-info/top_level.txt +0 -0
- {pyqrack_cuda-1.54.4 → pyqrack_cuda-1.54.5}/setup.cfg +0 -0
@@ -30,9 +30,12 @@ except ImportError:
|
|
30
30
|
# Initial stub and concept produced through conversation with Elara
|
31
31
|
# (the custom OpenAI GPT)
|
32
32
|
class LHVQubit:
|
33
|
-
def __init__(self):
|
33
|
+
def __init__(self, toClone=None):
|
34
34
|
# Initial state in "Bloch vector" terms, defaults to |0⟩
|
35
|
-
|
35
|
+
if toClone:
|
36
|
+
self.bloch = toClone.bloch.copy()
|
37
|
+
else:
|
38
|
+
self.reset()
|
36
39
|
|
37
40
|
def reset(self):
|
38
41
|
self.bloch = [0.0, 0.0, 1.0]
|
@@ -46,6 +49,10 @@ class LHVQubit:
|
|
46
49
|
x, y, z = self.bloch
|
47
50
|
self.bloch = [x, y, -z]
|
48
51
|
|
52
|
+
def y(self):
|
53
|
+
x, y, z = self.bloch
|
54
|
+
self.bloch = [-x, y, z]
|
55
|
+
|
49
56
|
def z(self):
|
50
57
|
x, y, z = self.bloch
|
51
58
|
self.bloch = [x, -y, z]
|
@@ -211,7 +218,7 @@ class QrackAceBackend:
|
|
211
218
|
tot_qubits += 1
|
212
219
|
sim_counts[sim_id] += 1
|
213
220
|
|
214
|
-
self._lhv_dict[tot_qubits] = LHVQubit()
|
221
|
+
self._lhv_dict[tot_qubits] = LHVQubit(toClone = toClone._lhv_dict[tot_qubits] if toClone else None)
|
215
222
|
tot_qubits += 1
|
216
223
|
|
217
224
|
sim_id = (sim_id + 1) % sim_count
|
@@ -288,13 +295,13 @@ class QrackAceBackend:
|
|
288
295
|
|
289
296
|
def _qec_s(self, t):
|
290
297
|
if isinstance(t, tuple):
|
291
|
-
self.sim[
|
298
|
+
self.sim[t[0]].s(t[1])
|
292
299
|
else:
|
293
300
|
t.s()
|
294
301
|
|
295
302
|
def _qec_adjs(self, t):
|
296
303
|
if isinstance(t, tuple):
|
297
|
-
self.sim[
|
304
|
+
self.sim[t[0]].adjs(t[1])
|
298
305
|
else:
|
299
306
|
t.adjs()
|
300
307
|
|
@@ -350,8 +357,10 @@ class QrackAceBackend:
|
|
350
357
|
self.sim[b[0]].h(b[1])
|
351
358
|
|
352
359
|
p = [self.sim[hq[0][0]].prob(hq[0][1]), hq[1].prob(), self.sim[hq[2][0]].prob(hq[2][1])]
|
353
|
-
|
354
|
-
|
360
|
+
# Balancing suggestion from Elara (the custom OpenAI GPT)
|
361
|
+
prms = math.sqrt((p[0] ** 2 + p[1] ** 2 + p[2] ** 2) / 3)
|
362
|
+
qrms = math.sqrt(((1 - p[0]) ** 2 + (1 - p[1]) ** 2 + (1 - p[2]) ** 2) / 3)
|
363
|
+
result = ((prms + (1 - qrms)) / 2) >= 0.5
|
355
364
|
syndrome = [1 - p[0], 1 - p[1], 1 - p[2]] if result else [p[0], p[1], p[2]]
|
356
365
|
|
357
366
|
for q in range(3):
|
@@ -654,7 +663,7 @@ class QrackAceBackend:
|
|
654
663
|
if pauli != Pauli.PauliZ:
|
655
664
|
self._correct(lq2, False)
|
656
665
|
if pauli != Pauli.PauliX:
|
657
|
-
self.
|
666
|
+
self._correct(lq2, True)
|
658
667
|
|
659
668
|
def cx(self, lq1, lq2):
|
660
669
|
self._cpauli(lq1, lq2, False, Pauli.PauliX)
|
@@ -741,10 +750,15 @@ class QrackAceBackend:
|
|
741
750
|
|
742
751
|
self._correct(lq)
|
743
752
|
b0 = hq[0]
|
753
|
+
b1 = hq[1]
|
744
754
|
b2 = hq[2]
|
745
|
-
|
755
|
+
# RMS
|
756
|
+
p = [self.sim[b0[0]].prob(b0[1]), b1.prob(), self.sim[b2[0]].prob(b2[1])]
|
757
|
+
# Balancing suggestion from Elara (the custom OpenAI GPT)
|
758
|
+
prms = math.sqrt((p[0] ** 2 + p[1] ** 2 + p[2] ** 2) / 3)
|
759
|
+
qrms = math.sqrt(((1 - p[0]) ** 2 + (1 - p[1]) ** 2 + (1 - p[2]) ** 2) / 3)
|
746
760
|
|
747
|
-
return
|
761
|
+
return (prms + (1 - qrms)) / 2
|
748
762
|
|
749
763
|
def m(self, lq):
|
750
764
|
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
|