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.
- {pyqrack_cuda-1.49.0/pyqrack_cuda.egg-info → pyqrack_cuda-1.49.1}/PKG-INFO +1 -1
- {pyqrack_cuda-1.49.0 → pyqrack_cuda-1.49.1}/pyqrack/qrack_ace_backend.py +77 -20
- {pyqrack_cuda-1.49.0 → pyqrack_cuda-1.49.1/pyqrack_cuda.egg-info}/PKG-INFO +1 -1
- {pyqrack_cuda-1.49.0 → pyqrack_cuda-1.49.1}/setup.py +1 -1
- {pyqrack_cuda-1.49.0 → pyqrack_cuda-1.49.1}/LICENSE +0 -0
- {pyqrack_cuda-1.49.0 → pyqrack_cuda-1.49.1}/MANIFEST.in +0 -0
- {pyqrack_cuda-1.49.0 → pyqrack_cuda-1.49.1}/Makefile +0 -0
- {pyqrack_cuda-1.49.0 → pyqrack_cuda-1.49.1}/README.md +0 -0
- {pyqrack_cuda-1.49.0 → pyqrack_cuda-1.49.1}/pyproject.toml +0 -0
- {pyqrack_cuda-1.49.0 → pyqrack_cuda-1.49.1}/pyqrack/__init__.py +0 -0
- {pyqrack_cuda-1.49.0 → pyqrack_cuda-1.49.1}/pyqrack/neuron_activation_fn.py +0 -0
- {pyqrack_cuda-1.49.0 → pyqrack_cuda-1.49.1}/pyqrack/pauli.py +0 -0
- {pyqrack_cuda-1.49.0 → pyqrack_cuda-1.49.1}/pyqrack/qrack_circuit.py +0 -0
- {pyqrack_cuda-1.49.0 → pyqrack_cuda-1.49.1}/pyqrack/qrack_neuron.py +0 -0
- {pyqrack_cuda-1.49.0 → pyqrack_cuda-1.49.1}/pyqrack/qrack_neuron_torch_layer.py +0 -0
- {pyqrack_cuda-1.49.0 → pyqrack_cuda-1.49.1}/pyqrack/qrack_simulator.py +0 -0
- {pyqrack_cuda-1.49.0 → pyqrack_cuda-1.49.1}/pyqrack/qrack_stabilizer.py +0 -0
- {pyqrack_cuda-1.49.0 → pyqrack_cuda-1.49.1}/pyqrack/qrack_system/__init__.py +0 -0
- {pyqrack_cuda-1.49.0 → pyqrack_cuda-1.49.1}/pyqrack/qrack_system/qrack_system.py +0 -0
- {pyqrack_cuda-1.49.0 → pyqrack_cuda-1.49.1}/pyqrack/quimb_circuit_type.py +0 -0
- {pyqrack_cuda-1.49.0 → pyqrack_cuda-1.49.1}/pyqrack/stats/__init__.py +0 -0
- {pyqrack_cuda-1.49.0 → pyqrack_cuda-1.49.1}/pyqrack/stats/load_quantized_data.py +0 -0
- {pyqrack_cuda-1.49.0 → pyqrack_cuda-1.49.1}/pyqrack/stats/quantize_by_range.py +0 -0
- {pyqrack_cuda-1.49.0 → pyqrack_cuda-1.49.1}/pyqrack_cuda.egg-info/SOURCES.txt +0 -0
- {pyqrack_cuda-1.49.0 → pyqrack_cuda-1.49.1}/pyqrack_cuda.egg-info/dependency_links.txt +0 -0
- {pyqrack_cuda-1.49.0 → pyqrack_cuda-1.49.1}/pyqrack_cuda.egg-info/not-zip-safe +0 -0
- {pyqrack_cuda-1.49.0 → pyqrack_cuda-1.49.1}/pyqrack_cuda.egg-info/requires.txt +0 -0
- {pyqrack_cuda-1.49.0 → pyqrack_cuda-1.49.1}/pyqrack_cuda.egg-info/top_level.txt +0 -0
- {pyqrack_cuda-1.49.0 → pyqrack_cuda-1.49.1}/setup.cfg +0 -0
@@ -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
|
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
|
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
|
-
|
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
|
-
#
|
1054
|
-
def
|
1055
|
-
coupling_map =
|
1056
|
-
|
1057
|
-
|
1058
|
-
|
1059
|
-
|
1060
|
-
|
1061
|
-
|
1062
|
-
|
1063
|
-
|
1064
|
-
|
1065
|
-
|
1066
|
-
|
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)
|
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
|