PyQrackIsing 9.2.1__py3-none-win_amd64.whl → 9.2.2__py3-none-win_amd64.whl
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/spin_glass_solver.py +16 -6
- pyqrackising/spin_glass_solver_sparse.py +16 -6
- pyqrackising/spin_glass_solver_streaming.py +16 -6
- {pyqrackising-9.2.1.dist-info → pyqrackising-9.2.2.dist-info}/METADATA +1 -1
- {pyqrackising-9.2.1.dist-info → pyqrackising-9.2.2.dist-info}/RECORD +8 -8
- {pyqrackising-9.2.1.dist-info → pyqrackising-9.2.2.dist-info}/WHEEL +0 -0
- {pyqrackising-9.2.1.dist-info → pyqrackising-9.2.2.dist-info}/licenses/LICENSE.md +0 -0
- {pyqrackising-9.2.1.dist-info → pyqrackising-9.2.2.dist-info}/top_level.txt +0 -0
|
@@ -150,22 +150,32 @@ def run_gray_optimization(best_theta, iterators, gray_iterations, thread_count,
|
|
|
150
150
|
|
|
151
151
|
if is_spin_glass:
|
|
152
152
|
for i in prange(thread_count):
|
|
153
|
-
iterator = iterators[i]
|
|
153
|
+
iterator = iterators[i].copy()
|
|
154
|
+
best_energy, best_iterator = -float("inf"), iterator.copy()
|
|
154
155
|
for curr_idx in range(thread_iterations):
|
|
155
156
|
for block in range(blocks):
|
|
156
157
|
gray_code_next(iterator, curr_idx, block * 64)
|
|
157
158
|
energy = compute_energy(iterator, G_m, n)
|
|
158
|
-
if energy >
|
|
159
|
-
|
|
159
|
+
if energy > best_energy:
|
|
160
|
+
best_iterator, best_energy = iterator.copy(), energy
|
|
161
|
+
else:
|
|
162
|
+
iterator = best_iterator.copy()
|
|
163
|
+
if best_energy > energies[i]:
|
|
164
|
+
states[i], energies[i] = best_iterator.copy(), best_energy
|
|
160
165
|
else:
|
|
161
166
|
for i in prange(thread_count):
|
|
162
|
-
iterator = iterators[i]
|
|
167
|
+
iterator = iterators[i].copy()
|
|
168
|
+
best_energy, best_iterator = -float("inf"), iterator.copy()
|
|
163
169
|
for curr_idx in range(thread_iterations):
|
|
164
170
|
for block in range(blocks):
|
|
165
171
|
gray_code_next(iterator, curr_idx, block * 64)
|
|
166
172
|
energy = compute_cut(iterator, G_m, n)
|
|
167
|
-
if energy >
|
|
168
|
-
|
|
173
|
+
if energy > best_energy:
|
|
174
|
+
best_iterator, best_energy = iterator.copy(), energy
|
|
175
|
+
else:
|
|
176
|
+
iterator = best_iterator.copy()
|
|
177
|
+
if best_energy > energies[i]:
|
|
178
|
+
states[i], energies[i] = best_iterator.copy(), best_energy
|
|
169
179
|
|
|
170
180
|
best_index = np.argmax(energies)
|
|
171
181
|
best_energy = energies[best_index]
|
|
@@ -150,22 +150,32 @@ def run_gray_optimization(best_theta, iterators, gray_iterations, thread_count,
|
|
|
150
150
|
|
|
151
151
|
if is_spin_glass:
|
|
152
152
|
for i in prange(thread_count):
|
|
153
|
-
iterator = iterators[i]
|
|
153
|
+
iterator = iterators[i].copy()
|
|
154
|
+
best_energy, best_iterator = -float("inf"), iterator.copy()
|
|
154
155
|
for curr_idx in range(thread_iterations):
|
|
155
156
|
for block in range(blocks):
|
|
156
157
|
gray_code_next(iterator, curr_idx, block * 64)
|
|
157
158
|
energy = compute_energy_sparse(iterator, G_data, G_rows, G_cols, n)
|
|
158
|
-
if energy >
|
|
159
|
-
|
|
159
|
+
if energy > best_energy:
|
|
160
|
+
best_iterator, best_energy = iterator.copy(), energy
|
|
161
|
+
else:
|
|
162
|
+
iterator = best_iterator.copy()
|
|
163
|
+
if best_energy > energies[i]:
|
|
164
|
+
states[i], energies[i] = best_iterator.copy(), best_energy
|
|
160
165
|
else:
|
|
161
166
|
for i in prange(thread_count):
|
|
162
|
-
iterator = iterators[i]
|
|
167
|
+
iterator = iterators[i].copy()
|
|
168
|
+
best_energy, best_iterator = -float("inf"), iterator.copy()
|
|
163
169
|
for curr_idx in range(thread_iterations):
|
|
164
170
|
for block in range(blocks):
|
|
165
171
|
gray_code_next(iterator, curr_idx, block * 64)
|
|
166
172
|
energy = compute_cut_sparse(iterator, G_data, G_rows, G_cols, n)
|
|
167
|
-
if energy >
|
|
168
|
-
|
|
173
|
+
if energy > best_energy:
|
|
174
|
+
best_iterator, best_energy = iterator.copy(), energy
|
|
175
|
+
else:
|
|
176
|
+
iterator = best_iterator.copy()
|
|
177
|
+
if best_energy > energies[i]:
|
|
178
|
+
states[i], energies[i] = best_iterator.copy(), best_energy
|
|
169
179
|
|
|
170
180
|
best_index = np.argmax(energies)
|
|
171
181
|
best_energy = energies[best_index]
|
|
@@ -142,22 +142,32 @@ def run_gray_optimization(best_theta, iterators, gray_iterations, thread_count,
|
|
|
142
142
|
|
|
143
143
|
if is_spin_glass:
|
|
144
144
|
for i in prange(thread_count):
|
|
145
|
-
iterator = iterators[i]
|
|
145
|
+
iterator = iterators[i].copy()
|
|
146
|
+
best_energy, best_iterator = -float("inf"), iterator.copy()
|
|
146
147
|
for curr_idx in range(thread_iterations):
|
|
147
148
|
for block in range(blocks):
|
|
148
149
|
gray_code_next(iterator, curr_idx, block * 64)
|
|
149
150
|
energy = compute_energy_streaming(iterator, G_func, nodes, n)
|
|
150
|
-
if energy >
|
|
151
|
-
|
|
151
|
+
if energy > best_energy:
|
|
152
|
+
best_iterator, best_energy = iterator.copy(), energy
|
|
153
|
+
else:
|
|
154
|
+
iterator = best_iterator.copy()
|
|
155
|
+
if best_energy > energies[i]:
|
|
156
|
+
states[i], energies[i] = best_iterator.copy(), best_energy
|
|
152
157
|
else:
|
|
153
158
|
for i in prange(thread_count):
|
|
154
|
-
iterator = iterators[i]
|
|
159
|
+
iterator = iterators[i].copy()
|
|
160
|
+
best_energy, best_iterator = -float("inf"), iterator.copy()
|
|
155
161
|
for curr_idx in range(thread_iterations):
|
|
156
162
|
for block in range(blocks):
|
|
157
163
|
gray_code_next(iterator, curr_idx, block * 64)
|
|
158
164
|
energy = compute_cut_streaming(iterator, G_func, nodes, n)
|
|
159
|
-
if energy >
|
|
160
|
-
|
|
165
|
+
if energy > best_energy:
|
|
166
|
+
best_iterator, best_energy = iterator.copy(), energy
|
|
167
|
+
else:
|
|
168
|
+
iterator = best_iterator.copy()
|
|
169
|
+
if best_energy > energies[i]:
|
|
170
|
+
states[i], energies[i] = best_iterator.copy(), best_energy
|
|
161
171
|
|
|
162
172
|
best_index = np.argmax(energies)
|
|
163
173
|
best_energy = energies[best_index]
|
|
@@ -6,15 +6,15 @@ pyqrackising/maxcut_tfim.py,sha256=U1nNjyfMS48TtTQk7TRf5_VF3pVPfAcZEa2awc2nR8k,1
|
|
|
6
6
|
pyqrackising/maxcut_tfim_sparse.py,sha256=eenJNSEwRvgwACfKoH0tj6rpn7uqH6nNTBuxUPh_lDg,11941
|
|
7
7
|
pyqrackising/maxcut_tfim_streaming.py,sha256=FkBsRoXSRhv4gUeN9O7Ivx54oxq_SqiCDKnYsyxU4bs,6664
|
|
8
8
|
pyqrackising/maxcut_tfim_util.py,sha256=2-tJrBMe7A5hjY-Q1rQKm6PHJfFOgL5WpPGhKndIf_Y,16856
|
|
9
|
-
pyqrackising/spin_glass_solver.py,sha256=
|
|
10
|
-
pyqrackising/spin_glass_solver_sparse.py,sha256=
|
|
11
|
-
pyqrackising/spin_glass_solver_streaming.py,sha256=
|
|
9
|
+
pyqrackising/spin_glass_solver.py,sha256=9uHx-zLkiq5yGT72SwIZiHghNm-kgH3UUlLnqAxXC0Y,13131
|
|
10
|
+
pyqrackising/spin_glass_solver_sparse.py,sha256=kU8u5ktygUSoF0VbNk71kjJD-weHnJmRV8wCqj5K7ws,13969
|
|
11
|
+
pyqrackising/spin_glass_solver_streaming.py,sha256=nvCPfdtOoufx8l5LWUm12vPbJ0BQrcAU3QYdNhlzC2I,9729
|
|
12
12
|
pyqrackising/tfim_magnetization.py,sha256=On1MhCNGGHRxJFRmCOpMcdqQJiy25gWkjz0Ka8i5f-Q,499
|
|
13
13
|
pyqrackising/tfim_square_magnetization.py,sha256=9uJCT8ytyufcGFrZiignjCkWJr9UcP44sAAy0BIBw34,531
|
|
14
14
|
pyqrackising/tsp.py,sha256=En1Dw66gSi1wit627jI_eKuZMlFNTJU5T3TKZ1R05eE,64231
|
|
15
15
|
pyqrackising/tsp_maxcut.py,sha256=lEDruz5lhjVu0ufvH5VaMJW3_nohO-rEijJJabEtuSU,10084
|
|
16
|
-
pyqrackising-9.2.
|
|
17
|
-
pyqrackising-9.2.
|
|
18
|
-
pyqrackising-9.2.
|
|
19
|
-
pyqrackising-9.2.
|
|
20
|
-
pyqrackising-9.2.
|
|
16
|
+
pyqrackising-9.2.2.dist-info/licenses/LICENSE.md,sha256=fTqV5eBpeAZO0_jit8j4Ref9ikBSlHJ8xwj5TLg7gFk,7817
|
|
17
|
+
pyqrackising-9.2.2.dist-info/METADATA,sha256=via3gA7edru7Yyi-BnZNKt3PL4ChfHSbic6xIBVFfvE,1170
|
|
18
|
+
pyqrackising-9.2.2.dist-info/WHEEL,sha256=ZjXRCNaQ9YSypEK2TE0LRB0sy2OVXSszb4Sx1XjM99k,97
|
|
19
|
+
pyqrackising-9.2.2.dist-info/top_level.txt,sha256=bxlfGuLwzeVEI8Jm5D9HvC_WedgvvkSrpFwbGDjg-Ag,13
|
|
20
|
+
pyqrackising-9.2.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|