PyQrackIsing 7.5.0__tar.gz → 7.5.2__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-7.5.0/pyqrackising.egg-info → pyqrackising-7.5.2}/PKG-INFO +1 -1
- {pyqrackising-7.5.0 → pyqrackising-7.5.2}/pyproject.toml +1 -1
- {pyqrackising-7.5.0 → pyqrackising-7.5.2}/pyqrackising/maxcut_tfim.py +1 -1
- {pyqrackising-7.5.0 → pyqrackising-7.5.2}/pyqrackising/maxcut_tfim_sparse.py +1 -1
- {pyqrackising-7.5.0 → pyqrackising-7.5.2}/pyqrackising/maxcut_tfim_streaming.py +1 -1
- {pyqrackising-7.5.0 → pyqrackising-7.5.2}/pyqrackising/tsp_maxcut.py +12 -15
- {pyqrackising-7.5.0 → pyqrackising-7.5.2/pyqrackising.egg-info}/PKG-INFO +1 -1
- {pyqrackising-7.5.0 → pyqrackising-7.5.2}/setup.py +1 -1
- {pyqrackising-7.5.0 → pyqrackising-7.5.2}/CMakeLists.txt +0 -0
- {pyqrackising-7.5.0 → pyqrackising-7.5.2}/LICENSE.md +0 -0
- {pyqrackising-7.5.0 → pyqrackising-7.5.2}/MANIFEST.in +0 -0
- {pyqrackising-7.5.0 → pyqrackising-7.5.2}/README.md +0 -0
- {pyqrackising-7.5.0 → pyqrackising-7.5.2}/pyqrackising/__init__.py +0 -0
- {pyqrackising-7.5.0 → pyqrackising-7.5.2}/pyqrackising/_pyqrack_ising.cpp +0 -0
- {pyqrackising-7.5.0 → pyqrackising-7.5.2}/pyqrackising/convert_tensor_network_to_tsp.py +0 -0
- {pyqrackising-7.5.0 → pyqrackising-7.5.2}/pyqrackising/generate_tfim_samples.py +0 -0
- {pyqrackising-7.5.0 → pyqrackising-7.5.2}/pyqrackising/kernels.cl +0 -0
- {pyqrackising-7.5.0 → pyqrackising-7.5.2}/pyqrackising/maxcut_tfim_util.py +0 -0
- {pyqrackising-7.5.0 → pyqrackising-7.5.2}/pyqrackising/spin_glass_solver.py +0 -0
- {pyqrackising-7.5.0 → pyqrackising-7.5.2}/pyqrackising/spin_glass_solver_sparse.py +0 -0
- {pyqrackising-7.5.0 → pyqrackising-7.5.2}/pyqrackising/spin_glass_solver_streaming.py +0 -0
- {pyqrackising-7.5.0 → pyqrackising-7.5.2}/pyqrackising/spin_glass_solver_util.py +0 -0
- {pyqrackising-7.5.0 → pyqrackising-7.5.2}/pyqrackising/tfim_magnetization.py +0 -0
- {pyqrackising-7.5.0 → pyqrackising-7.5.2}/pyqrackising/tfim_square_magnetization.py +0 -0
- {pyqrackising-7.5.0 → pyqrackising-7.5.2}/pyqrackising/tsp.py +0 -0
- {pyqrackising-7.5.0 → pyqrackising-7.5.2}/pyqrackising.egg-info/SOURCES.txt +0 -0
- {pyqrackising-7.5.0 → pyqrackising-7.5.2}/pyqrackising.egg-info/dependency_links.txt +0 -0
- {pyqrackising-7.5.0 → pyqrackising-7.5.2}/pyqrackising.egg-info/not-zip-safe +0 -0
- {pyqrackising-7.5.0 → pyqrackising-7.5.2}/pyqrackising.egg-info/top_level.txt +0 -0
- {pyqrackising-7.5.0 → pyqrackising-7.5.2}/setup.cfg +0 -0
|
@@ -12,7 +12,7 @@ build-backend = "setuptools.build_meta"
|
|
|
12
12
|
|
|
13
13
|
[project]
|
|
14
14
|
name = "pyqrackising"
|
|
15
|
-
version = "7.5.
|
|
15
|
+
version = "7.5.2"
|
|
16
16
|
requires-python = ">=3.8"
|
|
17
17
|
description = "Fast MAXCUT, TSP, and sampling heuristics from near-ideal transverse field Ising model (TFIM)"
|
|
18
18
|
readme = {file = "README.txt", content-type = "text/markdown"}
|
|
@@ -104,14 +104,13 @@ def tsp_maxcut(G, k_neighbors=20, is_optimized=False, is_parallel=True, **kwargs
|
|
|
104
104
|
nodes = list(range(n_qubits))
|
|
105
105
|
G_m = G
|
|
106
106
|
|
|
107
|
-
path,
|
|
107
|
+
path, _ = tsp_symmetric(G_m, is_cyclic=False, monte_carlo=True, k_neighbors=k_neighbors, is_parallel=is_parallel)
|
|
108
108
|
l, r, cut_value = tsp_to_maxcut_bipartition(path, G_m)
|
|
109
|
-
partition = (l, r)
|
|
110
109
|
|
|
111
110
|
if not is_optimized:
|
|
112
|
-
bitstring, energy = early_exit(G_m,
|
|
111
|
+
bitstring, energy = early_exit(G_m, (l, r), nodes)
|
|
113
112
|
|
|
114
|
-
return bitstring, cut_value,
|
|
113
|
+
return bitstring, cut_value, ([nodes[x] for x in l], [nodes[x] for x in r]), energy
|
|
115
114
|
|
|
116
115
|
bitint = 0
|
|
117
116
|
for b in partition[0]:
|
|
@@ -120,7 +119,7 @@ def tsp_maxcut(G, k_neighbors=20, is_optimized=False, is_parallel=True, **kwargs
|
|
|
120
119
|
bitstring, cut_value, cut, energy = spin_glass_solver(G_m, best_guess=bitint, **kwargs)
|
|
121
120
|
l, r = get_cut(bitstring, nodes)
|
|
122
121
|
|
|
123
|
-
return bitstring, cut_value, (l, r), energy
|
|
122
|
+
return bitstring, cut_value, ([nodes[x] for x in l], [nodes[x] for x in r]), energy
|
|
124
123
|
|
|
125
124
|
|
|
126
125
|
@njit(parallel=True)
|
|
@@ -212,14 +211,13 @@ def tsp_maxcut_sparse(G, k_neighbors=20, is_optimized=False, is_parallel=True, *
|
|
|
212
211
|
nodes = list(range(n_qubits))
|
|
213
212
|
G_m = G
|
|
214
213
|
|
|
215
|
-
path,
|
|
214
|
+
path, _ = tsp_symmetric_sparse(G_m, k_neighbors=k_neighbors, is_parallel=is_parallel)
|
|
216
215
|
l, r, cut_value = tsp_to_maxcut_bipartition_sparse(path, G_m.data, G_m.indptr, G_m.indices)
|
|
217
|
-
partition = (l, r)
|
|
218
216
|
|
|
219
217
|
if not is_optimized:
|
|
220
|
-
bitstring, energy = early_exit_sparse(G_m.data, G_m.indptr, G_m.indices,
|
|
218
|
+
bitstring, energy = early_exit_sparse(G_m.data, G_m.indptr, G_m.indices, (l, r), nodes)
|
|
221
219
|
|
|
222
|
-
return bitstring, cut_value,
|
|
220
|
+
return bitstring, cut_value, ([nodes[x] for x in l], [nodes[x] for x in r]), energy
|
|
223
221
|
|
|
224
222
|
bitint = 0
|
|
225
223
|
for b in partition[0]:
|
|
@@ -228,7 +226,7 @@ def tsp_maxcut_sparse(G, k_neighbors=20, is_optimized=False, is_parallel=True, *
|
|
|
228
226
|
bitstring, cut_value, cut, energy = spin_glass_solver_sparse(G_m, best_guess=bitint, **kwargs)
|
|
229
227
|
l, r = get_cut(bitstring, nodes)
|
|
230
228
|
|
|
231
|
-
return bitstring, cut_value, (l, r), energy
|
|
229
|
+
return bitstring, cut_value, ([nodes[x] for x in l], [nodes[x] for x in r]), energy
|
|
232
230
|
|
|
233
231
|
|
|
234
232
|
@njit(parallel=True)
|
|
@@ -296,14 +294,13 @@ def early_exit_streaming(G_func, partition, nodes):
|
|
|
296
294
|
|
|
297
295
|
def tsp_maxcut_streaming(G_func, nodes, k_neighbors=20, is_optimized=False, is_parallel=True, **kwargs):
|
|
298
296
|
n_qubits = len(nodes)
|
|
299
|
-
path,
|
|
297
|
+
path, _ = tsp_symmetric_streaming(G_func, nodes, k_neighbors=k_neighbors, is_parallel=is_parallel)
|
|
300
298
|
l, r, cut_value = tsp_to_maxcut_bipartition_streaming(path, G_func)
|
|
301
|
-
partition = (l, r)
|
|
302
299
|
|
|
303
300
|
if not is_optimized:
|
|
304
|
-
bitstring, energy = early_exit_streaming(G_func,
|
|
301
|
+
bitstring, energy = early_exit_streaming(G_func, (l, r), nodes)
|
|
305
302
|
|
|
306
|
-
return bitstring, cut_value,
|
|
303
|
+
return bitstring, cut_value, ([nodes[x] for x in l], [nodes[x] for x in r]), energy
|
|
307
304
|
|
|
308
305
|
bitint = 0
|
|
309
306
|
for b in partition[0]:
|
|
@@ -312,4 +309,4 @@ def tsp_maxcut_streaming(G_func, nodes, k_neighbors=20, is_optimized=False, is_p
|
|
|
312
309
|
bitstring, cut_value, cut, energy = spin_glass_solver_streaming(G_func, nodes, best_guess=bitint, **kwargs)
|
|
313
310
|
l, r = get_cut(bitstring, nodes)
|
|
314
311
|
|
|
315
|
-
return bitstring, cut_value, (l, r), energy
|
|
312
|
+
return bitstring, cut_value, ([nodes[x] for x in l], [nodes[x] for x in r]), energy
|
|
@@ -51,7 +51,7 @@ ext_modules = [CMakeExtension('tfim_sampler')]
|
|
|
51
51
|
|
|
52
52
|
setup(
|
|
53
53
|
name='pyqrackising',
|
|
54
|
-
version='7.5.
|
|
54
|
+
version='7.5.2',
|
|
55
55
|
author='Dan Strano',
|
|
56
56
|
author_email='stranoj@gmail.com',
|
|
57
57
|
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
|