PyQrackIsing 9.9.0__tar.gz → 9.10.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.
- {pyqrackising-9.9.0/pyqrackising.egg-info → pyqrackising-9.10.1}/PKG-INFO +5 -1
- {pyqrackising-9.9.0 → pyqrackising-9.10.1}/pyproject.toml +8 -5
- {pyqrackising-9.9.0 → pyqrackising-9.10.1}/pyqrackising/generate_tfim_samples.py +4 -4
- {pyqrackising-9.9.0 → pyqrackising-9.10.1}/pyqrackising/maxcut_tfim_util.py +5 -5
- {pyqrackising-9.9.0 → pyqrackising-9.10.1/pyqrackising.egg-info}/PKG-INFO +5 -1
- {pyqrackising-9.9.0 → pyqrackising-9.10.1}/pyqrackising.egg-info/SOURCES.txt +1 -0
- pyqrackising-9.10.1/pyqrackising.egg-info/requires.txt +4 -0
- {pyqrackising-9.9.0 → pyqrackising-9.10.1}/setup.py +1 -1
- {pyqrackising-9.9.0 → pyqrackising-9.10.1}/LICENSE.md +0 -0
- {pyqrackising-9.9.0 → pyqrackising-9.10.1}/MANIFEST.in +0 -0
- {pyqrackising-9.9.0 → pyqrackising-9.10.1}/README.md +0 -0
- {pyqrackising-9.9.0 → pyqrackising-9.10.1}/pyqrackising/__init__.py +0 -0
- {pyqrackising-9.9.0 → pyqrackising-9.10.1}/pyqrackising/convert_tensor_network_to_tsp.py +0 -0
- {pyqrackising-9.9.0 → pyqrackising-9.10.1}/pyqrackising/kernels.cl +0 -0
- {pyqrackising-9.9.0 → pyqrackising-9.10.1}/pyqrackising/maxcut_tfim.py +0 -0
- {pyqrackising-9.9.0 → pyqrackising-9.10.1}/pyqrackising/maxcut_tfim_sparse.py +0 -0
- {pyqrackising-9.9.0 → pyqrackising-9.10.1}/pyqrackising/maxcut_tfim_streaming.py +0 -0
- {pyqrackising-9.9.0 → pyqrackising-9.10.1}/pyqrackising/otoc.py +0 -0
- {pyqrackising-9.9.0 → pyqrackising-9.10.1}/pyqrackising/spin_glass_solver.py +0 -0
- {pyqrackising-9.9.0 → pyqrackising-9.10.1}/pyqrackising/spin_glass_solver_sparse.py +0 -0
- {pyqrackising-9.9.0 → pyqrackising-9.10.1}/pyqrackising/spin_glass_solver_streaming.py +0 -0
- {pyqrackising-9.9.0 → pyqrackising-9.10.1}/pyqrackising/tfim_magnetization.py +0 -0
- {pyqrackising-9.9.0 → pyqrackising-9.10.1}/pyqrackising/tfim_square_magnetization.py +0 -0
- {pyqrackising-9.9.0 → pyqrackising-9.10.1}/pyqrackising/tsp.py +0 -0
- {pyqrackising-9.9.0 → pyqrackising-9.10.1}/pyqrackising/tsp_maxcut.py +0 -0
- {pyqrackising-9.9.0 → pyqrackising-9.10.1}/pyqrackising.egg-info/dependency_links.txt +0 -0
- {pyqrackising-9.9.0 → pyqrackising-9.10.1}/pyqrackising.egg-info/not-zip-safe +0 -0
- {pyqrackising-9.9.0 → pyqrackising-9.10.1}/pyqrackising.egg-info/top_level.txt +0 -0
- {pyqrackising-9.9.0 → pyqrackising-9.10.1}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pyqrackising
|
|
3
|
-
Version: 9.
|
|
3
|
+
Version: 9.10.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
|
|
@@ -22,6 +22,10 @@ Classifier: Topic :: Scientific/Engineering
|
|
|
22
22
|
Requires-Python: >=3.8
|
|
23
23
|
Description-Content-Type: text/markdown
|
|
24
24
|
License-File: LICENSE.md
|
|
25
|
+
Requires-Dist: networkx
|
|
26
|
+
Requires-Dist: numpy
|
|
27
|
+
Requires-Dist: numba
|
|
28
|
+
Requires-Dist: scipy
|
|
25
29
|
Dynamic: author
|
|
26
30
|
Dynamic: home-page
|
|
27
31
|
Dynamic: license-file
|
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
[build-system]
|
|
2
2
|
requires = [
|
|
3
3
|
"setuptools",
|
|
4
|
-
"
|
|
5
|
-
"numpy",
|
|
6
|
-
"numba",
|
|
7
|
-
"scipy"
|
|
4
|
+
"wheel"
|
|
8
5
|
]
|
|
9
6
|
build-backend = "setuptools.build_meta"
|
|
10
7
|
|
|
11
8
|
[project]
|
|
12
9
|
name = "pyqrackising"
|
|
13
|
-
version = "9.
|
|
10
|
+
version = "9.10.1"
|
|
14
11
|
requires-python = ">=3.8"
|
|
15
12
|
description = "Fast MAXCUT, TSP, and sampling heuristics from near-ideal transverse field Ising model (TFIM)"
|
|
16
13
|
readme = {file = "README.txt", content-type = "text/markdown"}
|
|
@@ -31,6 +28,12 @@ classifiers=[
|
|
|
31
28
|
"Programming Language :: Python :: 3.10",
|
|
32
29
|
"Topic :: Scientific/Engineering",
|
|
33
30
|
]
|
|
31
|
+
dependencies=[
|
|
32
|
+
"networkx",
|
|
33
|
+
"numpy",
|
|
34
|
+
"numba",
|
|
35
|
+
"scipy"
|
|
36
|
+
]
|
|
34
37
|
|
|
35
38
|
[project.urls]
|
|
36
39
|
Homepage = "https://github.com/vm6502q/PyQrackIsing"
|
|
@@ -109,7 +109,7 @@ def fix_cdf(hamming_prob):
|
|
|
109
109
|
|
|
110
110
|
|
|
111
111
|
@njit
|
|
112
|
-
def get_tfim_hamming_distribution(J=-1.0, h=2.0, z=4, theta=0.174532925199432957, t=5, n_qubits=56):
|
|
112
|
+
def get_tfim_hamming_distribution(J=-1.0, h=2.0, z=4, theta=0.174532925199432957, t=5, n_qubits=56, omega=1.5*np.pi):
|
|
113
113
|
if abs(t) <= epsilon:
|
|
114
114
|
p = (1.0 - np.cos(theta)) / 2.0
|
|
115
115
|
bias = np.empty(n_qubits + 1, dtype=np.float64)
|
|
@@ -126,13 +126,13 @@ def get_tfim_hamming_distribution(J=-1.0, h=2.0, z=4, theta=0.174532925199432957
|
|
|
126
126
|
bias[0] = 1.0
|
|
127
127
|
return bias
|
|
128
128
|
|
|
129
|
-
bias = probability_by_hamming_weight(J, h, z, theta, t, n_qubits + 1)
|
|
129
|
+
bias = probability_by_hamming_weight(J, h, z, theta, t, n_qubits + 1, normalized=True, omega=omega)
|
|
130
130
|
|
|
131
131
|
return bias / bias.sum()
|
|
132
132
|
|
|
133
133
|
|
|
134
134
|
def generate_tfim_samples(
|
|
135
|
-
J=-1.0, h=2.0, z=4, theta=0.174532925199432957, t=5, n_qubits=56, shots=100
|
|
135
|
+
J=-1.0, h=2.0, z=4, theta=0.174532925199432957, t=5, n_qubits=56, shots=100, omega=1.5*np.pi
|
|
136
136
|
):
|
|
137
137
|
samples = []
|
|
138
138
|
|
|
@@ -151,7 +151,7 @@ def generate_tfim_samples(
|
|
|
151
151
|
n_rows, n_cols = factor_width(n_qubits)
|
|
152
152
|
|
|
153
153
|
# First dimension: Hamming weight
|
|
154
|
-
bias = get_tfim_hamming_distribution(J=J, h=h, z=z, theta=theta, t=t, n_qubits=n_qubits)
|
|
154
|
+
bias = get_tfim_hamming_distribution(J=J, h=h, z=z, theta=theta, t=t, n_qubits=n_qubits, omega=omega)
|
|
155
155
|
thresholds = fix_cdf(bias)
|
|
156
156
|
hamming_samples = dict(Counter(sample_hamming_weight(thresholds, shots)))
|
|
157
157
|
|
|
@@ -569,13 +569,13 @@ def init_thresholds(n_qubits):
|
|
|
569
569
|
|
|
570
570
|
|
|
571
571
|
@njit
|
|
572
|
-
def probability_by_hamming_weight(J, h, z, theta, t, n_bias, normalized=True):
|
|
572
|
+
def probability_by_hamming_weight(J, h, z, theta, t, n_bias, normalized=True, omega=1.5*np.pi):
|
|
573
573
|
zJ = z * J
|
|
574
574
|
theta_c = ((np.pi if J > 0 else -np.pi) / 2) if abs(zJ) < epsilon else np.arcsin(max(-1.0, min(1.0, h / zJ)))
|
|
575
575
|
|
|
576
576
|
p = (
|
|
577
577
|
2.0 ** (abs(J / h) - 1.0)
|
|
578
|
-
* (1.0 + np.sin(theta - theta_c) * np.cos(
|
|
578
|
+
* (1.0 + np.sin(theta - theta_c) * np.cos(omega * J * t + theta) / (1.0 + np.sqrt(t)))
|
|
579
579
|
- 0.5
|
|
580
580
|
)
|
|
581
581
|
|
|
@@ -600,7 +600,7 @@ def probability_by_hamming_weight(J, h, z, theta, t, n_bias, normalized=True):
|
|
|
600
600
|
|
|
601
601
|
|
|
602
602
|
@njit
|
|
603
|
-
def maxcut_hamming_cdf(hamming_prob, n_qubits, J_func, degrees, quality, tot_t, h_mult):
|
|
603
|
+
def maxcut_hamming_cdf(hamming_prob, n_qubits, J_func, degrees, quality, tot_t, h_mult, omega=1.5*np.pi):
|
|
604
604
|
n_steps = 1 << quality
|
|
605
605
|
delta_t = tot_t / n_steps
|
|
606
606
|
n_bias = n_qubits + 1
|
|
@@ -618,8 +618,8 @@ def maxcut_hamming_cdf(hamming_prob, n_qubits, J_func, degrees, quality, tot_t,
|
|
|
618
618
|
t = step * delta_t
|
|
619
619
|
tm1 = (step - 1) * delta_t
|
|
620
620
|
h_t = h_mult * (tot_t - t)
|
|
621
|
-
bias = probability_by_hamming_weight(J_eff, h_t, z, theta_eff, t, n_bias, False)
|
|
622
|
-
last_bias = probability_by_hamming_weight(J_eff, h_t, z, theta_eff, tm1, n_bias, False)
|
|
621
|
+
bias = probability_by_hamming_weight(J_eff, h_t, z, theta_eff, t, n_bias, False, omega)
|
|
622
|
+
last_bias = probability_by_hamming_weight(J_eff, h_t, z, theta_eff, tm1, n_bias, False, omega)
|
|
623
623
|
for i in range(n_bias):
|
|
624
624
|
hamming_prob[i] += bias[i] - last_bias[i]
|
|
625
625
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pyqrackising
|
|
3
|
-
Version: 9.
|
|
3
|
+
Version: 9.10.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
|
|
@@ -22,6 +22,10 @@ Classifier: Topic :: Scientific/Engineering
|
|
|
22
22
|
Requires-Python: >=3.8
|
|
23
23
|
Description-Content-Type: text/markdown
|
|
24
24
|
License-File: LICENSE.md
|
|
25
|
+
Requires-Dist: networkx
|
|
26
|
+
Requires-Dist: numpy
|
|
27
|
+
Requires-Dist: numba
|
|
28
|
+
Requires-Dist: scipy
|
|
25
29
|
Dynamic: author
|
|
26
30
|
Dynamic: home-page
|
|
27
31
|
Dynamic: license-file
|
|
@@ -7,7 +7,7 @@ with open(README_PATH) as readme_file:
|
|
|
7
7
|
|
|
8
8
|
setup(
|
|
9
9
|
name='pyqrackising',
|
|
10
|
-
version='9.
|
|
10
|
+
version='9.10.1',
|
|
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
|