pyqrack-cuda 1.48.3__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.48.3/pyqrack_cuda.egg-info → pyqrack_cuda-1.49.1}/PKG-INFO +1 -1
- {pyqrack_cuda-1.48.3 → pyqrack_cuda-1.49.1}/pyqrack/qrack_ace_backend.py +113 -8
- {pyqrack_cuda-1.48.3 → pyqrack_cuda-1.49.1}/pyqrack/qrack_simulator.py +40 -0
- {pyqrack_cuda-1.48.3 → pyqrack_cuda-1.49.1/pyqrack_cuda.egg-info}/PKG-INFO +1 -1
- {pyqrack_cuda-1.48.3 → pyqrack_cuda-1.49.1}/setup.py +1 -1
- {pyqrack_cuda-1.48.3 → pyqrack_cuda-1.49.1}/LICENSE +0 -0
- {pyqrack_cuda-1.48.3 → pyqrack_cuda-1.49.1}/MANIFEST.in +0 -0
- {pyqrack_cuda-1.48.3 → pyqrack_cuda-1.49.1}/Makefile +0 -0
- {pyqrack_cuda-1.48.3 → pyqrack_cuda-1.49.1}/README.md +0 -0
- {pyqrack_cuda-1.48.3 → pyqrack_cuda-1.49.1}/pyproject.toml +0 -0
- {pyqrack_cuda-1.48.3 → pyqrack_cuda-1.49.1}/pyqrack/__init__.py +0 -0
- {pyqrack_cuda-1.48.3 → pyqrack_cuda-1.49.1}/pyqrack/neuron_activation_fn.py +0 -0
- {pyqrack_cuda-1.48.3 → pyqrack_cuda-1.49.1}/pyqrack/pauli.py +0 -0
- {pyqrack_cuda-1.48.3 → pyqrack_cuda-1.49.1}/pyqrack/qrack_circuit.py +0 -0
- {pyqrack_cuda-1.48.3 → pyqrack_cuda-1.49.1}/pyqrack/qrack_neuron.py +0 -0
- {pyqrack_cuda-1.48.3 → pyqrack_cuda-1.49.1}/pyqrack/qrack_neuron_torch_layer.py +0 -0
- {pyqrack_cuda-1.48.3 → pyqrack_cuda-1.49.1}/pyqrack/qrack_stabilizer.py +0 -0
- {pyqrack_cuda-1.48.3 → pyqrack_cuda-1.49.1}/pyqrack/qrack_system/__init__.py +0 -0
- {pyqrack_cuda-1.48.3 → pyqrack_cuda-1.49.1}/pyqrack/qrack_system/qrack_system.py +0 -0
- {pyqrack_cuda-1.48.3 → pyqrack_cuda-1.49.1}/pyqrack/quimb_circuit_type.py +0 -0
- {pyqrack_cuda-1.48.3 → pyqrack_cuda-1.49.1}/pyqrack/stats/__init__.py +0 -0
- {pyqrack_cuda-1.48.3 → pyqrack_cuda-1.49.1}/pyqrack/stats/load_quantized_data.py +0 -0
- {pyqrack_cuda-1.48.3 → pyqrack_cuda-1.49.1}/pyqrack/stats/quantize_by_range.py +0 -0
- {pyqrack_cuda-1.48.3 → pyqrack_cuda-1.49.1}/pyqrack_cuda.egg-info/SOURCES.txt +0 -0
- {pyqrack_cuda-1.48.3 → pyqrack_cuda-1.49.1}/pyqrack_cuda.egg-info/dependency_links.txt +0 -0
- {pyqrack_cuda-1.48.3 → pyqrack_cuda-1.49.1}/pyqrack_cuda.egg-info/not-zip-safe +0 -0
- {pyqrack_cuda-1.48.3 → pyqrack_cuda-1.49.1}/pyqrack_cuda.egg-info/requires.txt +0 -0
- {pyqrack_cuda-1.48.3 → pyqrack_cuda-1.49.1}/pyqrack_cuda.egg-info/top_level.txt +0 -0
- {pyqrack_cuda-1.48.3 → pyqrack_cuda-1.49.1}/setup.cfg +0 -0
@@ -65,9 +65,11 @@ class QrackAceBackend:
|
|
65
65
|
|
66
66
|
col_seq = [True] * long_range_columns + [False]
|
67
67
|
len_col_seq = len(col_seq)
|
68
|
-
self._is_col_long_range = (
|
68
|
+
self._is_col_long_range = (
|
69
|
+
col_seq * ((self.row_length + len_col_seq - 1) // len_col_seq)
|
70
|
+
)[: self.row_length]
|
69
71
|
if long_range_columns < self.row_length:
|
70
|
-
|
72
|
+
self._is_col_long_range[-1] = False
|
71
73
|
self._hardware_offset = []
|
72
74
|
tot_qubits = 0
|
73
75
|
for _ in range(self.col_length):
|
@@ -453,9 +455,6 @@ class QrackAceBackend:
|
|
453
455
|
|
454
456
|
lq1_lr = self._is_col_long_range[lq1 % self.row_length]
|
455
457
|
lq2_lr = self._is_col_long_range[lq2 % self.row_length]
|
456
|
-
if lq1_lr and lq2_lr:
|
457
|
-
gate(self._unpack(lq1), self._unpack(lq2)[0])
|
458
|
-
return
|
459
458
|
|
460
459
|
self._correct(lq1)
|
461
460
|
|
@@ -482,9 +481,27 @@ class QrackAceBackend:
|
|
482
481
|
lq2_row = lq2 // self.row_length
|
483
482
|
lq2_col = lq2 % self.row_length
|
484
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
|
+
|
485
497
|
hq1 = None
|
486
498
|
hq2 = None
|
487
|
-
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):
|
488
505
|
if lq1_lr:
|
489
506
|
self._correct(lq2)
|
490
507
|
hq1 = self._unpack(lq1)
|
@@ -507,7 +524,7 @@ class QrackAceBackend:
|
|
507
524
|
gate([hq1[0]], hq2[0])
|
508
525
|
self._encode(lq2, hq2, False)
|
509
526
|
self._encode(lq1, hq1, True)
|
510
|
-
elif
|
527
|
+
elif lq2_col in connected_cols:
|
511
528
|
if lq1_lr:
|
512
529
|
self._correct(lq2)
|
513
530
|
hq2 = self._unpack(lq2, True)
|
@@ -530,7 +547,7 @@ class QrackAceBackend:
|
|
530
547
|
gate([hq1[0]], hq2[0])
|
531
548
|
self._encode(lq1, hq1, False)
|
532
549
|
self._encode(lq2, hq2, True)
|
533
|
-
|
550
|
+
elif lq1_col == lq2_col:
|
534
551
|
hq1 = self._unpack(lq1)
|
535
552
|
hq2 = self._unpack(lq2)
|
536
553
|
if lq1_lr:
|
@@ -549,6 +566,22 @@ class QrackAceBackend:
|
|
549
566
|
else:
|
550
567
|
gate([hq1[1]], hq2[1])
|
551
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])
|
552
585
|
|
553
586
|
def cx(self, lq1, lq2):
|
554
587
|
self._cpauli(lq1, lq2, False, Pauli.PauliX)
|
@@ -1016,3 +1049,75 @@ class QrackAceBackend:
|
|
1016
1049
|
del self._sim
|
1017
1050
|
|
1018
1051
|
return _data
|
1052
|
+
|
1053
|
+
def get_qiskit_basis_gates():
|
1054
|
+
return [
|
1055
|
+
"id",
|
1056
|
+
"u",
|
1057
|
+
"u1",
|
1058
|
+
"u2",
|
1059
|
+
"u3",
|
1060
|
+
"r",
|
1061
|
+
"rx",
|
1062
|
+
"ry",
|
1063
|
+
"rz",
|
1064
|
+
"h",
|
1065
|
+
"x",
|
1066
|
+
"y",
|
1067
|
+
"z",
|
1068
|
+
"s",
|
1069
|
+
"sdg",
|
1070
|
+
"sx",
|
1071
|
+
"sxdg",
|
1072
|
+
"p",
|
1073
|
+
"t",
|
1074
|
+
"tdg",
|
1075
|
+
"cx",
|
1076
|
+
"cy",
|
1077
|
+
"cz",
|
1078
|
+
"swap",
|
1079
|
+
"iswap",
|
1080
|
+
"reset",
|
1081
|
+
"measure",
|
1082
|
+
]
|
1083
|
+
|
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)
|
@@ -4374,3 +4374,43 @@ class QrackSimulator:
|
|
4374
4374
|
del self._sim
|
4375
4375
|
|
4376
4376
|
return _data
|
4377
|
+
|
4378
|
+
def get_qiskit_basis_gates():
|
4379
|
+
return [
|
4380
|
+
"id",
|
4381
|
+
"u",
|
4382
|
+
"u1",
|
4383
|
+
"u2",
|
4384
|
+
"u3",
|
4385
|
+
"r",
|
4386
|
+
"rx",
|
4387
|
+
"ry",
|
4388
|
+
"rz",
|
4389
|
+
"h",
|
4390
|
+
"x",
|
4391
|
+
"y",
|
4392
|
+
"z",
|
4393
|
+
"s",
|
4394
|
+
"sdg",
|
4395
|
+
"sx",
|
4396
|
+
"sxdg",
|
4397
|
+
"p",
|
4398
|
+
"t",
|
4399
|
+
"tdg",
|
4400
|
+
"cu",
|
4401
|
+
"cu1",
|
4402
|
+
"cu3",
|
4403
|
+
"cx",
|
4404
|
+
"cy",
|
4405
|
+
"cz",
|
4406
|
+
"ch",
|
4407
|
+
"cp",
|
4408
|
+
"csx",
|
4409
|
+
"ccx",
|
4410
|
+
"ccz",
|
4411
|
+
"swap",
|
4412
|
+
"iswap",
|
4413
|
+
"cswap",
|
4414
|
+
"reset",
|
4415
|
+
"measure",
|
4416
|
+
]
|
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
|