PyQrackIsing 9.16.9__tar.gz → 9.16.10__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 (36) hide show
  1. {pyqrackising-9.16.9/pyqrackising.egg-info → pyqrackising-9.16.10}/PKG-INFO +1 -1
  2. {pyqrackising-9.16.9 → pyqrackising-9.16.10}/pyproject.toml +1 -1
  3. {pyqrackising-9.16.9 → pyqrackising-9.16.10}/pyqrackising/maxcut_tfim_util.py +3 -17
  4. {pyqrackising-9.16.9 → pyqrackising-9.16.10}/pyqrackising/otoc.py +1 -1
  5. {pyqrackising-9.16.9 → pyqrackising-9.16.10/pyqrackising.egg-info}/PKG-INFO +1 -1
  6. {pyqrackising-9.16.9 → pyqrackising-9.16.10}/setup.py +1 -1
  7. {pyqrackising-9.16.9 → pyqrackising-9.16.10}/LICENSE.md +0 -0
  8. {pyqrackising-9.16.9 → pyqrackising-9.16.10}/MANIFEST.in +0 -0
  9. {pyqrackising-9.16.9 → pyqrackising-9.16.10}/README.md +0 -0
  10. {pyqrackising-9.16.9 → pyqrackising-9.16.10}/pyqrackising/__init__.py +0 -0
  11. {pyqrackising-9.16.9 → pyqrackising-9.16.10}/pyqrackising/convert_tensor_network_to_tsp.py +0 -0
  12. {pyqrackising-9.16.9 → pyqrackising-9.16.10}/pyqrackising/generate_tfim_samples.py +0 -0
  13. {pyqrackising-9.16.9 → pyqrackising-9.16.10}/pyqrackising/kernels.cl +0 -0
  14. {pyqrackising-9.16.9 → pyqrackising-9.16.10}/pyqrackising/maxcut_tfim.py +0 -0
  15. {pyqrackising-9.16.9 → pyqrackising-9.16.10}/pyqrackising/maxcut_tfim_sparse.py +0 -0
  16. {pyqrackising-9.16.9 → pyqrackising-9.16.10}/pyqrackising/maxcut_tfim_streaming.py +0 -0
  17. {pyqrackising-9.16.9 → pyqrackising-9.16.10}/pyqrackising/solve_maxcut_bnb.py +0 -0
  18. {pyqrackising-9.16.9 → pyqrackising-9.16.10}/pyqrackising/solve_maxcut_bnb_sparse.py +0 -0
  19. {pyqrackising-9.16.9 → pyqrackising-9.16.10}/pyqrackising/solve_maxcut_bnb_streaming.py +0 -0
  20. {pyqrackising-9.16.9 → pyqrackising-9.16.10}/pyqrackising/solve_maxcut_exact.py +0 -0
  21. {pyqrackising-9.16.9 → pyqrackising-9.16.10}/pyqrackising/solve_maxcut_exact_sparse.py +0 -0
  22. {pyqrackising-9.16.9 → pyqrackising-9.16.10}/pyqrackising/solve_maxcut_exact_streaming.py +0 -0
  23. {pyqrackising-9.16.9 → pyqrackising-9.16.10}/pyqrackising/spin_glass_solver.py +0 -0
  24. {pyqrackising-9.16.9 → pyqrackising-9.16.10}/pyqrackising/spin_glass_solver_hybrid.py +0 -0
  25. {pyqrackising-9.16.9 → pyqrackising-9.16.10}/pyqrackising/spin_glass_solver_sparse.py +0 -0
  26. {pyqrackising-9.16.9 → pyqrackising-9.16.10}/pyqrackising/spin_glass_solver_streaming.py +0 -0
  27. {pyqrackising-9.16.9 → pyqrackising-9.16.10}/pyqrackising/tfim_magnetization.py +0 -0
  28. {pyqrackising-9.16.9 → pyqrackising-9.16.10}/pyqrackising/tfim_square_magnetization.py +0 -0
  29. {pyqrackising-9.16.9 → pyqrackising-9.16.10}/pyqrackising/tsp.py +0 -0
  30. {pyqrackising-9.16.9 → pyqrackising-9.16.10}/pyqrackising/tsp_maxcut.py +0 -0
  31. {pyqrackising-9.16.9 → pyqrackising-9.16.10}/pyqrackising.egg-info/SOURCES.txt +0 -0
  32. {pyqrackising-9.16.9 → pyqrackising-9.16.10}/pyqrackising.egg-info/dependency_links.txt +0 -0
  33. {pyqrackising-9.16.9 → pyqrackising-9.16.10}/pyqrackising.egg-info/not-zip-safe +0 -0
  34. {pyqrackising-9.16.9 → pyqrackising-9.16.10}/pyqrackising.egg-info/requires.txt +0 -0
  35. {pyqrackising-9.16.9 → pyqrackising-9.16.10}/pyqrackising.egg-info/top_level.txt +0 -0
  36. {pyqrackising-9.16.9 → pyqrackising-9.16.10}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyqrackising
3
- Version: 9.16.9
3
+ Version: 9.16.10
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 @@ build-backend = "setuptools.build_meta"
7
7
 
8
8
  [project]
9
9
  name = "pyqrackising"
10
- version = "9.16.9"
10
+ version = "9.16.10"
11
11
  requires-python = ">=3.8"
12
12
  description = "Fast MAXCUT, TSP, and sampling heuristics from near-ideal transverse field Ising model (TFIM)"
13
13
  readme = {file = "README.txt", content-type = "text/markdown"}
@@ -555,24 +555,10 @@ def init_theta(h_mult, n_qubits, J_eff, degrees):
555
555
  return theta
556
556
 
557
557
 
558
- def init_thresholds(n_qubits):
558
+ def init_thresholds(n_qubits, theta=0.0):
559
559
  n_bias = n_qubits + 1
560
- thresholds = np.empty(n_bias, dtype=np.float64)
561
- normalizer = 0
562
- for q in range(n_bias >> 1):
563
- normalizer += math.comb(n_qubits, q) << 1
564
- if n_bias & 1:
565
- normalizer += math.comb(n_qubits, n_qubits >> 1)
566
- p = 1.0
567
- for q in range(n_bias >> 1):
568
- val = p / normalizer
569
- thresholds[q] = val
570
- thresholds[n_bias - (q + 1)] = val
571
- p = math.comb(n_qubits, q + 1)
572
- if n_bias & 1:
573
- thresholds[n_qubits >> 1] = p / normalizer
574
-
575
- return thresholds
560
+ p = (1.0 - np.sin(theta)) / 2.0
561
+ return np.array([math.comb(n_qubits, k) * (p ** k * (1.0 - p) ** (n_qubits - k)) for k in range(n_bias)])
576
562
 
577
563
 
578
564
  @njit(cache=True)
@@ -67,7 +67,7 @@ def get_otoc_hamming_distribution(J=-1.0, h=2.0, z=4, theta=0.0, t=5, n_qubits=6
67
67
  case _:
68
68
  pass
69
69
 
70
- x_basis = init_thresholds(n_qubits) + diff_x
70
+ x_basis = init_thresholds(n_qubits, theta) + diff_x
71
71
  x_min = x_basis.min()
72
72
  if x_min < 0:
73
73
  x_basis -= x_min
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyqrackising
3
- Version: 9.16.9
3
+ Version: 9.16.10
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.16.9",
10
+ version="9.16.10",
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