PyQrackIsing 9.11.3__tar.gz → 9.11.4__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.11.3/pyqrackising.egg-info → pyqrackising-9.11.4}/PKG-INFO +1 -1
- {pyqrackising-9.11.3 → pyqrackising-9.11.4}/pyproject.toml +1 -1
- {pyqrackising-9.11.3 → pyqrackising-9.11.4}/pyqrackising/spin_glass_solver.py +8 -2
- {pyqrackising-9.11.3 → pyqrackising-9.11.4}/pyqrackising/spin_glass_solver_sparse.py +7 -1
- {pyqrackising-9.11.3 → pyqrackising-9.11.4}/pyqrackising/spin_glass_solver_streaming.py +8 -2
- {pyqrackising-9.11.3 → pyqrackising-9.11.4/pyqrackising.egg-info}/PKG-INFO +1 -1
- {pyqrackising-9.11.3 → pyqrackising-9.11.4}/setup.py +1 -1
- {pyqrackising-9.11.3 → pyqrackising-9.11.4}/LICENSE.md +0 -0
- {pyqrackising-9.11.3 → pyqrackising-9.11.4}/MANIFEST.in +0 -0
- {pyqrackising-9.11.3 → pyqrackising-9.11.4}/README.md +0 -0
- {pyqrackising-9.11.3 → pyqrackising-9.11.4}/pyqrackising/__init__.py +0 -0
- {pyqrackising-9.11.3 → pyqrackising-9.11.4}/pyqrackising/convert_tensor_network_to_tsp.py +0 -0
- {pyqrackising-9.11.3 → pyqrackising-9.11.4}/pyqrackising/generate_tfim_samples.py +0 -0
- {pyqrackising-9.11.3 → pyqrackising-9.11.4}/pyqrackising/kernels.cl +0 -0
- {pyqrackising-9.11.3 → pyqrackising-9.11.4}/pyqrackising/maxcut_tfim.py +0 -0
- {pyqrackising-9.11.3 → pyqrackising-9.11.4}/pyqrackising/maxcut_tfim_sparse.py +0 -0
- {pyqrackising-9.11.3 → pyqrackising-9.11.4}/pyqrackising/maxcut_tfim_streaming.py +0 -0
- {pyqrackising-9.11.3 → pyqrackising-9.11.4}/pyqrackising/maxcut_tfim_util.py +0 -0
- {pyqrackising-9.11.3 → pyqrackising-9.11.4}/pyqrackising/otoc.py +0 -0
- {pyqrackising-9.11.3 → pyqrackising-9.11.4}/pyqrackising/tfim_magnetization.py +0 -0
- {pyqrackising-9.11.3 → pyqrackising-9.11.4}/pyqrackising/tfim_square_magnetization.py +0 -0
- {pyqrackising-9.11.3 → pyqrackising-9.11.4}/pyqrackising/tsp.py +0 -0
- {pyqrackising-9.11.3 → pyqrackising-9.11.4}/pyqrackising/tsp_maxcut.py +0 -0
- {pyqrackising-9.11.3 → pyqrackising-9.11.4}/pyqrackising.egg-info/SOURCES.txt +0 -0
- {pyqrackising-9.11.3 → pyqrackising-9.11.4}/pyqrackising.egg-info/dependency_links.txt +0 -0
- {pyqrackising-9.11.3 → pyqrackising-9.11.4}/pyqrackising.egg-info/not-zip-safe +0 -0
- {pyqrackising-9.11.3 → pyqrackising-9.11.4}/pyqrackising.egg-info/requires.txt +0 -0
- {pyqrackising-9.11.3 → pyqrackising-9.11.4}/pyqrackising.egg-info/top_level.txt +0 -0
- {pyqrackising-9.11.3 → pyqrackising-9.11.4}/setup.cfg +0 -0
|
@@ -7,7 +7,7 @@ build-backend = "setuptools.build_meta"
|
|
|
7
7
|
|
|
8
8
|
[project]
|
|
9
9
|
name = "pyqrackising"
|
|
10
|
-
version = "9.11.
|
|
10
|
+
version = "9.11.4"
|
|
11
11
|
requires-python = ">=3.8"
|
|
12
12
|
description = "Fast MAXCUT, TSP, and sampling heuristics from near-ideal transverse field Ising model (TFIM)"
|
|
13
13
|
readme = {file = "README.txt", content-type = "text/markdown"}
|
|
@@ -118,7 +118,7 @@ def pick_gray_seeds(best_theta, thread_count, gray_seed_multiple, G_m, n, is_spi
|
|
|
118
118
|
best_energies[i] = energies[idx]
|
|
119
119
|
|
|
120
120
|
if is_spin_glass:
|
|
121
|
-
best_energies
|
|
121
|
+
best_energies *= 2.0
|
|
122
122
|
|
|
123
123
|
return best_seeds, best_energies[0]
|
|
124
124
|
|
|
@@ -352,6 +352,7 @@ def spin_glass_solver(
|
|
|
352
352
|
best_guess = None
|
|
353
353
|
|
|
354
354
|
bitstring = ""
|
|
355
|
+
cut_value = None
|
|
355
356
|
if isinstance(best_guess, str):
|
|
356
357
|
bitstring = best_guess
|
|
357
358
|
elif isinstance(best_guess, int):
|
|
@@ -372,7 +373,12 @@ def spin_glass_solver(
|
|
|
372
373
|
)
|
|
373
374
|
|
|
374
375
|
best_theta = np.array([b == "1" for b in list(bitstring)], dtype=np.bool_)
|
|
375
|
-
|
|
376
|
+
if is_spin_glass:
|
|
377
|
+
max_energy = compute_energy(best_theta, G_m, n_qubits)
|
|
378
|
+
elif cut_value is None:
|
|
379
|
+
max_energy = compute_cut(best_theta, G_m, n_qubits)
|
|
380
|
+
else:
|
|
381
|
+
max_energy = cut_value
|
|
376
382
|
|
|
377
383
|
if n_qubits < heuristic_threshold:
|
|
378
384
|
bitstring, l, r = get_cut(best_theta, nodes, n_qubits)
|
|
@@ -419,6 +419,7 @@ def spin_glass_solver_sparse(
|
|
|
419
419
|
best_guess = None
|
|
420
420
|
|
|
421
421
|
bitstring = ""
|
|
422
|
+
cut_value = None
|
|
422
423
|
if isinstance(best_guess, str):
|
|
423
424
|
bitstring = best_guess
|
|
424
425
|
elif isinstance(best_guess, int):
|
|
@@ -439,7 +440,12 @@ def spin_glass_solver_sparse(
|
|
|
439
440
|
)
|
|
440
441
|
|
|
441
442
|
best_theta = np.array([b == "1" for b in list(bitstring)], dtype=np.bool_)
|
|
442
|
-
|
|
443
|
+
if is_spin_glass:
|
|
444
|
+
max_energy = compute_energy_sparse(best_theta, G_m.data, G_m.indptr, G_m.indices, n_qubits)
|
|
445
|
+
elif cut_value is None:
|
|
446
|
+
max_energy = compute_cut_sparse(best_theta, G_m.data, G_m.indptr, G_m.indices, n_qubits)
|
|
447
|
+
else:
|
|
448
|
+
max_energy = cut_value
|
|
443
449
|
|
|
444
450
|
if n_qubits < heuristic_threshold_sparse:
|
|
445
451
|
bitstring, l, r = get_cut(best_theta, nodes, n_qubits)
|
|
@@ -109,7 +109,7 @@ def pick_gray_seeds(best_theta, thread_count, gray_seed_multiple, G_func, nodes,
|
|
|
109
109
|
best_energies[i] = energies[idx]
|
|
110
110
|
|
|
111
111
|
if is_spin_glass:
|
|
112
|
-
best_energies
|
|
112
|
+
best_energies *= 2.0
|
|
113
113
|
|
|
114
114
|
return best_seeds, best_energies[0]
|
|
115
115
|
|
|
@@ -180,6 +180,7 @@ def spin_glass_solver_streaming(
|
|
|
180
180
|
best_guess = None
|
|
181
181
|
|
|
182
182
|
bitstring = ""
|
|
183
|
+
cut_value = None
|
|
183
184
|
if isinstance(best_guess, str):
|
|
184
185
|
bitstring = best_guess
|
|
185
186
|
elif isinstance(best_guess, int):
|
|
@@ -199,7 +200,12 @@ def spin_glass_solver_streaming(
|
|
|
199
200
|
)
|
|
200
201
|
|
|
201
202
|
best_theta = np.array([b == "1" for b in list(bitstring)], dtype=np.bool_)
|
|
202
|
-
|
|
203
|
+
if is_spin_glass:
|
|
204
|
+
max_energy = compute_energy_streaming(best_theta, G_func, nodes, n_qubits)
|
|
205
|
+
elif cut_value is None:
|
|
206
|
+
max_energy = compute_cut_streaming(best_theta, G_func, nodes, n_qubits)
|
|
207
|
+
else:
|
|
208
|
+
max_energy = cut_value
|
|
203
209
|
|
|
204
210
|
if n_qubits < heuristic_threshold:
|
|
205
211
|
bitstring, l, r = get_cut(best_theta, nodes, n_qubits)
|
|
@@ -7,7 +7,7 @@ with open(README_PATH) as readme_file:
|
|
|
7
7
|
|
|
8
8
|
setup(
|
|
9
9
|
name="pyqrackising",
|
|
10
|
-
version="9.11.
|
|
10
|
+
version="9.11.4",
|
|
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
|
|
File without changes
|