pyqrack-cpu 1.58.5__py3-none-manylinux_2_39_x86_64.whl → 1.58.7__py3-none-manylinux_2_39_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.

@@ -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
  ):
@@ -525,6 +493,7 @@ class QrackAceBackend:
525
493
 
526
494
  sim.mtrx([m00, m01, m10, m11], q)
527
495
 
496
+
528
497
  def _correct(self, lq, phase=False):
529
498
  hq = self._unpack(lq)
530
499
 
@@ -579,22 +548,25 @@ class QrackAceBackend:
579
548
  p, a, i = [0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0]
580
549
  p[0], a[0], i[0] = self.get_bloch_angles(hq[0])
581
550
  p[1], a[1], i[1] = self.get_bloch_angles(hq[1])
582
- p[3], a[2], i[2] = self.get_bloch_angles(hq[3])
583
- p[4], a[3], i[3] = self.get_bloch_angles(hq[4])
551
+ p[3], a[3], i[3] = self.get_bloch_angles(hq[3])
552
+ p[4], a[4], i[4] = self.get_bloch_angles(hq[4])
584
553
 
585
554
  indices = []
586
555
  a_target = 0
587
556
  i_target = 0
588
- for x in range(4):
557
+ weight = 0
558
+ for x in range(5):
589
559
  if p[x] < 0.5:
590
560
  continue
591
561
  indices.append(x)
592
- a_target += a[x]
593
- i_target += i[x]
562
+ w = (1.5 - p[x])
563
+ a_target += w * a[x]
564
+ i_target += w * i[x]
565
+ weight += w
594
566
 
595
567
  if len(indices) > 1:
596
- a_target /= len(indices)
597
- i_target /= len(indices)
568
+ a_target /= weight
569
+ i_target /= weight
598
570
  for x in indices:
599
571
  self.rotate_to_bloch(hq[x], a[x], i[x], a_target, i_target)
600
572
  else:
@@ -623,16 +595,19 @@ class QrackAceBackend:
623
595
  indices = []
624
596
  a_target = 0
625
597
  i_target = 0
598
+ weight = 0
626
599
  for x in range(2):
627
600
  if p[x] < 0.5:
628
601
  continue
629
602
  indices.append(x)
630
- a_target += a[x]
631
- i_target += i[x]
603
+ w = (1.5 - p[x])
604
+ a_target += x * a[x]
605
+ i_target += w * i[x]
606
+ weight += w
632
607
 
633
608
  if len(indices) > 1:
634
- a_target /= len(indices)
635
- i_target /= len(indices)
609
+ a_target /= weight
610
+ i_target /= weight
636
611
  for x in indices:
637
612
  self.rotate_to_bloch(hq[x], a[x], i[x], a_target, i_target)
638
613
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyqrack-cpu
3
- Version: 1.58.5
3
+ Version: 1.58.7
4
4
  Summary: pyqrack - Pure Python vm6502q/qrack Wrapper
5
5
  Home-page: https://github.com/vm6502q/pyqrack
6
6
  Author: Daniel Strano
@@ -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=M52WNROaaIbYvPHOzIZVx14y3mcau5fsWRWKsP0SXGk,48519
4
+ pyqrack/qrack_ace_backend.py,sha256=1NfJdRBFNZP8pOANGktOP5ZlZOJPe3rzmn2uBur68I4,47711
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.so.9.21.0,sha256=iw9qucXX8cw4hZH
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.58.5.dist-info/licenses/LICENSE,sha256=HxB-7SaWTuewAk1nz-3_3FUD6QhgX73kNT_taKVUTq8,1069
20
- pyqrack_cpu-1.58.5.dist-info/METADATA,sha256=z-EDDWFqNv8ydSevCoNgd3cG8ynzJ80WZ-_sJf2nt-Q,6140
21
- pyqrack_cpu-1.58.5.dist-info/WHEEL,sha256=k8EuOMBHdXsN9XSTE5LrpwS4FtdLkoSlyO_7W-lE_zg,109
22
- pyqrack_cpu-1.58.5.dist-info/top_level.txt,sha256=YE_3q9JTGRLMilNg2tGP1y7uU-Dx8PDao2OhwoIbv8E,8
23
- pyqrack_cpu-1.58.5.dist-info/RECORD,,
19
+ pyqrack_cpu-1.58.7.dist-info/licenses/LICENSE,sha256=HxB-7SaWTuewAk1nz-3_3FUD6QhgX73kNT_taKVUTq8,1069
20
+ pyqrack_cpu-1.58.7.dist-info/METADATA,sha256=OOgTMNuhNtEJyvSiA3gv8A8qIvuq9nD3Pu310twYmLU,6140
21
+ pyqrack_cpu-1.58.7.dist-info/WHEEL,sha256=k8EuOMBHdXsN9XSTE5LrpwS4FtdLkoSlyO_7W-lE_zg,109
22
+ pyqrack_cpu-1.58.7.dist-info/top_level.txt,sha256=YE_3q9JTGRLMilNg2tGP1y7uU-Dx8PDao2OhwoIbv8E,8
23
+ pyqrack_cpu-1.58.7.dist-info/RECORD,,