PyQrackIsing 9.15.5__tar.gz → 9.16.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 (36) hide show
  1. {pyqrackising-9.15.5/pyqrackising.egg-info → pyqrackising-9.16.0}/PKG-INFO +1 -1
  2. {pyqrackising-9.15.5 → pyqrackising-9.16.0}/README.md +1 -1
  3. {pyqrackising-9.15.5 → pyqrackising-9.16.0}/pyproject.toml +1 -1
  4. {pyqrackising-9.15.5 → pyqrackising-9.16.0}/pyqrackising/__init__.py +1 -0
  5. pyqrackising-9.16.0/pyqrackising/spin_glass_solver_hybrid.py +46 -0
  6. {pyqrackising-9.15.5 → pyqrackising-9.16.0/pyqrackising.egg-info}/PKG-INFO +1 -1
  7. {pyqrackising-9.15.5 → pyqrackising-9.16.0}/pyqrackising.egg-info/SOURCES.txt +1 -0
  8. {pyqrackising-9.15.5 → pyqrackising-9.16.0}/setup.py +1 -1
  9. {pyqrackising-9.15.5 → pyqrackising-9.16.0}/LICENSE.md +0 -0
  10. {pyqrackising-9.15.5 → pyqrackising-9.16.0}/MANIFEST.in +0 -0
  11. {pyqrackising-9.15.5 → pyqrackising-9.16.0}/pyqrackising/convert_tensor_network_to_tsp.py +0 -0
  12. {pyqrackising-9.15.5 → pyqrackising-9.16.0}/pyqrackising/generate_tfim_samples.py +0 -0
  13. {pyqrackising-9.15.5 → pyqrackising-9.16.0}/pyqrackising/kernels.cl +0 -0
  14. {pyqrackising-9.15.5 → pyqrackising-9.16.0}/pyqrackising/maxcut_tfim.py +0 -0
  15. {pyqrackising-9.15.5 → pyqrackising-9.16.0}/pyqrackising/maxcut_tfim_sparse.py +0 -0
  16. {pyqrackising-9.15.5 → pyqrackising-9.16.0}/pyqrackising/maxcut_tfim_streaming.py +0 -0
  17. {pyqrackising-9.15.5 → pyqrackising-9.16.0}/pyqrackising/maxcut_tfim_util.py +0 -0
  18. {pyqrackising-9.15.5 → pyqrackising-9.16.0}/pyqrackising/otoc.py +0 -0
  19. {pyqrackising-9.15.5 → pyqrackising-9.16.0}/pyqrackising/solve_maxcut_bnb.py +0 -0
  20. {pyqrackising-9.15.5 → pyqrackising-9.16.0}/pyqrackising/solve_maxcut_bnb_sparse.py +0 -0
  21. {pyqrackising-9.15.5 → pyqrackising-9.16.0}/pyqrackising/solve_maxcut_bnb_streaming.py +0 -0
  22. {pyqrackising-9.15.5 → pyqrackising-9.16.0}/pyqrackising/solve_maxcut_exact.py +0 -0
  23. {pyqrackising-9.15.5 → pyqrackising-9.16.0}/pyqrackising/solve_maxcut_exact_sparse.py +0 -0
  24. {pyqrackising-9.15.5 → pyqrackising-9.16.0}/pyqrackising/solve_maxcut_exact_streaming.py +0 -0
  25. {pyqrackising-9.15.5 → pyqrackising-9.16.0}/pyqrackising/spin_glass_solver.py +0 -0
  26. {pyqrackising-9.15.5 → pyqrackising-9.16.0}/pyqrackising/spin_glass_solver_sparse.py +0 -0
  27. {pyqrackising-9.15.5 → pyqrackising-9.16.0}/pyqrackising/spin_glass_solver_streaming.py +0 -0
  28. {pyqrackising-9.15.5 → pyqrackising-9.16.0}/pyqrackising/tfim_magnetization.py +0 -0
  29. {pyqrackising-9.15.5 → pyqrackising-9.16.0}/pyqrackising/tfim_square_magnetization.py +0 -0
  30. {pyqrackising-9.15.5 → pyqrackising-9.16.0}/pyqrackising/tsp.py +0 -0
  31. {pyqrackising-9.15.5 → pyqrackising-9.16.0}/pyqrackising/tsp_maxcut.py +0 -0
  32. {pyqrackising-9.15.5 → pyqrackising-9.16.0}/pyqrackising.egg-info/dependency_links.txt +0 -0
  33. {pyqrackising-9.15.5 → pyqrackising-9.16.0}/pyqrackising.egg-info/not-zip-safe +0 -0
  34. {pyqrackising-9.15.5 → pyqrackising-9.16.0}/pyqrackising.egg-info/requires.txt +0 -0
  35. {pyqrackising-9.15.5 → pyqrackising-9.16.0}/pyqrackising.egg-info/top_level.txt +0 -0
  36. {pyqrackising-9.15.5 → pyqrackising-9.16.0}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyqrackising
3
- Version: 9.15.5
3
+ Version: 9.16.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
@@ -89,7 +89,7 @@ solution_bit_string, cut_value, node_groups, energy = spin_glass_solver(
89
89
  )
90
90
  # solution_bit_string, cut_value, node_groups, energy = spin_glass_solver(G, best_guess=maxcut_tfim(G, quality=6)[0])
91
91
  ```
92
- We also provide `spin_glass_solver_sparse(G)` and `spin_glass_solver_streaming(G_func, nodes)`. `best_guess` gives the option to seed the algorithm with a best guess as to the maximal cut (as an integer, binary string, or list of booleans). By default, `spin_glass_solver()` uses `maxcut_tfim(G)` with passed-through `quality` as `best_guess`, which typically works well, but it could be seeded with higher `maxcut_tfim()` `quality` or Goemans-Williamson, for example. `is_spin_glass` controls whether the solver optimizes for cut value or spin-glass energy. This function is designed with a sign convention for weights such that it can immediately be used as a MAXCUT solver itself: you might need to reverse the sign convention on your weights for spin glass graphs, but this is only convention. `gray_iterations` gives manual control over how many iterations are carried out of a parallel Gray-code search on `best_guess`. `gray_seed_multiple` controls how many parallel search seeds (as a multiple of your CPU thread count) are tested for the best parallel seeds, and a value of `1` will perfectly cover the search space without collision if your node count is a power of 2. `bp_scale` controls opt-in and time complexity scaling for _belief propagation_ as a competing "warm start," with `None` disabling this option completely, `1.0` representing a budget of exactly `O(n^3)` time complexity, and lesser or greater values representing a linear multiplier on that budget. `bp_damping` similarly controls belief propagation damping.
92
+ We also provide `spin_glass_solver_sparse(G)`, `spin_glass_solver_streaming(G_func, nodes)`, and `spin_glass_hybrid(G)` (which combines the dense TFIM-based solver with a sparse local-optimization solver). `best_guess` gives the option to seed the algorithm with a best guess as to the maximal cut (as an integer, binary string, or list of booleans). By default, `spin_glass_solver()` uses `maxcut_tfim(G)` with passed-through `quality` as `best_guess`, which typically works well, but it could be seeded with higher `maxcut_tfim()` `quality` or Goemans-Williamson, for example. `is_spin_glass` controls whether the solver optimizes for cut value or spin-glass energy. This function is designed with a sign convention for weights such that it can immediately be used as a MAXCUT solver itself: you might need to reverse the sign convention on your weights for spin glass graphs, but this is only convention. `gray_iterations` gives manual control over how many iterations are carried out of a parallel Gray-code search on `best_guess`. `gray_seed_multiple` controls how many parallel search seeds (as a multiple of your CPU thread count) are tested for the best parallel seeds, and a value of `1` will perfectly cover the search space without collision if your node count is a power of 2. `bp_scale` controls opt-in and time complexity scaling for _belief propagation_ as a competing "warm start," with `None` disabling this option completely, `1.0` representing a budget of exactly `O(n^3)` time complexity, and lesser or greater values representing a linear multiplier on that budget. `bp_damping` similarly controls belief propagation damping.
93
93
 
94
94
  These solvers above can be used as a "warm state" for _MaxSAT-based_ solvers or _branch-and-bound_ solvers, potentially to reach _exact_ solutions to MAXCUT:
95
95
 
@@ -7,7 +7,7 @@ build-backend = "setuptools.build_meta"
7
7
 
8
8
  [project]
9
9
  name = "pyqrackising"
10
- version = "9.15.5"
10
+ version = "9.16.0"
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"}
@@ -9,6 +9,7 @@ from .maxcut_tfim_util import probability_by_hamming_weight
9
9
  from .spin_glass_solver import spin_glass_solver
10
10
  from .spin_glass_solver_sparse import spin_glass_solver_sparse
11
11
  from .spin_glass_solver_streaming import spin_glass_solver_streaming
12
+ from .spin_glass_solver_hybrid import spin_glass_solver_hybrid
12
13
  from .tsp import tsp_symmetric, tsp_asymmetric
13
14
  from .tsp_maxcut import tsp_maxcut, tsp_maxcut_sparse, tsp_maxcut_streaming
14
15
  from .convert_tensor_network_to_tsp import convert_tensor_network_to_tsp, convert_quimb_tree_to_tsp
@@ -0,0 +1,46 @@
1
+ from .maxcut_tfim import maxcut_tfim
2
+ from .spin_glass_solver_sparse import spin_glass_solver_sparse
3
+
4
+ import networkx as nx
5
+
6
+
7
+ def spin_glass_solver_hybrid(
8
+ G,
9
+ quality=None,
10
+ shots=None,
11
+ is_maxcut_gpu=True,
12
+ is_spin_glass=True,
13
+ anneal_t=None,
14
+ anneal_h=None,
15
+ repulsion_base=None,
16
+ is_log=False,
17
+ gray_iterations=None,
18
+ gray_seed_multiple=None,
19
+ bp_scale=None,
20
+ bp_damping=0.5,
21
+ ):
22
+ if not isinstance(G, nx.Graph):
23
+ raise TypeError("G graph must be a networkx.Graph for maxcut_hybrid!")
24
+
25
+ guess, _, _ = maxcut_tfim(
26
+ G,
27
+ quality=quality,
28
+ shots=shots,
29
+ repulsion_base=repulsion_base,
30
+ is_maxcut_gpu=is_maxcut_gpu,
31
+ is_spin_glass=is_spin_glass,
32
+ anneal_t=anneal_t,
33
+ anneal_h=anneal_h
34
+ )
35
+
36
+ return spin_glass_solver_sparse(
37
+ G,
38
+ best_guess=guess,
39
+ is_maxcut_gpu=is_maxcut_gpu,
40
+ is_spin_glass=is_spin_glass,
41
+ is_log=is_log,
42
+ gray_iterations=gray_iterations,
43
+ gray_seed_multiple=gray_seed_multiple,
44
+ bp_scale=bp_scale,
45
+ bp_damping=bp_damping
46
+ )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyqrackising
3
- Version: 9.15.5
3
+ Version: 9.16.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
@@ -19,6 +19,7 @@ pyqrackising/solve_maxcut_exact.py
19
19
  pyqrackising/solve_maxcut_exact_sparse.py
20
20
  pyqrackising/solve_maxcut_exact_streaming.py
21
21
  pyqrackising/spin_glass_solver.py
22
+ pyqrackising/spin_glass_solver_hybrid.py
22
23
  pyqrackising/spin_glass_solver_sparse.py
23
24
  pyqrackising/spin_glass_solver_streaming.py
24
25
  pyqrackising/tfim_magnetization.py
@@ -7,7 +7,7 @@ with open(README_PATH) as readme_file:
7
7
 
8
8
  setup(
9
9
  name="pyqrackising",
10
- version="9.15.5",
10
+ version="9.16.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