pyqrack-cuda 1.58.5__tar.gz → 1.58.6__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.58.5/pyqrack_cuda.egg-info → pyqrack_cuda-1.58.6}/PKG-INFO +1 -1
- {pyqrack_cuda-1.58.5 → pyqrack_cuda-1.58.6}/pyqrack/qrack_ace_backend.py +19 -45
- {pyqrack_cuda-1.58.5 → pyqrack_cuda-1.58.6/pyqrack_cuda.egg-info}/PKG-INFO +1 -1
- {pyqrack_cuda-1.58.5 → pyqrack_cuda-1.58.6}/setup.py +1 -1
- {pyqrack_cuda-1.58.5 → pyqrack_cuda-1.58.6}/LICENSE +0 -0
- {pyqrack_cuda-1.58.5 → pyqrack_cuda-1.58.6}/MANIFEST.in +0 -0
- {pyqrack_cuda-1.58.5 → pyqrack_cuda-1.58.6}/Makefile +0 -0
- {pyqrack_cuda-1.58.5 → pyqrack_cuda-1.58.6}/README.md +0 -0
- {pyqrack_cuda-1.58.5 → pyqrack_cuda-1.58.6}/pyproject.toml +0 -0
- {pyqrack_cuda-1.58.5 → pyqrack_cuda-1.58.6}/pyqrack/__init__.py +0 -0
- {pyqrack_cuda-1.58.5 → pyqrack_cuda-1.58.6}/pyqrack/neuron_activation_fn.py +0 -0
- {pyqrack_cuda-1.58.5 → pyqrack_cuda-1.58.6}/pyqrack/pauli.py +0 -0
- {pyqrack_cuda-1.58.5 → pyqrack_cuda-1.58.6}/pyqrack/qrack_circuit.py +0 -0
- {pyqrack_cuda-1.58.5 → pyqrack_cuda-1.58.6}/pyqrack/qrack_neuron.py +0 -0
- {pyqrack_cuda-1.58.5 → pyqrack_cuda-1.58.6}/pyqrack/qrack_neuron_torch_layer.py +0 -0
- {pyqrack_cuda-1.58.5 → pyqrack_cuda-1.58.6}/pyqrack/qrack_simulator.py +0 -0
- {pyqrack_cuda-1.58.5 → pyqrack_cuda-1.58.6}/pyqrack/qrack_stabilizer.py +0 -0
- {pyqrack_cuda-1.58.5 → pyqrack_cuda-1.58.6}/pyqrack/qrack_system/__init__.py +0 -0
- {pyqrack_cuda-1.58.5 → pyqrack_cuda-1.58.6}/pyqrack/qrack_system/qrack_system.py +0 -0
- {pyqrack_cuda-1.58.5 → pyqrack_cuda-1.58.6}/pyqrack/quimb_circuit_type.py +0 -0
- {pyqrack_cuda-1.58.5 → pyqrack_cuda-1.58.6}/pyqrack/stats/__init__.py +0 -0
- {pyqrack_cuda-1.58.5 → pyqrack_cuda-1.58.6}/pyqrack/stats/load_quantized_data.py +0 -0
- {pyqrack_cuda-1.58.5 → pyqrack_cuda-1.58.6}/pyqrack/stats/quantize_by_range.py +0 -0
- {pyqrack_cuda-1.58.5 → pyqrack_cuda-1.58.6}/pyqrack_cuda.egg-info/SOURCES.txt +0 -0
- {pyqrack_cuda-1.58.5 → pyqrack_cuda-1.58.6}/pyqrack_cuda.egg-info/dependency_links.txt +0 -0
- {pyqrack_cuda-1.58.5 → pyqrack_cuda-1.58.6}/pyqrack_cuda.egg-info/not-zip-safe +0 -0
- {pyqrack_cuda-1.58.5 → pyqrack_cuda-1.58.6}/pyqrack_cuda.egg-info/requires.txt +0 -0
- {pyqrack_cuda-1.58.5 → pyqrack_cuda-1.58.6}/pyqrack_cuda.egg-info/top_level.txt +0 -0
- {pyqrack_cuda-1.58.5 → pyqrack_cuda-1.58.6}/setup.cfg +0 -0
@@ -443,20 +443,6 @@ class QrackAceBackend:
|
|
443
443
|
|
444
444
|
return qb, lhv
|
445
445
|
|
446
|
-
def get_lhv_bloch_angles(self, q):
|
447
|
-
z = (1 - q.bloch[2]) / 2
|
448
|
-
prob = z**2
|
449
|
-
x = (1 - q.bloch[0]) / 2
|
450
|
-
prob += x**2
|
451
|
-
y = (1 - q.bloch[1]) / 2
|
452
|
-
prob += y**2
|
453
|
-
|
454
|
-
prob = math.sqrt(prob)
|
455
|
-
inclination = math.atan2(math.sqrt(x**2 + y**2), z)
|
456
|
-
azimuth = math.atan2(y, x)
|
457
|
-
|
458
|
-
return prob, azimuth, inclination
|
459
|
-
|
460
446
|
def get_bloch_angles(self, hq):
|
461
447
|
sim = self.sim[hq[0]]
|
462
448
|
q = hq[1]
|
@@ -485,24 +471,6 @@ class QrackAceBackend:
|
|
485
471
|
|
486
472
|
return prob, azimuth, inclination
|
487
473
|
|
488
|
-
def rotate_lhv_to_bloch(
|
489
|
-
self, q, azimuth_curr, inclination_curr, azimuth_target, inclination_target
|
490
|
-
):
|
491
|
-
delta_azimuth = azimuth_target - azimuth_curr
|
492
|
-
delta_inclination = inclination_target - inclination_curr
|
493
|
-
|
494
|
-
cosA = math.cos(delta_azimuth)
|
495
|
-
sinA = math.sin(delta_azimuth)
|
496
|
-
cosI = math.cos(delta_inclination / 2)
|
497
|
-
sinI = math.sin(delta_inclination / 2)
|
498
|
-
|
499
|
-
m00 = complex(cosI, 0)
|
500
|
-
m01 = complex(-cosA, sinA) * sinI
|
501
|
-
m10 = complex(cosA, sinA) * sinI
|
502
|
-
m11 = complex(cosI, 0)
|
503
|
-
|
504
|
-
q.mtrx([m00, m01, m10, m11])
|
505
|
-
|
506
474
|
def rotate_to_bloch(
|
507
475
|
self, hq, azimuth_curr, inclination_curr, azimuth_target, inclination_target
|
508
476
|
):
|
@@ -579,22 +547,25 @@ class QrackAceBackend:
|
|
579
547
|
p, a, i = [0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0]
|
580
548
|
p[0], a[0], i[0] = self.get_bloch_angles(hq[0])
|
581
549
|
p[1], a[1], i[1] = self.get_bloch_angles(hq[1])
|
582
|
-
p[3], a[
|
583
|
-
p[4], a[
|
550
|
+
p[3], a[3], i[3] = self.get_bloch_angles(hq[3])
|
551
|
+
p[4], a[4], i[4] = self.get_bloch_angles(hq[4])
|
584
552
|
|
585
553
|
indices = []
|
586
554
|
a_target = 0
|
587
555
|
i_target = 0
|
588
|
-
|
589
|
-
|
556
|
+
weight = 0
|
557
|
+
for x in range(5):
|
558
|
+
if p[x] <= 0.5:
|
590
559
|
continue
|
591
560
|
indices.append(x)
|
592
|
-
|
593
|
-
|
561
|
+
w = (0.5 - p[x])
|
562
|
+
a_target += w * a[x]
|
563
|
+
i_target += w * i[x]
|
564
|
+
weight += w
|
594
565
|
|
595
566
|
if len(indices) > 1:
|
596
|
-
a_target /=
|
597
|
-
i_target /=
|
567
|
+
a_target /= weight
|
568
|
+
i_target /= weight
|
598
569
|
for x in indices:
|
599
570
|
self.rotate_to_bloch(hq[x], a[x], i[x], a_target, i_target)
|
600
571
|
else:
|
@@ -623,16 +594,19 @@ class QrackAceBackend:
|
|
623
594
|
indices = []
|
624
595
|
a_target = 0
|
625
596
|
i_target = 0
|
597
|
+
weight = 0
|
626
598
|
for x in range(2):
|
627
|
-
if p[x]
|
599
|
+
if p[x] <= 0.5:
|
628
600
|
continue
|
629
601
|
indices.append(x)
|
630
|
-
|
631
|
-
|
602
|
+
w = (0.5 - p[x])
|
603
|
+
a_target += x * a[x]
|
604
|
+
i_target += w * i[x]
|
605
|
+
weight += w
|
632
606
|
|
633
607
|
if len(indices) > 1:
|
634
|
-
a_target /=
|
635
|
-
i_target /=
|
608
|
+
a_target /= weight
|
609
|
+
i_target /= weight
|
636
610
|
for x in indices:
|
637
611
|
self.rotate_to_bloch(hq[x], a[x], i[x], a_target, i_target)
|
638
612
|
|
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
|