pyqrack-cuda 1.49.0__tar.gz → 1.49.1__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.49.0/pyqrack_cuda.egg-info → pyqrack_cuda-1.49.1}/PKG-INFO +1 -1
  2. {pyqrack_cuda-1.49.0 → pyqrack_cuda-1.49.1}/pyqrack/qrack_ace_backend.py +77 -20
  3. {pyqrack_cuda-1.49.0 → pyqrack_cuda-1.49.1/pyqrack_cuda.egg-info}/PKG-INFO +1 -1
  4. {pyqrack_cuda-1.49.0 → pyqrack_cuda-1.49.1}/setup.py +1 -1
  5. {pyqrack_cuda-1.49.0 → pyqrack_cuda-1.49.1}/LICENSE +0 -0
  6. {pyqrack_cuda-1.49.0 → pyqrack_cuda-1.49.1}/MANIFEST.in +0 -0
  7. {pyqrack_cuda-1.49.0 → pyqrack_cuda-1.49.1}/Makefile +0 -0
  8. {pyqrack_cuda-1.49.0 → pyqrack_cuda-1.49.1}/README.md +0 -0
  9. {pyqrack_cuda-1.49.0 → pyqrack_cuda-1.49.1}/pyproject.toml +0 -0
  10. {pyqrack_cuda-1.49.0 → pyqrack_cuda-1.49.1}/pyqrack/__init__.py +0 -0
  11. {pyqrack_cuda-1.49.0 → pyqrack_cuda-1.49.1}/pyqrack/neuron_activation_fn.py +0 -0
  12. {pyqrack_cuda-1.49.0 → pyqrack_cuda-1.49.1}/pyqrack/pauli.py +0 -0
  13. {pyqrack_cuda-1.49.0 → pyqrack_cuda-1.49.1}/pyqrack/qrack_circuit.py +0 -0
  14. {pyqrack_cuda-1.49.0 → pyqrack_cuda-1.49.1}/pyqrack/qrack_neuron.py +0 -0
  15. {pyqrack_cuda-1.49.0 → pyqrack_cuda-1.49.1}/pyqrack/qrack_neuron_torch_layer.py +0 -0
  16. {pyqrack_cuda-1.49.0 → pyqrack_cuda-1.49.1}/pyqrack/qrack_simulator.py +0 -0
  17. {pyqrack_cuda-1.49.0 → pyqrack_cuda-1.49.1}/pyqrack/qrack_stabilizer.py +0 -0
  18. {pyqrack_cuda-1.49.0 → pyqrack_cuda-1.49.1}/pyqrack/qrack_system/__init__.py +0 -0
  19. {pyqrack_cuda-1.49.0 → pyqrack_cuda-1.49.1}/pyqrack/qrack_system/qrack_system.py +0 -0
  20. {pyqrack_cuda-1.49.0 → pyqrack_cuda-1.49.1}/pyqrack/quimb_circuit_type.py +0 -0
  21. {pyqrack_cuda-1.49.0 → pyqrack_cuda-1.49.1}/pyqrack/stats/__init__.py +0 -0
  22. {pyqrack_cuda-1.49.0 → pyqrack_cuda-1.49.1}/pyqrack/stats/load_quantized_data.py +0 -0
  23. {pyqrack_cuda-1.49.0 → pyqrack_cuda-1.49.1}/pyqrack/stats/quantize_by_range.py +0 -0
  24. {pyqrack_cuda-1.49.0 → pyqrack_cuda-1.49.1}/pyqrack_cuda.egg-info/SOURCES.txt +0 -0
  25. {pyqrack_cuda-1.49.0 → pyqrack_cuda-1.49.1}/pyqrack_cuda.egg-info/dependency_links.txt +0 -0
  26. {pyqrack_cuda-1.49.0 → pyqrack_cuda-1.49.1}/pyqrack_cuda.egg-info/not-zip-safe +0 -0
  27. {pyqrack_cuda-1.49.0 → pyqrack_cuda-1.49.1}/pyqrack_cuda.egg-info/requires.txt +0 -0
  28. {pyqrack_cuda-1.49.0 → pyqrack_cuda-1.49.1}/pyqrack_cuda.egg-info/top_level.txt +0 -0
  29. {pyqrack_cuda-1.49.0 → pyqrack_cuda-1.49.1}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyqrack-cuda
3
- Version: 1.49.0
3
+ Version: 1.49.1
4
4
  Summary: pyqrack - Pure Python vm6502q/qrack Wrapper
5
5
  Home-page: https://github.com/vm6502q/pyqrack
6
6
  Author: Daniel Strano
@@ -455,9 +455,6 @@ class QrackAceBackend:
455
455
 
456
456
  lq1_lr = self._is_col_long_range[lq1 % self.row_length]
457
457
  lq2_lr = self._is_col_long_range[lq2 % self.row_length]
458
- if lq1_lr and lq2_lr:
459
- gate(self._unpack(lq1), self._unpack(lq2)[0])
460
- return
461
458
 
462
459
  self._correct(lq1)
463
460
 
@@ -484,9 +481,27 @@ class QrackAceBackend:
484
481
  lq2_row = lq2 // self.row_length
485
482
  lq2_col = lq2 % self.row_length
486
483
 
484
+ connected_cols = []
485
+ c = (lq1_col - 1) % cols
486
+ while self._is_col_long_range[c]:
487
+ connected_cols.append(c)
488
+ c = (c - 1) % cols
489
+ connected_cols.append(c)
490
+ boundary = len(connected_cols)
491
+ c = (lq1_col + 1) % cols
492
+ while self._is_col_long_range[c]:
493
+ connected_cols.append(c)
494
+ c = (c + 1) % cols
495
+ connected_cols.append(c)
496
+
487
497
  hq1 = None
488
498
  hq2 = None
489
- if (lq2_row == lq1_row) and (((lq1_col + 1) % self.row_length) == lq2_col):
499
+ if lq1_lr and lq2_lr:
500
+ if lq2_col in connected_cols:
501
+ gate(self._unpack(lq1), self._unpack(lq2)[0])
502
+ else:
503
+ shadow(self._unpack(lq1)[0], self._unpack(lq2)[0])
504
+ elif (lq2_col in connected_cols) and (connected_cols.index(lq2_col) < boundary):
490
505
  if lq1_lr:
491
506
  self._correct(lq2)
492
507
  hq1 = self._unpack(lq1)
@@ -509,7 +524,7 @@ class QrackAceBackend:
509
524
  gate([hq1[0]], hq2[0])
510
525
  self._encode(lq2, hq2, False)
511
526
  self._encode(lq1, hq1, True)
512
- elif (lq1_row == lq2_row) and (((lq2_col + 1) % self.row_length) == lq1_col):
527
+ elif lq2_col in connected_cols:
513
528
  if lq1_lr:
514
529
  self._correct(lq2)
515
530
  hq2 = self._unpack(lq2, True)
@@ -532,7 +547,7 @@ class QrackAceBackend:
532
547
  gate([hq1[0]], hq2[0])
533
548
  self._encode(lq1, hq1, False)
534
549
  self._encode(lq2, hq2, True)
535
- else:
550
+ elif lq1_col == lq2_col:
536
551
  hq1 = self._unpack(lq1)
537
552
  hq2 = self._unpack(lq2)
538
553
  if lq1_lr:
@@ -551,6 +566,22 @@ class QrackAceBackend:
551
566
  else:
552
567
  gate([hq1[1]], hq2[1])
553
568
  gate([hq1[2]], hq2[2])
569
+ else:
570
+ hq1 = self._unpack(lq1)
571
+ hq2 = self._unpack(lq2)
572
+ if lq1_lr:
573
+ self._correct(lq2)
574
+ self._decode(lq2, hq2)
575
+ shadow(hq1[0], hq2[0])
576
+ self._encode(lq2, hq2)
577
+ elif lq2_lr:
578
+ self._decode(lq1, hq1)
579
+ shadow(hq1[0], hq2[0])
580
+ self._encode(lq1, hq1)
581
+ else:
582
+ shadow(hq1[0], hq2[0])
583
+ shadow(hq1[1], hq2[1])
584
+ shadow(hq1[2], hq2[2])
554
585
 
555
586
  def cx(self, lq1, lq2):
556
587
  self._cpauli(lq1, lq2, False, Pauli.PauliX)
@@ -1050,17 +1081,43 @@ class QrackAceBackend:
1050
1081
  "measure",
1051
1082
  ]
1052
1083
 
1053
- # Provided by Elara (custom OpenAI GPT)
1054
- def generate_logical_coupling_map(self):
1055
- coupling_map = []
1056
- for y in range(self._col_length):
1057
- for x in range(self._row_length):
1058
- q = y * self._row_length + x
1059
- # Define neighbors with orbifolding
1060
- neighbors = []
1061
- neighbors.append((x + 1) % self._row_length + y * self._row_length)
1062
- neighbors.append(x + ((y + 1) % self._col_length) * self._row_length)
1063
- for nq in neighbors:
1064
- coupling_map.append([q, nq])
1065
-
1066
- return coupling_map
1084
+ # Mostly written by Dan, but with a little help from Elara (custom OpenAI GPT)
1085
+ def get_logical_coupling_map(self):
1086
+ coupling_map = set()
1087
+ rows, cols = self.row_length, self.col_length
1088
+
1089
+ # Map each column index to its full list of logical qubit indices
1090
+ def logical_index(row, col):
1091
+ return row * cols + col
1092
+
1093
+ for col in range(cols):
1094
+ connected_cols = [col]
1095
+ c = (col - 1) % cols
1096
+ while self._is_col_long_range[c]:
1097
+ connected_cols.append(c)
1098
+ c = (c - 1) % cols
1099
+ connected_cols.append(c)
1100
+ c = (col + 1) % cols
1101
+ while self._is_col_long_range[c]:
1102
+ connected_cols.append(c)
1103
+ c = (c + 1) % cols
1104
+ connected_cols.append(c)
1105
+
1106
+ is_long = self._is_col_long_range[col]
1107
+ if is_long:
1108
+ for row in range(rows):
1109
+ a = logical_index(row, col)
1110
+ for c in connected_cols:
1111
+ for r in range(0, rows):
1112
+ b = logical_index(r, c)
1113
+ if a != b:
1114
+ coupling_map.add((a, b))
1115
+ else:
1116
+ for row in range(rows):
1117
+ a = logical_index(row, col)
1118
+ for c in connected_cols:
1119
+ for r in range(0, rows):
1120
+ b = logical_index(r, c)
1121
+ coupling_map.add((a, b))
1122
+
1123
+ return sorted(coupling_map)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyqrack-cuda
3
- Version: 1.49.0
3
+ Version: 1.49.1
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.49.0"
10
+ VERSION = "1.49.1"
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