PyQrackIsing 6.1.0__tar.gz → 6.1.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-6.1.0/pyqrackising.egg-info → pyqrackising-6.1.2}/PKG-INFO +1 -1
- {pyqrackising-6.1.0 → pyqrackising-6.1.2}/README.md +1 -1
- {pyqrackising-6.1.0 → pyqrackising-6.1.2}/pyproject.toml +1 -1
- {pyqrackising-6.1.0 → pyqrackising-6.1.2}/pyqrackising/kernels.cl +8 -8
- {pyqrackising-6.1.0 → pyqrackising-6.1.2}/pyqrackising/maxcut_tfim.py +2 -2
- {pyqrackising-6.1.0 → pyqrackising-6.1.2}/pyqrackising/maxcut_tfim_sparse.py +1 -1
- {pyqrackising-6.1.0 → pyqrackising-6.1.2}/pyqrackising/maxcut_tfim_streaming.py +1 -1
- {pyqrackising-6.1.0 → pyqrackising-6.1.2}/pyqrackising/maxcut_tfim_util.py +1 -1
- {pyqrackising-6.1.0 → pyqrackising-6.1.2}/pyqrackising/spin_glass_solver_sparse.py +1 -0
- {pyqrackising-6.1.0 → pyqrackising-6.1.2/pyqrackising.egg-info}/PKG-INFO +1 -1
- {pyqrackising-6.1.0 → pyqrackising-6.1.2}/setup.py +1 -1
- {pyqrackising-6.1.0 → pyqrackising-6.1.2}/CMakeLists.txt +0 -0
- {pyqrackising-6.1.0 → pyqrackising-6.1.2}/LICENSE.md +0 -0
- {pyqrackising-6.1.0 → pyqrackising-6.1.2}/MANIFEST.in +0 -0
- {pyqrackising-6.1.0 → pyqrackising-6.1.2}/pyqrackising/__init__.py +0 -0
- {pyqrackising-6.1.0 → pyqrackising-6.1.2}/pyqrackising/_pyqrack_ising.cpp +0 -0
- {pyqrackising-6.1.0 → pyqrackising-6.1.2}/pyqrackising/generate_tfim_samples.py +0 -0
- {pyqrackising-6.1.0 → pyqrackising-6.1.2}/pyqrackising/spin_glass_solver.py +0 -0
- {pyqrackising-6.1.0 → pyqrackising-6.1.2}/pyqrackising/spin_glass_solver_streaming.py +0 -0
- {pyqrackising-6.1.0 → pyqrackising-6.1.2}/pyqrackising/spin_glass_solver_util.py +0 -0
- {pyqrackising-6.1.0 → pyqrackising-6.1.2}/pyqrackising/tfim_magnetization.py +0 -0
- {pyqrackising-6.1.0 → pyqrackising-6.1.2}/pyqrackising/tfim_square_magnetization.py +0 -0
- {pyqrackising-6.1.0 → pyqrackising-6.1.2}/pyqrackising/tsp.py +0 -0
- {pyqrackising-6.1.0 → pyqrackising-6.1.2}/pyqrackising.egg-info/SOURCES.txt +0 -0
- {pyqrackising-6.1.0 → pyqrackising-6.1.2}/pyqrackising.egg-info/dependency_links.txt +0 -0
- {pyqrackising-6.1.0 → pyqrackising-6.1.2}/pyqrackising.egg-info/not-zip-safe +0 -0
- {pyqrackising-6.1.0 → pyqrackising-6.1.2}/pyqrackising.egg-info/top_level.txt +0 -0
- {pyqrackising-6.1.0 → pyqrackising-6.1.2}/setup.cfg +0 -0
|
@@ -145,7 +145,7 @@ We expose an environment variable, "`PYQRACKISING_MAX_GPU_PROC_ELEM`", for when
|
|
|
145
145
|
|
|
146
146
|
Similarly, for `is_alt_gpu_sampling=True`, define the "top-`n`" count of highest-weight direct neighbors to retain during sampling with environment variable "`PYQRACKISING_GPU_TOP_N`". The default is `32`. Increasing this might increase solution quality, but it will also increase time-to-solution and private memory usage.
|
|
147
147
|
|
|
148
|
-
By default, PyQrackIsing expects all `numpy` floating-point array inputs to be 32-bit. If you'd like to use 64-bit, you can set environment variable `PYQRACKISING_FPPOW=6` (meaning, 2^6=64, for the "floating-point (precision) power"). The default is `5`, for 32-bit. 16-bit is stubbed out and
|
|
148
|
+
By default, PyQrackIsing expects all `numpy` floating-point array inputs to be 32-bit. If you'd like to use 64-bit, you can set environment variable `PYQRACKISING_FPPOW=6` (meaning, 2^6=64, for the "floating-point (precision) power"). The default is `5`, for 32-bit. 16-bit is stubbed out and compiles for OpenCL, but the bigger hurdle is that `numpy` on `x86_64` doesn't provide a 16-bit floating point implementation. (As author of Qrack, I could suggest to the `numpy` maintainers that open-source, IEEE-compliant software-based implementations exist for `x86_64` and other architectures, but I'm sure they're aware and likely waiting for in-compiler support.) If you're on an ARM-based architecture, there's a good chance 16-bit floating-point will work, if `numpy` uses the native hardware support.
|
|
149
149
|
|
|
150
150
|
## About
|
|
151
151
|
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 = "6.1.
|
|
15
|
+
version = "6.1.2"
|
|
16
16
|
requires-python = ">=3.8"
|
|
17
17
|
description = "Fast MAXCUT, TSP, and sampling heuristics from near-ideal transverse field Ising model (TFIM)"
|
|
18
18
|
readme = {file = "README.txt", content-type = "text/markdown"}
|
|
@@ -413,13 +413,13 @@ __kernel void sample_for_solution_best_bitset(
|
|
|
413
413
|
|
|
414
414
|
int lowest_option = 0;
|
|
415
415
|
real1 lowest_weight = highest_weights[0];
|
|
416
|
-
if (lowest_weight !=
|
|
416
|
+
if (-lowest_weight != INFINITY_R1) {
|
|
417
417
|
for (int x = 1; x < TOP_N; ++x) {
|
|
418
418
|
real1 val = highest_weights[x];
|
|
419
419
|
if (val < lowest_weight) {
|
|
420
420
|
lowest_option = x;
|
|
421
421
|
lowest_weight = highest_weights[x];
|
|
422
|
-
if (val ==
|
|
422
|
+
if (-val == INFINITY_R1) {
|
|
423
423
|
break;
|
|
424
424
|
}
|
|
425
425
|
}
|
|
@@ -436,7 +436,7 @@ __kernel void sample_for_solution_best_bitset(
|
|
|
436
436
|
real1 total_weight = ZERO_R1;
|
|
437
437
|
for (int x = 0; x < TOP_N; ++x) {
|
|
438
438
|
const real1 val = highest_weights[x];
|
|
439
|
-
if (val ==
|
|
439
|
+
if (-val == INFINITY_R1) {
|
|
440
440
|
continue;
|
|
441
441
|
}
|
|
442
442
|
total_weight += val;
|
|
@@ -447,7 +447,7 @@ __kernel void sample_for_solution_best_bitset(
|
|
|
447
447
|
int best_bit = 0;
|
|
448
448
|
for (int x = 0; x < TOP_N; ++x) {
|
|
449
449
|
const real1 val = highest_weights[x];
|
|
450
|
-
if (val ==
|
|
450
|
+
if (-val == INFINITY_R1) {
|
|
451
451
|
continue;
|
|
452
452
|
}
|
|
453
453
|
tot_prob += val;
|
|
@@ -629,13 +629,13 @@ __kernel void sample_for_solution_best_bitset_sparse(
|
|
|
629
629
|
|
|
630
630
|
int lowest_option = 0;
|
|
631
631
|
real1 lowest_weight = highest_weights[0];
|
|
632
|
-
if (lowest_weight !=
|
|
632
|
+
if (-lowest_weight != INFINITY_R1) {
|
|
633
633
|
for (int x = 0; x < TOP_N; ++x) {
|
|
634
634
|
real1 val = highest_weights[x];
|
|
635
635
|
if (val < lowest_weight) {
|
|
636
636
|
lowest_option = x;
|
|
637
637
|
lowest_weight = highest_weights[x];
|
|
638
|
-
if (val ==
|
|
638
|
+
if (-val == INFINITY_R1) {
|
|
639
639
|
break;
|
|
640
640
|
}
|
|
641
641
|
}
|
|
@@ -652,7 +652,7 @@ __kernel void sample_for_solution_best_bitset_sparse(
|
|
|
652
652
|
real1 total_weight = ZERO_R1;
|
|
653
653
|
for (int x = 0; x < TOP_N; ++x) {
|
|
654
654
|
const real1 val = highest_weights[x];
|
|
655
|
-
if (val ==
|
|
655
|
+
if (-val == INFINITY_R1) {
|
|
656
656
|
continue;
|
|
657
657
|
}
|
|
658
658
|
total_weight += val;
|
|
@@ -663,7 +663,7 @@ __kernel void sample_for_solution_best_bitset_sparse(
|
|
|
663
663
|
int best_bit = 0;
|
|
664
664
|
for (int x = 0; x < TOP_N; ++x) {
|
|
665
665
|
const real1 val = highest_weights[x];
|
|
666
|
-
if (val ==
|
|
666
|
+
if (-val == INFINITY_R1) {
|
|
667
667
|
continue;
|
|
668
668
|
}
|
|
669
669
|
tot_prob += val;
|
|
@@ -285,7 +285,7 @@ def maxcut_tfim(
|
|
|
285
285
|
grid_size = n_steps * n_qubits
|
|
286
286
|
|
|
287
287
|
if (not is_base_maxcut_gpu) or not (IS_OPENCL_AVAILABLE and grid_size >= 128):
|
|
288
|
-
return cpu_footer(shots, quality, n_qubits, G_m, nodes)
|
|
288
|
+
return cpu_footer(shots, quality, n_qubits, G_m, nodes, dtype)
|
|
289
289
|
|
|
290
290
|
J_eff, degrees = init_J_and_z(G_m, dtype)
|
|
291
291
|
|
|
@@ -352,7 +352,7 @@ def maxcut_tfim(
|
|
|
352
352
|
return gpu_footer(shots, n_qubits, G_m, J_eff, hamming_prob, nodes, dtype)
|
|
353
353
|
|
|
354
354
|
fix_cdf(hamming_prob)
|
|
355
|
-
best_solution, best_value = run_sampling_opencl(G_m, hamming_prob, shots, n_qubits, is_g_buf_reused
|
|
355
|
+
best_solution, best_value = run_sampling_opencl(G_m, hamming_prob, shots, n_qubits, is_g_buf_reused)
|
|
356
356
|
bit_string, l, r = get_cut(best_solution, nodes)
|
|
357
357
|
|
|
358
358
|
return bit_string, best_value, (l, r)
|
|
@@ -417,7 +417,7 @@ def maxcut_tfim_sparse(
|
|
|
417
417
|
return gpu_footer(shots, n_qubits, G_m.data, G_m.indptr, G_m.indices, J_eff, hamming_prob, nodes, dtype)
|
|
418
418
|
|
|
419
419
|
fix_cdf(hamming_prob)
|
|
420
|
-
best_solution, best_value = run_sampling_opencl(G_m, hamming_prob, shots, n_qubits, is_g_buf_reused
|
|
420
|
+
best_solution, best_value = run_sampling_opencl(G_m, hamming_prob, shots, n_qubits, is_g_buf_reused)
|
|
421
421
|
bit_string, l, r = get_cut(best_solution, nodes)
|
|
422
422
|
|
|
423
423
|
return bit_string, best_value, (l, r)
|
|
@@ -147,7 +147,7 @@ def cpu_footer(shots, quality, n_qubits, G_func, G_func_args_tuple, nodes, dtype
|
|
|
147
147
|
J_eff, degrees, G_max = init_J_and_z(G_func, G_func_args_tuple, nodes, dtype)
|
|
148
148
|
hamming_prob = init_thresholds(n_qubits, dtype)
|
|
149
149
|
|
|
150
|
-
maxcut_hamming_cdf(n_qubits, J_eff, degrees, quality, hamming_prob)
|
|
150
|
+
maxcut_hamming_cdf(n_qubits, J_eff, degrees, quality, hamming_prob, dtype)
|
|
151
151
|
|
|
152
152
|
max_weight = degrees.sum()
|
|
153
153
|
degrees = None
|
|
@@ -73,7 +73,7 @@ def maxcut_hamming_cdf(n_qubits, J_func, degrees, quality, hamming_prob, dtype):
|
|
|
73
73
|
h_mult = 2.0 / tot_t
|
|
74
74
|
n_bias = n_qubits - 1
|
|
75
75
|
|
|
76
|
-
theta = init_theta(h_mult, n_qubits, J_func, degrees)
|
|
76
|
+
theta = init_theta(h_mult, n_qubits, J_func, degrees, dtype)
|
|
77
77
|
|
|
78
78
|
for qc in prange(n_qubits, n_steps * n_qubits):
|
|
79
79
|
step = qc // n_qubits
|
|
@@ -51,7 +51,7 @@ ext_modules = [CMakeExtension('tfim_sampler')]
|
|
|
51
51
|
|
|
52
52
|
setup(
|
|
53
53
|
name='pyqrackising',
|
|
54
|
-
version='6.1.
|
|
54
|
+
version='6.1.2',
|
|
55
55
|
author='Dan Strano',
|
|
56
56
|
author_email='stranoj@gmail.com',
|
|
57
57
|
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
|