PyQrackIsing 5.7.1__tar.gz → 5.7.3__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 (28) hide show
  1. {pyqrackising-5.7.1/pyqrackising.egg-info → pyqrackising-5.7.3}/PKG-INFO +1 -1
  2. {pyqrackising-5.7.1 → pyqrackising-5.7.3}/pyproject.toml +1 -1
  3. {pyqrackising-5.7.1 → pyqrackising-5.7.3}/pyqrackising/kernels.cl +6 -4
  4. {pyqrackising-5.7.1 → pyqrackising-5.7.3}/pyqrackising/spin_glass_solver.py +3 -1
  5. {pyqrackising-5.7.1 → pyqrackising-5.7.3}/pyqrackising/spin_glass_solver_sparse.py +3 -1
  6. {pyqrackising-5.7.1 → pyqrackising-5.7.3/pyqrackising.egg-info}/PKG-INFO +1 -1
  7. {pyqrackising-5.7.1 → pyqrackising-5.7.3}/setup.py +1 -1
  8. {pyqrackising-5.7.1 → pyqrackising-5.7.3}/CMakeLists.txt +0 -0
  9. {pyqrackising-5.7.1 → pyqrackising-5.7.3}/LICENSE.md +0 -0
  10. {pyqrackising-5.7.1 → pyqrackising-5.7.3}/MANIFEST.in +0 -0
  11. {pyqrackising-5.7.1 → pyqrackising-5.7.3}/README.md +0 -0
  12. {pyqrackising-5.7.1 → pyqrackising-5.7.3}/pyqrackising/__init__.py +0 -0
  13. {pyqrackising-5.7.1 → pyqrackising-5.7.3}/pyqrackising/_pyqrack_ising.cpp +0 -0
  14. {pyqrackising-5.7.1 → pyqrackising-5.7.3}/pyqrackising/generate_tfim_samples.py +0 -0
  15. {pyqrackising-5.7.1 → pyqrackising-5.7.3}/pyqrackising/maxcut_tfim.py +0 -0
  16. {pyqrackising-5.7.1 → pyqrackising-5.7.3}/pyqrackising/maxcut_tfim_sparse.py +0 -0
  17. {pyqrackising-5.7.1 → pyqrackising-5.7.3}/pyqrackising/maxcut_tfim_streaming.py +0 -0
  18. {pyqrackising-5.7.1 → pyqrackising-5.7.3}/pyqrackising/maxcut_tfim_util.py +0 -0
  19. {pyqrackising-5.7.1 → pyqrackising-5.7.3}/pyqrackising/spin_glass_solver_streaming.py +0 -0
  20. {pyqrackising-5.7.1 → pyqrackising-5.7.3}/pyqrackising/spin_glass_solver_util.py +0 -0
  21. {pyqrackising-5.7.1 → pyqrackising-5.7.3}/pyqrackising/tfim_magnetization.py +0 -0
  22. {pyqrackising-5.7.1 → pyqrackising-5.7.3}/pyqrackising/tfim_square_magnetization.py +0 -0
  23. {pyqrackising-5.7.1 → pyqrackising-5.7.3}/pyqrackising/tsp.py +0 -0
  24. {pyqrackising-5.7.1 → pyqrackising-5.7.3}/pyqrackising.egg-info/SOURCES.txt +0 -0
  25. {pyqrackising-5.7.1 → pyqrackising-5.7.3}/pyqrackising.egg-info/dependency_links.txt +0 -0
  26. {pyqrackising-5.7.1 → pyqrackising-5.7.3}/pyqrackising.egg-info/not-zip-safe +0 -0
  27. {pyqrackising-5.7.1 → pyqrackising-5.7.3}/pyqrackising.egg-info/top_level.txt +0 -0
  28. {pyqrackising-5.7.1 → pyqrackising-5.7.3}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyqrackising
3
- Version: 5.7.1
3
+ Version: 5.7.3
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
@@ -12,7 +12,7 @@ build-backend = "setuptools.build_meta"
12
12
 
13
13
  [project]
14
14
  name = "pyqrackising"
15
- version = "5.7.1"
15
+ version = "5.7.3"
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"}
@@ -131,6 +131,8 @@ float bootstrap_worker(__constant char* theta, __global double* G_m, __constant
131
131
  return (float)energy;
132
132
  }
133
133
 
134
+ #define ENERGY_EPSILON 2e-23
135
+
134
136
  __kernel void bootstrap(
135
137
  uint prng_seed,
136
138
  __global double* G_m,
@@ -174,8 +176,8 @@ __kernel void bootstrap(
174
176
  if (hid_energy < lid_energy) {
175
177
  loc_energy[lt_id] = hid_energy;
176
178
  loc_index[lt_id] = loc_index[lt_id + offset];
177
- } else if ((hid_energy == lid_energy) && ((xorshift32(&prng_seed) >> 31) & 1)) {
178
- loc_index[lt_id] = hid_energy;
179
+ } else if (((hid_energy - lid_energy) <= ENERGY_EPSILON) && ((xorshift32(&prng_seed) >> 31) & 1)) {
180
+ loc_index[lt_id] = loc_index[lt_id + offset];
179
181
  }
180
182
  }
181
183
  }
@@ -259,8 +261,8 @@ __kernel void bootstrap_sparse(
259
261
  if (hid_energy < lid_energy) {
260
262
  loc_energy[lt_id] = hid_energy;
261
263
  loc_index[lt_id] = loc_index[lt_id + offset];
262
- } else if ((hid_energy == lid_energy) && ((xorshift32(&prng_seed) >> 31) & 1)) {
263
- loc_index[lt_id] = hid_energy;
264
+ } else if (((hid_energy - lid_energy) <= ENERGY_EPSILON) && ((xorshift32(&prng_seed) >> 31) & 1)) {
265
+ loc_index[lt_id] = loc_index[lt_id + offset];
264
266
  }
265
267
  }
266
268
  }
@@ -124,7 +124,9 @@ def run_bootstrap_opencl(best_theta, G_m_buf, indices_array_np, k, min_energy):
124
124
  if min_energy < energy:
125
125
  return min_energy
126
126
 
127
- best_i = np.random.choice(np.where(min_energy_host == energy)[0])
127
+ ENERGY_EPSILON = 2e-23
128
+ choices = np.where(abs(min_energy_host - energy) <= ENERGY_EPSILON)[0]
129
+ best_i = np.random.choice(choices) if len(choices) else np.argmin(min_energy_host)
128
130
 
129
131
  flip_index_start = best_i * k
130
132
  indices_to_flip = indices_array_np[flip_index_start : flip_index_start + k]
@@ -129,7 +129,9 @@ def run_bootstrap_opencl(best_theta, G_data_buf, G_rows_buf, G_cols_buf, indices
129
129
  if min_energy < energy:
130
130
  return min_energy
131
131
 
132
- best_i = np.random.choice(np.where(min_energy_host == energy)[0])
132
+ ENERGY_EPSILON = 2e-23
133
+ choices = np.where(abs(min_energy_host - energy) <= ENERGY_EPSILON)[0]
134
+ best_i = np.random.choice(choices) if len(choices) else np.argmin(min_energy_host)
133
135
 
134
136
  flip_index_start = best_i * k
135
137
  indices_to_flip = indices_array_np[flip_index_start : flip_index_start + k]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyqrackising
3
- Version: 5.7.1
3
+ Version: 5.7.3
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
@@ -51,7 +51,7 @@ ext_modules = [CMakeExtension('tfim_sampler')]
51
51
 
52
52
  setup(
53
53
  name='pyqrackising',
54
- version='5.7.1',
54
+ version='5.7.3',
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