PyQrackIsing 9.2.0__tar.gz → 9.2.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.
Files changed (27) hide show
  1. {pyqrackising-9.2.0/pyqrackising.egg-info → pyqrackising-9.2.1}/PKG-INFO +1 -1
  2. {pyqrackising-9.2.0 → pyqrackising-9.2.1}/pyproject.toml +1 -1
  3. {pyqrackising-9.2.0 → pyqrackising-9.2.1}/pyqrackising/spin_glass_solver.py +6 -6
  4. {pyqrackising-9.2.0 → pyqrackising-9.2.1}/pyqrackising/spin_glass_solver_sparse.py +6 -6
  5. {pyqrackising-9.2.0 → pyqrackising-9.2.1}/pyqrackising/spin_glass_solver_streaming.py +6 -6
  6. {pyqrackising-9.2.0 → pyqrackising-9.2.1/pyqrackising.egg-info}/PKG-INFO +1 -1
  7. {pyqrackising-9.2.0 → pyqrackising-9.2.1}/setup.py +1 -1
  8. {pyqrackising-9.2.0 → pyqrackising-9.2.1}/LICENSE.md +0 -0
  9. {pyqrackising-9.2.0 → pyqrackising-9.2.1}/MANIFEST.in +0 -0
  10. {pyqrackising-9.2.0 → pyqrackising-9.2.1}/README.md +0 -0
  11. {pyqrackising-9.2.0 → pyqrackising-9.2.1}/pyqrackising/__init__.py +0 -0
  12. {pyqrackising-9.2.0 → pyqrackising-9.2.1}/pyqrackising/convert_tensor_network_to_tsp.py +0 -0
  13. {pyqrackising-9.2.0 → pyqrackising-9.2.1}/pyqrackising/generate_tfim_samples.py +0 -0
  14. {pyqrackising-9.2.0 → pyqrackising-9.2.1}/pyqrackising/kernels.cl +0 -0
  15. {pyqrackising-9.2.0 → pyqrackising-9.2.1}/pyqrackising/maxcut_tfim.py +0 -0
  16. {pyqrackising-9.2.0 → pyqrackising-9.2.1}/pyqrackising/maxcut_tfim_sparse.py +0 -0
  17. {pyqrackising-9.2.0 → pyqrackising-9.2.1}/pyqrackising/maxcut_tfim_streaming.py +0 -0
  18. {pyqrackising-9.2.0 → pyqrackising-9.2.1}/pyqrackising/maxcut_tfim_util.py +0 -0
  19. {pyqrackising-9.2.0 → pyqrackising-9.2.1}/pyqrackising/tfim_magnetization.py +0 -0
  20. {pyqrackising-9.2.0 → pyqrackising-9.2.1}/pyqrackising/tfim_square_magnetization.py +0 -0
  21. {pyqrackising-9.2.0 → pyqrackising-9.2.1}/pyqrackising/tsp.py +0 -0
  22. {pyqrackising-9.2.0 → pyqrackising-9.2.1}/pyqrackising/tsp_maxcut.py +0 -0
  23. {pyqrackising-9.2.0 → pyqrackising-9.2.1}/pyqrackising.egg-info/SOURCES.txt +0 -0
  24. {pyqrackising-9.2.0 → pyqrackising-9.2.1}/pyqrackising.egg-info/dependency_links.txt +0 -0
  25. {pyqrackising-9.2.0 → pyqrackising-9.2.1}/pyqrackising.egg-info/not-zip-safe +0 -0
  26. {pyqrackising-9.2.0 → pyqrackising-9.2.1}/pyqrackising.egg-info/top_level.txt +0 -0
  27. {pyqrackising-9.2.0 → pyqrackising-9.2.1}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyqrackising
3
- Version: 9.2.0
3
+ Version: 9.2.1
4
4
  Summary: Fast MAXCUT, TSP, and sampling heuristics from near-ideal transverse field Ising model (TFIM)
5
5
  Home-page: https://github.com/vm6502q/PyQrackIsing
6
6
  Author: Dan Strano
@@ -10,7 +10,7 @@ build-backend = "setuptools.build_meta"
10
10
 
11
11
  [project]
12
12
  name = "pyqrackising"
13
- version = "9.2.0"
13
+ version = "9.2.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"}
@@ -105,7 +105,7 @@ def run_double_bit_flips(best_theta, is_spin_glass, G_m, thread_count):
105
105
 
106
106
  @njit(parallel=True)
107
107
  def pick_gray_seeds(best_theta, thread_count, gray_seed_multiple, G_m, n, is_spin_glass):
108
- blocks = (n + thread_count - 1) // thread_count
108
+ blocks = (n + 63) // 64
109
109
  block_size = thread_count * gray_seed_multiple
110
110
  seed_count = block_size * blocks
111
111
 
@@ -115,14 +115,14 @@ def pick_gray_seeds(best_theta, thread_count, gray_seed_multiple, G_m, n, is_spi
115
115
  if is_spin_glass:
116
116
  for s in prange(seed_count):
117
117
  i = s % block_size
118
- offset = (s // block_size) * thread_count
118
+ offset = (s // block_size) * 64
119
119
  seed = gray_mutation(i, best_theta, offset)
120
120
  energies[s] = compute_energy(seed, G_m, n)
121
121
  seeds[s] = seed
122
122
  else:
123
123
  for s in prange(seed_count):
124
124
  i = s % block_size
125
- offset = (s // block_size) * thread_count
125
+ offset = (s // block_size) * 64
126
126
  seed = gray_mutation(i, best_theta, offset)
127
127
  energies[s] = compute_cut(seed, G_m, n)
128
128
  seeds[s] = seed
@@ -143,7 +143,7 @@ def pick_gray_seeds(best_theta, thread_count, gray_seed_multiple, G_m, n, is_spi
143
143
  def run_gray_optimization(best_theta, iterators, gray_iterations, thread_count, is_spin_glass, G_m):
144
144
  n = len(best_theta)
145
145
  thread_iterations = (gray_iterations + thread_count - 1) // thread_count
146
- blocks = (n + thread_count - 1) // thread_count
146
+ blocks = (n + 63) // 64
147
147
 
148
148
  states = np.empty((thread_count, n), dtype=np.bool_)
149
149
  energies = np.full(thread_count, np.finfo(dtype).min, dtype=dtype)
@@ -153,7 +153,7 @@ def run_gray_optimization(best_theta, iterators, gray_iterations, thread_count,
153
153
  iterator = iterators[i]
154
154
  for curr_idx in range(thread_iterations):
155
155
  for block in range(blocks):
156
- gray_code_next(iterator, curr_idx, block * thread_count)
156
+ gray_code_next(iterator, curr_idx, block * 64)
157
157
  energy = compute_energy(iterator, G_m, n)
158
158
  if energy > energies[i]:
159
159
  states[i], energies[i] = iterator.copy(), energy
@@ -162,7 +162,7 @@ def run_gray_optimization(best_theta, iterators, gray_iterations, thread_count,
162
162
  iterator = iterators[i]
163
163
  for curr_idx in range(thread_iterations):
164
164
  for block in range(blocks):
165
- gray_code_next(iterator, curr_idx, block * thread_count)
165
+ gray_code_next(iterator, curr_idx, block * 64)
166
166
  energy = compute_cut(iterator, G_m, n)
167
167
  if energy > energies[i]:
168
168
  states[i], energies[i] = iterator.copy(), energy
@@ -105,7 +105,7 @@ def run_double_bit_flips(best_theta, is_spin_glass, G_data, G_rows, G_cols, thre
105
105
 
106
106
  @njit(parallel=True)
107
107
  def pick_gray_seeds(best_theta, thread_count, gray_seed_multiple, G_data, G_rows, G_cols, n, is_spin_glass):
108
- blocks = (n + thread_count - 1) // thread_count
108
+ blocks = (n + 63) // 64
109
109
  block_size = thread_count * gray_seed_multiple
110
110
  seed_count = block_size * blocks
111
111
 
@@ -115,14 +115,14 @@ def pick_gray_seeds(best_theta, thread_count, gray_seed_multiple, G_data, G_rows
115
115
  if is_spin_glass:
116
116
  for s in prange(seed_count):
117
117
  i = s % block_size
118
- offset = (s // block_size) * thread_count
118
+ offset = (s // block_size) * 64
119
119
  seed = gray_mutation(i, best_theta, offset)
120
120
  energies[s] = compute_energy_sparse(seed, G_data, G_rows, G_cols, n)
121
121
  seeds[s] = seed
122
122
  else:
123
123
  for s in prange(seed_count):
124
124
  i = s % block_size
125
- offset = (s // block_size) * thread_count
125
+ offset = (s // block_size) * 64
126
126
  seed = gray_mutation(i, best_theta, offset)
127
127
  energies[s] = compute_cut_sparse(seed, G_data, G_rows, G_cols, n)
128
128
  seeds[s] = seed
@@ -143,7 +143,7 @@ def pick_gray_seeds(best_theta, thread_count, gray_seed_multiple, G_data, G_rows
143
143
  def run_gray_optimization(best_theta, iterators, gray_iterations, thread_count, is_spin_glass, G_data, G_rows, G_cols):
144
144
  n = len(best_theta)
145
145
  thread_iterations = (gray_iterations + thread_count - 1) // thread_count
146
- blocks = (n + thread_count - 1) // thread_count
146
+ blocks = (n + 63) // 64
147
147
 
148
148
  states = np.empty((thread_count, n), dtype=np.bool_)
149
149
  energies = np.full(thread_count, np.finfo(dtype).min, dtype=dtype)
@@ -153,7 +153,7 @@ def run_gray_optimization(best_theta, iterators, gray_iterations, thread_count,
153
153
  iterator = iterators[i]
154
154
  for curr_idx in range(thread_iterations):
155
155
  for block in range(blocks):
156
- gray_code_next(iterator, curr_idx, block * thread_count)
156
+ gray_code_next(iterator, curr_idx, block * 64)
157
157
  energy = compute_energy_sparse(iterator, G_data, G_rows, G_cols, n)
158
158
  if energy > energies[i]:
159
159
  states[i], energies[i] = iterator.copy(), energy
@@ -162,7 +162,7 @@ def run_gray_optimization(best_theta, iterators, gray_iterations, thread_count,
162
162
  iterator = iterators[i]
163
163
  for curr_idx in range(thread_iterations):
164
164
  for block in range(blocks):
165
- gray_code_next(iterator, curr_idx, block * thread_count)
165
+ gray_code_next(iterator, curr_idx, block * 64)
166
166
  energy = compute_cut_sparse(iterator, G_data, G_rows, G_cols, n)
167
167
  if energy > energies[i]:
168
168
  states[i], energies[i] = iterator.copy(), energy
@@ -97,7 +97,7 @@ def run_double_bit_flips(best_theta, is_spin_glass, G_func, nodes, thread_count)
97
97
 
98
98
  @njit(parallel=True)
99
99
  def pick_gray_seeds(best_theta, thread_count, gray_seed_multiple, G_func, nodes, n, is_spin_glass):
100
- blocks = (n + thread_count - 1) // thread_count
100
+ blocks = (n + 63) // 64
101
101
  block_size = thread_count * gray_seed_multiple
102
102
  seed_count = block_size * blocks
103
103
 
@@ -106,15 +106,15 @@ def pick_gray_seeds(best_theta, thread_count, gray_seed_multiple, G_func, nodes,
106
106
 
107
107
  if is_spin_glass:
108
108
  for s in prange(seed_count):
109
- offset = s // block_size
110
109
  i = s % block_size
110
+ offset = (s // block_size) * 64
111
111
  seed = gray_mutation(i, best_theta, offset)
112
112
  energies[s] = compute_energy_streaming(seed, G_func, nodes, n)
113
113
  seeds[s] = seed
114
114
  else:
115
115
  for s in prange(seed_count):
116
- offset = s // block_size
117
116
  i = s % block_size
117
+ offset = (s // block_size) * 64
118
118
  seed = gray_mutation(i, best_theta, offset)
119
119
  energies[s] = compute_cut_streaming(seed, G_func, nodes, n)
120
120
  seeds[s] = seed
@@ -135,7 +135,7 @@ def pick_gray_seeds(best_theta, thread_count, gray_seed_multiple, G_func, nodes,
135
135
  def run_gray_optimization(best_theta, iterators, gray_iterations, thread_count, is_spin_glass, G_func, nodes):
136
136
  n = len(best_theta)
137
137
  thread_iterations = (gray_iterations + thread_count - 1) // thread_count
138
- blocks = (n + thread_count - 1) // thread_count
138
+ blocks = (n + 63) // 64
139
139
 
140
140
  states = np.empty((thread_count, n), dtype=np.bool_)
141
141
  energies = np.full(thread_count, np.finfo(dtype).min, dtype=dtype)
@@ -145,7 +145,7 @@ def run_gray_optimization(best_theta, iterators, gray_iterations, thread_count,
145
145
  iterator = iterators[i]
146
146
  for curr_idx in range(thread_iterations):
147
147
  for block in range(blocks):
148
- gray_code_next(iterator, curr_idx, block * thread_count)
148
+ gray_code_next(iterator, curr_idx, block * 64)
149
149
  energy = compute_energy_streaming(iterator, G_func, nodes, n)
150
150
  if energy > energies[i]:
151
151
  states[i], energies[i] = iterator.copy(), energy
@@ -154,7 +154,7 @@ def run_gray_optimization(best_theta, iterators, gray_iterations, thread_count,
154
154
  iterator = iterators[i]
155
155
  for curr_idx in range(thread_iterations):
156
156
  for block in range(blocks):
157
- gray_code_next(iterator, curr_idx, block * thread_count)
157
+ gray_code_next(iterator, curr_idx, block * 64)
158
158
  energy = compute_cut_streaming(iterator, G_func, nodes, n)
159
159
  if energy > energies[i]:
160
160
  states[i], energies[i] = iterator.copy(), energy
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyqrackising
3
- Version: 9.2.0
3
+ Version: 9.2.1
4
4
  Summary: Fast MAXCUT, TSP, and sampling heuristics from near-ideal transverse field Ising model (TFIM)
5
5
  Home-page: https://github.com/vm6502q/PyQrackIsing
6
6
  Author: Dan Strano
@@ -7,7 +7,7 @@ with open(README_PATH) as readme_file:
7
7
 
8
8
  setup(
9
9
  name='pyqrackising',
10
- version='9.2.0',
10
+ version='9.2.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