PyQrackIsing 9.0.0__tar.gz → 9.0.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-9.0.0/pyqrackising.egg-info → pyqrackising-9.0.1}/PKG-INFO +1 -1
- {pyqrackising-9.0.0 → pyqrackising-9.0.1}/pyproject.toml +1 -1
- {pyqrackising-9.0.0 → pyqrackising-9.0.1}/pyqrackising/maxcut_tfim_util.py +0 -2
- {pyqrackising-9.0.0 → pyqrackising-9.0.1}/pyqrackising/spin_glass_solver.py +10 -8
- {pyqrackising-9.0.0 → pyqrackising-9.0.1}/pyqrackising/spin_glass_solver_sparse.py +10 -8
- {pyqrackising-9.0.0 → pyqrackising-9.0.1}/pyqrackising/spin_glass_solver_streaming.py +10 -8
- {pyqrackising-9.0.0 → pyqrackising-9.0.1/pyqrackising.egg-info}/PKG-INFO +1 -1
- {pyqrackising-9.0.0 → pyqrackising-9.0.1}/setup.py +1 -1
- {pyqrackising-9.0.0 → pyqrackising-9.0.1}/LICENSE.md +0 -0
- {pyqrackising-9.0.0 → pyqrackising-9.0.1}/MANIFEST.in +0 -0
- {pyqrackising-9.0.0 → pyqrackising-9.0.1}/README.md +0 -0
- {pyqrackising-9.0.0 → pyqrackising-9.0.1}/pyqrackising/__init__.py +0 -0
- {pyqrackising-9.0.0 → pyqrackising-9.0.1}/pyqrackising/convert_tensor_network_to_tsp.py +0 -0
- {pyqrackising-9.0.0 → pyqrackising-9.0.1}/pyqrackising/generate_tfim_samples.py +0 -0
- {pyqrackising-9.0.0 → pyqrackising-9.0.1}/pyqrackising/kernels.cl +0 -0
- {pyqrackising-9.0.0 → pyqrackising-9.0.1}/pyqrackising/maxcut_tfim.py +0 -0
- {pyqrackising-9.0.0 → pyqrackising-9.0.1}/pyqrackising/maxcut_tfim_sparse.py +0 -0
- {pyqrackising-9.0.0 → pyqrackising-9.0.1}/pyqrackising/maxcut_tfim_streaming.py +0 -0
- {pyqrackising-9.0.0 → pyqrackising-9.0.1}/pyqrackising/tfim_magnetization.py +0 -0
- {pyqrackising-9.0.0 → pyqrackising-9.0.1}/pyqrackising/tfim_square_magnetization.py +0 -0
- {pyqrackising-9.0.0 → pyqrackising-9.0.1}/pyqrackising/tsp.py +0 -0
- {pyqrackising-9.0.0 → pyqrackising-9.0.1}/pyqrackising/tsp_maxcut.py +0 -0
- {pyqrackising-9.0.0 → pyqrackising-9.0.1}/pyqrackising.egg-info/SOURCES.txt +0 -0
- {pyqrackising-9.0.0 → pyqrackising-9.0.1}/pyqrackising.egg-info/dependency_links.txt +0 -0
- {pyqrackising-9.0.0 → pyqrackising-9.0.1}/pyqrackising.egg-info/not-zip-safe +0 -0
- {pyqrackising-9.0.0 → pyqrackising-9.0.1}/pyqrackising.egg-info/top_level.txt +0 -0
- {pyqrackising-9.0.0 → pyqrackising-9.0.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 = "9.0.
|
|
13
|
+
version = "9.0.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"}
|
|
@@ -60,7 +60,8 @@ def run_double_bit_flips(best_theta, is_spin_glass, G_m):
|
|
|
60
60
|
state[j] = not state[j]
|
|
61
61
|
energy = compute_energy(state, G_m, n)
|
|
62
62
|
if energy > energies[i]:
|
|
63
|
-
states[i], energies[i] = state, energy
|
|
63
|
+
states[i], energies[i] = state.copy(), energy
|
|
64
|
+
state[j] = not state[j]
|
|
64
65
|
else:
|
|
65
66
|
for i in prange(n):
|
|
66
67
|
state = best_theta.copy()
|
|
@@ -71,7 +72,8 @@ def run_double_bit_flips(best_theta, is_spin_glass, G_m):
|
|
|
71
72
|
state[j] = not state[j]
|
|
72
73
|
energy = compute_cut(state, G_m, n)
|
|
73
74
|
if energy > energies[i]:
|
|
74
|
-
states[i], energies[i] = state, energy
|
|
75
|
+
states[i], energies[i] = state.copy(), energy
|
|
76
|
+
state[j] = not state[j]
|
|
75
77
|
|
|
76
78
|
best_index = np.argmax(energies)
|
|
77
79
|
best_energy = energies[best_index]
|
|
@@ -94,19 +96,19 @@ def run_gray_optimization(best_theta, iterators, gray_iterations, thread_count,
|
|
|
94
96
|
i_offset = i * thread_iterations
|
|
95
97
|
iterator = iterators[i]
|
|
96
98
|
for curr_idx in range(thread_iterations):
|
|
97
|
-
|
|
98
|
-
energy = compute_energy(
|
|
99
|
+
gray_code_next(iterator, curr_idx)
|
|
100
|
+
energy = compute_energy(iterator, G_m, n)
|
|
99
101
|
if energy > energies[i]:
|
|
100
|
-
states[i], energies[i] =
|
|
102
|
+
states[i], energies[i] = iterator.copy(), energy
|
|
101
103
|
else:
|
|
102
104
|
for i in prange(thread_count):
|
|
103
105
|
i_offset = i * thread_iterations
|
|
104
106
|
iterator = iterators[i]
|
|
105
107
|
for curr_idx in range(thread_iterations):
|
|
106
|
-
|
|
107
|
-
energy = compute_cut(
|
|
108
|
+
gray_code_next(iterator, curr_idx)
|
|
109
|
+
energy = compute_cut(iterator, G_m, n)
|
|
108
110
|
if energy > energies[i]:
|
|
109
|
-
states[i], energies[i] =
|
|
111
|
+
states[i], energies[i] = iterator.copy(), energy
|
|
110
112
|
|
|
111
113
|
best_index = np.argmax(energies)
|
|
112
114
|
best_energy = energies[best_index]
|
|
@@ -61,7 +61,8 @@ def run_double_bit_flips(best_theta, is_spin_glass, G_data, G_rows, G_cols):
|
|
|
61
61
|
state[j] = not state[j]
|
|
62
62
|
energy = compute_energy_sparse(state, G_data, G_rows, G_cols, n)
|
|
63
63
|
if energy > energies[i]:
|
|
64
|
-
states[i], energies[i] = state, energy
|
|
64
|
+
states[i], energies[i] = state.copy(), energy
|
|
65
|
+
state[j] = not state[j]
|
|
65
66
|
else:
|
|
66
67
|
for i in prange(n):
|
|
67
68
|
state = best_theta.copy()
|
|
@@ -72,7 +73,8 @@ def run_double_bit_flips(best_theta, is_spin_glass, G_data, G_rows, G_cols):
|
|
|
72
73
|
state[j] = not state[j]
|
|
73
74
|
energy = compute_cut_sparse(state, G_data, G_rows, G_cols, n)
|
|
74
75
|
if energy > energies[i]:
|
|
75
|
-
states[i], energies[i] = state, energy
|
|
76
|
+
states[i], energies[i] = state.copy(), energy
|
|
77
|
+
state[j] = not state[j]
|
|
76
78
|
|
|
77
79
|
best_index = np.argmax(energies)
|
|
78
80
|
best_energy = energies[best_index]
|
|
@@ -95,19 +97,19 @@ def run_gray_optimization(best_theta, iterators, gray_iterations, thread_count,
|
|
|
95
97
|
i_offset = i * thread_iterations
|
|
96
98
|
iterator = iterators[i]
|
|
97
99
|
for curr_idx in range(thread_iterations):
|
|
98
|
-
|
|
99
|
-
energy = compute_energy_sparse(
|
|
100
|
+
gray_code_next(iterator, curr_idx)
|
|
101
|
+
energy = compute_energy_sparse(iterator, G_data, G_rows, G_cols, n)
|
|
100
102
|
if energy > energies[i]:
|
|
101
|
-
states[i], energies[i] =
|
|
103
|
+
states[i], energies[i] = iterator.copy(), energy
|
|
102
104
|
else:
|
|
103
105
|
for i in prange(thread_count):
|
|
104
106
|
i_offset = i * thread_iterations
|
|
105
107
|
iterator = iterators[i]
|
|
106
108
|
for curr_idx in range(thread_iterations):
|
|
107
|
-
|
|
108
|
-
energy = compute_cut_sparse(
|
|
109
|
+
gray_code_next(iterator, curr_idx)
|
|
110
|
+
energy = compute_cut_sparse(iterator, G_data, G_rows, G_cols, n)
|
|
109
111
|
if energy > energies[i]:
|
|
110
|
-
states[i], energies[i] =
|
|
112
|
+
states[i], energies[i] = iterator.copy(), energy
|
|
111
113
|
|
|
112
114
|
best_index = np.argmax(energies)
|
|
113
115
|
best_energy = energies[best_index]
|
|
@@ -53,7 +53,8 @@ def run_double_bit_flips(best_theta, is_spin_glass, G_func, nodes):
|
|
|
53
53
|
state[j] = not state[j]
|
|
54
54
|
energy = compute_energy_streaming(state, G_func, nodes, n)
|
|
55
55
|
if energy > energies[i]:
|
|
56
|
-
states[i], energies[i] = state, energy
|
|
56
|
+
states[i], energies[i] = state.copy(), energy
|
|
57
|
+
state[j] = not state[j]
|
|
57
58
|
else:
|
|
58
59
|
for i in prange(n):
|
|
59
60
|
state = best_theta.copy()
|
|
@@ -64,7 +65,8 @@ def run_double_bit_flips(best_theta, is_spin_glass, G_func, nodes):
|
|
|
64
65
|
state[j] = not state[j]
|
|
65
66
|
energy = compute_cut_streaming(state, G_func, nodes, n)
|
|
66
67
|
if energy > energies[i]:
|
|
67
|
-
states[i], energies[i] = state, energy
|
|
68
|
+
states[i], energies[i] = state.copy(), energy
|
|
69
|
+
state[j] = not state[j]
|
|
68
70
|
|
|
69
71
|
best_index = np.argmax(energies)
|
|
70
72
|
best_energy = energies[best_index]
|
|
@@ -87,19 +89,19 @@ def run_gray_optimization(best_theta, iterators, gray_iterations, thread_count,
|
|
|
87
89
|
i_offset = i * thread_iterations
|
|
88
90
|
iterator = iterators[i]
|
|
89
91
|
for curr_idx in range(thread_iterations):
|
|
90
|
-
|
|
91
|
-
energy = compute_energy_streaming(
|
|
92
|
+
gray_code_next(iterator, curr_idx)
|
|
93
|
+
energy = compute_energy_streaming(iterator, G_func, nodes, n)
|
|
92
94
|
if energy > energies[i]:
|
|
93
|
-
states[i], energies[i] =
|
|
95
|
+
states[i], energies[i] = iterator.copy(), energy
|
|
94
96
|
else:
|
|
95
97
|
for i in prange(thread_count):
|
|
96
98
|
i_offset = i * thread_iterations
|
|
97
99
|
iterator = iterators[i]
|
|
98
100
|
for curr_idx in range(thread_iterations):
|
|
99
|
-
|
|
100
|
-
energy = compute_cut_streaming(
|
|
101
|
+
gray_code_next(iterator, curr_idx)
|
|
102
|
+
energy = compute_cut_streaming(iterator, G_func, nodes, n)
|
|
101
103
|
if energy > energies[i]:
|
|
102
|
-
states[i], energies[i] =
|
|
104
|
+
states[i], energies[i] = iterator.copy(), energy
|
|
103
105
|
|
|
104
106
|
best_index = np.argmax(energies)
|
|
105
107
|
best_energy = energies[best_index]
|
|
@@ -7,7 +7,7 @@ with open(README_PATH) as readme_file:
|
|
|
7
7
|
|
|
8
8
|
setup(
|
|
9
9
|
name='pyqrackising',
|
|
10
|
-
version='9.0.
|
|
10
|
+
version='9.0.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
|