pyqrack-cpu 1.61.0__py3-none-macosx_13_0_x86_64.whl → 1.61.2__py3-none-macosx_13_0_x86_64.whl
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.
Potentially problematic release.
This version of pyqrack-cpu might be problematic. Click here for more details.
- pyqrack/qrack_ace_backend.py +32 -49
- {pyqrack_cpu-1.61.0.dist-info → pyqrack_cpu-1.61.2.dist-info}/METADATA +1 -1
- {pyqrack_cpu-1.61.0.dist-info → pyqrack_cpu-1.61.2.dist-info}/RECORD +6 -6
- {pyqrack_cpu-1.61.0.dist-info → pyqrack_cpu-1.61.2.dist-info}/LICENSE +0 -0
- {pyqrack_cpu-1.61.0.dist-info → pyqrack_cpu-1.61.2.dist-info}/WHEEL +0 -0
- {pyqrack_cpu-1.61.0.dist-info → pyqrack_cpu-1.61.2.dist-info}/top_level.txt +0 -0
pyqrack/qrack_ace_backend.py
CHANGED
|
@@ -443,49 +443,42 @@ class QrackAceBackend:
|
|
|
443
443
|
def _get_lhv_bloch_angles(self, sim):
|
|
444
444
|
# Z axis
|
|
445
445
|
z = 1 - 2 * sim.prob(Pauli.PauliZ)
|
|
446
|
-
prob = z**2
|
|
447
446
|
|
|
448
447
|
# X axis
|
|
449
448
|
x = 1 - 2 * sim.prob(Pauli.PauliX)
|
|
450
|
-
prob += x**2
|
|
451
449
|
|
|
452
450
|
# Y axis
|
|
453
451
|
y = 1 - 2 * sim.prob(Pauli.PauliY)
|
|
454
|
-
prob += y**2
|
|
455
452
|
|
|
456
|
-
prob = math.sqrt(prob)
|
|
457
453
|
inclination = math.atan2(math.sqrt(x**2 + y**2), z)
|
|
458
454
|
azimuth = math.atan2(y, x)
|
|
459
455
|
|
|
460
|
-
return
|
|
456
|
+
return azimuth, inclination
|
|
461
457
|
|
|
462
458
|
def _get_bloch_angles(self, hq):
|
|
463
|
-
sim = self.sim[hq[0]]
|
|
459
|
+
sim = self.sim[hq[0]].clone()
|
|
464
460
|
q = hq[1]
|
|
461
|
+
sim.separate([q])
|
|
465
462
|
|
|
466
463
|
# Z axis
|
|
467
464
|
z = 1 - 2 * sim.prob(q)
|
|
468
|
-
prob = z**2
|
|
469
465
|
|
|
470
466
|
# X axis
|
|
471
467
|
sim.h(q)
|
|
472
468
|
x = 1 - 2 * sim.prob(q)
|
|
473
|
-
prob += x**2
|
|
474
469
|
sim.h(q)
|
|
475
470
|
|
|
476
471
|
# Y axis
|
|
477
472
|
sim.adjs(q)
|
|
478
473
|
sim.h(q)
|
|
479
474
|
y = 1 - 2 * sim.prob(q)
|
|
480
|
-
prob += y**2
|
|
481
475
|
sim.h(q)
|
|
482
476
|
sim.s(q)
|
|
483
477
|
|
|
484
|
-
prob = math.sqrt(prob)
|
|
485
478
|
inclination = math.atan2(math.sqrt(x**2 + y**2), z)
|
|
486
479
|
azimuth = math.atan2(y, x)
|
|
487
480
|
|
|
488
|
-
return
|
|
481
|
+
return azimuth, inclination
|
|
489
482
|
|
|
490
483
|
def _rotate_to_bloch(
|
|
491
484
|
self, hq, delta_azimuth, delta_inclination
|
|
@@ -576,30 +569,25 @@ class QrackAceBackend:
|
|
|
576
569
|
self.sim[hq[q][0]].x(hq[q][1])
|
|
577
570
|
|
|
578
571
|
if not skip_rotation:
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
572
|
+
a, i = [0, 0, 0, 0, 0], [0, 0, 0, 0, 0]
|
|
573
|
+
a[0], i[0] = self._get_bloch_angles(hq[0])
|
|
574
|
+
a[1], i[1] = self._get_bloch_angles(hq[1])
|
|
575
|
+
a[2], i[2] = self._get_lhv_bloch_angles(hq[2])
|
|
576
|
+
a[3], i[3] = self._get_bloch_angles(hq[3])
|
|
577
|
+
a[4], i[4] = self._get_bloch_angles(hq[4])
|
|
584
578
|
|
|
585
|
-
indices = []
|
|
586
579
|
a_target = 0
|
|
587
580
|
i_target = 0
|
|
588
|
-
weight = 0
|
|
589
581
|
for x in range(5):
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
if len(indices) > 1:
|
|
600
|
-
a_target /= weight
|
|
601
|
-
i_target /= weight
|
|
602
|
-
for x in indices:
|
|
582
|
+
a_target += a[x]
|
|
583
|
+
i_target += i[x]
|
|
584
|
+
|
|
585
|
+
a_target /= 5
|
|
586
|
+
i_target /= 5
|
|
587
|
+
for x in range(5):
|
|
588
|
+
if x == 2:
|
|
589
|
+
self._rotate_lhv_to_bloch(hq[x], a_target - a[x], i_target - i[x])
|
|
590
|
+
else:
|
|
603
591
|
self._rotate_to_bloch(hq[x], a_target - a[x], i_target - i[x])
|
|
604
592
|
|
|
605
593
|
else:
|
|
@@ -622,28 +610,23 @@ class QrackAceBackend:
|
|
|
622
610
|
self.sim[hq[q][0]].x(hq[q][1])
|
|
623
611
|
|
|
624
612
|
if not skip_rotation:
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
613
|
+
a, i = [0, 0, 0], [0, 0, 0]
|
|
614
|
+
a[0], i[0] = self._get_bloch_angles(hq[0])
|
|
615
|
+
a[1], i[1] = self._get_bloch_angles(hq[1])
|
|
616
|
+
a[2], i[2] = self._get_lhv_bloch_angles(hq[2])
|
|
628
617
|
|
|
629
|
-
indices = []
|
|
630
618
|
a_target = 0
|
|
631
619
|
i_target = 0
|
|
632
|
-
weight = 0
|
|
633
620
|
for x in range(3):
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
if len(indices) > 1:
|
|
644
|
-
a_target /= weight
|
|
645
|
-
i_target /= weight
|
|
646
|
-
for x in indices:
|
|
621
|
+
a_target += a[x]
|
|
622
|
+
i_target += i[x]
|
|
623
|
+
|
|
624
|
+
a_target /= 3
|
|
625
|
+
i_target /= 3
|
|
626
|
+
for x in range(3):
|
|
627
|
+
if x == 2:
|
|
628
|
+
self._rotate_lhv_to_bloch(hq[x], a_target - a[x], i_target - i[x])
|
|
629
|
+
else:
|
|
647
630
|
self._rotate_to_bloch(hq[x], a_target - a[x], i_target - i[x])
|
|
648
631
|
|
|
649
632
|
if phase:
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
pyqrack/__init__.py,sha256=3tBwfCCD-zQjQ2g1EUZdggKdn-3b2uSFTbT7LS0YLaU,785
|
|
2
2
|
pyqrack/neuron_activation_fn.py,sha256=fQTTFfsvwcot_43Vopacot47IV2Rxk8pelUyuzwpXPs,593
|
|
3
3
|
pyqrack/pauli.py,sha256=wg500wDOwdIU4lEVJoMmjtbAdmtakZYzLPjdzC2rwUQ,654
|
|
4
|
-
pyqrack/qrack_ace_backend.py,sha256=
|
|
4
|
+
pyqrack/qrack_ace_backend.py,sha256=x1s_I_YijLsKkhkQPWZUUQNHiJom_uTjGFoqz1cgDQQ,48358
|
|
5
5
|
pyqrack/qrack_circuit.py,sha256=vDCKGbcEHJDFUKprjCpWgit8lXFnMrPimKHURD2_Hj4,19538
|
|
6
6
|
pyqrack/qrack_neuron.py,sha256=UiJdjAGB6usjAGHWSosSFCUUeIkhh3MtZbsaxfsIsNw,9043
|
|
7
7
|
pyqrack/qrack_neuron_torch_layer.py,sha256=Bs5BLC2GFevfSpo_jSJ2AZl-hfDRJmzlGN9pFw1CtoQ,6160
|
|
@@ -16,8 +16,8 @@ pyqrack/qrack_system/qrack_lib/libqrack_pinvoke.dylib,sha256=Cdb_wa2cG_V5lzswBH4
|
|
|
16
16
|
pyqrack/stats/__init__.py,sha256=Hla85my2fY_roR9lIjGBVpEG7ySOTMwjWa8D6-kgCnY,276
|
|
17
17
|
pyqrack/stats/load_quantized_data.py,sha256=z12u9F7Nt3P-i44nY1xxvso_klS6WIHS3iqq7R2_lqE,1184
|
|
18
18
|
pyqrack/stats/quantize_by_range.py,sha256=UM0_7jJDdQ7g30cR3UQAxkbzkqrmsy1oUfqg0h11FUY,2270
|
|
19
|
-
pyqrack_cpu-1.61.
|
|
20
|
-
pyqrack_cpu-1.61.
|
|
21
|
-
pyqrack_cpu-1.61.
|
|
22
|
-
pyqrack_cpu-1.61.
|
|
23
|
-
pyqrack_cpu-1.61.
|
|
19
|
+
pyqrack_cpu-1.61.2.dist-info/LICENSE,sha256=HxB-7SaWTuewAk1nz-3_3FUD6QhgX73kNT_taKVUTq8,1069
|
|
20
|
+
pyqrack_cpu-1.61.2.dist-info/METADATA,sha256=BzwhQQ7tAt2oQ4IqtDrLcmbP00EybPVvg690dg7mhIg,5951
|
|
21
|
+
pyqrack_cpu-1.61.2.dist-info/WHEEL,sha256=nZx8s83OrgdDmpcWX-8FgI0sEAjdQimt4SdYsdcCaC8,107
|
|
22
|
+
pyqrack_cpu-1.61.2.dist-info/top_level.txt,sha256=YE_3q9JTGRLMilNg2tGP1y7uU-Dx8PDao2OhwoIbv8E,8
|
|
23
|
+
pyqrack_cpu-1.61.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|