pyqrackising 9.5.9__py3-none-win_amd64.whl → 9.5.10__py3-none-win_amd64.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 pyqrackising might be problematic. Click here for more details.
- pyqrackising/otoc.py +13 -11
- {pyqrackising-9.5.9.dist-info → pyqrackising-9.5.10.dist-info}/METADATA +1 -1
- {pyqrackising-9.5.9.dist-info → pyqrackising-9.5.10.dist-info}/RECORD +6 -6
- {pyqrackising-9.5.9.dist-info → pyqrackising-9.5.10.dist-info}/WHEEL +0 -0
- {pyqrackising-9.5.9.dist-info → pyqrackising-9.5.10.dist-info}/licenses/LICENSE.md +0 -0
- {pyqrackising-9.5.9.dist-info → pyqrackising-9.5.10.dist-info}/top_level.txt +0 -0
pyqrackising/otoc.py
CHANGED
|
@@ -15,21 +15,22 @@ def get_otoc_hamming_distribution(J=-1.0, h=2.0, z=4, theta=0.0, t=5, n_qubits=6
|
|
|
15
15
|
bias[0] = 1.0
|
|
16
16
|
return bias
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
diff_x = np.empty(n_bias, dtype=np.float64)
|
|
19
19
|
tot_prob = 0
|
|
20
20
|
p = 1.0
|
|
21
21
|
for q in range(n_qubits >> 1):
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
diff_x[q] = p
|
|
23
|
+
diff_x[n_bias - (q + 1)] = p
|
|
24
24
|
tot_prob += 2 * p
|
|
25
25
|
p = math.comb(n_qubits, q + 1)
|
|
26
26
|
if n_qubits & 1:
|
|
27
|
-
|
|
27
|
+
diff_x[n_qubits >> 1] = p
|
|
28
28
|
tot_prob += p
|
|
29
|
-
|
|
29
|
+
diff_x *= n_qubits / tot_prob
|
|
30
30
|
|
|
31
31
|
signal_frac = 0.0
|
|
32
32
|
diff_z = np.zeros(n_bias, dtype=np.float64)
|
|
33
|
+
diff_z[0] = n_qubits
|
|
33
34
|
for pauli_string in pauli_strings:
|
|
34
35
|
pauli_string = list(pauli_string)
|
|
35
36
|
if len(pauli_string) != n_qubits:
|
|
@@ -44,12 +45,11 @@ def get_otoc_hamming_distribution(J=-1.0, h=2.0, z=4, theta=0.0, t=5, n_qubits=6
|
|
|
44
45
|
fwd = probability_by_hamming_weight(J, h, z, theta, t, n_qubits + 1)
|
|
45
46
|
rev = probability_by_hamming_weight(-J, -h, z, theta + np.pi, t, n_qubits + 1)
|
|
46
47
|
diff_theta = rev - fwd
|
|
47
|
-
diff_theta[0] += 1.0
|
|
48
48
|
|
|
49
49
|
phi = theta + np.pi / 2
|
|
50
50
|
fwd = probability_by_hamming_weight(-h, -J, z, phi, t, n_qubits + 1)
|
|
51
51
|
rev = probability_by_hamming_weight(h, J, z, phi - np.pi, t, n_qubits + 1)
|
|
52
|
-
diff_phi =
|
|
52
|
+
diff_phi = rev - fwd
|
|
53
53
|
|
|
54
54
|
diff_lam = (diff_theta + diff_phi) / 2
|
|
55
55
|
|
|
@@ -58,17 +58,19 @@ def get_otoc_hamming_distribution(J=-1.0, h=2.0, z=4, theta=0.0, t=5, n_qubits=6
|
|
|
58
58
|
case 'X':
|
|
59
59
|
diff_z += diff_theta
|
|
60
60
|
case 'Z':
|
|
61
|
-
|
|
61
|
+
diff_x += diff_phi
|
|
62
62
|
case 'Y':
|
|
63
|
-
diff_z +=
|
|
63
|
+
diff_z += diff_theta
|
|
64
|
+
diff_x += diff_phi
|
|
64
65
|
case _:
|
|
65
|
-
|
|
66
|
+
pass
|
|
66
67
|
|
|
67
68
|
# Normalize:
|
|
68
69
|
diff_z /= diff_z.sum()
|
|
70
|
+
diff_x /= diff_x.sum()
|
|
69
71
|
|
|
70
72
|
signal_frac = 2 ** signal_frac
|
|
71
|
-
diff_z = signal_frac * diff_z + (1 - signal_frac) *
|
|
73
|
+
diff_z = signal_frac * diff_z + (1 - signal_frac) * diff_x
|
|
72
74
|
|
|
73
75
|
# Normalize:
|
|
74
76
|
diff_z /= diff_z.sum()
|
|
@@ -6,7 +6,7 @@ pyqrackising/maxcut_tfim.py,sha256=05nRjk5hhEjNFjtXdKVObL0cYYuJ8URfcjrOGK5tGi4,1
|
|
|
6
6
|
pyqrackising/maxcut_tfim_sparse.py,sha256=zMgaVmEgfZWL2tp728PuEg5Dc_jbQBUPsgbP3lXiMiA,11194
|
|
7
7
|
pyqrackising/maxcut_tfim_streaming.py,sha256=EcRXKurqLiQs6pMNz-rhMp2YQzRXD726RnkXsPt4IJ0,6346
|
|
8
8
|
pyqrackising/maxcut_tfim_util.py,sha256=2FSBcba8Ys8HEe_h-ayB68pAqeeJXeveEHGmZKg_tkI,16889
|
|
9
|
-
pyqrackising/otoc.py,sha256=
|
|
9
|
+
pyqrackising/otoc.py,sha256=FLcIq-b3D7_ACyV7YYp9-XjYjaRXM01JI5KtqeaEmug,7234
|
|
10
10
|
pyqrackising/spin_glass_solver.py,sha256=tgmdJ6b1TetnFM--QEzOZFsNkquQYRVYiHVSzIGYvMI,14207
|
|
11
11
|
pyqrackising/spin_glass_solver_sparse.py,sha256=cmXfAR43n1beRk4LaQbwfrQWkkhMPzPXpdK2T1HhQrk,15159
|
|
12
12
|
pyqrackising/spin_glass_solver_streaming.py,sha256=joQLMKotgjQMwbG0msv_AookiWva_AiVBIR0Xr1Unho,10310
|
|
@@ -14,8 +14,8 @@ pyqrackising/tfim_magnetization.py,sha256=On1MhCNGGHRxJFRmCOpMcdqQJiy25gWkjz0Ka8
|
|
|
14
14
|
pyqrackising/tfim_square_magnetization.py,sha256=9uJCT8ytyufcGFrZiignjCkWJr9UcP44sAAy0BIBw34,531
|
|
15
15
|
pyqrackising/tsp.py,sha256=k8VK6fKw_niR-dVz8MyOT7LedABIwTzcSkhTOircYBg,64290
|
|
16
16
|
pyqrackising/tsp_maxcut.py,sha256=lEDruz5lhjVu0ufvH5VaMJW3_nohO-rEijJJabEtuSU,10084
|
|
17
|
-
pyqrackising-9.5.
|
|
18
|
-
pyqrackising-9.5.
|
|
19
|
-
pyqrackising-9.5.
|
|
20
|
-
pyqrackising-9.5.
|
|
21
|
-
pyqrackising-9.5.
|
|
17
|
+
pyqrackising-9.5.10.dist-info/licenses/LICENSE.md,sha256=fTqV5eBpeAZO0_jit8j4Ref9ikBSlHJ8xwj5TLg7gFk,7817
|
|
18
|
+
pyqrackising-9.5.10.dist-info/METADATA,sha256=6hx2Dl22pktF2ZXz0eT4Kvu3NGG5BmG2rejeRhRpFPw,1171
|
|
19
|
+
pyqrackising-9.5.10.dist-info/WHEEL,sha256=ZjXRCNaQ9YSypEK2TE0LRB0sy2OVXSszb4Sx1XjM99k,97
|
|
20
|
+
pyqrackising-9.5.10.dist-info/top_level.txt,sha256=bxlfGuLwzeVEI8Jm5D9HvC_WedgvvkSrpFwbGDjg-Ag,13
|
|
21
|
+
pyqrackising-9.5.10.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|