PyQrackIsing 9.3.8__tar.gz → 9.3.9__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.3.8/pyqrackising.egg-info → pyqrackising-9.3.9}/PKG-INFO +1 -1
- {pyqrackising-9.3.8 → pyqrackising-9.3.9}/pyproject.toml +1 -1
- {pyqrackising-9.3.8 → pyqrackising-9.3.9}/pyqrackising/generate_tfim_samples.py +12 -1
- {pyqrackising-9.3.8 → pyqrackising-9.3.9}/pyqrackising/otoc.py +11 -2
- {pyqrackising-9.3.8 → pyqrackising-9.3.9/pyqrackising.egg-info}/PKG-INFO +1 -1
- {pyqrackising-9.3.8 → pyqrackising-9.3.9}/setup.py +1 -1
- {pyqrackising-9.3.8 → pyqrackising-9.3.9}/LICENSE.md +0 -0
- {pyqrackising-9.3.8 → pyqrackising-9.3.9}/MANIFEST.in +0 -0
- {pyqrackising-9.3.8 → pyqrackising-9.3.9}/README.md +0 -0
- {pyqrackising-9.3.8 → pyqrackising-9.3.9}/pyqrackising/__init__.py +0 -0
- {pyqrackising-9.3.8 → pyqrackising-9.3.9}/pyqrackising/convert_tensor_network_to_tsp.py +0 -0
- {pyqrackising-9.3.8 → pyqrackising-9.3.9}/pyqrackising/kernels.cl +0 -0
- {pyqrackising-9.3.8 → pyqrackising-9.3.9}/pyqrackising/maxcut_tfim.py +0 -0
- {pyqrackising-9.3.8 → pyqrackising-9.3.9}/pyqrackising/maxcut_tfim_sparse.py +0 -0
- {pyqrackising-9.3.8 → pyqrackising-9.3.9}/pyqrackising/maxcut_tfim_streaming.py +0 -0
- {pyqrackising-9.3.8 → pyqrackising-9.3.9}/pyqrackising/maxcut_tfim_util.py +0 -0
- {pyqrackising-9.3.8 → pyqrackising-9.3.9}/pyqrackising/spin_glass_solver.py +0 -0
- {pyqrackising-9.3.8 → pyqrackising-9.3.9}/pyqrackising/spin_glass_solver_sparse.py +0 -0
- {pyqrackising-9.3.8 → pyqrackising-9.3.9}/pyqrackising/spin_glass_solver_streaming.py +0 -0
- {pyqrackising-9.3.8 → pyqrackising-9.3.9}/pyqrackising/tfim_magnetization.py +0 -0
- {pyqrackising-9.3.8 → pyqrackising-9.3.9}/pyqrackising/tfim_square_magnetization.py +0 -0
- {pyqrackising-9.3.8 → pyqrackising-9.3.9}/pyqrackising/tsp.py +0 -0
- {pyqrackising-9.3.8 → pyqrackising-9.3.9}/pyqrackising/tsp_maxcut.py +0 -0
- {pyqrackising-9.3.8 → pyqrackising-9.3.9}/pyqrackising.egg-info/SOURCES.txt +0 -0
- {pyqrackising-9.3.8 → pyqrackising-9.3.9}/pyqrackising.egg-info/dependency_links.txt +0 -0
- {pyqrackising-9.3.8 → pyqrackising-9.3.9}/pyqrackising.egg-info/not-zip-safe +0 -0
- {pyqrackising-9.3.8 → pyqrackising-9.3.9}/pyqrackising.egg-info/top_level.txt +0 -0
- {pyqrackising-9.3.8 → pyqrackising-9.3.9}/setup.cfg +0 -0
|
@@ -10,7 +10,7 @@ build-backend = "setuptools.build_meta"
|
|
|
10
10
|
|
|
11
11
|
[project]
|
|
12
12
|
name = "pyqrackising"
|
|
13
|
-
version = "9.3.
|
|
13
|
+
version = "9.3.9"
|
|
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"}
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
from .maxcut_tfim_util import probability_by_hamming_weight, sample_mag
|
|
1
|
+
from .maxcut_tfim_util import probability_by_hamming_weight, sample_mag, opencl_context
|
|
2
2
|
import itertools
|
|
3
3
|
import math
|
|
4
|
+
import sys
|
|
4
5
|
import numpy as np
|
|
5
6
|
from numba import njit
|
|
6
7
|
|
|
7
8
|
|
|
9
|
+
epsilon = opencl_context.epsilon
|
|
10
|
+
|
|
11
|
+
|
|
8
12
|
@njit
|
|
9
13
|
def factor_width(width, is_transpose=False):
|
|
10
14
|
col_len = math.floor(math.sqrt(width))
|
|
@@ -104,6 +108,13 @@ def fix_cdf(hamming_prob):
|
|
|
104
108
|
|
|
105
109
|
@njit
|
|
106
110
|
def get_tfim_hamming_distribution(J=-1.0, h=2.0, z=4, theta=0.174532925199432957, t=5, n_qubits=56):
|
|
111
|
+
if h <= epsilon:
|
|
112
|
+
bias = np.empty(n_qubits + 1, dtype=np.float64)
|
|
113
|
+
if J > 0:
|
|
114
|
+
bias[-1] = 1.0
|
|
115
|
+
else:
|
|
116
|
+
bias[0] = 1.0
|
|
117
|
+
return bias
|
|
107
118
|
bias = probability_by_hamming_weight(J, h, z, theta, t, n_qubits + 1)
|
|
108
119
|
return bias / bias.sum()
|
|
109
120
|
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
from .maxcut_tfim_util import probability_by_hamming_weight, sample_mag
|
|
1
|
+
from .maxcut_tfim_util import probability_by_hamming_weight, sample_mag, opencl_context
|
|
2
2
|
from numba import njit
|
|
3
3
|
import numpy as np
|
|
4
4
|
import random
|
|
5
|
+
import sys
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
epsilon = opencl_context.epsilon
|
|
5
9
|
|
|
6
10
|
|
|
7
11
|
def get_otoc_hamming_distribution(J=-1.0, h=2.0, z=4, theta=0.174532925199432957, t=5, n_qubits=56, cycles=1, pauli_string = 'X' + 'I' * 55):
|
|
@@ -9,6 +13,12 @@ def get_otoc_hamming_distribution(J=-1.0, h=2.0, z=4, theta=0.174532925199432957
|
|
|
9
13
|
if len(pauli_string) != n_qubits:
|
|
10
14
|
raise ValueError("OTOCS pauli_string must be same length as n_qubits! (Use 'I' for qubits that aren't changed.)")
|
|
11
15
|
|
|
16
|
+
n_bias = n_qubits + 1
|
|
17
|
+
if h <= epsilon:
|
|
18
|
+
bias = np.empty(n_bias, dtype=np.float64)
|
|
19
|
+
bias[0] = 1.0
|
|
20
|
+
return { 'X': bias, 'Y': bias, 'Z': bias }
|
|
21
|
+
|
|
12
22
|
fwd = probability_by_hamming_weight(J, h, z, theta, t, n_qubits + 1)
|
|
13
23
|
rev = probability_by_hamming_weight(-J, -h, z, theta + np.pi, t, n_qubits + 1)
|
|
14
24
|
diff_theta = rev - fwd
|
|
@@ -25,7 +35,6 @@ def get_otoc_hamming_distribution(J=-1.0, h=2.0, z=4, theta=0.174532925199432957
|
|
|
25
35
|
diff_phi *= cycles
|
|
26
36
|
# diff_lam = diff_phi
|
|
27
37
|
|
|
28
|
-
n_bias = n_qubits + 1
|
|
29
38
|
diff_z = np.zeros(n_bias, dtype=np.float64)
|
|
30
39
|
diff_x = np.zeros(n_bias, dtype=np.float64)
|
|
31
40
|
diff_y = np.zeros(n_bias, dtype=np.float64)
|
|
@@ -7,7 +7,7 @@ with open(README_PATH) as readme_file:
|
|
|
7
7
|
|
|
8
8
|
setup(
|
|
9
9
|
name='pyqrackising',
|
|
10
|
-
version='9.3.
|
|
10
|
+
version='9.3.9',
|
|
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
|