PyQrackIsing 1.26.3__tar.gz → 1.27.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.
Files changed (21) hide show
  1. {pyqrackising-1.26.3/PyQrackIsing.egg-info → pyqrackising-1.27.1}/PKG-INFO +1 -1
  2. {pyqrackising-1.26.3 → pyqrackising-1.27.1}/PyQrackIsing/maxcut_tfim.py +29 -4
  3. {pyqrackising-1.26.3 → pyqrackising-1.27.1/PyQrackIsing.egg-info}/PKG-INFO +1 -1
  4. {pyqrackising-1.26.3 → pyqrackising-1.27.1}/pyproject.toml +1 -1
  5. {pyqrackising-1.26.3 → pyqrackising-1.27.1}/setup.py +1 -1
  6. {pyqrackising-1.26.3 → pyqrackising-1.27.1}/CMakeLists.txt +0 -0
  7. {pyqrackising-1.26.3 → pyqrackising-1.27.1}/LICENSE.md +0 -0
  8. {pyqrackising-1.26.3 → pyqrackising-1.27.1}/MANIFEST.in +0 -0
  9. {pyqrackising-1.26.3 → pyqrackising-1.27.1}/PyQrackIsing/__init__.py +0 -0
  10. {pyqrackising-1.26.3 → pyqrackising-1.27.1}/PyQrackIsing/_pyqrack_ising.cpp +0 -0
  11. {pyqrackising-1.26.3 → pyqrackising-1.27.1}/PyQrackIsing/generate_tfim_samples.py +0 -0
  12. {pyqrackising-1.26.3 → pyqrackising-1.27.1}/PyQrackIsing/spin_glass_solver.py +0 -0
  13. {pyqrackising-1.26.3 → pyqrackising-1.27.1}/PyQrackIsing/tfim_magnetization.py +0 -0
  14. {pyqrackising-1.26.3 → pyqrackising-1.27.1}/PyQrackIsing/tfim_square_magnetization.py +0 -0
  15. {pyqrackising-1.26.3 → pyqrackising-1.27.1}/PyQrackIsing/tsp_symmetric.py +0 -0
  16. {pyqrackising-1.26.3 → pyqrackising-1.27.1}/PyQrackIsing.egg-info/SOURCES.txt +0 -0
  17. {pyqrackising-1.26.3 → pyqrackising-1.27.1}/PyQrackIsing.egg-info/dependency_links.txt +0 -0
  18. {pyqrackising-1.26.3 → pyqrackising-1.27.1}/PyQrackIsing.egg-info/not-zip-safe +0 -0
  19. {pyqrackising-1.26.3 → pyqrackising-1.27.1}/PyQrackIsing.egg-info/top_level.txt +0 -0
  20. {pyqrackising-1.26.3 → pyqrackising-1.27.1}/README.md +0 -0
  21. {pyqrackising-1.26.3 → pyqrackising-1.27.1}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: PyQrackIsing
3
- Version: 1.26.3
3
+ Version: 1.27.1
4
4
  Summary: Near-ideal closed-form solutions for transverse field Ising model (TFIM)
5
5
  Home-page: https://github.com/vm6502q/PyQrackIsing
6
6
  Author: Dan Strano
@@ -32,12 +32,12 @@ try:
32
32
  return result
33
33
 
34
34
  @cuda.jit
35
- def cuda_maxcut_hamming_cdf(delta_t, tot_t, h_mult, J_func, degrees, theta, hamming_prob):
35
+ def cuda_maxcut_hamming_cdf_wide(delta_t, tot_t, h_mult, J_func, degrees, theta, hamming_prob):
36
36
  step = cuda.blockIdx.x
37
37
  qi = cuda.blockIdx.y
38
38
  J_eff = J_func[qi]
39
39
  z = degrees[qi]
40
- if abs(z * J_eff) <= (2 ** (-54)):
40
+ if abs(z * J_eff) <= (2 ** (-52)):
41
41
  return
42
42
 
43
43
  n_qubits = cuda.gridDim.y
@@ -53,6 +53,29 @@ try:
53
53
  diff -= cuda_probability_by_hamming_weight(qo, J_eff, h_t, z, theta_eff, tm1, n_qubits)
54
54
  hamming_prob[qo] += diff
55
55
 
56
+ @cuda.jit
57
+ def cuda_maxcut_hamming_cdf(n_qubits, delta_t, tot_t, h_mult, J_func, degrees, theta, hamming_prob):
58
+ step = cuda.blockIdx.x // n_qubits
59
+ qi = cuda.blockIdx.x % n_qubits
60
+ J_eff = J_func[qi]
61
+ z = degrees[qi]
62
+ if abs(z * J_eff) <= (2 ** (-52)):
63
+ return
64
+
65
+ theta_eff = theta[qi]
66
+ t = step * delta_t
67
+ tm1 = (step - 1) * delta_t
68
+ h_t = h_mult * (tot_t - t)
69
+
70
+ n_threads = cuda.blockDim.x
71
+ qo = cuda.threadIdx.x
72
+ while qo < n_qubits:
73
+ _qo = (n_qubits - (1 + qo)) if J_eff > 0.0 else qo
74
+ diff = cuda_probability_by_hamming_weight(_qo, J_eff, h_t, z, theta_eff, t, n_qubits)
75
+ diff -= cuda_probability_by_hamming_weight(_qo, J_eff, h_t, z, theta_eff, tm1, n_qubits)
76
+ hamming_prob[_qo] += diff
77
+ qo += n_threads
78
+
56
79
  except:
57
80
  IS_CUDA_AVAILABLE = False
58
81
 
@@ -375,8 +398,10 @@ def maxcut_tfim(
375
398
  # Warp size is 32:
376
399
  group_size = n_qubits - 1
377
400
  grid_dims = (n_steps, n_qubits)
378
-
379
- cuda_maxcut_hamming_cdf[grid_dims, group_size](delta_t, tot_t, h_mult, J_eff, degrees, theta, thresholds)
401
+ if group_size <= 256:
402
+ cuda_maxcut_hamming_cdf_wide[grid_dims, group_size](delta_t, tot_t, h_mult, J_eff, degrees, theta, thresholds)
403
+ else:
404
+ cuda_maxcut_hamming_cdf[n_steps * n_qubits, 128](n_qubits, delta_t, tot_t, h_mult, J_eff, degrees, theta, thresholds)
380
405
 
381
406
  thresholds /= thresholds.sum()
382
407
  tot_prob = 0.0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: PyQrackIsing
3
- Version: 1.26.3
3
+ Version: 1.27.1
4
4
  Summary: Near-ideal closed-form solutions for transverse field Ising model (TFIM)
5
5
  Home-page: https://github.com/vm6502q/PyQrackIsing
6
6
  Author: Dan Strano
@@ -12,7 +12,7 @@ build-backend = "setuptools.build_meta"
12
12
 
13
13
  [project]
14
14
  name = "PyQrackIsing"
15
- version = "1.26.3"
15
+ version = "1.27.1"
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.26.3',
54
+ version='1.27.1',
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