PyQrackIsing 8.14.6__tar.gz → 8.14.7__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-8.14.6/pyqrackising.egg-info → pyqrackising-8.14.7}/PKG-INFO +1 -1
- {pyqrackising-8.14.6 → pyqrackising-8.14.7}/pyproject.toml +1 -1
- {pyqrackising-8.14.6 → pyqrackising-8.14.7}/pyqrackising/maxcut_tfim.py +4 -4
- {pyqrackising-8.14.6 → pyqrackising-8.14.7}/pyqrackising/maxcut_tfim_sparse.py +4 -5
- {pyqrackising-8.14.6 → pyqrackising-8.14.7}/pyqrackising/maxcut_tfim_streaming.py +4 -5
- {pyqrackising-8.14.6 → pyqrackising-8.14.7}/pyqrackising/maxcut_tfim_util.py +2 -1
- {pyqrackising-8.14.6 → pyqrackising-8.14.7/pyqrackising.egg-info}/PKG-INFO +1 -1
- {pyqrackising-8.14.6 → pyqrackising-8.14.7}/setup.py +1 -1
- {pyqrackising-8.14.6 → pyqrackising-8.14.7}/LICENSE.md +0 -0
- {pyqrackising-8.14.6 → pyqrackising-8.14.7}/MANIFEST.in +0 -0
- {pyqrackising-8.14.6 → pyqrackising-8.14.7}/README.md +0 -0
- {pyqrackising-8.14.6 → pyqrackising-8.14.7}/pyqrackising/__init__.py +0 -0
- {pyqrackising-8.14.6 → pyqrackising-8.14.7}/pyqrackising/convert_tensor_network_to_tsp.py +0 -0
- {pyqrackising-8.14.6 → pyqrackising-8.14.7}/pyqrackising/generate_tfim_samples.py +0 -0
- {pyqrackising-8.14.6 → pyqrackising-8.14.7}/pyqrackising/kernels.cl +0 -0
- {pyqrackising-8.14.6 → pyqrackising-8.14.7}/pyqrackising/spin_glass_solver.py +0 -0
- {pyqrackising-8.14.6 → pyqrackising-8.14.7}/pyqrackising/spin_glass_solver_sparse.py +0 -0
- {pyqrackising-8.14.6 → pyqrackising-8.14.7}/pyqrackising/spin_glass_solver_streaming.py +0 -0
- {pyqrackising-8.14.6 → pyqrackising-8.14.7}/pyqrackising/spin_glass_solver_util.py +0 -0
- {pyqrackising-8.14.6 → pyqrackising-8.14.7}/pyqrackising/tfim_magnetization.py +0 -0
- {pyqrackising-8.14.6 → pyqrackising-8.14.7}/pyqrackising/tfim_square_magnetization.py +0 -0
- {pyqrackising-8.14.6 → pyqrackising-8.14.7}/pyqrackising/tsp.py +0 -0
- {pyqrackising-8.14.6 → pyqrackising-8.14.7}/pyqrackising/tsp_maxcut.py +0 -0
- {pyqrackising-8.14.6 → pyqrackising-8.14.7}/pyqrackising.egg-info/SOURCES.txt +0 -0
- {pyqrackising-8.14.6 → pyqrackising-8.14.7}/pyqrackising.egg-info/dependency_links.txt +0 -0
- {pyqrackising-8.14.6 → pyqrackising-8.14.7}/pyqrackising.egg-info/not-zip-safe +0 -0
- {pyqrackising-8.14.6 → pyqrackising-8.14.7}/pyqrackising.egg-info/top_level.txt +0 -0
- {pyqrackising-8.14.6 → pyqrackising-8.14.7}/setup.cfg +0 -0
|
@@ -10,7 +10,7 @@ build-backend = "setuptools.build_meta"
|
|
|
10
10
|
|
|
11
11
|
[project]
|
|
12
12
|
name = "pyqrackising"
|
|
13
|
-
version = "8.14.
|
|
13
|
+
version = "8.14.7"
|
|
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"}
|
|
@@ -210,7 +210,7 @@ def cpu_footer(shots, quality, n_qubits, G_m, nodes, is_spin_glass, anneal_t, an
|
|
|
210
210
|
hamming_prob = maxcut_hamming_cdf(n_qubits, J_eff, degrees, quality, anneal_t, anneal_h)
|
|
211
211
|
|
|
212
212
|
degrees = None
|
|
213
|
-
J_eff =
|
|
213
|
+
J_eff = repulsion_base ** J_eff
|
|
214
214
|
|
|
215
215
|
best_solution, best_value = sample_measurement(G_m, max_edge, shots, hamming_prob, J_eff, repulsion_base, is_spin_glass)
|
|
216
216
|
|
|
@@ -311,7 +311,7 @@ def maxcut_tfim(
|
|
|
311
311
|
return "01", weight, ([nodes[0]], [nodes[1]])
|
|
312
312
|
|
|
313
313
|
if quality is None:
|
|
314
|
-
quality =
|
|
314
|
+
quality = 5
|
|
315
315
|
|
|
316
316
|
if shots is None:
|
|
317
317
|
# Number of measurement shots
|
|
@@ -326,7 +326,7 @@ def maxcut_tfim(
|
|
|
326
326
|
if repulsion_base is None:
|
|
327
327
|
repulsion_base = 8.0
|
|
328
328
|
|
|
329
|
-
is_opencl = is_maxcut_gpu and IS_OPENCL_AVAILABLE
|
|
329
|
+
is_opencl = is_maxcut_gpu and IS_OPENCL_AVAILABLE
|
|
330
330
|
|
|
331
331
|
if not is_opencl:
|
|
332
332
|
bit_string, best_value, partition = cpu_footer(shots, quality, n_qubits, G_m, nodes, is_spin_glass, anneal_t, anneal_h, repulsion_base)
|
|
@@ -346,7 +346,7 @@ def maxcut_tfim(
|
|
|
346
346
|
hamming_prob = maxcut_hamming_cdf(n_qubits, J_eff, degrees, quality, anneal_t, anneal_h)
|
|
347
347
|
|
|
348
348
|
degrees = None
|
|
349
|
-
J_eff =
|
|
349
|
+
J_eff = repulsion_base ** J_eff
|
|
350
350
|
|
|
351
351
|
best_solution, best_value = sample_for_opencl(G_m, G_m_buf, max_edge, shots, hamming_prob, J_eff, repulsion_base, is_spin_glass, is_segmented, segment_size, theta_segment_size)
|
|
352
352
|
|
|
@@ -222,8 +222,7 @@ def init_J_and_z(G_m):
|
|
|
222
222
|
def cpu_footer(J_eff, degrees, shots, quality, n_qubits, G_max, G_data, G_rows, G_cols, nodes, is_spin_glass, anneal_t, anneal_h, repulsion_base):
|
|
223
223
|
hamming_prob = maxcut_hamming_cdf(n_qubits, J_eff, degrees, quality, anneal_t, anneal_h)
|
|
224
224
|
|
|
225
|
-
|
|
226
|
-
J_eff = 1.0 / (1.0 + epsilon - J_eff)
|
|
225
|
+
J_eff = repulsion_base ** J_eff
|
|
227
226
|
|
|
228
227
|
best_solution, best_value = sample_measurement(G_data, G_rows, G_cols, G_max, shots, hamming_prob, J_eff, repulsion_base, is_spin_glass)
|
|
229
228
|
|
|
@@ -374,7 +373,7 @@ def maxcut_tfim_sparse(
|
|
|
374
373
|
return "01", weight, ([nodes[0]], [nodes[1]])
|
|
375
374
|
|
|
376
375
|
if quality is None:
|
|
377
|
-
quality =
|
|
376
|
+
quality = 5
|
|
378
377
|
|
|
379
378
|
if shots is None:
|
|
380
379
|
# Number of measurement shots
|
|
@@ -393,7 +392,7 @@ def maxcut_tfim_sparse(
|
|
|
393
392
|
|
|
394
393
|
n_qubits = G_m.shape[0]
|
|
395
394
|
|
|
396
|
-
is_opencl = is_maxcut_gpu and IS_OPENCL_AVAILABLE
|
|
395
|
+
is_opencl = is_maxcut_gpu and IS_OPENCL_AVAILABLE
|
|
397
396
|
|
|
398
397
|
if not is_opencl:
|
|
399
398
|
bit_string, best_value, partition = cpu_footer(J_eff, degrees, shots, quality, n_qubits, G_max, G_m.data, G_m.indptr, G_m.indices, nodes, is_spin_glass, anneal_t, anneal_h, repulsion_base)
|
|
@@ -413,7 +412,7 @@ def maxcut_tfim_sparse(
|
|
|
413
412
|
hamming_prob = maxcut_hamming_cdf(n_qubits, J_eff, degrees, quality, anneal_t, anneal_h)
|
|
414
413
|
|
|
415
414
|
degrees = None
|
|
416
|
-
J_eff =
|
|
415
|
+
J_eff = repulsion_base ** J_eff
|
|
417
416
|
|
|
418
417
|
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, G_max, shots, hamming_prob, J_eff, repulsion_base, is_spin_glass, is_segmented, segment_size, theta_segment_size)
|
|
419
418
|
|
|
@@ -84,7 +84,7 @@ def compute_cut(sample, G_func, nodes, n_qubits):
|
|
|
84
84
|
|
|
85
85
|
|
|
86
86
|
@njit(parallel=True)
|
|
87
|
-
def sample_measurement(G_func, nodes, max_edge, shots, thresholds,
|
|
87
|
+
def sample_measurement(G_func, nodes, max_edge, shots, thresholds, weights, n, repulsion_base, is_spin_glass):
|
|
88
88
|
shots = max(1, shots >> 1)
|
|
89
89
|
tot_init_weight = weights.sum()
|
|
90
90
|
|
|
@@ -171,12 +171,11 @@ def find_G_min(G_func, nodes, n_nodes):
|
|
|
171
171
|
def cpu_footer(shots, quality, n_qubits, G_min, G_func, nodes, is_spin_glass, anneal_t, anneal_h, repulsion_base):
|
|
172
172
|
J_eff, degrees, max_edge = init_J_and_z(G_func, nodes, G_min)
|
|
173
173
|
hamming_prob = maxcut_hamming_cdf(n_qubits, J_eff, degrees, quality, anneal_t, anneal_h)
|
|
174
|
-
degrees_sum = degrees.sum()
|
|
175
174
|
|
|
176
175
|
degrees = None
|
|
177
|
-
J_eff =
|
|
176
|
+
J_eff = repulsion_base ** J_eff
|
|
178
177
|
|
|
179
|
-
best_solution, best_value = sample_measurement(G_func, nodes, max_edge, shots, hamming_prob,
|
|
178
|
+
best_solution, best_value = sample_measurement(G_func, nodes, max_edge, shots, hamming_prob, J_eff, n_qubits, repulsion_base, is_spin_glass)
|
|
180
179
|
|
|
181
180
|
bit_string, l, r = get_cut(best_solution, nodes, n_qubits)
|
|
182
181
|
|
|
@@ -211,7 +210,7 @@ def maxcut_tfim_streaming(
|
|
|
211
210
|
return "01", weight, ([nodes[0]], [nodes[1]])
|
|
212
211
|
|
|
213
212
|
if quality is None:
|
|
214
|
-
quality =
|
|
213
|
+
quality = 5
|
|
215
214
|
|
|
216
215
|
if shots is None:
|
|
217
216
|
# Number of measurement shots
|
|
@@ -368,7 +368,8 @@ def maxcut_hamming_cdf(n_qubits, J_func, degrees, quality, tot_t, h_mult):
|
|
|
368
368
|
cum_prob = np.empty(n_bias, dtype=np.float64)
|
|
369
369
|
for i in range(n_bias):
|
|
370
370
|
tot_prob += hamming_prob[i + 1]
|
|
371
|
-
cum_prob[i] =
|
|
371
|
+
cum_prob[i] = tot_prob
|
|
372
|
+
cum_prob[-1] = 1.0
|
|
372
373
|
|
|
373
374
|
return cum_prob
|
|
374
375
|
|
|
@@ -7,7 +7,7 @@ with open(README_PATH) as readme_file:
|
|
|
7
7
|
|
|
8
8
|
setup(
|
|
9
9
|
name='pyqrackising',
|
|
10
|
-
version='8.14.
|
|
10
|
+
version='8.14.7',
|
|
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
|