PyQrackIsing 9.11.1__tar.gz → 9.11.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-9.11.1/pyqrackising.egg-info → pyqrackising-9.11.2}/PKG-INFO +1 -1
- {pyqrackising-9.11.1 → pyqrackising-9.11.2}/pyproject.toml +1 -1
- {pyqrackising-9.11.1 → pyqrackising-9.11.2}/pyqrackising/generate_tfim_samples.py +15 -7
- {pyqrackising-9.11.1 → pyqrackising-9.11.2/pyqrackising.egg-info}/PKG-INFO +1 -1
- {pyqrackising-9.11.1 → pyqrackising-9.11.2}/setup.py +1 -1
- {pyqrackising-9.11.1 → pyqrackising-9.11.2}/LICENSE.md +0 -0
- {pyqrackising-9.11.1 → pyqrackising-9.11.2}/MANIFEST.in +0 -0
- {pyqrackising-9.11.1 → pyqrackising-9.11.2}/README.md +0 -0
- {pyqrackising-9.11.1 → pyqrackising-9.11.2}/pyqrackising/__init__.py +0 -0
- {pyqrackising-9.11.1 → pyqrackising-9.11.2}/pyqrackising/convert_tensor_network_to_tsp.py +0 -0
- {pyqrackising-9.11.1 → pyqrackising-9.11.2}/pyqrackising/kernels.cl +0 -0
- {pyqrackising-9.11.1 → pyqrackising-9.11.2}/pyqrackising/maxcut_tfim.py +0 -0
- {pyqrackising-9.11.1 → pyqrackising-9.11.2}/pyqrackising/maxcut_tfim_sparse.py +0 -0
- {pyqrackising-9.11.1 → pyqrackising-9.11.2}/pyqrackising/maxcut_tfim_streaming.py +0 -0
- {pyqrackising-9.11.1 → pyqrackising-9.11.2}/pyqrackising/maxcut_tfim_util.py +0 -0
- {pyqrackising-9.11.1 → pyqrackising-9.11.2}/pyqrackising/otoc.py +0 -0
- {pyqrackising-9.11.1 → pyqrackising-9.11.2}/pyqrackising/spin_glass_solver.py +0 -0
- {pyqrackising-9.11.1 → pyqrackising-9.11.2}/pyqrackising/spin_glass_solver_sparse.py +0 -0
- {pyqrackising-9.11.1 → pyqrackising-9.11.2}/pyqrackising/spin_glass_solver_streaming.py +0 -0
- {pyqrackising-9.11.1 → pyqrackising-9.11.2}/pyqrackising/tfim_magnetization.py +0 -0
- {pyqrackising-9.11.1 → pyqrackising-9.11.2}/pyqrackising/tfim_square_magnetization.py +0 -0
- {pyqrackising-9.11.1 → pyqrackising-9.11.2}/pyqrackising/tsp.py +0 -0
- {pyqrackising-9.11.1 → pyqrackising-9.11.2}/pyqrackising/tsp_maxcut.py +0 -0
- {pyqrackising-9.11.1 → pyqrackising-9.11.2}/pyqrackising.egg-info/SOURCES.txt +0 -0
- {pyqrackising-9.11.1 → pyqrackising-9.11.2}/pyqrackising.egg-info/dependency_links.txt +0 -0
- {pyqrackising-9.11.1 → pyqrackising-9.11.2}/pyqrackising.egg-info/not-zip-safe +0 -0
- {pyqrackising-9.11.1 → pyqrackising-9.11.2}/pyqrackising.egg-info/requires.txt +0 -0
- {pyqrackising-9.11.1 → pyqrackising-9.11.2}/pyqrackising.egg-info/top_level.txt +0 -0
- {pyqrackising-9.11.1 → pyqrackising-9.11.2}/setup.cfg +0 -0
|
@@ -7,7 +7,7 @@ build-backend = "setuptools.build_meta"
|
|
|
7
7
|
|
|
8
8
|
[project]
|
|
9
9
|
name = "pyqrackising"
|
|
10
|
-
version = "9.11.
|
|
10
|
+
version = "9.11.2"
|
|
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"}
|
|
@@ -105,15 +105,17 @@ def sample_fixed_hamming_weight(h_weight, count, n_rows, n_cols, burnin=10):
|
|
|
105
105
|
|
|
106
106
|
samples = []
|
|
107
107
|
|
|
108
|
-
|
|
108
|
+
burn = burnin * n_qubits
|
|
109
|
+
thinning = n_qubits
|
|
109
110
|
|
|
110
|
-
for
|
|
111
|
+
ones = set([i for i in range(n_qubits) if (state >> i) & 1])
|
|
112
|
+
zeros = set([i for i in range(n_qubits) if not (state >> i) & 1])
|
|
113
|
+
|
|
114
|
+
for step in range(burn + thinning * count):
|
|
111
115
|
# choose random 1-bit and 0-bit
|
|
112
|
-
ones = [i for i in range(n_qubits) if (state >> i) & 1]
|
|
113
|
-
zeros = [i for i in range(n_qubits) if not (state >> i) & 1]
|
|
114
116
|
|
|
115
|
-
i = random.choice(ones)
|
|
116
|
-
j = random.choice(zeros)
|
|
117
|
+
i = random.choice(tuple(ones))
|
|
118
|
+
j = random.choice(tuple(zeros))
|
|
117
119
|
|
|
118
120
|
delta = delta_like_edges(state, i, j, neighbors)
|
|
119
121
|
new_like = like_edges + delta
|
|
@@ -122,10 +124,16 @@ def sample_fixed_hamming_weight(h_weight, count, n_rows, n_cols, burnin=10):
|
|
|
122
124
|
accept_prob = new_like / like_edges
|
|
123
125
|
if np.random.random() < accept_prob:
|
|
124
126
|
state ^= 1 << i
|
|
127
|
+
ones.remove(i)
|
|
128
|
+
zeros.add(i)
|
|
129
|
+
|
|
125
130
|
state ^= 1 << j
|
|
131
|
+
zeros.remove(j)
|
|
132
|
+
ones.add(j)
|
|
133
|
+
|
|
126
134
|
like_edges = new_like
|
|
127
135
|
|
|
128
|
-
if step >=
|
|
136
|
+
if step >= burn and (step - burn) % thinning == 0:
|
|
129
137
|
samples.append(state)
|
|
130
138
|
|
|
131
139
|
return samples
|
|
@@ -7,7 +7,7 @@ with open(README_PATH) as readme_file:
|
|
|
7
7
|
|
|
8
8
|
setup(
|
|
9
9
|
name="pyqrackising",
|
|
10
|
-
version="9.11.
|
|
10
|
+
version="9.11.2",
|
|
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
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|