PyQrackIsing 3.5.0__tar.gz → 3.5.1__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 (24) hide show
  1. {pyqrackising-3.5.0/pyqrackising.egg-info → pyqrackising-3.5.1}/PKG-INFO +1 -1
  2. {pyqrackising-3.5.0 → pyqrackising-3.5.1}/pyproject.toml +1 -1
  3. {pyqrackising-3.5.0 → pyqrackising-3.5.1}/pyqrackising/tsp.py +5 -28
  4. {pyqrackising-3.5.0 → pyqrackising-3.5.1/pyqrackising.egg-info}/PKG-INFO +1 -1
  5. {pyqrackising-3.5.0 → pyqrackising-3.5.1}/setup.py +1 -1
  6. {pyqrackising-3.5.0 → pyqrackising-3.5.1}/CMakeLists.txt +0 -0
  7. {pyqrackising-3.5.0 → pyqrackising-3.5.1}/LICENSE.md +0 -0
  8. {pyqrackising-3.5.0 → pyqrackising-3.5.1}/MANIFEST.in +0 -0
  9. {pyqrackising-3.5.0 → pyqrackising-3.5.1}/README.md +0 -0
  10. {pyqrackising-3.5.0 → pyqrackising-3.5.1}/pyqrackising/__init__.py +0 -0
  11. {pyqrackising-3.5.0 → pyqrackising-3.5.1}/pyqrackising/_pyqrack_ising.cpp +0 -0
  12. {pyqrackising-3.5.0 → pyqrackising-3.5.1}/pyqrackising/generate_tfim_samples.py +0 -0
  13. {pyqrackising-3.5.0 → pyqrackising-3.5.1}/pyqrackising/kernels.cl +0 -0
  14. {pyqrackising-3.5.0 → pyqrackising-3.5.1}/pyqrackising/maxcut_tfim.py +0 -0
  15. {pyqrackising-3.5.0 → pyqrackising-3.5.1}/pyqrackising/maxcut_tfim_sparse.py +0 -0
  16. {pyqrackising-3.5.0 → pyqrackising-3.5.1}/pyqrackising/spin_glass_solver.py +0 -0
  17. {pyqrackising-3.5.0 → pyqrackising-3.5.1}/pyqrackising/spin_glass_solver_sparse.py +0 -0
  18. {pyqrackising-3.5.0 → pyqrackising-3.5.1}/pyqrackising/tfim_magnetization.py +0 -0
  19. {pyqrackising-3.5.0 → pyqrackising-3.5.1}/pyqrackising/tfim_square_magnetization.py +0 -0
  20. {pyqrackising-3.5.0 → pyqrackising-3.5.1}/pyqrackising.egg-info/SOURCES.txt +0 -0
  21. {pyqrackising-3.5.0 → pyqrackising-3.5.1}/pyqrackising.egg-info/dependency_links.txt +0 -0
  22. {pyqrackising-3.5.0 → pyqrackising-3.5.1}/pyqrackising.egg-info/not-zip-safe +0 -0
  23. {pyqrackising-3.5.0 → pyqrackising-3.5.1}/pyqrackising.egg-info/top_level.txt +0 -0
  24. {pyqrackising-3.5.0 → pyqrackising-3.5.1}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyqrackising
3
- Version: 3.5.0
3
+ Version: 3.5.1
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
@@ -11,7 +11,7 @@ build-backend = "setuptools.build_meta"
11
11
 
12
12
  [project]
13
13
  name = "pyqrackising"
14
- version = "3.5.0"
14
+ version = "3.5.1"
15
15
  requires-python = ">=3.8"
16
16
  description = "Fast MAXCUT, TSP, and sampling heuristics from near-ideal transverse field Ising model (TFIM)"
17
17
  readme = {file = "README.txt", content-type = "text/markdown"}
@@ -496,8 +496,7 @@ def tsp_symmetric(G, start_node=None, end_node=None, quality=2, shots=None, corr
496
496
  best_path = path_a + path_b
497
497
  best_weight = weight
498
498
 
499
- if len(c):
500
- best_path += c
499
+ best_path += c
501
500
 
502
501
  if is_top_level:
503
502
  if is_cyclic:
@@ -513,17 +512,12 @@ def tsp_symmetric(G, start_node=None, end_node=None, quality=2, shots=None, corr
513
512
  if k_neighbors > 0:
514
513
  best_path, best_weight = targeted_three_opt(best_path, G_m, k_neighbors)
515
514
  else:
516
- best_path, best_weight = one_way_two_opt(best_path, G_m)
517
-
518
- if is_cyclic:
519
- cycle_node = best_path[0]
520
- best_weight += G_m[cycle_node, best_path[-1]]
521
- best_path += [cycle_node]
515
+ best_weight = path_length(best_path, G_m)
522
516
 
523
517
  return [nodes[x] for x in best_path], best_weight
524
518
 
525
519
 
526
- def tsp_asymmetric(G, start_node=None, end_node=None, quality=1, shots=None, correction_quality=2, monte_carlo=True, k_neighbors=16, is_cyclic=True, multi_start=1, is_top_level=True):
520
+ def tsp_asymmetric(G, start_node=None, end_node=None, quality=2, shots=None, correction_quality=2, monte_carlo=True, k_neighbors=16, is_cyclic=True, multi_start=1, is_top_level=True):
527
521
  nodes = None
528
522
  n_nodes = 0
529
523
  G_m = None
@@ -606,15 +600,8 @@ def tsp_asymmetric(G, start_node=None, end_node=None, quality=1, shots=None, cor
606
600
  best_path = stitch_asymmetric(G_m, path_a, path_b)
607
601
  else:
608
602
  best_path = path_a + path_b
609
- best_weight = G_m[path_a[0], path_b[0]]
610
- weight = G_m[path_a[0], path_b[-1]]
611
- if weight < best_weight:
612
- path_b.reverse()
613
- best_path = path_a + path_b
614
- best_weight = weight
615
603
 
616
- if len(c):
617
- best_path += c
604
+ best_path += c
618
605
 
619
606
  if is_top_level:
620
607
  if is_cyclic:
@@ -651,17 +638,7 @@ def tsp_asymmetric(G, start_node=None, end_node=None, quality=1, shots=None, cor
651
638
  if weight < best_weight:
652
639
  final_path, best_weight = path, weight
653
640
  else:
654
- final_path, best_weight = one_way_two_opt(best_path.copy(), G_m)
655
- if not start_node and not end_node:
656
- best_path.reverse()
657
- path, weight = one_way_two_opt(best_path, G_m)
658
- if weight < best_weight:
659
- final_path, best_weight = path, weight
660
-
661
- if is_cyclic:
662
- cycle_node = best_path[0]
663
- best_weight += G_m[cycle_node, best_path[-1]]
664
- best_path += [cycle_node]
641
+ best_weight = path_length(path, G_m)
665
642
 
666
643
  if is_reversed:
667
644
  final_path.reverse()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyqrackising
3
- Version: 3.5.0
3
+ Version: 3.5.1
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
@@ -51,7 +51,7 @@ ext_modules = [CMakeExtension('tfim_sampler')]
51
51
 
52
52
  setup(
53
53
  name='pyqrackising',
54
- version='3.5.0',
54
+ version='3.5.1',
55
55
  author='Dan Strano',
56
56
  author_email='stranoj@gmail.com',
57
57
  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