PyQrackIsing 9.2.3__tar.gz → 9.2.5__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.2.3/pyqrackising.egg-info → pyqrackising-9.2.5}/PKG-INFO +1 -1
- {pyqrackising-9.2.3 → pyqrackising-9.2.5}/pyproject.toml +1 -1
- {pyqrackising-9.2.3 → pyqrackising-9.2.5}/pyqrackising/spin_glass_solver.py +27 -0
- {pyqrackising-9.2.3 → pyqrackising-9.2.5}/pyqrackising/spin_glass_solver_sparse.py +27 -0
- {pyqrackising-9.2.3 → pyqrackising-9.2.5}/pyqrackising/spin_glass_solver_streaming.py +19 -0
- {pyqrackising-9.2.3 → pyqrackising-9.2.5}/pyqrackising/tsp.py +3 -4
- {pyqrackising-9.2.3 → pyqrackising-9.2.5/pyqrackising.egg-info}/PKG-INFO +1 -1
- {pyqrackising-9.2.3 → pyqrackising-9.2.5}/setup.py +1 -1
- {pyqrackising-9.2.3 → pyqrackising-9.2.5}/LICENSE.md +0 -0
- {pyqrackising-9.2.3 → pyqrackising-9.2.5}/MANIFEST.in +0 -0
- {pyqrackising-9.2.3 → pyqrackising-9.2.5}/README.md +0 -0
- {pyqrackising-9.2.3 → pyqrackising-9.2.5}/pyqrackising/__init__.py +0 -0
- {pyqrackising-9.2.3 → pyqrackising-9.2.5}/pyqrackising/convert_tensor_network_to_tsp.py +0 -0
- {pyqrackising-9.2.3 → pyqrackising-9.2.5}/pyqrackising/generate_tfim_samples.py +0 -0
- {pyqrackising-9.2.3 → pyqrackising-9.2.5}/pyqrackising/kernels.cl +0 -0
- {pyqrackising-9.2.3 → pyqrackising-9.2.5}/pyqrackising/maxcut_tfim.py +0 -0
- {pyqrackising-9.2.3 → pyqrackising-9.2.5}/pyqrackising/maxcut_tfim_sparse.py +0 -0
- {pyqrackising-9.2.3 → pyqrackising-9.2.5}/pyqrackising/maxcut_tfim_streaming.py +0 -0
- {pyqrackising-9.2.3 → pyqrackising-9.2.5}/pyqrackising/maxcut_tfim_util.py +0 -0
- {pyqrackising-9.2.3 → pyqrackising-9.2.5}/pyqrackising/tfim_magnetization.py +0 -0
- {pyqrackising-9.2.3 → pyqrackising-9.2.5}/pyqrackising/tfim_square_magnetization.py +0 -0
- {pyqrackising-9.2.3 → pyqrackising-9.2.5}/pyqrackising/tsp_maxcut.py +0 -0
- {pyqrackising-9.2.3 → pyqrackising-9.2.5}/pyqrackising.egg-info/SOURCES.txt +0 -0
- {pyqrackising-9.2.3 → pyqrackising-9.2.5}/pyqrackising.egg-info/dependency_links.txt +0 -0
- {pyqrackising-9.2.3 → pyqrackising-9.2.5}/pyqrackising.egg-info/not-zip-safe +0 -0
- {pyqrackising-9.2.3 → pyqrackising-9.2.5}/pyqrackising.egg-info/top_level.txt +0 -0
- {pyqrackising-9.2.3 → pyqrackising-9.2.5}/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.2.
|
|
13
|
+
version = "9.2.5"
|
|
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"}
|
|
@@ -376,6 +376,33 @@ def spin_glass_solver(
|
|
|
376
376
|
max_energy = energy
|
|
377
377
|
best_theta = state
|
|
378
378
|
improved = True
|
|
379
|
+
continue
|
|
380
|
+
|
|
381
|
+
# Post-reheat phase
|
|
382
|
+
reheat_theta = state
|
|
383
|
+
|
|
384
|
+
# Single bit flips with O(n^2)
|
|
385
|
+
if is_opencl:
|
|
386
|
+
theta_buf = make_best_theta_buf(reheat_theta)
|
|
387
|
+
energy, state = run_bit_flips_opencl(False, n_qubits, single_bit_flips_kernel, max_energy, reheat_theta, theta_buf, G_m_buf, is_segmented, *opencl_args)
|
|
388
|
+
else:
|
|
389
|
+
energy, state = run_single_bit_flips(reheat_theta, is_spin_glass, G_m)
|
|
390
|
+
if energy > max_energy:
|
|
391
|
+
max_energy = energy
|
|
392
|
+
best_theta = state
|
|
393
|
+
improved = True
|
|
394
|
+
continue
|
|
395
|
+
|
|
396
|
+
# Double bit flips with O(n^3)
|
|
397
|
+
if is_opencl:
|
|
398
|
+
# theta_buf has not changed
|
|
399
|
+
energy, state = run_bit_flips_opencl(True, n_qubits, double_bit_flips_kernel, max_energy, reheat_theta, theta_buf, G_m_buf, is_segmented, *opencl_args)
|
|
400
|
+
else:
|
|
401
|
+
energy, state = run_double_bit_flips(reheat_theta, is_spin_glass, G_m, thread_count)
|
|
402
|
+
if energy > max_energy:
|
|
403
|
+
max_energy = energy
|
|
404
|
+
best_theta = state
|
|
405
|
+
improved = True
|
|
379
406
|
|
|
380
407
|
bitstring, l, r = get_cut(best_theta, nodes, n_qubits)
|
|
381
408
|
if is_spin_glass:
|
|
@@ -380,6 +380,33 @@ def spin_glass_solver_sparse(
|
|
|
380
380
|
max_energy = energy
|
|
381
381
|
best_theta = state
|
|
382
382
|
improved = True
|
|
383
|
+
continue
|
|
384
|
+
|
|
385
|
+
# Post-reheat phase
|
|
386
|
+
reheat_theta = state
|
|
387
|
+
|
|
388
|
+
# Single bit flips with O(n^2)
|
|
389
|
+
if is_opencl:
|
|
390
|
+
theta_buf = make_best_theta_buf(reheat_theta)
|
|
391
|
+
energy, state = run_bit_flips_opencl(False, n_qubits, single_bit_flips_kernel, max_energy, reheat_theta, theta_buf, G_data_buf, G_rows_buf, G_cols_buf, is_segmented, *opencl_args)
|
|
392
|
+
else:
|
|
393
|
+
energy, state = run_single_bit_flips(reheat_theta, is_spin_glass, G_m.data, G_m.indptr, G_m.indices)
|
|
394
|
+
if energy > max_energy:
|
|
395
|
+
max_energy = energy
|
|
396
|
+
best_theta = state
|
|
397
|
+
improved = True
|
|
398
|
+
continue
|
|
399
|
+
|
|
400
|
+
# Double bit flips with O(n^3)
|
|
401
|
+
if is_opencl:
|
|
402
|
+
# theta_buf has not changed
|
|
403
|
+
energy, state = run_bit_flips_opencl(True, n_qubits, double_bit_flips_kernel, max_energy, reheat_theta, theta_buf, G_data_buf, G_rows_buf, G_cols_buf, is_segmented, *opencl_args)
|
|
404
|
+
else:
|
|
405
|
+
energy, state = run_double_bit_flips(reheat_theta, is_spin_glass, G_m.data, G_m.indptr, G_m.indices, thread_count)
|
|
406
|
+
if energy > max_energy:
|
|
407
|
+
max_energy = energy
|
|
408
|
+
best_theta = state
|
|
409
|
+
improved = True
|
|
383
410
|
|
|
384
411
|
bitstring, l, r = get_cut(best_theta, nodes, n_qubits)
|
|
385
412
|
if is_spin_glass:
|
|
@@ -261,6 +261,25 @@ def spin_glass_solver_streaming(
|
|
|
261
261
|
max_energy = energy
|
|
262
262
|
best_theta = state
|
|
263
263
|
improved = True
|
|
264
|
+
continue
|
|
265
|
+
|
|
266
|
+
# Post-reheat phase
|
|
267
|
+
reheat_theta = state
|
|
268
|
+
|
|
269
|
+
# Single bit flips with O(n^2)
|
|
270
|
+
energy, state = run_single_bit_flips(reheat_theta, is_spin_glass, G_func, nodes)
|
|
271
|
+
if energy > max_energy:
|
|
272
|
+
max_energy = energy
|
|
273
|
+
best_theta = state
|
|
274
|
+
improved = True
|
|
275
|
+
continue
|
|
276
|
+
|
|
277
|
+
# Double bit flips with O(n^3)
|
|
278
|
+
energy, state = run_double_bit_flips(reheat_theta, is_spin_glass, G_func, nodes, thread_count)
|
|
279
|
+
if energy > max_energy:
|
|
280
|
+
max_energy = energy
|
|
281
|
+
best_theta = state
|
|
282
|
+
improved = True
|
|
264
283
|
|
|
265
284
|
bitstring, l, r = get_cut(best_theta, nodes, n_qubits)
|
|
266
285
|
if is_spin_glass:
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
from .maxcut_tfim_util import binary_search, opencl_context, to_scipy_sparse_upper_triangular
|
|
2
|
-
from .
|
|
2
|
+
from .spin_glass_solver import spin_glass_solver
|
|
3
3
|
from concurrent.futures import ProcessPoolExecutor
|
|
4
|
-
import time
|
|
5
4
|
import itertools
|
|
6
5
|
import networkx as nx
|
|
7
6
|
from numba import njit, prange
|
|
@@ -639,7 +638,7 @@ def tsp_symmetric_header(G_m, nodes, quality, shots, anneal_t, anneal_h, repulsi
|
|
|
639
638
|
for _ in range(multi_start):
|
|
640
639
|
bits = ([], [])
|
|
641
640
|
while (len(bits[0]) == 0) or (len(bits[1]) == 0):
|
|
642
|
-
_, cut_value, bits =
|
|
641
|
+
_, cut_value, bits, _ = spin_glass_solver(G_m, is_spin_glass=False, quality=quality, shots=shots, anneal_t=anneal_t, anneal_h=anneal_h, repulsion_base=repulsion_base)
|
|
643
642
|
if cut_value > best_cut:
|
|
644
643
|
best_cut = cut_value
|
|
645
644
|
a, b = bits
|
|
@@ -851,7 +850,7 @@ def tsp_asymmetric_header(G_m, nodes, quality, shots, anneal_t, anneal_h, repuls
|
|
|
851
850
|
for _ in range(multi_start):
|
|
852
851
|
bits = ([], [])
|
|
853
852
|
while (len(bits[0]) == 0) or (len(bits[1]) == 0):
|
|
854
|
-
_, cut_value, bits =
|
|
853
|
+
_, cut_value, bits, _ = spin_glass_solver((G_m + G_m.T) / 2, is_spin_glass=False, quality=quality, shots=shots, anneal_t=anneal_t, anneal_h=anneal_h, repulsion_base=repulsion_base)
|
|
855
854
|
if cut_value > best_cut:
|
|
856
855
|
best_cut = cut_value
|
|
857
856
|
a, b = bits
|
|
@@ -7,7 +7,7 @@ with open(README_PATH) as readme_file:
|
|
|
7
7
|
|
|
8
8
|
setup(
|
|
9
9
|
name='pyqrackising',
|
|
10
|
-
version='9.2.
|
|
10
|
+
version='9.2.5',
|
|
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
|