PyQrackIsing 9.5.12__tar.gz → 9.6.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.
Files changed (28) hide show
  1. {pyqrackising-9.5.12/pyqrackising.egg-info → pyqrackising-9.6.0}/PKG-INFO +1 -1
  2. {pyqrackising-9.5.12 → pyqrackising-9.6.0}/pyproject.toml +1 -1
  3. {pyqrackising-9.5.12 → pyqrackising-9.6.0}/pyqrackising/maxcut_tfim.py +3 -0
  4. {pyqrackising-9.5.12 → pyqrackising-9.6.0}/pyqrackising/maxcut_tfim_sparse.py +3 -0
  5. {pyqrackising-9.5.12 → pyqrackising-9.6.0}/pyqrackising/maxcut_tfim_streaming.py +3 -0
  6. {pyqrackising-9.5.12 → pyqrackising-9.6.0}/pyqrackising/maxcut_tfim_util.py +9 -7
  7. {pyqrackising-9.5.12 → pyqrackising-9.6.0}/pyqrackising/spin_glass_solver.py +1 -1
  8. {pyqrackising-9.5.12 → pyqrackising-9.6.0/pyqrackising.egg-info}/PKG-INFO +1 -1
  9. {pyqrackising-9.5.12 → pyqrackising-9.6.0}/setup.py +1 -1
  10. {pyqrackising-9.5.12 → pyqrackising-9.6.0}/LICENSE.md +0 -0
  11. {pyqrackising-9.5.12 → pyqrackising-9.6.0}/MANIFEST.in +0 -0
  12. {pyqrackising-9.5.12 → pyqrackising-9.6.0}/README.md +0 -0
  13. {pyqrackising-9.5.12 → pyqrackising-9.6.0}/pyqrackising/__init__.py +0 -0
  14. {pyqrackising-9.5.12 → pyqrackising-9.6.0}/pyqrackising/convert_tensor_network_to_tsp.py +0 -0
  15. {pyqrackising-9.5.12 → pyqrackising-9.6.0}/pyqrackising/generate_tfim_samples.py +0 -0
  16. {pyqrackising-9.5.12 → pyqrackising-9.6.0}/pyqrackising/kernels.cl +0 -0
  17. {pyqrackising-9.5.12 → pyqrackising-9.6.0}/pyqrackising/otoc.py +0 -0
  18. {pyqrackising-9.5.12 → pyqrackising-9.6.0}/pyqrackising/spin_glass_solver_sparse.py +0 -0
  19. {pyqrackising-9.5.12 → pyqrackising-9.6.0}/pyqrackising/spin_glass_solver_streaming.py +0 -0
  20. {pyqrackising-9.5.12 → pyqrackising-9.6.0}/pyqrackising/tfim_magnetization.py +0 -0
  21. {pyqrackising-9.5.12 → pyqrackising-9.6.0}/pyqrackising/tfim_square_magnetization.py +0 -0
  22. {pyqrackising-9.5.12 → pyqrackising-9.6.0}/pyqrackising/tsp.py +0 -0
  23. {pyqrackising-9.5.12 → pyqrackising-9.6.0}/pyqrackising/tsp_maxcut.py +0 -0
  24. {pyqrackising-9.5.12 → pyqrackising-9.6.0}/pyqrackising.egg-info/SOURCES.txt +0 -0
  25. {pyqrackising-9.5.12 → pyqrackising-9.6.0}/pyqrackising.egg-info/dependency_links.txt +0 -0
  26. {pyqrackising-9.5.12 → pyqrackising-9.6.0}/pyqrackising.egg-info/not-zip-safe +0 -0
  27. {pyqrackising-9.5.12 → pyqrackising-9.6.0}/pyqrackising.egg-info/top_level.txt +0 -0
  28. {pyqrackising-9.5.12 → pyqrackising-9.6.0}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyqrackising
3
- Version: 9.5.12
3
+ Version: 9.6.0
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.5.12"
13
+ version = "9.6.0"
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"}
@@ -22,6 +22,9 @@ def update_repulsion_choice(G_m, weights, n, used, node, repulsion_base):
22
22
  # Select node
23
23
  used[node] = True
24
24
 
25
+ if abs(1.0 - repulsion_base) <= epsilon:
26
+ return
27
+
25
28
  # Repulsion: penalize neighbors
26
29
  for nbr in range(n):
27
30
  if used[nbr]:
@@ -22,6 +22,9 @@ def update_repulsion_choice(G_data, G_rows, G_cols, weights, n, used, node, repu
22
22
  # Select node
23
23
  used[node] = True
24
24
 
25
+ if abs(1.0 - repulsion_base) <= epsilon:
26
+ return
27
+
25
28
  # Repulsion: penalize neighbors
26
29
  for j in range(G_rows[node], G_rows[node + 1]):
27
30
  nbr = G_cols[j]
@@ -15,6 +15,9 @@ def update_repulsion_choice(G_func, nodes, weights, n, used, node, repulsion_bas
15
15
  # Select node
16
16
  used[node] = True
17
17
 
18
+ if abs(1.0 - repulsion_base) <= epsilon:
19
+ return
20
+
18
21
  # Repulsion: penalize neighbors
19
22
  for nbr in range(n):
20
23
  if used[nbr]:
@@ -392,17 +392,19 @@ def init_theta(h_mult, n_qubits, J_eff, degrees):
392
392
  def init_thresholds(n_qubits):
393
393
  n_bias = n_qubits + 1
394
394
  thresholds = np.empty(n_bias, dtype=np.float64)
395
- tot_prob = 0
395
+ normalizer = 0
396
+ for q in range(n_qubits >> 1):
397
+ normalizer += math.comb(n_qubits, q) << 1
398
+ if n_qubits & 1:
399
+ normalizer += math.comb(n_qubits, n_qubits >> 1)
396
400
  p = 1
397
401
  for q in range(n_qubits >> 1):
398
- thresholds[q] = p
399
- thresholds[n_bias - (q + 1)] = p
400
- tot_prob += 2 * p
402
+ val = p / normalizer
403
+ thresholds[q] = val
404
+ thresholds[n_bias - (q + 1)] = val
401
405
  p = math.comb(n_qubits, q + 1)
402
406
  if n_qubits & 1:
403
- thresholds[n_qubits >> 1] = p
404
- tot_prob += p
405
- thresholds /= tot_prob
407
+ thresholds[n_qubits >> 1] = p / normalizer
406
408
 
407
409
  return thresholds
408
410
 
@@ -308,7 +308,7 @@ def spin_glass_solver(
308
308
  best_theta = np.array([b == "1" for b in list(bitstring)], dtype=np.bool_)
309
309
 
310
310
  if gray_iterations is None:
311
- gray_iterations = n_qubits * os.cpu_count()
311
+ gray_iterations = n_qubits * n_qubits * os.cpu_count()
312
312
 
313
313
  if gray_seed_multiple is None:
314
314
  gray_seed_multiple = os.cpu_count()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyqrackising
3
- Version: 9.5.12
3
+ Version: 9.6.0
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.5.12',
10
+ version='9.6.0',
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