PyQrackIsing 1.14.1__tar.gz → 1.14.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.14.1/PyQrackIsing.egg-info → pyqrackising-1.14.2}/PKG-INFO +1 -1
- {pyqrackising-1.14.1 → pyqrackising-1.14.2}/PyQrackIsing/maxcut_tfim.py +98 -7
- {pyqrackising-1.14.1 → pyqrackising-1.14.2/PyQrackIsing.egg-info}/PKG-INFO +1 -1
- {pyqrackising-1.14.1 → pyqrackising-1.14.2}/pyproject.toml +1 -1
- {pyqrackising-1.14.1 → pyqrackising-1.14.2}/setup.py +1 -1
- {pyqrackising-1.14.1 → pyqrackising-1.14.2}/CMakeLists.txt +0 -0
- {pyqrackising-1.14.1 → pyqrackising-1.14.2}/LICENSE.md +0 -0
- {pyqrackising-1.14.1 → pyqrackising-1.14.2}/MANIFEST.in +0 -0
- {pyqrackising-1.14.1 → pyqrackising-1.14.2}/PyQrackIsing/__init__.py +0 -0
- {pyqrackising-1.14.1 → pyqrackising-1.14.2}/PyQrackIsing/_pyqrack_ising.cpp +0 -0
- {pyqrackising-1.14.1 → pyqrackising-1.14.2}/PyQrackIsing/generate_tfim_samples.py +0 -0
- {pyqrackising-1.14.1 → pyqrackising-1.14.2}/PyQrackIsing/spin_glass_solver.py +0 -0
- {pyqrackising-1.14.1 → pyqrackising-1.14.2}/PyQrackIsing/tfim_magnetization.py +0 -0
- {pyqrackising-1.14.1 → pyqrackising-1.14.2}/PyQrackIsing/tfim_square_magnetization.py +0 -0
- {pyqrackising-1.14.1 → pyqrackising-1.14.2}/PyQrackIsing/tsp_symmetric.py +0 -0
- {pyqrackising-1.14.1 → pyqrackising-1.14.2}/PyQrackIsing.egg-info/SOURCES.txt +0 -0
- {pyqrackising-1.14.1 → pyqrackising-1.14.2}/PyQrackIsing.egg-info/dependency_links.txt +0 -0
- {pyqrackising-1.14.1 → pyqrackising-1.14.2}/PyQrackIsing.egg-info/not-zip-safe +0 -0
- {pyqrackising-1.14.1 → pyqrackising-1.14.2}/PyQrackIsing.egg-info/top_level.txt +0 -0
- {pyqrackising-1.14.1 → pyqrackising-1.14.2}/README.md +0 -0
- {pyqrackising-1.14.1 → pyqrackising-1.14.2}/setup.cfg +0 -0
|
@@ -49,8 +49,93 @@ try:
|
|
|
49
49
|
bias[i] = bias[end - i]
|
|
50
50
|
bias[end - i] = tmp
|
|
51
51
|
|
|
52
|
+
|
|
53
|
+
@cuda.jit
|
|
54
|
+
def cuda_maxcut_hamming_cdf_256(n_qubits, n_steps, delta_t, tot_t, h_mult, J_func, degrees, theta, hamming_prob):
|
|
55
|
+
qc = cuda.blockIdx.x * cuda.blockDim.x + cuda.threadIdx.x
|
|
56
|
+
step = qc // n_qubits
|
|
57
|
+
q = qc % n_qubits
|
|
58
|
+
|
|
59
|
+
if step >= n_steps:
|
|
60
|
+
return
|
|
61
|
+
|
|
62
|
+
J_eff = J_func[q]
|
|
63
|
+
if abs(J_eff) <= (2 ** (-54)):
|
|
64
|
+
return
|
|
65
|
+
|
|
66
|
+
z = degrees[q]
|
|
67
|
+
theta_eff = theta[q]
|
|
68
|
+
t = step * delta_t
|
|
69
|
+
tm1 = (step - 1) * delta_t
|
|
70
|
+
h_t = h_mult * (tot_t - t)
|
|
71
|
+
n_bias = n_qubits - 1
|
|
72
|
+
|
|
73
|
+
bias = cuda.local.array(shape=(256,), dtype=types.float64)
|
|
74
|
+
cuda_probability_by_hamming_weight(J_eff, h_t, z, theta_eff, t, n_qubits, bias)
|
|
75
|
+
last_bias = cuda.local.array(shape=(256,), dtype=types.float64)
|
|
76
|
+
cuda_probability_by_hamming_weight(J_eff, h_t, z, theta_eff, tm1, n_qubits, last_bias)
|
|
77
|
+
for i in range(n_qubits - 1):
|
|
78
|
+
hamming_prob[i] += bias[i] - last_bias[i]
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
@cuda.jit
|
|
82
|
+
def cuda_maxcut_hamming_cdf_512(n_qubits, n_steps, delta_t, tot_t, h_mult, J_func, degrees, theta, hamming_prob):
|
|
83
|
+
qc = cuda.blockIdx.x * cuda.blockDim.x + cuda.threadIdx.x
|
|
84
|
+
step = qc // n_qubits
|
|
85
|
+
q = qc % n_qubits
|
|
86
|
+
|
|
87
|
+
if step >= n_steps:
|
|
88
|
+
return
|
|
89
|
+
|
|
90
|
+
J_eff = J_func[q]
|
|
91
|
+
if abs(J_eff) <= (2 ** (-54)):
|
|
92
|
+
return
|
|
93
|
+
|
|
94
|
+
z = degrees[q]
|
|
95
|
+
theta_eff = theta[q]
|
|
96
|
+
t = step * delta_t
|
|
97
|
+
tm1 = (step - 1) * delta_t
|
|
98
|
+
h_t = h_mult * (tot_t - t)
|
|
99
|
+
n_bias = n_qubits - 1
|
|
100
|
+
|
|
101
|
+
bias = cuda.local.array(shape=(512,), dtype=types.float64)
|
|
102
|
+
cuda_probability_by_hamming_weight(J_eff, h_t, z, theta_eff, t, n_qubits, bias)
|
|
103
|
+
last_bias = cuda.local.array(shape=(512,), dtype=types.float64)
|
|
104
|
+
cuda_probability_by_hamming_weight(J_eff, h_t, z, theta_eff, tm1, n_qubits, last_bias)
|
|
105
|
+
for i in range(n_qubits - 1):
|
|
106
|
+
hamming_prob[i] += bias[i] - last_bias[i]
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
@cuda.jit
|
|
110
|
+
def cuda_maxcut_hamming_cdf_1024(n_qubits, n_steps, delta_t, tot_t, h_mult, J_func, degrees, theta, hamming_prob):
|
|
111
|
+
qc = cuda.blockIdx.x * cuda.blockDim.x + cuda.threadIdx.x
|
|
112
|
+
step = qc // n_qubits
|
|
113
|
+
q = qc % n_qubits
|
|
114
|
+
|
|
115
|
+
if step >= n_steps:
|
|
116
|
+
return
|
|
117
|
+
|
|
118
|
+
J_eff = J_func[q]
|
|
119
|
+
if abs(J_eff) <= (2 ** (-54)):
|
|
120
|
+
return
|
|
121
|
+
|
|
122
|
+
z = degrees[q]
|
|
123
|
+
theta_eff = theta[q]
|
|
124
|
+
t = step * delta_t
|
|
125
|
+
tm1 = (step - 1) * delta_t
|
|
126
|
+
h_t = h_mult * (tot_t - t)
|
|
127
|
+
n_bias = n_qubits - 1
|
|
128
|
+
|
|
129
|
+
bias = cuda.local.array(shape=(1024,), dtype=types.float64)
|
|
130
|
+
cuda_probability_by_hamming_weight(J_eff, h_t, z, theta_eff, t, n_qubits, bias)
|
|
131
|
+
last_bias = cuda.local.array(shape=(1024,), dtype=types.float64)
|
|
132
|
+
cuda_probability_by_hamming_weight(J_eff, h_t, z, theta_eff, tm1, n_qubits, last_bias)
|
|
133
|
+
for i in range(n_qubits - 1):
|
|
134
|
+
hamming_prob[i] += bias[i] - last_bias[i]
|
|
135
|
+
|
|
136
|
+
|
|
52
137
|
@cuda.jit
|
|
53
|
-
def
|
|
138
|
+
def cuda_maxcut_hamming_cdf_2048(n_qubits, n_steps, delta_t, tot_t, h_mult, J_func, degrees, theta, hamming_prob):
|
|
54
139
|
qc = cuda.blockIdx.x * cuda.blockDim.x + cuda.threadIdx.x
|
|
55
140
|
step = qc // n_qubits
|
|
56
141
|
q = qc % n_qubits
|
|
@@ -69,9 +154,9 @@ try:
|
|
|
69
154
|
h_t = h_mult * (tot_t - t)
|
|
70
155
|
n_bias = n_qubits - 1
|
|
71
156
|
|
|
72
|
-
bias = cuda.local.array(shape=(
|
|
157
|
+
bias = cuda.local.array(shape=(2048,), dtype=types.float64)
|
|
73
158
|
cuda_probability_by_hamming_weight(J_eff, h_t, z, theta_eff, t, n_qubits, bias)
|
|
74
|
-
last_bias = cuda.local.array(shape=(
|
|
159
|
+
last_bias = cuda.local.array(shape=(2048,), dtype=types.float64)
|
|
75
160
|
cuda_probability_by_hamming_weight(J_eff, h_t, z, theta_eff, tm1, n_qubits, last_bias)
|
|
76
161
|
for i in range(n_qubits - 1):
|
|
77
162
|
hamming_prob[i] += bias[i] - last_bias[i]
|
|
@@ -97,7 +182,7 @@ try:
|
|
|
97
182
|
h_t = h_mult * (tot_t - t)
|
|
98
183
|
n_bias = n_qubits - 1
|
|
99
184
|
|
|
100
|
-
bias = cuda.local.array(shape=(
|
|
185
|
+
bias = cuda.local.array(shape=(4096,), dtype=types.float64)
|
|
101
186
|
cuda_probability_by_hamming_weight(J_eff, h_t, z, theta_eff, t, n_qubits, bias)
|
|
102
187
|
for i in range(n_qubits - 1):
|
|
103
188
|
hamming_prob[i] += bias[i]
|
|
@@ -328,7 +413,7 @@ def maxcut_tfim(
|
|
|
328
413
|
tot_prob += n
|
|
329
414
|
thresholds /= tot_prob
|
|
330
415
|
|
|
331
|
-
if IS_CUDA_AVAILABLE and cuda.is_available() and grid_size >= 128 and (n_qubits <=
|
|
416
|
+
if IS_CUDA_AVAILABLE and cuda.is_available() and grid_size >= 128 and (n_qubits <= 4096):
|
|
332
417
|
delta_t = 1.0 / n_steps
|
|
333
418
|
tot_t = n_steps * delta_t
|
|
334
419
|
h_mult = 32.0 / tot_t
|
|
@@ -347,8 +432,14 @@ def maxcut_tfim(
|
|
|
347
432
|
)
|
|
348
433
|
)
|
|
349
434
|
|
|
350
|
-
if n_qubits <=
|
|
351
|
-
|
|
435
|
+
if n_qubits <= 256:
|
|
436
|
+
cuda_maxcut_hamming_cdf_256[grid_size, group_size](n_qubits, n_steps, delta_t, tot_t, h_mult, J_eff, degrees, theta, thresholds)
|
|
437
|
+
elif n_qubits <= 512:
|
|
438
|
+
cuda_maxcut_hamming_cdf_512[grid_size, group_size](n_qubits, n_steps, delta_t, tot_t, h_mult, J_eff, degrees, theta, thresholds)
|
|
439
|
+
elif n_qubits <= 1024:
|
|
440
|
+
cuda_maxcut_hamming_cdf_1024[grid_size, group_size](n_qubits, n_steps, delta_t, tot_t, h_mult, J_eff, degrees, theta, thresholds)
|
|
441
|
+
elif n_qubits <= 2048:
|
|
442
|
+
cuda_maxcut_hamming_cdf_2048[grid_size, group_size](n_qubits, n_steps, delta_t, tot_t, h_mult, J_eff, degrees, theta, thresholds)
|
|
352
443
|
else:
|
|
353
444
|
cuda_maxcut_hamming_cdf_large[grid_size, group_size](n_qubits, n_steps, delta_t, tot_t, h_mult, J_eff, degrees, theta, thresholds)
|
|
354
445
|
|
|
@@ -12,7 +12,7 @@ build-backend = "setuptools.build_meta"
|
|
|
12
12
|
|
|
13
13
|
[project]
|
|
14
14
|
name = "PyQrackIsing"
|
|
15
|
-
version = "1.14.
|
|
15
|
+
version = "1.14.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.14.
|
|
54
|
+
version='1.14.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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|