PyQrackIsing 6.3.0__tar.gz → 7.0.0__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-6.3.0/pyqrackising.egg-info → pyqrackising-7.0.0}/PKG-INFO +1 -1
- {pyqrackising-6.3.0 → pyqrackising-7.0.0}/pyproject.toml +1 -1
- {pyqrackising-6.3.0 → pyqrackising-7.0.0}/pyqrackising/maxcut_tfim_streaming.py +28 -29
- {pyqrackising-6.3.0 → pyqrackising-7.0.0}/pyqrackising/spin_glass_solver.py +4 -2
- {pyqrackising-6.3.0 → pyqrackising-7.0.0}/pyqrackising/spin_glass_solver_sparse.py +4 -2
- {pyqrackising-6.3.0 → pyqrackising-7.0.0}/pyqrackising/spin_glass_solver_streaming.py +17 -16
- {pyqrackising-6.3.0 → pyqrackising-7.0.0/pyqrackising.egg-info}/PKG-INFO +1 -1
- {pyqrackising-6.3.0 → pyqrackising-7.0.0}/setup.py +1 -1
- {pyqrackising-6.3.0 → pyqrackising-7.0.0}/CMakeLists.txt +0 -0
- {pyqrackising-6.3.0 → pyqrackising-7.0.0}/LICENSE.md +0 -0
- {pyqrackising-6.3.0 → pyqrackising-7.0.0}/MANIFEST.in +0 -0
- {pyqrackising-6.3.0 → pyqrackising-7.0.0}/README.md +0 -0
- {pyqrackising-6.3.0 → pyqrackising-7.0.0}/pyqrackising/__init__.py +0 -0
- {pyqrackising-6.3.0 → pyqrackising-7.0.0}/pyqrackising/_pyqrack_ising.cpp +0 -0
- {pyqrackising-6.3.0 → pyqrackising-7.0.0}/pyqrackising/convert_tensor_network_to_tsp.py +0 -0
- {pyqrackising-6.3.0 → pyqrackising-7.0.0}/pyqrackising/generate_tfim_samples.py +0 -0
- {pyqrackising-6.3.0 → pyqrackising-7.0.0}/pyqrackising/kernels.cl +0 -0
- {pyqrackising-6.3.0 → pyqrackising-7.0.0}/pyqrackising/maxcut_tfim.py +0 -0
- {pyqrackising-6.3.0 → pyqrackising-7.0.0}/pyqrackising/maxcut_tfim_sparse.py +0 -0
- {pyqrackising-6.3.0 → pyqrackising-7.0.0}/pyqrackising/maxcut_tfim_util.py +0 -0
- {pyqrackising-6.3.0 → pyqrackising-7.0.0}/pyqrackising/spin_glass_solver_util.py +0 -0
- {pyqrackising-6.3.0 → pyqrackising-7.0.0}/pyqrackising/tfim_magnetization.py +0 -0
- {pyqrackising-6.3.0 → pyqrackising-7.0.0}/pyqrackising/tfim_square_magnetization.py +0 -0
- {pyqrackising-6.3.0 → pyqrackising-7.0.0}/pyqrackising/tsp.py +0 -0
- {pyqrackising-6.3.0 → pyqrackising-7.0.0}/pyqrackising.egg-info/SOURCES.txt +0 -0
- {pyqrackising-6.3.0 → pyqrackising-7.0.0}/pyqrackising.egg-info/dependency_links.txt +0 -0
- {pyqrackising-6.3.0 → pyqrackising-7.0.0}/pyqrackising.egg-info/not-zip-safe +0 -0
- {pyqrackising-6.3.0 → pyqrackising-7.0.0}/pyqrackising.egg-info/top_level.txt +0 -0
- {pyqrackising-6.3.0 → pyqrackising-7.0.0}/setup.cfg +0 -0
|
@@ -12,7 +12,7 @@ build-backend = "setuptools.build_meta"
|
|
|
12
12
|
|
|
13
13
|
[project]
|
|
14
14
|
name = "pyqrackising"
|
|
15
|
-
version = "
|
|
15
|
+
version = "7.0.0"
|
|
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"}
|
|
@@ -14,7 +14,7 @@ except ImportError:
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
@njit
|
|
17
|
-
def update_repulsion_choice(G_func,
|
|
17
|
+
def update_repulsion_choice(G_func, nodes, max_weight, weights, n, used, node):
|
|
18
18
|
# Select node
|
|
19
19
|
used[node] = True
|
|
20
20
|
|
|
@@ -22,12 +22,12 @@ def update_repulsion_choice(G_func, G_func_args_tuple, nodes, max_weight, weight
|
|
|
22
22
|
for nbr in range(n):
|
|
23
23
|
if used[nbr]:
|
|
24
24
|
continue
|
|
25
|
-
weights[nbr] *= max(1.1920928955078125e-7, 1 - G_func(
|
|
25
|
+
weights[nbr] *= max(1.1920928955078125e-7, 1 - G_func(nodes[node], nodes[nbr]) / max_weight)
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
# Written by Elara (OpenAI custom GPT) and improved by Dan Strano
|
|
29
29
|
@njit
|
|
30
|
-
def local_repulsion_choice(G_func,
|
|
30
|
+
def local_repulsion_choice(G_func, nodes, max_weight, weights, n, m, shot):
|
|
31
31
|
"""
|
|
32
32
|
Pick m nodes out of n with repulsion bias:
|
|
33
33
|
- High-degree nodes are already less likely
|
|
@@ -40,7 +40,7 @@ def local_repulsion_choice(G_func, G_func_args_tuple, nodes, max_weight, weights
|
|
|
40
40
|
used = np.zeros(n, dtype=np.bool_) # False = available, True = used
|
|
41
41
|
|
|
42
42
|
# Update answer and weights
|
|
43
|
-
update_repulsion_choice(G_func,
|
|
43
|
+
update_repulsion_choice(G_func, nodes, max_weight, weights, n, used, shot % n)
|
|
44
44
|
|
|
45
45
|
for _ in range(1, m):
|
|
46
46
|
# Count available
|
|
@@ -71,23 +71,24 @@ def local_repulsion_choice(G_func, G_func_args_tuple, nodes, max_weight, weights
|
|
|
71
71
|
used[node] = True
|
|
72
72
|
|
|
73
73
|
# Update answer and weights
|
|
74
|
-
update_repulsion_choice(G_func,
|
|
74
|
+
update_repulsion_choice(G_func, nodes, max_weight, weights, n, used, node)
|
|
75
75
|
|
|
76
76
|
return used
|
|
77
77
|
|
|
78
78
|
|
|
79
79
|
@njit
|
|
80
|
-
def compute_energy(sample, G_func,
|
|
80
|
+
def compute_energy(sample, G_func, nodes, n_qubits):
|
|
81
81
|
energy = 0
|
|
82
82
|
for u in range(n_qubits):
|
|
83
83
|
for v in range(u + 1, n_qubits):
|
|
84
|
-
|
|
84
|
+
val = G_func(nodes[u], nodes[v])
|
|
85
|
+
energy += val if sample[u] == sample[v] else -val
|
|
85
86
|
|
|
86
87
|
return energy
|
|
87
88
|
|
|
88
89
|
|
|
89
90
|
@njit(parallel=True)
|
|
90
|
-
def sample_for_solution(G_func,
|
|
91
|
+
def sample_for_solution(G_func, nodes, max_weight, shots, thresholds, degrees_sum, weights, n, dtype):
|
|
91
92
|
solutions = np.empty((shots, n), dtype=np.bool_)
|
|
92
93
|
energies = np.empty(shots, dtype=dtype)
|
|
93
94
|
|
|
@@ -100,10 +101,10 @@ def sample_for_solution(G_func, G_func_args_tuple, nodes, max_weight, shots, thr
|
|
|
100
101
|
m += 1
|
|
101
102
|
|
|
102
103
|
# Second dimension: permutation within Hamming weight
|
|
103
|
-
sample = local_repulsion_choice(G_func,
|
|
104
|
+
sample = local_repulsion_choice(G_func, nodes, max_weight, weights, n, m, s)
|
|
104
105
|
|
|
105
106
|
solutions[s] = sample
|
|
106
|
-
energies[s] = compute_energy(sample, G_func,
|
|
107
|
+
energies[s] = compute_energy(sample, G_func, nodes, n)
|
|
107
108
|
|
|
108
109
|
best_solution = solutions[np.argmin(energies)]
|
|
109
110
|
|
|
@@ -111,13 +112,13 @@ def sample_for_solution(G_func, G_func_args_tuple, nodes, max_weight, shots, thr
|
|
|
111
112
|
for u in range(n):
|
|
112
113
|
for v in range(u + 1, n):
|
|
113
114
|
if best_solution[u] != best_solution[v]:
|
|
114
|
-
best_value += G_func(
|
|
115
|
+
best_value += G_func(nodes[u], nodes[v])
|
|
115
116
|
|
|
116
117
|
return best_solution, best_value
|
|
117
118
|
|
|
118
119
|
|
|
119
120
|
@njit(parallel=True)
|
|
120
|
-
def init_J_and_z(G_func,
|
|
121
|
+
def init_J_and_z(G_func, nodes, dtype):
|
|
121
122
|
n_qubits = len(nodes)
|
|
122
123
|
degrees = np.empty(n_qubits, dtype=np.uint32)
|
|
123
124
|
J_eff = np.empty(n_qubits, dtype=dtype)
|
|
@@ -127,10 +128,10 @@ def init_J_and_z(G_func, G_func_args_tuple, nodes, dtype):
|
|
|
127
128
|
degree = 0
|
|
128
129
|
J = 0.0
|
|
129
130
|
for m in range(n_qubits):
|
|
130
|
-
val = G_func(
|
|
131
|
+
val = G_func(nodes[n], nodes[m])
|
|
131
132
|
if val != 0.0:
|
|
132
133
|
degree += 1
|
|
133
|
-
|
|
134
|
+
J += val
|
|
134
135
|
G_max = max(val, G_max)
|
|
135
136
|
J = -J / degree if degree > 0 else 0
|
|
136
137
|
degrees[n] = degree
|
|
@@ -143,8 +144,8 @@ def init_J_and_z(G_func, G_func_args_tuple, nodes, dtype):
|
|
|
143
144
|
|
|
144
145
|
|
|
145
146
|
@njit
|
|
146
|
-
def cpu_footer(shots, quality, n_qubits, G_func,
|
|
147
|
-
J_eff, degrees, G_max = init_J_and_z(G_func,
|
|
147
|
+
def cpu_footer(shots, quality, n_qubits, G_func, nodes, dtype):
|
|
148
|
+
J_eff, degrees, G_max = init_J_and_z(G_func, nodes, dtype)
|
|
148
149
|
hamming_prob = init_thresholds(n_qubits, dtype)
|
|
149
150
|
|
|
150
151
|
maxcut_hamming_cdf(n_qubits, J_eff, degrees, quality, hamming_prob, dtype)
|
|
@@ -153,7 +154,7 @@ def cpu_footer(shots, quality, n_qubits, G_func, G_func_args_tuple, nodes, dtype
|
|
|
153
154
|
degrees = None
|
|
154
155
|
J_eff = 1.0 / (1.0 + (2 ** -52) - J_eff)
|
|
155
156
|
|
|
156
|
-
best_solution, best_value = sample_for_solution(G_func,
|
|
157
|
+
best_solution, best_value = sample_for_solution(G_func, nodes, G_max, shots, hamming_prob, max_weight, J_eff, n_qubits, dtype)
|
|
157
158
|
|
|
158
159
|
bit_string, l, r = get_cut(best_solution, nodes)
|
|
159
160
|
|
|
@@ -161,10 +162,10 @@ def cpu_footer(shots, quality, n_qubits, G_func, G_func_args_tuple, nodes, dtype
|
|
|
161
162
|
|
|
162
163
|
|
|
163
164
|
@njit
|
|
164
|
-
def gpu_footer(shots, n_qubits, G_func,
|
|
165
|
+
def gpu_footer(shots, n_qubits, G_func, nodes, G_max, weights, degrees, hamming_prob, max_weight, dtype):
|
|
165
166
|
fix_cdf(hamming_prob)
|
|
166
167
|
|
|
167
|
-
best_solution, best_value = sample_for_solution(G_func,
|
|
168
|
+
best_solution, best_value = sample_for_solution(G_func, nodes, G_max, shots, hamming_prob, max_weight, weights, n_qubits, dtype)
|
|
168
169
|
|
|
169
170
|
bit_string, l, r = get_cut(best_solution, nodes)
|
|
170
171
|
|
|
@@ -174,12 +175,12 @@ def gpu_footer(shots, n_qubits, G_func, G_func_args_tuple, nodes, G_max, weights
|
|
|
174
175
|
def maxcut_tfim_streaming(
|
|
175
176
|
G_func,
|
|
176
177
|
nodes,
|
|
177
|
-
G_func_args_tuple=None,
|
|
178
178
|
quality=None,
|
|
179
179
|
shots=None,
|
|
180
180
|
is_base_maxcut_gpu=True
|
|
181
181
|
):
|
|
182
182
|
dtype = opencl_context.dtype
|
|
183
|
+
wgs = opencl_context.work_group_size
|
|
183
184
|
n_qubits = len(nodes)
|
|
184
185
|
|
|
185
186
|
if n_qubits < 3:
|
|
@@ -190,7 +191,7 @@ def maxcut_tfim_streaming(
|
|
|
190
191
|
return "0", 0, (nodes, [])
|
|
191
192
|
|
|
192
193
|
if n_qubits == 2:
|
|
193
|
-
weight = G_func(
|
|
194
|
+
weight = G_func(nodes[0], nodes[1])
|
|
194
195
|
if weight < 0.0:
|
|
195
196
|
return "00", 0, (nodes, [])
|
|
196
197
|
|
|
@@ -206,10 +207,10 @@ def maxcut_tfim_streaming(
|
|
|
206
207
|
n_steps = n_qubits << quality
|
|
207
208
|
grid_size = n_steps * n_qubits
|
|
208
209
|
|
|
209
|
-
if (not is_base_maxcut_gpu) or not
|
|
210
|
-
return cpu_footer(shots, quality, n_qubits, G_func,
|
|
210
|
+
if (not is_base_maxcut_gpu) or (not IS_OPENCL_AVAILABLE):
|
|
211
|
+
return cpu_footer(shots, quality, n_qubits, G_func, nodes, dtype)
|
|
211
212
|
|
|
212
|
-
J_eff, degrees, G_max = init_J_and_z(G_func,
|
|
213
|
+
J_eff, degrees, G_max = init_J_and_z(G_func, nodes, dtype)
|
|
213
214
|
|
|
214
215
|
delta_t = 1.0 / n_steps
|
|
215
216
|
tot_t = 2.0 * n_steps * delta_t
|
|
@@ -228,7 +229,7 @@ def maxcut_tfim_streaming(
|
|
|
228
229
|
theta_buf = cl.Buffer(opencl_context.ctx, mf.READ_WRITE, size=(n_qubits * 4))
|
|
229
230
|
|
|
230
231
|
# Warp size is 32:
|
|
231
|
-
group_size = min(
|
|
232
|
+
group_size = min(wgs, n_qubits)
|
|
232
233
|
global_size = ((n_qubits + group_size - 1) // group_size) * group_size
|
|
233
234
|
|
|
234
235
|
opencl_context.init_theta_kernel(
|
|
@@ -239,9 +240,7 @@ def maxcut_tfim_streaming(
|
|
|
239
240
|
hamming_prob = init_thresholds(n_qubits, dtype)
|
|
240
241
|
|
|
241
242
|
# Warp size is 32:
|
|
242
|
-
group_size = n_qubits - 1
|
|
243
|
-
if group_size > 256:
|
|
244
|
-
group_size = 256
|
|
243
|
+
group_size = min(wgs, n_qubits - 1)
|
|
245
244
|
grid_dim = n_steps * n_qubits * group_size
|
|
246
245
|
|
|
247
246
|
# Move to GPU
|
|
@@ -271,4 +270,4 @@ def maxcut_tfim_streaming(
|
|
|
271
270
|
degrees = None
|
|
272
271
|
J_eff = 1.0 / (1.0 + (2 ** -52) - J_eff)
|
|
273
272
|
|
|
274
|
-
return gpu_footer(shots, n_qubits, G_func,
|
|
273
|
+
return gpu_footer(shots, n_qubits, G_func, nodes, G_max, J_eff, degrees, hamming_prob, max_weight, dtype)
|
|
@@ -143,7 +143,9 @@ def run_bootstrap_opencl(best_theta, G_m_buf, indices_array_np, k, min_energy, i
|
|
|
143
143
|
if min_energy < energy:
|
|
144
144
|
return min_energy
|
|
145
145
|
|
|
146
|
-
|
|
146
|
+
atol = dtype(1.1920928955078125e-7)
|
|
147
|
+
rtol = dtype(0)
|
|
148
|
+
choices = np.where(np.isclose(min_energy_host, energy, atol=atol, rtol=rtol))[0]
|
|
147
149
|
best_i = np.random.choice(choices) if len(choices) else np.argmin(min_energy_host)
|
|
148
150
|
|
|
149
151
|
flip_index_start = best_i * k
|
|
@@ -152,7 +154,7 @@ def run_bootstrap_opencl(best_theta, G_m_buf, indices_array_np, k, min_energy, i
|
|
|
152
154
|
for i in indices_to_flip:
|
|
153
155
|
best_theta[i] = not best_theta[i]
|
|
154
156
|
|
|
155
|
-
return
|
|
157
|
+
return min_energy_host[best_i]
|
|
156
158
|
|
|
157
159
|
|
|
158
160
|
def spin_glass_solver(
|
|
@@ -150,7 +150,9 @@ def run_bootstrap_opencl(best_theta, G_data_buf, G_rows_buf, G_cols_buf, indices
|
|
|
150
150
|
if min_energy < energy:
|
|
151
151
|
return min_energy
|
|
152
152
|
|
|
153
|
-
|
|
153
|
+
atol = dtype(1.1920928955078125e-7)
|
|
154
|
+
rtol = dtype(0)
|
|
155
|
+
choices = np.where(np.isclose(min_energy_host, energy, atol=atol, rtol=rtol))[0]
|
|
154
156
|
best_i = np.random.choice(choices) if len(choices) else np.argmin(min_energy_host)
|
|
155
157
|
|
|
156
158
|
flip_index_start = best_i * k
|
|
@@ -159,7 +161,7 @@ def run_bootstrap_opencl(best_theta, G_data_buf, G_rows_buf, G_cols_buf, indices
|
|
|
159
161
|
for i in indices_to_flip:
|
|
160
162
|
best_theta[i] = not best_theta[i]
|
|
161
163
|
|
|
162
|
-
return
|
|
164
|
+
return min_energy_host[best_i]
|
|
163
165
|
|
|
164
166
|
|
|
165
167
|
def to_scipy_sparse_upper_triangular(G, nodes, n_nodes, dtype):
|
|
@@ -9,52 +9,54 @@ import os
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
@njit
|
|
12
|
-
def evaluate_cut_edges(theta_bits, G_func,
|
|
12
|
+
def evaluate_cut_edges(theta_bits, G_func, nodes):
|
|
13
13
|
n_qubits = len(nodes)
|
|
14
14
|
cut = 0
|
|
15
15
|
for u in range(n_qubits):
|
|
16
16
|
for v in range(u + 1, n_qubits):
|
|
17
17
|
if theta_bits[u] != theta_bits[v]:
|
|
18
|
-
cut += G_func(
|
|
18
|
+
cut += G_func(nodes[u], nodes[v])
|
|
19
19
|
|
|
20
20
|
return cut
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
@njit
|
|
24
|
-
def compute_energy(theta_bits, G_func,
|
|
24
|
+
def compute_energy(theta_bits, G_func, nodes):
|
|
25
25
|
n_qubits = len(nodes)
|
|
26
26
|
energy = 0
|
|
27
27
|
for u in range(n_qubits):
|
|
28
28
|
for v in range(u + 1, n_qubits):
|
|
29
|
-
val = G_func(
|
|
29
|
+
val = G_func(nodes[u], nodes[v])
|
|
30
30
|
energy += (val if theta_bits[u] == theta_bits[v] else -val)
|
|
31
31
|
|
|
32
32
|
return energy
|
|
33
33
|
|
|
34
34
|
|
|
35
35
|
@njit
|
|
36
|
-
def bootstrap_worker(theta, G_func,
|
|
36
|
+
def bootstrap_worker(theta, G_func, nodes, indices):
|
|
37
37
|
local_theta = theta.copy()
|
|
38
38
|
for i in indices:
|
|
39
39
|
local_theta[i] = not local_theta[i]
|
|
40
|
-
energy = compute_energy(local_theta, G_func,
|
|
40
|
+
energy = compute_energy(local_theta, G_func, nodes)
|
|
41
41
|
|
|
42
42
|
return energy
|
|
43
43
|
|
|
44
44
|
|
|
45
45
|
@njit(parallel=True)
|
|
46
|
-
def bootstrap(best_theta, G_func,
|
|
46
|
+
def bootstrap(best_theta, G_func, nodes, indices_array, k, min_energy, dtype):
|
|
47
47
|
n = len(indices_array) // k
|
|
48
48
|
energies = np.empty(n, dtype=dtype)
|
|
49
49
|
for i in prange(n):
|
|
50
50
|
j = i * k
|
|
51
|
-
energies[i] = bootstrap_worker(best_theta, G_func,
|
|
51
|
+
energies[i] = bootstrap_worker(best_theta, G_func, nodes, indices_array[j : j + k])
|
|
52
52
|
|
|
53
53
|
energy = energies.min()
|
|
54
54
|
if energy < min_energy:
|
|
55
|
-
|
|
55
|
+
atol = dtype(1.1920928955078125e-7)
|
|
56
|
+
rtol = dtype(0)
|
|
57
|
+
index_match = np.random.choice(np.where(np.isclose(energies, energy, atol=atol, rtol=rtol))[0])
|
|
56
58
|
indices = indices_array[(index_match * k) : ((index_match + 1) * k)]
|
|
57
|
-
min_energy =
|
|
59
|
+
min_energy = energies[index_match]
|
|
58
60
|
for i in indices:
|
|
59
61
|
best_theta[i] = not best_theta[i]
|
|
60
62
|
|
|
@@ -64,7 +66,6 @@ def bootstrap(best_theta, G_func, G_func_args_tuple, nodes, indices_array, k, mi
|
|
|
64
66
|
def spin_glass_solver_streaming(
|
|
65
67
|
G_func,
|
|
66
68
|
nodes,
|
|
67
|
-
G_func_args_tuple=None,
|
|
68
69
|
quality=None,
|
|
69
70
|
shots=None,
|
|
70
71
|
best_guess=None,
|
|
@@ -81,7 +82,7 @@ def spin_glass_solver_streaming(
|
|
|
81
82
|
return "0", 0, (nodes, []), 0
|
|
82
83
|
|
|
83
84
|
if n_qubits == 2:
|
|
84
|
-
weight = G_func(
|
|
85
|
+
weight = G_func(nodes[0], nodes[1])
|
|
85
86
|
if weight < 0.0:
|
|
86
87
|
return "00", 0, (nodes, []), weight
|
|
87
88
|
|
|
@@ -98,10 +99,10 @@ def spin_glass_solver_streaming(
|
|
|
98
99
|
elif isinstance(best_guess, list):
|
|
99
100
|
bitstring = "".join(["1" if b else "0" for b in best_guess])
|
|
100
101
|
else:
|
|
101
|
-
bitstring, _, _ = maxcut_tfim_streaming(G_func, nodes,
|
|
102
|
+
bitstring, _, _ = maxcut_tfim_streaming(G_func, nodes, quality=quality, shots=shots, is_base_maxcut_gpu=is_base_maxcut_gpu)
|
|
102
103
|
best_theta = np.array([b == "1" for b in list(bitstring)], dtype=np.bool_)
|
|
103
104
|
|
|
104
|
-
min_energy = compute_energy(best_theta, G_func,
|
|
105
|
+
min_energy = compute_energy(best_theta, G_func, nodes)
|
|
105
106
|
improved = True
|
|
106
107
|
correction_quality = 1
|
|
107
108
|
combos_list = []
|
|
@@ -121,7 +122,7 @@ def spin_glass_solver_streaming(
|
|
|
121
122
|
else:
|
|
122
123
|
combos = combos_list[k - 1]
|
|
123
124
|
|
|
124
|
-
energy = bootstrap(best_theta, G_func,
|
|
125
|
+
energy = bootstrap(best_theta, G_func, nodes, combos, k, min_energy, dtype)
|
|
125
126
|
|
|
126
127
|
if energy < min_energy:
|
|
127
128
|
min_energy = energy
|
|
@@ -133,6 +134,6 @@ def spin_glass_solver_streaming(
|
|
|
133
134
|
k = k + 1
|
|
134
135
|
|
|
135
136
|
bitstring, l, r = get_cut_from_bit_array(best_theta, nodes)
|
|
136
|
-
cut_value = evaluate_cut_edges(best_theta, G_func,
|
|
137
|
+
cut_value = evaluate_cut_edges(best_theta, G_func, nodes)
|
|
137
138
|
|
|
138
139
|
return bitstring, float(cut_value), (l, r), float(min_energy)
|
|
@@ -51,7 +51,7 @@ ext_modules = [CMakeExtension('tfim_sampler')]
|
|
|
51
51
|
|
|
52
52
|
setup(
|
|
53
53
|
name='pyqrackising',
|
|
54
|
-
version='
|
|
54
|
+
version='7.0.0',
|
|
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
|