PyQrackIsing 8.14.9__tar.gz → 8.15.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-8.14.9/pyqrackising.egg-info → pyqrackising-8.15.0}/PKG-INFO +1 -1
  2. {pyqrackising-8.14.9 → pyqrackising-8.15.0}/README.md +4 -4
  3. {pyqrackising-8.14.9 → pyqrackising-8.15.0}/pyproject.toml +1 -1
  4. {pyqrackising-8.14.9 → pyqrackising-8.15.0}/pyqrackising/maxcut_tfim.py +2 -2
  5. {pyqrackising-8.14.9 → pyqrackising-8.15.0}/pyqrackising/maxcut_tfim_sparse.py +2 -2
  6. {pyqrackising-8.14.9 → pyqrackising-8.15.0}/pyqrackising/maxcut_tfim_streaming.py +2 -2
  7. {pyqrackising-8.14.9 → pyqrackising-8.15.0/pyqrackising.egg-info}/PKG-INFO +1 -1
  8. {pyqrackising-8.14.9 → pyqrackising-8.15.0}/setup.py +1 -1
  9. {pyqrackising-8.14.9 → pyqrackising-8.15.0}/LICENSE.md +0 -0
  10. {pyqrackising-8.14.9 → pyqrackising-8.15.0}/MANIFEST.in +0 -0
  11. {pyqrackising-8.14.9 → pyqrackising-8.15.0}/pyqrackising/__init__.py +0 -0
  12. {pyqrackising-8.14.9 → pyqrackising-8.15.0}/pyqrackising/convert_tensor_network_to_tsp.py +0 -0
  13. {pyqrackising-8.14.9 → pyqrackising-8.15.0}/pyqrackising/generate_tfim_samples.py +0 -0
  14. {pyqrackising-8.14.9 → pyqrackising-8.15.0}/pyqrackising/kernels.cl +0 -0
  15. {pyqrackising-8.14.9 → pyqrackising-8.15.0}/pyqrackising/maxcut_tfim_util.py +0 -0
  16. {pyqrackising-8.14.9 → pyqrackising-8.15.0}/pyqrackising/spin_glass_solver.py +0 -0
  17. {pyqrackising-8.14.9 → pyqrackising-8.15.0}/pyqrackising/spin_glass_solver_sparse.py +0 -0
  18. {pyqrackising-8.14.9 → pyqrackising-8.15.0}/pyqrackising/spin_glass_solver_streaming.py +0 -0
  19. {pyqrackising-8.14.9 → pyqrackising-8.15.0}/pyqrackising/spin_glass_solver_util.py +0 -0
  20. {pyqrackising-8.14.9 → pyqrackising-8.15.0}/pyqrackising/tfim_magnetization.py +0 -0
  21. {pyqrackising-8.14.9 → pyqrackising-8.15.0}/pyqrackising/tfim_square_magnetization.py +0 -0
  22. {pyqrackising-8.14.9 → pyqrackising-8.15.0}/pyqrackising/tsp.py +0 -0
  23. {pyqrackising-8.14.9 → pyqrackising-8.15.0}/pyqrackising/tsp_maxcut.py +0 -0
  24. {pyqrackising-8.14.9 → pyqrackising-8.15.0}/pyqrackising.egg-info/SOURCES.txt +0 -0
  25. {pyqrackising-8.14.9 → pyqrackising-8.15.0}/pyqrackising.egg-info/dependency_links.txt +0 -0
  26. {pyqrackising-8.14.9 → pyqrackising-8.15.0}/pyqrackising.egg-info/not-zip-safe +0 -0
  27. {pyqrackising-8.14.9 → pyqrackising-8.15.0}/pyqrackising.egg-info/top_level.txt +0 -0
  28. {pyqrackising-8.14.9 → pyqrackising-8.15.0}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyqrackising
3
- Version: 8.14.9
3
+ Version: 8.15.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
@@ -50,10 +50,10 @@ from pyqrackising import maxcut_tfim
50
50
  import networkx as nx
51
51
 
52
52
  G = nx.petersen_graph()
53
- best_solution_bit_string, best_cut_value, best_node_groups = maxcut_tfim(G, quality=5, shots=None, is_spin_glass=False, anneal_t=8.0, anneal_h=8.0, repulsion_base=4.0)
53
+ best_solution_bit_string, best_cut_value, best_node_groups = maxcut_tfim(G, quality=6, shots=None, is_spin_glass=False, anneal_t=8.0, anneal_h=8.0, repulsion_base=5.0)
54
54
  ```
55
55
 
56
- We also provide `maxcut_tfim_sparse(G)`, for `scipy` CSR sparse arrays (or `networkx` graphs), and `maxcut_tfim_streaming(G_func, nodes)` for `numba` JIT streaming weights function definitions. The (integer) `quality` setting is optional, with a default value of `5`, but you can turn it up for higher-quality results, or turn it down to save time. (You can also optionally specify the number of measurement `shots` as an argument, if you want specific fine-grained control over resource usage.) `anneal_t` and `anneal_h` control the physical maximum annealing time and `h` transverse field parameter, as in Trotterized Ising model. While `anneal_t` and `anneal_h` control how annealing finds the _Hamming weight_ of cuts (i.e., how many nodes end up in either partition), `repulsion_base` similarly controls the steepness of the search basin for optimizing bit-string locality ("like-like" repulsion and "like-unlike" attraction) within each partition. If you want to run MAXCUT on a graph with non-uniform edge weights, specify them as the `weight` attribute of each edge, with `networkx`. (If any `weight` attribute is not defined, the solver assumes it's `1.0` for that edge.)
56
+ We also provide `maxcut_tfim_sparse(G)`, for `scipy` CSR sparse arrays (or `networkx` graphs), and `maxcut_tfim_streaming(G_func, nodes)` for `numba` JIT streaming weights function definitions. The (integer) `quality` setting is optional, with a default value of `6`, but you can turn it up for higher-quality results, or turn it down to save time. (You can also optionally specify the number of measurement `shots` as an argument, if you want specific fine-grained control over resource usage.) `anneal_t` and `anneal_h` control the physical maximum annealing time and `h` transverse field parameter, as in Trotterized Ising model. While `anneal_t` and `anneal_h` control how annealing finds the _Hamming weight_ of cuts (i.e., how many nodes end up in either partition), `repulsion_base` similarly controls the steepness of the search basin for optimizing bit-string locality ("like-like" repulsion and "like-unlike" attraction) within each partition. If you want to run MAXCUT on a graph with non-uniform edge weights, specify them as the `weight` attribute of each edge, with `networkx`. (If any `weight` attribute is not defined, the solver assumes it's `1.0` for that edge.)
57
57
 
58
58
  Based on a combination of the TFIM-inspired MAXCUT solver and another technique for finding ground-state energy in quantum chemistry that we call the _"binary Clifford eigensolver,"_ we also provide an (approximate) spin glass ground-state solver:
59
59
  ```py
@@ -73,10 +73,10 @@ def generate_spin_glass_graph(n_nodes=16, degree=3, seed=None):
73
73
 
74
74
 
75
75
  G = generate_spin_glass_graph(n_nodes=64, seed=42)
76
- solution_bit_string, cut_value, node_groups, energy = spin_glass_solver(G, quality=4, shots=None, anneal_t=8.0, anneal_h=8.0, best_guess=None, is_combo_maxcut_gpu=True, min_order=1, max_order=None, reheat_tries=0)
76
+ solution_bit_string, cut_value, node_groups, energy = spin_glass_solver(G, quality=6, shots=None, anneal_t=8.0, anneal_h=8.0, is_spin_glass=True, best_guess=None, is_combo_maxcut_gpu=True, min_order=1, max_order=None, reheat_tries=0)
77
77
  # solution_bit_string, cut_value, node_groups, energy = spin_glass_solver(G, best_guess=maxcut_tfim(G, quality=6)[0])
78
78
  ```
79
- We also provide `spin_glass_solver_sparse(G)` and `spin_glass_solver_streaming(G_func, nodes)`. `is_combo_maxcut_gpu` controls whether gradient descent optimization is done on GPU (which is costly and the only GPU-based feature). `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. `min_order` determines the minimum order of local search and defaults to `1`, meaning it will perform a local search on at least single nodes (or `2` for pairs of nodes, or `3` for triplets of nodes, etc). `max_order` sets a ceiling on adaptive search for productive local search "order," and defaults to `None` for no ceiling. After the initial optimization round, `reheat_tries` will randomly flip `log2(n)` bits out of `n` count of total nodes and re-optimize, similar to "simulated annealing," for as many additional rounds as the `reheat_tries` value (which defaults to `0`). 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.
79
+ We also provide `spin_glass_solver_sparse(G)` and `spin_glass_solver_streaming(G_func, nodes)`. `is_combo_maxcut_gpu` controls whether gradient descent optimization is done on GPU (which is costly and the only GPU-based feature). `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. `min_order` determines the minimum order of local search and defaults to `1`, meaning it will perform a local search on at least single nodes (or `2` for pairs of nodes, or `3` for triplets of nodes, etc). `max_order` sets a ceiling on adaptive search for productive local search "order," and defaults to `None` for no ceiling. After the initial optimization round, `reheat_tries` will randomly flip `log2(n)` bits out of `n` count of total nodes and re-optimize, similar to "simulated annealing," for as many additional rounds as the `reheat_tries` value (which defaults to `0`). `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.
80
80
 
81
81
  From the MAXCUT solvers, we provide a (recursive) Traveling Salesman Problem (TSP) solver:
82
82
  ```py
@@ -10,7 +10,7 @@ build-backend = "setuptools.build_meta"
10
10
 
11
11
  [project]
12
12
  name = "pyqrackising"
13
- version = "8.14.9"
13
+ version = "8.15.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"}
@@ -301,7 +301,7 @@ def maxcut_tfim(
301
301
  return "01", weight, ([nodes[0]], [nodes[1]])
302
302
 
303
303
  if quality is None:
304
- quality = 5
304
+ quality = 6
305
305
 
306
306
  if shots is None:
307
307
  # Number of measurement shots
@@ -314,7 +314,7 @@ def maxcut_tfim(
314
314
  anneal_h = 8.0
315
315
 
316
316
  if repulsion_base is None:
317
- repulsion_base = 2.0
317
+ repulsion_base = 5.0
318
318
 
319
319
  is_opencl = is_maxcut_gpu and IS_OPENCL_AVAILABLE
320
320
 
@@ -316,7 +316,7 @@ def maxcut_tfim_sparse(
316
316
  return "01", weight, ([nodes[0]], [nodes[1]])
317
317
 
318
318
  if quality is None:
319
- quality = 5
319
+ quality = 6
320
320
 
321
321
  if shots is None:
322
322
  # Number of measurement shots
@@ -329,7 +329,7 @@ def maxcut_tfim_sparse(
329
329
  anneal_h = 8.0
330
330
 
331
331
  if repulsion_base is None:
332
- repulsion_base = 2.0
332
+ repulsion_base = 5.0
333
333
 
334
334
  J_eff, degrees = init_J_and_z(G_m, repulsion_base)
335
335
 
@@ -197,7 +197,7 @@ def maxcut_tfim_streaming(
197
197
  return "01", weight, ([nodes[0]], [nodes[1]])
198
198
 
199
199
  if quality is None:
200
- quality = 5
200
+ quality = 6
201
201
 
202
202
  if shots is None:
203
203
  # Number of measurement shots
@@ -210,7 +210,7 @@ def maxcut_tfim_streaming(
210
210
  anneal_h = 8.0
211
211
 
212
212
  if repulsion_base is None:
213
- repulsion_base = 2.0
213
+ repulsion_base = 5.0
214
214
 
215
215
  G_min = find_G_min(G_func, nodes, n_qubits)
216
216
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyqrackising
3
- Version: 8.14.9
3
+ Version: 8.15.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='8.14.9',
10
+ version='8.15.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