pyqrack-cuda 1.58.8__tar.gz → 1.58.9__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.
Files changed (29) hide show
  1. {pyqrack_cuda-1.58.8/pyqrack_cuda.egg-info → pyqrack_cuda-1.58.9}/PKG-INFO +1 -1
  2. {pyqrack_cuda-1.58.8 → pyqrack_cuda-1.58.9}/pyqrack/qrack_ace_backend.py +43 -3
  3. {pyqrack_cuda-1.58.8 → pyqrack_cuda-1.58.9/pyqrack_cuda.egg-info}/PKG-INFO +1 -1
  4. {pyqrack_cuda-1.58.8 → pyqrack_cuda-1.58.9}/setup.py +1 -1
  5. {pyqrack_cuda-1.58.8 → pyqrack_cuda-1.58.9}/LICENSE +0 -0
  6. {pyqrack_cuda-1.58.8 → pyqrack_cuda-1.58.9}/MANIFEST.in +0 -0
  7. {pyqrack_cuda-1.58.8 → pyqrack_cuda-1.58.9}/Makefile +0 -0
  8. {pyqrack_cuda-1.58.8 → pyqrack_cuda-1.58.9}/README.md +0 -0
  9. {pyqrack_cuda-1.58.8 → pyqrack_cuda-1.58.9}/pyproject.toml +0 -0
  10. {pyqrack_cuda-1.58.8 → pyqrack_cuda-1.58.9}/pyqrack/__init__.py +0 -0
  11. {pyqrack_cuda-1.58.8 → pyqrack_cuda-1.58.9}/pyqrack/neuron_activation_fn.py +0 -0
  12. {pyqrack_cuda-1.58.8 → pyqrack_cuda-1.58.9}/pyqrack/pauli.py +0 -0
  13. {pyqrack_cuda-1.58.8 → pyqrack_cuda-1.58.9}/pyqrack/qrack_circuit.py +0 -0
  14. {pyqrack_cuda-1.58.8 → pyqrack_cuda-1.58.9}/pyqrack/qrack_neuron.py +0 -0
  15. {pyqrack_cuda-1.58.8 → pyqrack_cuda-1.58.9}/pyqrack/qrack_neuron_torch_layer.py +0 -0
  16. {pyqrack_cuda-1.58.8 → pyqrack_cuda-1.58.9}/pyqrack/qrack_simulator.py +0 -0
  17. {pyqrack_cuda-1.58.8 → pyqrack_cuda-1.58.9}/pyqrack/qrack_stabilizer.py +0 -0
  18. {pyqrack_cuda-1.58.8 → pyqrack_cuda-1.58.9}/pyqrack/qrack_system/__init__.py +0 -0
  19. {pyqrack_cuda-1.58.8 → pyqrack_cuda-1.58.9}/pyqrack/qrack_system/qrack_system.py +0 -0
  20. {pyqrack_cuda-1.58.8 → pyqrack_cuda-1.58.9}/pyqrack/quimb_circuit_type.py +0 -0
  21. {pyqrack_cuda-1.58.8 → pyqrack_cuda-1.58.9}/pyqrack/stats/__init__.py +0 -0
  22. {pyqrack_cuda-1.58.8 → pyqrack_cuda-1.58.9}/pyqrack/stats/load_quantized_data.py +0 -0
  23. {pyqrack_cuda-1.58.8 → pyqrack_cuda-1.58.9}/pyqrack/stats/quantize_by_range.py +0 -0
  24. {pyqrack_cuda-1.58.8 → pyqrack_cuda-1.58.9}/pyqrack_cuda.egg-info/SOURCES.txt +0 -0
  25. {pyqrack_cuda-1.58.8 → pyqrack_cuda-1.58.9}/pyqrack_cuda.egg-info/dependency_links.txt +0 -0
  26. {pyqrack_cuda-1.58.8 → pyqrack_cuda-1.58.9}/pyqrack_cuda.egg-info/not-zip-safe +0 -0
  27. {pyqrack_cuda-1.58.8 → pyqrack_cuda-1.58.9}/pyqrack_cuda.egg-info/requires.txt +0 -0
  28. {pyqrack_cuda-1.58.8 → pyqrack_cuda-1.58.9}/pyqrack_cuda.egg-info/top_level.txt +0 -0
  29. {pyqrack_cuda-1.58.8 → pyqrack_cuda-1.58.9}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyqrack-cuda
3
- Version: 1.58.8
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
@@ -443,6 +443,20 @@ 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
+
446
460
  def get_bloch_angles(self, hq):
447
461
  sim = self.sim[hq[0]]
448
462
  q = hq[1]
@@ -471,6 +485,24 @@ class QrackAceBackend:
471
485
 
472
486
  return prob, azimuth, inclination
473
487
 
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
+
474
506
  def rotate_to_bloch(
475
507
  self, hq, azimuth_curr, inclination_curr, azimuth_target, inclination_target
476
508
  ):
@@ -548,6 +580,7 @@ class QrackAceBackend:
548
580
  p, a, i = [0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0]
549
581
  p[0], a[0], i[0] = self.get_bloch_angles(hq[0])
550
582
  p[1], a[1], i[1] = self.get_bloch_angles(hq[1])
583
+ p[2], a[2], i[2] = self.get_lhv_bloch_angles(hq[2])
551
584
  p[3], a[3], i[3] = self.get_bloch_angles(hq[3])
552
585
  p[4], a[4], i[4] = self.get_bloch_angles(hq[4])
553
586
 
@@ -568,7 +601,10 @@ class QrackAceBackend:
568
601
  a_target /= weight
569
602
  i_target /= weight
570
603
  for x in indices:
571
- self.rotate_to_bloch(hq[x], a[x], i[x], a_target, i_target)
604
+ if x == 2:
605
+ self.rotate_lhv_to_bloch(hq[x], a[x], i[x], a_target, i_target)
606
+ else:
607
+ self.rotate_to_bloch(hq[x], a[x], i[x], a_target, i_target)
572
608
  else:
573
609
  # RMS
574
610
  p = [
@@ -588,9 +624,10 @@ class QrackAceBackend:
588
624
  else:
589
625
  self.sim[hq[q][0]].x(hq[q][1])
590
626
 
591
- p, a, i = [0, 0], [0, 0], [0, 0]
627
+ p, a, i = [0, 0, 0], [0, 0, 0], [0, 0, 0]
592
628
  p[0], a[0], i[0] = self.get_bloch_angles(hq[0])
593
629
  p[1], a[1], i[1] = self.get_bloch_angles(hq[1])
630
+ p[2], a[2], i[2] = self.get_lhv_bloch_angles(hq[2])
594
631
 
595
632
  indices = []
596
633
  a_target = 0
@@ -609,7 +646,10 @@ class QrackAceBackend:
609
646
  a_target /= weight
610
647
  i_target /= weight
611
648
  for x in indices:
612
- self.rotate_to_bloch(hq[x], a[x], i[x], a_target, i_target)
649
+ if x == 2:
650
+ self.rotate_lhv_to_bloch(hq[x], a[x], i[x], a_target, i_target)
651
+ else:
652
+ self.rotate_to_bloch(hq[x], a[x], i[x], a_target, i_target)
613
653
 
614
654
  if phase:
615
655
  for q in qb:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyqrack-cuda
3
- Version: 1.58.8
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
@@ -7,7 +7,7 @@ from setuptools import setup
7
7
  from setuptools.command.build_py import build_py
8
8
 
9
9
 
10
- VERSION = "1.58.8"
10
+ VERSION = "1.58.9"
11
11
 
12
12
  # Read long description from README.
13
13
  README_PATH = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'README.md')
File without changes
File without changes
File without changes
File without changes
File without changes