PyQrackIsing 1.14.0__tar.gz → 1.14.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.14.0/PyQrackIsing.egg-info → pyqrackising-1.14.1}/PKG-INFO +1 -1
  2. {pyqrackising-1.14.0 → pyqrackising-1.14.1}/PyQrackIsing/maxcut_tfim.py +34 -2
  3. {pyqrackising-1.14.0 → pyqrackising-1.14.1/PyQrackIsing.egg-info}/PKG-INFO +1 -1
  4. {pyqrackising-1.14.0 → pyqrackising-1.14.1}/pyproject.toml +1 -1
  5. {pyqrackising-1.14.0 → pyqrackising-1.14.1}/setup.py +1 -1
  6. {pyqrackising-1.14.0 → pyqrackising-1.14.1}/CMakeLists.txt +0 -0
  7. {pyqrackising-1.14.0 → pyqrackising-1.14.1}/LICENSE.md +0 -0
  8. {pyqrackising-1.14.0 → pyqrackising-1.14.1}/MANIFEST.in +0 -0
  9. {pyqrackising-1.14.0 → pyqrackising-1.14.1}/PyQrackIsing/__init__.py +0 -0
  10. {pyqrackising-1.14.0 → pyqrackising-1.14.1}/PyQrackIsing/_pyqrack_ising.cpp +0 -0
  11. {pyqrackising-1.14.0 → pyqrackising-1.14.1}/PyQrackIsing/generate_tfim_samples.py +0 -0
  12. {pyqrackising-1.14.0 → pyqrackising-1.14.1}/PyQrackIsing/spin_glass_solver.py +0 -0
  13. {pyqrackising-1.14.0 → pyqrackising-1.14.1}/PyQrackIsing/tfim_magnetization.py +0 -0
  14. {pyqrackising-1.14.0 → pyqrackising-1.14.1}/PyQrackIsing/tfim_square_magnetization.py +0 -0
  15. {pyqrackising-1.14.0 → pyqrackising-1.14.1}/PyQrackIsing/tsp_symmetric.py +0 -0
  16. {pyqrackising-1.14.0 → pyqrackising-1.14.1}/PyQrackIsing.egg-info/SOURCES.txt +0 -0
  17. {pyqrackising-1.14.0 → pyqrackising-1.14.1}/PyQrackIsing.egg-info/dependency_links.txt +0 -0
  18. {pyqrackising-1.14.0 → pyqrackising-1.14.1}/PyQrackIsing.egg-info/not-zip-safe +0 -0
  19. {pyqrackising-1.14.0 → pyqrackising-1.14.1}/PyQrackIsing.egg-info/top_level.txt +0 -0
  20. {pyqrackising-1.14.0 → pyqrackising-1.14.1}/README.md +0 -0
  21. {pyqrackising-1.14.0 → pyqrackising-1.14.1}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: PyQrackIsing
3
- Version: 1.14.0
3
+ Version: 1.14.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
@@ -76,6 +76,35 @@ try:
76
76
  for i in range(n_qubits - 1):
77
77
  hamming_prob[i] += bias[i] - last_bias[i]
78
78
 
79
+
80
+ @cuda.jit
81
+ def cuda_maxcut_hamming_cdf_large(n_qubits, n_steps, delta_t, tot_t, h_mult, J_func, degrees, theta, hamming_prob):
82
+ qc = cuda.blockIdx.x * cuda.blockDim.x + cuda.threadIdx.x
83
+ step = qc // n_qubits
84
+ q = qc % n_qubits
85
+
86
+ if step >= n_steps:
87
+ return
88
+
89
+ J_eff = J_func[q]
90
+ if abs(J_eff) <= (2 ** (-54)):
91
+ return
92
+
93
+ z = degrees[q]
94
+ theta_eff = theta[q]
95
+ t = step * delta_t
96
+ tm1 = (step - 1) * delta_t
97
+ h_t = h_mult * (tot_t - t)
98
+ n_bias = n_qubits - 1
99
+
100
+ bias = cuda.local.array(shape=(16384,), dtype=types.float64)
101
+ cuda_probability_by_hamming_weight(J_eff, h_t, z, theta_eff, t, n_qubits, bias)
102
+ for i in range(n_qubits - 1):
103
+ hamming_prob[i] += bias[i]
104
+ cuda_probability_by_hamming_weight(J_eff, h_t, z, theta_eff, tm1, n_qubits, bias)
105
+ for i in range(n_qubits - 1):
106
+ hamming_prob[i] -= bias[i]
107
+
79
108
  except:
80
109
  IS_CUDA_AVAILABLE = False
81
110
 
@@ -299,7 +328,7 @@ def maxcut_tfim(
299
328
  tot_prob += n
300
329
  thresholds /= tot_prob
301
330
 
302
- if IS_CUDA_AVAILABLE and cuda.is_available() and grid_size >= 128 and (n_qubits <= 8192):
331
+ if IS_CUDA_AVAILABLE and cuda.is_available() and grid_size >= 128 and (n_qubits <= 16384):
303
332
  delta_t = 1.0 / n_steps
304
333
  tot_t = n_steps * delta_t
305
334
  h_mult = 32.0 / tot_t
@@ -318,7 +347,10 @@ def maxcut_tfim(
318
347
  )
319
348
  )
320
349
 
321
- cuda_maxcut_hamming_cdf[grid_size, group_size](n_qubits, n_steps, delta_t, tot_t, h_mult, J_eff, degrees, theta, thresholds)
350
+ if n_qubits <= 8192:
351
+ cuda_maxcut_hamming_cdf[grid_size, group_size](n_qubits, n_steps, delta_t, tot_t, h_mult, J_eff, degrees, theta, thresholds)
352
+ else:
353
+ cuda_maxcut_hamming_cdf_large[grid_size, group_size](n_qubits, n_steps, delta_t, tot_t, h_mult, J_eff, degrees, theta, thresholds)
322
354
 
323
355
  tot_prob = sum(thresholds)
324
356
  thresholds /= tot_prob
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: PyQrackIsing
3
- Version: 1.14.0
3
+ Version: 1.14.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.14.0"
15
+ version = "1.14.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.14.0',
54
+ version='1.14.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