PyQrackIsing 8.15.0__tar.gz → 8.15.1__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.15.0/pyqrackising.egg-info → pyqrackising-8.15.1}/PKG-INFO +1 -1
- {pyqrackising-8.15.0 → pyqrackising-8.15.1}/pyproject.toml +1 -1
- {pyqrackising-8.15.0 → pyqrackising-8.15.1}/pyqrackising/maxcut_tfim.py +1 -1
- {pyqrackising-8.15.0 → pyqrackising-8.15.1}/pyqrackising/maxcut_tfim_sparse.py +1 -1
- {pyqrackising-8.15.0 → pyqrackising-8.15.1}/pyqrackising/spin_glass_solver.py +13 -6
- {pyqrackising-8.15.0 → pyqrackising-8.15.1}/pyqrackising/spin_glass_solver_sparse.py +13 -6
- {pyqrackising-8.15.0 → pyqrackising-8.15.1/pyqrackising.egg-info}/PKG-INFO +1 -1
- {pyqrackising-8.15.0 → pyqrackising-8.15.1}/setup.py +1 -1
- {pyqrackising-8.15.0 → pyqrackising-8.15.1}/LICENSE.md +0 -0
- {pyqrackising-8.15.0 → pyqrackising-8.15.1}/MANIFEST.in +0 -0
- {pyqrackising-8.15.0 → pyqrackising-8.15.1}/README.md +0 -0
- {pyqrackising-8.15.0 → pyqrackising-8.15.1}/pyqrackising/__init__.py +0 -0
- {pyqrackising-8.15.0 → pyqrackising-8.15.1}/pyqrackising/convert_tensor_network_to_tsp.py +0 -0
- {pyqrackising-8.15.0 → pyqrackising-8.15.1}/pyqrackising/generate_tfim_samples.py +0 -0
- {pyqrackising-8.15.0 → pyqrackising-8.15.1}/pyqrackising/kernels.cl +0 -0
- {pyqrackising-8.15.0 → pyqrackising-8.15.1}/pyqrackising/maxcut_tfim_streaming.py +0 -0
- {pyqrackising-8.15.0 → pyqrackising-8.15.1}/pyqrackising/maxcut_tfim_util.py +0 -0
- {pyqrackising-8.15.0 → pyqrackising-8.15.1}/pyqrackising/spin_glass_solver_streaming.py +0 -0
- {pyqrackising-8.15.0 → pyqrackising-8.15.1}/pyqrackising/spin_glass_solver_util.py +0 -0
- {pyqrackising-8.15.0 → pyqrackising-8.15.1}/pyqrackising/tfim_magnetization.py +0 -0
- {pyqrackising-8.15.0 → pyqrackising-8.15.1}/pyqrackising/tfim_square_magnetization.py +0 -0
- {pyqrackising-8.15.0 → pyqrackising-8.15.1}/pyqrackising/tsp.py +0 -0
- {pyqrackising-8.15.0 → pyqrackising-8.15.1}/pyqrackising/tsp_maxcut.py +0 -0
- {pyqrackising-8.15.0 → pyqrackising-8.15.1}/pyqrackising.egg-info/SOURCES.txt +0 -0
- {pyqrackising-8.15.0 → pyqrackising-8.15.1}/pyqrackising.egg-info/dependency_links.txt +0 -0
- {pyqrackising-8.15.0 → pyqrackising-8.15.1}/pyqrackising.egg-info/not-zip-safe +0 -0
- {pyqrackising-8.15.0 → pyqrackising-8.15.1}/pyqrackising.egg-info/top_level.txt +0 -0
- {pyqrackising-8.15.0 → pyqrackising-8.15.1}/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.15.
|
|
13
|
+
version = "8.15.1"
|
|
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"}
|
|
@@ -252,7 +252,7 @@ def run_cut_opencl(best_energy, samples, G_m_buf, is_segmented, segment_size, is
|
|
|
252
252
|
best_x = np.argmax(max_energy_host)
|
|
253
253
|
energy = max_energy_host[best_x]
|
|
254
254
|
|
|
255
|
-
if energy
|
|
255
|
+
if energy <= best_energy:
|
|
256
256
|
# No improvement: we can exit early
|
|
257
257
|
return samples[0], max_energy_host[0]
|
|
258
258
|
|
|
@@ -266,7 +266,7 @@ def run_cut_opencl(best_energy, samples, G_data_buf, G_rows_buf, G_cols_buf, is_
|
|
|
266
266
|
best_x = np.argmax(max_energy_host)
|
|
267
267
|
energy = max_energy_host[best_x]
|
|
268
268
|
|
|
269
|
-
if energy
|
|
269
|
+
if energy <= best_energy:
|
|
270
270
|
# No improvement: we can exit early
|
|
271
271
|
return samples[0], max_energy_host[0]
|
|
272
272
|
|
|
@@ -65,7 +65,7 @@ def bootstrap(best_theta, G_m, indices_array, k, min_energy, dtype, is_spin_glas
|
|
|
65
65
|
return min_energy
|
|
66
66
|
|
|
67
67
|
|
|
68
|
-
def run_bootstrap_opencl(best_theta, G_m_buf, indices_array_np, k,
|
|
68
|
+
def run_bootstrap_opencl(best_theta, G_m_buf, indices_array_np, k, best_energy, is_segmented, local_size, global_size, args_buf, local_energy_buf, local_index_buf, max_energy_host, max_index_host, max_energy_buf, max_index_buf):
|
|
69
69
|
ctx = opencl_context.ctx
|
|
70
70
|
queue = opencl_context.queue
|
|
71
71
|
bootstrap_kernel = opencl_context.bootstrap_segmented_kernel if is_segmented else opencl_context.bootstrap_kernel
|
|
@@ -110,15 +110,22 @@ def run_bootstrap_opencl(best_theta, G_m_buf, indices_array_np, k, min_energy, i
|
|
|
110
110
|
|
|
111
111
|
# Read results
|
|
112
112
|
cl.enqueue_copy(queue, max_energy_host, max_energy_buf)
|
|
113
|
-
cl.enqueue_copy(queue, max_index_host, max_index_buf)
|
|
114
113
|
queue.finish()
|
|
115
114
|
|
|
115
|
+
# Queue read for results we might not need
|
|
116
|
+
cl.enqueue_copy(queue, max_index_host, max_index_buf)
|
|
117
|
+
|
|
116
118
|
# Find global minimum
|
|
117
|
-
|
|
118
|
-
|
|
119
|
+
best_x = np.argmax(max_energy_host)
|
|
120
|
+
energy = max_energy_host[best_x]
|
|
119
121
|
|
|
120
|
-
if
|
|
121
|
-
|
|
122
|
+
if energy <= best_energy:
|
|
123
|
+
# No improvement: we can exit early
|
|
124
|
+
return best_energy
|
|
125
|
+
|
|
126
|
+
# We need the best index
|
|
127
|
+
queue.finish()
|
|
128
|
+
best_i = max_index_host[best_x]
|
|
122
129
|
|
|
123
130
|
flip_index_start = best_i * k
|
|
124
131
|
indices_to_flip = indices_array_np[flip_index_start : flip_index_start + k]
|
|
@@ -70,7 +70,7 @@ def bootstrap(best_theta, G_data, G_rows, G_cols, indices_array, k, min_energy,
|
|
|
70
70
|
return min_energy
|
|
71
71
|
|
|
72
72
|
|
|
73
|
-
def run_bootstrap_opencl(best_theta, G_data_buf, G_rows_buf, G_cols_buf, indices_array_np, k,
|
|
73
|
+
def run_bootstrap_opencl(best_theta, G_data_buf, G_rows_buf, G_cols_buf, indices_array_np, k, best_energy, is_segmented, local_size, global_size, args_buf, local_energy_buf, local_index_buf, max_energy_host, max_index_host, max_energy_buf, max_index_buf):
|
|
74
74
|
ctx = opencl_context.ctx
|
|
75
75
|
queue = opencl_context.queue
|
|
76
76
|
bootstrap_kernel = opencl_context.bootstrap_sparse_segmented_kernel if is_segmented else opencl_context.bootstrap_sparse_kernel
|
|
@@ -119,15 +119,22 @@ def run_bootstrap_opencl(best_theta, G_data_buf, G_rows_buf, G_cols_buf, indices
|
|
|
119
119
|
|
|
120
120
|
# Read results
|
|
121
121
|
cl.enqueue_copy(queue, max_energy_host, max_energy_buf)
|
|
122
|
-
cl.enqueue_copy(queue, max_index_host, max_index_buf)
|
|
123
122
|
queue.finish()
|
|
124
123
|
|
|
124
|
+
# Queue read for results we might not need
|
|
125
|
+
cl.enqueue_copy(queue, max_index_host, max_index_buf)
|
|
126
|
+
|
|
125
127
|
# Find global minimum
|
|
126
|
-
|
|
127
|
-
|
|
128
|
+
best_x = np.argmax(max_energy_host)
|
|
129
|
+
energy = max_energy_host[best_x]
|
|
128
130
|
|
|
129
|
-
if
|
|
130
|
-
|
|
131
|
+
if energy <= best_energy:
|
|
132
|
+
# No improvement: we can exit early
|
|
133
|
+
return best_energy
|
|
134
|
+
|
|
135
|
+
# We need the best index
|
|
136
|
+
queue.finish()
|
|
137
|
+
best_i = max_index_host[best_x]
|
|
131
138
|
|
|
132
139
|
flip_index_start = best_i * k
|
|
133
140
|
indices_to_flip = indices_array_np[flip_index_start : flip_index_start + k]
|
|
@@ -7,7 +7,7 @@ with open(README_PATH) as readme_file:
|
|
|
7
7
|
|
|
8
8
|
setup(
|
|
9
9
|
name='pyqrackising',
|
|
10
|
-
version='8.15.
|
|
10
|
+
version='8.15.1',
|
|
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
|