pyqrack-cuda 1.52.6__tar.gz → 1.52.8__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.52.6/pyqrack_cuda.egg-info → pyqrack_cuda-1.52.8}/PKG-INFO +1 -1
- {pyqrack_cuda-1.52.6 → pyqrack_cuda-1.52.8}/pyqrack/qrack_ace_backend.py +44 -59
- {pyqrack_cuda-1.52.6 → pyqrack_cuda-1.52.8/pyqrack_cuda.egg-info}/PKG-INFO +1 -1
- {pyqrack_cuda-1.52.6 → pyqrack_cuda-1.52.8}/setup.py +1 -1
- {pyqrack_cuda-1.52.6 → pyqrack_cuda-1.52.8}/LICENSE +0 -0
- {pyqrack_cuda-1.52.6 → pyqrack_cuda-1.52.8}/MANIFEST.in +0 -0
- {pyqrack_cuda-1.52.6 → pyqrack_cuda-1.52.8}/Makefile +0 -0
- {pyqrack_cuda-1.52.6 → pyqrack_cuda-1.52.8}/README.md +0 -0
- {pyqrack_cuda-1.52.6 → pyqrack_cuda-1.52.8}/pyproject.toml +0 -0
- {pyqrack_cuda-1.52.6 → pyqrack_cuda-1.52.8}/pyqrack/__init__.py +0 -0
- {pyqrack_cuda-1.52.6 → pyqrack_cuda-1.52.8}/pyqrack/neuron_activation_fn.py +0 -0
- {pyqrack_cuda-1.52.6 → pyqrack_cuda-1.52.8}/pyqrack/pauli.py +0 -0
- {pyqrack_cuda-1.52.6 → pyqrack_cuda-1.52.8}/pyqrack/qrack_circuit.py +0 -0
- {pyqrack_cuda-1.52.6 → pyqrack_cuda-1.52.8}/pyqrack/qrack_neuron.py +0 -0
- {pyqrack_cuda-1.52.6 → pyqrack_cuda-1.52.8}/pyqrack/qrack_neuron_torch_layer.py +0 -0
- {pyqrack_cuda-1.52.6 → pyqrack_cuda-1.52.8}/pyqrack/qrack_simulator.py +0 -0
- {pyqrack_cuda-1.52.6 → pyqrack_cuda-1.52.8}/pyqrack/qrack_stabilizer.py +0 -0
- {pyqrack_cuda-1.52.6 → pyqrack_cuda-1.52.8}/pyqrack/qrack_system/__init__.py +0 -0
- {pyqrack_cuda-1.52.6 → pyqrack_cuda-1.52.8}/pyqrack/qrack_system/qrack_system.py +0 -0
- {pyqrack_cuda-1.52.6 → pyqrack_cuda-1.52.8}/pyqrack/quimb_circuit_type.py +0 -0
- {pyqrack_cuda-1.52.6 → pyqrack_cuda-1.52.8}/pyqrack/stats/__init__.py +0 -0
- {pyqrack_cuda-1.52.6 → pyqrack_cuda-1.52.8}/pyqrack/stats/load_quantized_data.py +0 -0
- {pyqrack_cuda-1.52.6 → pyqrack_cuda-1.52.8}/pyqrack/stats/quantize_by_range.py +0 -0
- {pyqrack_cuda-1.52.6 → pyqrack_cuda-1.52.8}/pyqrack_cuda.egg-info/SOURCES.txt +0 -0
- {pyqrack_cuda-1.52.6 → pyqrack_cuda-1.52.8}/pyqrack_cuda.egg-info/dependency_links.txt +0 -0
- {pyqrack_cuda-1.52.6 → pyqrack_cuda-1.52.8}/pyqrack_cuda.egg-info/not-zip-safe +0 -0
- {pyqrack_cuda-1.52.6 → pyqrack_cuda-1.52.8}/pyqrack_cuda.egg-info/requires.txt +0 -0
- {pyqrack_cuda-1.52.6 → pyqrack_cuda-1.52.8}/pyqrack_cuda.egg-info/top_level.txt +0 -0
- {pyqrack_cuda-1.52.6 → pyqrack_cuda-1.52.8}/setup.cfg +0 -0
@@ -132,7 +132,7 @@ class QrackAceBackend:
|
|
132
132
|
|
133
133
|
# You can still "monkey-patch" this, after the constructor.
|
134
134
|
if "QRACK_QUNIT_SEPARABILITY_THRESHOLD" not in os.environ:
|
135
|
-
self.sim[i].set_sdrp(0.
|
135
|
+
self.sim[i].set_sdrp(0.0428)
|
136
136
|
|
137
137
|
def clone(self):
|
138
138
|
return QrackAceBackend(toClone=self)
|
@@ -220,25 +220,14 @@ class QrackAceBackend:
|
|
220
220
|
self._qubit_dict[offset + 2],
|
221
221
|
]
|
222
222
|
|
223
|
-
def _encode_decode(self,
|
223
|
+
def _encode_decode(self, hq):
|
224
224
|
if len(hq) < 2:
|
225
225
|
return
|
226
226
|
if hq[0][0] == hq[1][0]:
|
227
|
-
|
228
|
-
self.sim[b0[0]].mcx([b0[1]], hq[1][1])
|
227
|
+
b = hq[0]
|
229
228
|
else:
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
def _encode_decode_half(self, lq, hq, toward_0):
|
234
|
-
if len(hq) < 2:
|
235
|
-
return
|
236
|
-
if toward_0 and (hq[0][0] == hq[1][0]):
|
237
|
-
b0 = hq[0]
|
238
|
-
self.sim[b0[0]].mcx([b0[1]], hq[1][1])
|
239
|
-
elif not toward_0 and (hq[2][0] == hq[1][0]):
|
240
|
-
b2 = hq[2]
|
241
|
-
self.sim[b2[0]].mcx([b2[1]], hq[1][1])
|
229
|
+
b = hq[2]
|
230
|
+
self.sim[b[0]].mcx([b[1]], hq[1][1])
|
242
231
|
|
243
232
|
def _correct(self, lq, phase=False):
|
244
233
|
if self._is_col_long_range[lq % self.row_length]:
|
@@ -373,12 +362,12 @@ class QrackAceBackend:
|
|
373
362
|
|
374
363
|
if not math.isclose(ph, -lm) and not math.isclose(abs(ph), math.pi / 2):
|
375
364
|
# Produces/destroys superposition
|
376
|
-
self._encode_decode(
|
365
|
+
self._encode_decode(hq)
|
377
366
|
b = hq[0]
|
378
367
|
self.sim[b[0]].u(b[1], th, ph, lm)
|
379
368
|
b = hq[2]
|
380
369
|
self.sim[b[0]].u(b[1], th, ph, lm)
|
381
|
-
self._encode_decode(
|
370
|
+
self._encode_decode(hq)
|
382
371
|
self._correct(lq)
|
383
372
|
else:
|
384
373
|
# Shouldn't produce/destroy superposition
|
@@ -402,12 +391,12 @@ class QrackAceBackend:
|
|
402
391
|
self.sim[b[0]].r(p, th, b[1])
|
403
392
|
else:
|
404
393
|
# Produces/destroys superposition
|
405
|
-
self._encode_decode(
|
394
|
+
self._encode_decode(hq)
|
406
395
|
b = hq[0]
|
407
396
|
self.sim[b[0]].r(p, th, b[1])
|
408
397
|
b = hq[2]
|
409
398
|
self.sim[b[0]].r(p, th, b[1])
|
410
|
-
self._encode_decode(
|
399
|
+
self._encode_decode(hq)
|
411
400
|
self._correct(lq)
|
412
401
|
|
413
402
|
def h(self, lq):
|
@@ -417,12 +406,12 @@ class QrackAceBackend:
|
|
417
406
|
self.sim[b[0]].h(b[1])
|
418
407
|
return
|
419
408
|
|
420
|
-
self._encode_decode(
|
409
|
+
self._encode_decode(hq)
|
421
410
|
b = hq[0]
|
422
411
|
self.sim[b[0]].h(b[1])
|
423
412
|
b = hq[2]
|
424
413
|
self.sim[b[0]].h(b[1])
|
425
|
-
self._encode_decode(
|
414
|
+
self._encode_decode(hq)
|
426
415
|
self._correct(lq)
|
427
416
|
|
428
417
|
def s(self, lq):
|
@@ -545,6 +534,8 @@ class QrackAceBackend:
|
|
545
534
|
hq1 = self._unpack(lq1)
|
546
535
|
hq2 = self._unpack(lq2)
|
547
536
|
|
537
|
+
self._correct(lq1)
|
538
|
+
|
548
539
|
if lq1_lr and lq2_lr:
|
549
540
|
b1 = hq1[0]
|
550
541
|
b2 = hq2[0]
|
@@ -557,64 +548,58 @@ class QrackAceBackend:
|
|
557
548
|
|
558
549
|
if (lq2_col in connected_cols) and (connected_cols.index(lq2_col) < boundary):
|
559
550
|
# lq2_col < lq1_col
|
560
|
-
self.
|
561
|
-
self.
|
562
|
-
|
551
|
+
self._encode_decode(hq1)
|
552
|
+
self._encode_decode(hq2)
|
553
|
+
gate, shadow = self._get_gate(pauli, anti, hq1[0][0])
|
563
554
|
if lq1_lr:
|
564
|
-
|
555
|
+
gate([hq1[0][1]], hq2[2][1])
|
556
|
+
shadow(hq1[0], hq2[0])
|
565
557
|
elif lq2_lr:
|
566
|
-
|
558
|
+
gate([hq1[0][1]], hq2[0][1])
|
567
559
|
else:
|
568
|
-
|
569
|
-
|
570
|
-
self.
|
560
|
+
gate([hq1[0][1]], hq2[2][1])
|
561
|
+
shadow(hq1[2], hq2[0])
|
562
|
+
self._encode_decode(hq2)
|
563
|
+
self._encode_decode(hq1)
|
571
564
|
elif lq2_col in connected_cols:
|
572
565
|
# lq1_col < lq2_col
|
573
|
-
self.
|
574
|
-
self.
|
575
|
-
|
566
|
+
self._encode_decode(hq1)
|
567
|
+
self._encode_decode(hq2)
|
568
|
+
gate, shadow = self._get_gate(pauli, anti, hq2[0][0])
|
576
569
|
if lq1_lr:
|
577
|
-
|
570
|
+
gate([hq1[0][1]], hq2[0][1])
|
571
|
+
shadow(hq1[0], hq2[2])
|
578
572
|
elif lq2_lr:
|
579
|
-
|
573
|
+
gate([hq1[2][1]], hq2[0][1])
|
580
574
|
else:
|
581
|
-
|
582
|
-
|
583
|
-
self.
|
575
|
+
gate([hq1[2][1]], hq2[0][1])
|
576
|
+
shadow(hq1[0], hq2[2])
|
577
|
+
self._encode_decode(hq2)
|
578
|
+
self._encode_decode(hq1)
|
584
579
|
elif lq1_col == lq2_col:
|
585
580
|
# Both are in the same boundary column.
|
581
|
+
self._encode_decode(hq1)
|
582
|
+
self._encode_decode(hq2)
|
586
583
|
b = hq1[0]
|
587
584
|
gate, shadow = self._get_gate(pauli, anti, b[0])
|
588
585
|
gate([b[1]], hq2[0][1])
|
589
|
-
if (lq1_row & 1) == (lq2_row & 1):
|
590
|
-
b = hq1[1]
|
591
|
-
gate, shadow = self._get_gate(pauli, anti, b[0])
|
592
|
-
gate([b[1]], hq2[1][1])
|
593
|
-
else:
|
594
|
-
shadow(hq1[1], hq2[1])
|
595
586
|
b = hq1[2]
|
596
587
|
gate, shadow = self._get_gate(pauli, anti, b[0])
|
597
588
|
gate([b[1]], hq2[2][1])
|
589
|
+
self._encode_decode(hq1)
|
590
|
+
self._encode_decode(hq2)
|
598
591
|
else:
|
599
592
|
# The qubits have no quantum connection.
|
600
593
|
gate, shadow = self._get_gate(pauli, anti, hq1[0][0])
|
594
|
+
self._encode_decode(hq1)
|
595
|
+
self._encode_decode(hq2)
|
596
|
+
shadow(hq1[0], hq2[0])
|
601
597
|
if lq1_lr:
|
602
|
-
|
603
|
-
|
604
|
-
shadow(hq1[0], hq2[0] if connected01 else hq2[2])
|
605
|
-
self._encode_decode(lq2, hq2)
|
606
|
-
elif lq2_lr:
|
607
|
-
connected01 = (hq1[0][0] == hq1[1][0])
|
608
|
-
self._encode_decode(lq1, hq1)
|
609
|
-
shadow(hq1[0] if connected01 else hq1[2], hq2[0])
|
610
|
-
self._encode_decode(lq1, hq1)
|
611
|
-
else:
|
612
|
-
self._encode_decode(lq1, hq1)
|
613
|
-
self._encode_decode(lq2, hq2)
|
614
|
-
shadow(hq1[0], hq2[0])
|
598
|
+
shadow(hq1[0], hq2[2])
|
599
|
+
elif not lq2_lr:
|
615
600
|
shadow(hq1[2], hq2[2])
|
616
|
-
|
617
|
-
|
601
|
+
self._encode_decode(hq2)
|
602
|
+
self._encode_decode(hq1)
|
618
603
|
|
619
604
|
self._correct(lq1, True)
|
620
605
|
if pauli != Pauli.PauliZ:
|
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
|