PyQrackIsing 9.5.11__tar.gz → 9.5.12__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.
- {pyqrackising-9.5.11/pyqrackising.egg-info → pyqrackising-9.5.12}/PKG-INFO +1 -1
- {pyqrackising-9.5.11 → pyqrackising-9.5.12}/pyproject.toml +1 -1
- {pyqrackising-9.5.11 → pyqrackising-9.5.12}/pyqrackising/maxcut_tfim_sparse.py +1 -1
- {pyqrackising-9.5.11 → pyqrackising-9.5.12}/pyqrackising/maxcut_tfim_util.py +7 -7
- {pyqrackising-9.5.11 → pyqrackising-9.5.12}/pyqrackising/otoc.py +0 -2
- {pyqrackising-9.5.11 → pyqrackising-9.5.12/pyqrackising.egg-info}/PKG-INFO +1 -1
- {pyqrackising-9.5.11 → pyqrackising-9.5.12}/setup.py +1 -1
- {pyqrackising-9.5.11 → pyqrackising-9.5.12}/LICENSE.md +0 -0
- {pyqrackising-9.5.11 → pyqrackising-9.5.12}/MANIFEST.in +0 -0
- {pyqrackising-9.5.11 → pyqrackising-9.5.12}/README.md +0 -0
- {pyqrackising-9.5.11 → pyqrackising-9.5.12}/pyqrackising/__init__.py +0 -0
- {pyqrackising-9.5.11 → pyqrackising-9.5.12}/pyqrackising/convert_tensor_network_to_tsp.py +0 -0
- {pyqrackising-9.5.11 → pyqrackising-9.5.12}/pyqrackising/generate_tfim_samples.py +0 -0
- {pyqrackising-9.5.11 → pyqrackising-9.5.12}/pyqrackising/kernels.cl +0 -0
- {pyqrackising-9.5.11 → pyqrackising-9.5.12}/pyqrackising/maxcut_tfim.py +0 -0
- {pyqrackising-9.5.11 → pyqrackising-9.5.12}/pyqrackising/maxcut_tfim_streaming.py +0 -0
- {pyqrackising-9.5.11 → pyqrackising-9.5.12}/pyqrackising/spin_glass_solver.py +0 -0
- {pyqrackising-9.5.11 → pyqrackising-9.5.12}/pyqrackising/spin_glass_solver_sparse.py +0 -0
- {pyqrackising-9.5.11 → pyqrackising-9.5.12}/pyqrackising/spin_glass_solver_streaming.py +0 -0
- {pyqrackising-9.5.11 → pyqrackising-9.5.12}/pyqrackising/tfim_magnetization.py +0 -0
- {pyqrackising-9.5.11 → pyqrackising-9.5.12}/pyqrackising/tfim_square_magnetization.py +0 -0
- {pyqrackising-9.5.11 → pyqrackising-9.5.12}/pyqrackising/tsp.py +0 -0
- {pyqrackising-9.5.11 → pyqrackising-9.5.12}/pyqrackising/tsp_maxcut.py +0 -0
- {pyqrackising-9.5.11 → pyqrackising-9.5.12}/pyqrackising.egg-info/SOURCES.txt +0 -0
- {pyqrackising-9.5.11 → pyqrackising-9.5.12}/pyqrackising.egg-info/dependency_links.txt +0 -0
- {pyqrackising-9.5.11 → pyqrackising-9.5.12}/pyqrackising.egg-info/not-zip-safe +0 -0
- {pyqrackising-9.5.11 → pyqrackising-9.5.12}/pyqrackising.egg-info/top_level.txt +0 -0
- {pyqrackising-9.5.11 → pyqrackising-9.5.12}/setup.cfg +0 -0
|
@@ -10,7 +10,7 @@ build-backend = "setuptools.build_meta"
|
|
|
10
10
|
|
|
11
11
|
[project]
|
|
12
12
|
name = "pyqrackising"
|
|
13
|
-
version = "9.5.
|
|
13
|
+
version = "9.5.12"
|
|
14
14
|
requires-python = ">=3.8"
|
|
15
15
|
description = "Fast MAXCUT, TSP, and sampling heuristics from near-ideal transverse field Ising model (TFIM)"
|
|
16
16
|
readme = {file = "README.txt", content-type = "text/markdown"}
|
|
@@ -324,7 +324,7 @@ def maxcut_tfim_sparse(
|
|
|
324
324
|
best_solution, best_value = sample_for_opencl(G_m.data, G_m.indptr, G_m.indices, G_data_buf, G_rows_buf, G_cols_buf, shots, cum_prob, repulsion_base, is_spin_glass, is_segmented, segment_size, theta_segment_size)
|
|
325
325
|
else:
|
|
326
326
|
thread_count = os.cpu_count() ** 2
|
|
327
|
-
best_solution, best_value = sample_measurement(
|
|
327
|
+
best_solution, best_value = sample_measurement(G_m.data, G_m.indptr, G_m.indices, shots, thread_count, cum_prob, repulsion_base, is_spin_glass)
|
|
328
328
|
|
|
329
329
|
bit_string, l, r = get_cut(best_solution, nodes, n_qubits)
|
|
330
330
|
|
|
@@ -390,13 +390,13 @@ def init_theta(h_mult, n_qubits, J_eff, degrees):
|
|
|
390
390
|
|
|
391
391
|
|
|
392
392
|
def init_thresholds(n_qubits):
|
|
393
|
-
n_bias = n_qubits
|
|
393
|
+
n_bias = n_qubits + 1
|
|
394
394
|
thresholds = np.empty(n_bias, dtype=np.float64)
|
|
395
395
|
tot_prob = 0
|
|
396
|
-
p =
|
|
397
|
-
for q in range(
|
|
398
|
-
thresholds[q
|
|
399
|
-
thresholds[n_bias - q] = p
|
|
396
|
+
p = 1
|
|
397
|
+
for q in range(n_qubits >> 1):
|
|
398
|
+
thresholds[q] = p
|
|
399
|
+
thresholds[n_bias - (q + 1)] = p
|
|
400
400
|
tot_prob += 2 * p
|
|
401
401
|
p = math.comb(n_qubits, q + 1)
|
|
402
402
|
if n_qubits & 1:
|
|
@@ -438,7 +438,7 @@ def probability_by_hamming_weight(J, h, z, theta, t, n_bias, normalized=True):
|
|
|
438
438
|
return bias
|
|
439
439
|
|
|
440
440
|
|
|
441
|
-
@njit
|
|
441
|
+
@njit
|
|
442
442
|
def maxcut_hamming_cdf(hamming_prob, n_qubits, J_func, degrees, quality, tot_t, h_mult):
|
|
443
443
|
n_steps = 1 << quality
|
|
444
444
|
delta_t = tot_t / n_steps
|
|
@@ -446,7 +446,7 @@ def maxcut_hamming_cdf(hamming_prob, n_qubits, J_func, degrees, quality, tot_t,
|
|
|
446
446
|
|
|
447
447
|
theta = init_theta(h_mult, n_qubits, J_func, degrees)
|
|
448
448
|
|
|
449
|
-
for qc in
|
|
449
|
+
for qc in range(n_qubits, n_steps * n_qubits):
|
|
450
450
|
step = qc // n_qubits
|
|
451
451
|
q = qc % n_qubits
|
|
452
452
|
J_eff = J_func[q]
|
|
@@ -51,8 +51,6 @@ def get_otoc_hamming_distribution(J=-1.0, h=2.0, z=4, theta=0.0, t=5, n_qubits=6
|
|
|
51
51
|
rev = probability_by_hamming_weight(h, J, z, phi - np.pi, t, n_qubits + 1)
|
|
52
52
|
diff_phi = rev - fwd
|
|
53
53
|
|
|
54
|
-
diff_lam = (diff_theta + diff_phi) / 2
|
|
55
|
-
|
|
56
54
|
for b in pauli_string:
|
|
57
55
|
match b:
|
|
58
56
|
case 'X':
|
|
@@ -7,7 +7,7 @@ with open(README_PATH) as readme_file:
|
|
|
7
7
|
|
|
8
8
|
setup(
|
|
9
9
|
name='pyqrackising',
|
|
10
|
-
version='9.5.
|
|
10
|
+
version='9.5.12',
|
|
11
11
|
author='Dan Strano',
|
|
12
12
|
author_email='stranoj@gmail.com',
|
|
13
13
|
description='Fast MAXCUT, TSP, and sampling heuristics from near-ideal transverse field Ising model (TFIM)',
|
|
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
|