pyqrack-cpu 1.58.7__py3-none-manylinux_2_39_x86_64.whl → 1.58.9__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,7 +443,7 @@ class QrackAceBackend:
443
443
 
444
444
  return qb, lhv
445
445
 
446
- def get_bloch_angles(self, hq):
446
+ def _get_bloch_angles(self, hq):
447
447
  sim = self.sim[hq[0]]
448
448
  q = hq[1]
449
449
 
@@ -471,7 +471,7 @@ class QrackAceBackend:
471
471
 
472
472
  return prob, azimuth, inclination
473
473
 
474
- def rotate_to_bloch(
474
+ def _rotate_to_bloch(
475
475
  self, hq, azimuth_curr, inclination_curr, azimuth_target, inclination_target
476
476
  ):
477
477
  sim = self.sim[hq[0]]
@@ -546,10 +546,10 @@ class QrackAceBackend:
546
546
  self.sim[hq[q][0]].x(hq[q][1])
547
547
 
548
548
  p, a, i = [0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0]
549
- p[0], a[0], i[0] = self.get_bloch_angles(hq[0])
550
- p[1], a[1], i[1] = self.get_bloch_angles(hq[1])
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])
549
+ p[0], a[0], i[0] = self._get_bloch_angles(hq[0])
550
+ p[1], a[1], i[1] = self._get_bloch_angles(hq[1])
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])
553
553
 
554
554
  indices = []
555
555
  a_target = 0
@@ -560,6 +560,7 @@ class QrackAceBackend:
560
560
  continue
561
561
  indices.append(x)
562
562
  w = (1.5 - p[x])
563
+ w *= w
563
564
  a_target += w * a[x]
564
565
  i_target += w * i[x]
565
566
  weight += w
@@ -568,7 +569,7 @@ class QrackAceBackend:
568
569
  a_target /= weight
569
570
  i_target /= weight
570
571
  for x in indices:
571
- self.rotate_to_bloch(hq[x], a[x], i[x], a_target, i_target)
572
+ self._rotate_to_bloch(hq[x], a[x], i[x], a_target, i_target)
572
573
  else:
573
574
  # RMS
574
575
  p = [
@@ -588,20 +589,21 @@ class QrackAceBackend:
588
589
  else:
589
590
  self.sim[hq[q][0]].x(hq[q][1])
590
591
 
591
- p, a, i = [0, 0], [0, 0], [0, 0]
592
- p[0], a[0], i[0] = self.get_bloch_angles(hq[0])
593
- p[1], a[1], i[1] = self.get_bloch_angles(hq[1])
592
+ p, a, i = [0, 0, 0], [0, 0, 0], [0, 0, 0]
593
+ p[0], a[0], i[0] = self._get_bloch_angles(hq[0])
594
+ p[1], a[1], i[1] = self._get_bloch_angles(hq[1])
594
595
 
595
596
  indices = []
596
597
  a_target = 0
597
598
  i_target = 0
598
599
  weight = 0
599
- for x in range(2):
600
+ for x in range(3):
600
601
  if p[x] < 0.5:
601
602
  continue
602
603
  indices.append(x)
603
604
  w = (1.5 - p[x])
604
- a_target += x * a[x]
605
+ w *= w
606
+ a_target += w * a[x]
605
607
  i_target += w * i[x]
606
608
  weight += w
607
609
 
@@ -609,7 +611,7 @@ class QrackAceBackend:
609
611
  a_target /= weight
610
612
  i_target /= weight
611
613
  for x in indices:
612
- self.rotate_to_bloch(hq[x], a[x], i[x], a_target, i_target)
614
+ self._rotate_to_bloch(hq[x], a[x], i[x], a_target, i_target)
613
615
 
614
616
  if phase:
615
617
  for q in qb:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyqrack-cpu
3
- Version: 1.58.7
3
+ Version: 1.58.9
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=1NfJdRBFNZP8pOANGktOP5ZlZOJPe3rzmn2uBur68I4,47711
4
+ pyqrack/qrack_ace_backend.py,sha256=Q9XFDoe2miRqbqTm-ZrMdXBfZ8Bk2dkvJuaBc3RBcM8,47776
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.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,,
19
+ pyqrack_cpu-1.58.9.dist-info/licenses/LICENSE,sha256=HxB-7SaWTuewAk1nz-3_3FUD6QhgX73kNT_taKVUTq8,1069
20
+ pyqrack_cpu-1.58.9.dist-info/METADATA,sha256=78H62VRh8Tg2BjJeV3Dihu2iaEu-PjP9hFgUannUs6I,6140
21
+ pyqrack_cpu-1.58.9.dist-info/WHEEL,sha256=k8EuOMBHdXsN9XSTE5LrpwS4FtdLkoSlyO_7W-lE_zg,109
22
+ pyqrack_cpu-1.58.9.dist-info/top_level.txt,sha256=YE_3q9JTGRLMilNg2tGP1y7uU-Dx8PDao2OhwoIbv8E,8
23
+ pyqrack_cpu-1.58.9.dist-info/RECORD,,