PyQrackIsing 1.17.1__tar.gz → 1.18.2__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-1.17.1/PyQrackIsing.egg-info → pyqrackising-1.18.2}/PKG-INFO +1 -1
- {pyqrackising-1.17.1 → pyqrackising-1.18.2}/PyQrackIsing/maxcut_tfim.py +1 -1
- {pyqrackising-1.17.1 → pyqrackising-1.18.2}/PyQrackIsing/spin_glass_solver.py +2 -3
- {pyqrackising-1.17.1 → pyqrackising-1.18.2}/PyQrackIsing/tsp_symmetric.py +6 -11
- {pyqrackising-1.17.1 → pyqrackising-1.18.2/PyQrackIsing.egg-info}/PKG-INFO +1 -1
- {pyqrackising-1.17.1 → pyqrackising-1.18.2}/README.md +2 -2
- {pyqrackising-1.17.1 → pyqrackising-1.18.2}/pyproject.toml +1 -1
- {pyqrackising-1.17.1 → pyqrackising-1.18.2}/setup.py +1 -1
- {pyqrackising-1.17.1 → pyqrackising-1.18.2}/CMakeLists.txt +0 -0
- {pyqrackising-1.17.1 → pyqrackising-1.18.2}/LICENSE.md +0 -0
- {pyqrackising-1.17.1 → pyqrackising-1.18.2}/MANIFEST.in +0 -0
- {pyqrackising-1.17.1 → pyqrackising-1.18.2}/PyQrackIsing/__init__.py +0 -0
- {pyqrackising-1.17.1 → pyqrackising-1.18.2}/PyQrackIsing/_pyqrack_ising.cpp +0 -0
- {pyqrackising-1.17.1 → pyqrackising-1.18.2}/PyQrackIsing/generate_tfim_samples.py +0 -0
- {pyqrackising-1.17.1 → pyqrackising-1.18.2}/PyQrackIsing/tfim_magnetization.py +0 -0
- {pyqrackising-1.17.1 → pyqrackising-1.18.2}/PyQrackIsing/tfim_square_magnetization.py +0 -0
- {pyqrackising-1.17.1 → pyqrackising-1.18.2}/PyQrackIsing.egg-info/SOURCES.txt +0 -0
- {pyqrackising-1.17.1 → pyqrackising-1.18.2}/PyQrackIsing.egg-info/dependency_links.txt +0 -0
- {pyqrackising-1.17.1 → pyqrackising-1.18.2}/PyQrackIsing.egg-info/not-zip-safe +0 -0
- {pyqrackising-1.17.1 → pyqrackising-1.18.2}/PyQrackIsing.egg-info/top_level.txt +0 -0
- {pyqrackising-1.17.1 → pyqrackising-1.18.2}/setup.cfg +0 -0
|
@@ -44,10 +44,9 @@ def bootstrap_worker(theta, edge_keys, edge_values, indices):
|
|
|
44
44
|
def bootstrap(theta, edge_keys, edge_values, k, indices_array):
|
|
45
45
|
n = len(indices_array) // k
|
|
46
46
|
energies = np.empty(n)
|
|
47
|
-
j =
|
|
47
|
+
j = [i * k for i in range(n)]
|
|
48
48
|
for i in prange(n):
|
|
49
|
-
energies[i] = bootstrap_worker(theta, edge_keys, edge_values, indices_array[j : j + k])
|
|
50
|
-
j += k
|
|
49
|
+
energies[i] = bootstrap_worker(theta, edge_keys, edge_values, indices_array[j[i] : j[i] + k])
|
|
51
50
|
|
|
52
51
|
return energies
|
|
53
52
|
|
|
@@ -120,7 +120,7 @@ def targeted_three_opt(path, W, k_neighbors=20):
|
|
|
120
120
|
|
|
121
121
|
return best_path, best_dist
|
|
122
122
|
|
|
123
|
-
def tsp_symmetric(G, quality=0, shots=None, correction_quality=2,
|
|
123
|
+
def tsp_symmetric(G, quality=0, shots=None, correction_quality=2, is_3_opt=True, k_neighbors=20, is_cyclic=True):
|
|
124
124
|
nodes = None
|
|
125
125
|
n_nodes = 0
|
|
126
126
|
G_m = None
|
|
@@ -145,16 +145,11 @@ def tsp_symmetric(G, quality=0, shots=None, correction_quality=2, start_node=Non
|
|
|
145
145
|
|
|
146
146
|
a = []
|
|
147
147
|
b = []
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
while (len(a) == 0) or (len(b) == 0):
|
|
154
|
-
bits = ''
|
|
155
|
-
_, _, bits, _ = spin_glass_solver(G, quality=quality, shots=shots, correction_quality=correction_quality)
|
|
156
|
-
a = list(bits[0])
|
|
157
|
-
b = list(bits[1])
|
|
148
|
+
while (len(a) == 0) or (len(b) == 0):
|
|
149
|
+
bits = ''
|
|
150
|
+
_, _, bits, _ = spin_glass_solver(G, quality=quality, shots=shots, correction_quality=correction_quality)
|
|
151
|
+
a = list(bits[0])
|
|
152
|
+
b = list(bits[1])
|
|
158
153
|
|
|
159
154
|
n_a_nodes = len(a)
|
|
160
155
|
n_b_nodes = len(b)
|
|
@@ -93,13 +93,13 @@ def generate_tsp_graph(n_nodes=64, seed=None):
|
|
|
93
93
|
|
|
94
94
|
n_nodes = 128
|
|
95
95
|
G = generate_tsp_graph(n_nodes=n_nodes, seed=42)
|
|
96
|
-
circuit, path_length = tsp_symmetric(G, quality=0, correction_quality=2,
|
|
96
|
+
circuit, path_length = tsp_symmetric(G, quality=0, correction_quality=2, is_3_opt=True, k_neighbors=20)
|
|
97
97
|
|
|
98
98
|
print(f"Node count: {n_nodes}")
|
|
99
99
|
print(f"Path: {circuit}")
|
|
100
100
|
print(f"Path length: {path_length}")
|
|
101
101
|
```
|
|
102
|
-
We only provide a solver for the symmetric version of the TSP (i.e., the distance from "A" to "B" is considered the same as from "B" to "A").
|
|
102
|
+
We only provide a solver for the symmetric version of the TSP (i.e., the distance from "A" to "B" is considered the same as from "B" to "A"). The path must be a complete circuit back to its origin.
|
|
103
103
|
|
|
104
104
|
## About
|
|
105
105
|
Transverse field Ising model (TFIM) is the basis of most claimed algorithmic "quantum advantage," circa 2025, with the notable exception of Shor's integer factoring algorithm.
|
|
@@ -12,7 +12,7 @@ build-backend = "setuptools.build_meta"
|
|
|
12
12
|
|
|
13
13
|
[project]
|
|
14
14
|
name = "PyQrackIsing"
|
|
15
|
-
version = "1.
|
|
15
|
+
version = "1.18.2"
|
|
16
16
|
requires-python = ">=3.8"
|
|
17
17
|
description = "Near-ideal closed-form solutions for transverse field Ising model (TFIM)"
|
|
18
18
|
readme = {file = "README.txt", content-type = "text/markdown"}
|
|
@@ -51,7 +51,7 @@ ext_modules = [CMakeExtension('tfim_sampler')]
|
|
|
51
51
|
|
|
52
52
|
setup(
|
|
53
53
|
name='PyQrackIsing',
|
|
54
|
-
version='1.
|
|
54
|
+
version='1.18.2',
|
|
55
55
|
author='Dan Strano',
|
|
56
56
|
author_email='stranoj@gmail.com',
|
|
57
57
|
description='Near-ideal closed-form solutions for transverse field Ising model (TFIM)',
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|