PyQrackIsing 9.12.2__tar.gz → 9.13.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.
- {pyqrackising-9.12.2/pyqrackising.egg-info → pyqrackising-9.13.0}/PKG-INFO +1 -1
- {pyqrackising-9.12.2 → pyqrackising-9.13.0}/README.md +3 -2
- {pyqrackising-9.12.2 → pyqrackising-9.13.0}/pyproject.toml +1 -1
- {pyqrackising-9.12.2 → pyqrackising-9.13.0}/pyqrackising/__init__.py +3 -0
- {pyqrackising-9.12.2 → pyqrackising-9.13.0}/pyqrackising/maxcut_tfim_util.py +748 -739
- pyqrackising-9.12.2/pyqrackising/solve_maxcut_exact.py → pyqrackising-9.13.0/pyqrackising/solve_maxcut_bnb.py +2 -2
- pyqrackising-9.12.2/pyqrackising/solve_maxcut_exact_sparse.py → pyqrackising-9.13.0/pyqrackising/solve_maxcut_bnb_sparse.py +4 -4
- pyqrackising-9.12.2/pyqrackising/solve_maxcut_exact_streaming.py → pyqrackising-9.13.0/pyqrackising/solve_maxcut_bnb_streaming.py +2 -2
- pyqrackising-9.13.0/pyqrackising/solve_maxcut_exact.py +305 -0
- pyqrackising-9.13.0/pyqrackising/solve_maxcut_exact_sparse.py +227 -0
- pyqrackising-9.13.0/pyqrackising/solve_maxcut_exact_streaming.py +217 -0
- {pyqrackising-9.12.2 → pyqrackising-9.13.0/pyqrackising.egg-info}/PKG-INFO +1 -1
- {pyqrackising-9.12.2 → pyqrackising-9.13.0}/pyqrackising.egg-info/SOURCES.txt +3 -0
- {pyqrackising-9.12.2 → pyqrackising-9.13.0}/setup.py +1 -1
- {pyqrackising-9.12.2 → pyqrackising-9.13.0}/LICENSE.md +0 -0
- {pyqrackising-9.12.2 → pyqrackising-9.13.0}/MANIFEST.in +0 -0
- {pyqrackising-9.12.2 → pyqrackising-9.13.0}/pyqrackising/convert_tensor_network_to_tsp.py +0 -0
- {pyqrackising-9.12.2 → pyqrackising-9.13.0}/pyqrackising/generate_tfim_samples.py +0 -0
- {pyqrackising-9.12.2 → pyqrackising-9.13.0}/pyqrackising/kernels.cl +0 -0
- {pyqrackising-9.12.2 → pyqrackising-9.13.0}/pyqrackising/maxcut_tfim.py +0 -0
- {pyqrackising-9.12.2 → pyqrackising-9.13.0}/pyqrackising/maxcut_tfim_sparse.py +0 -0
- {pyqrackising-9.12.2 → pyqrackising-9.13.0}/pyqrackising/maxcut_tfim_streaming.py +0 -0
- {pyqrackising-9.12.2 → pyqrackising-9.13.0}/pyqrackising/otoc.py +0 -0
- {pyqrackising-9.12.2 → pyqrackising-9.13.0}/pyqrackising/spin_glass_solver.py +0 -0
- {pyqrackising-9.12.2 → pyqrackising-9.13.0}/pyqrackising/spin_glass_solver_sparse.py +0 -0
- {pyqrackising-9.12.2 → pyqrackising-9.13.0}/pyqrackising/spin_glass_solver_streaming.py +0 -0
- {pyqrackising-9.12.2 → pyqrackising-9.13.0}/pyqrackising/tfim_magnetization.py +0 -0
- {pyqrackising-9.12.2 → pyqrackising-9.13.0}/pyqrackising/tfim_square_magnetization.py +0 -0
- {pyqrackising-9.12.2 → pyqrackising-9.13.0}/pyqrackising/tsp.py +0 -0
- {pyqrackising-9.12.2 → pyqrackising-9.13.0}/pyqrackising/tsp_maxcut.py +0 -0
- {pyqrackising-9.12.2 → pyqrackising-9.13.0}/pyqrackising.egg-info/dependency_links.txt +0 -0
- {pyqrackising-9.12.2 → pyqrackising-9.13.0}/pyqrackising.egg-info/not-zip-safe +0 -0
- {pyqrackising-9.12.2 → pyqrackising-9.13.0}/pyqrackising.egg-info/requires.txt +0 -0
- {pyqrackising-9.12.2 → pyqrackising-9.13.0}/pyqrackising.egg-info/top_level.txt +0 -0
- {pyqrackising-9.12.2 → pyqrackising-9.13.0}/setup.cfg +0 -0
|
@@ -78,14 +78,15 @@ solution_bit_string, cut_value, node_groups, energy = spin_glass_solver(G, quali
|
|
|
78
78
|
```
|
|
79
79
|
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.
|
|
80
80
|
|
|
81
|
-
These solvers above can be used as a "warm state" for _branch
|
|
81
|
+
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:
|
|
82
82
|
|
|
83
83
|
```py
|
|
84
84
|
from pyqrackising import solve_maxcut_exact, solve_maxcut_exact_sparse, solve_maxcut_exact_streaming
|
|
85
|
+
from pyqrackising import solve_maxcut_bnb, solve_maxcut_bnb_sparse, solve_maxcut_bnb_streaming
|
|
85
86
|
import networkx as nx
|
|
86
87
|
|
|
87
88
|
G = nx.petersen_graph()
|
|
88
|
-
best_solution_bit_string, best_cut_value, best_node_groups =
|
|
89
|
+
best_solution_bit_string, best_cut_value, best_node_groups = solve_maxcut_bnb(G, time_limit=None)
|
|
89
90
|
```
|
|
90
91
|
Pass a time limit (in seconds) if desired.
|
|
91
92
|
|
|
@@ -7,7 +7,7 @@ build-backend = "setuptools.build_meta"
|
|
|
7
7
|
|
|
8
8
|
[project]
|
|
9
9
|
name = "pyqrackising"
|
|
10
|
-
version = "9.
|
|
10
|
+
version = "9.13.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"}
|
|
@@ -15,3 +15,6 @@ from .convert_tensor_network_to_tsp import convert_tensor_network_to_tsp, conver
|
|
|
15
15
|
from .solve_maxcut_exact import solve_maxcut_exact
|
|
16
16
|
from .solve_maxcut_exact_sparse import solve_maxcut_exact_sparse
|
|
17
17
|
from .solve_maxcut_exact_streaming import solve_maxcut_exact_streaming
|
|
18
|
+
from .solve_maxcut_bnb import solve_maxcut_bnb
|
|
19
|
+
from .solve_maxcut_bnb_sparse import solve_maxcut_bnb_sparse
|
|
20
|
+
from .solve_maxcut_bnb_streaming import solve_maxcut_bnb_streaming
|