PyQrackIsing 1.28.0__tar.gz → 1.29.0__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 (22) hide show
  1. {pyqrackising-1.28.0/PyQrackIsing.egg-info → pyqrackising-1.29.0}/PKG-INFO +1 -1
  2. {pyqrackising-1.28.0 → pyqrackising-1.29.0}/PyQrackIsing/maxcut_tfim.py +14 -10
  3. {pyqrackising-1.28.0 → pyqrackising-1.29.0/PyQrackIsing.egg-info}/PKG-INFO +1 -1
  4. {pyqrackising-1.28.0 → pyqrackising-1.29.0}/pyproject.toml +1 -2
  5. {pyqrackising-1.28.0 → pyqrackising-1.29.0}/setup.py +1 -1
  6. {pyqrackising-1.28.0 → pyqrackising-1.29.0}/CMakeLists.txt +0 -0
  7. {pyqrackising-1.28.0 → pyqrackising-1.29.0}/LICENSE.md +0 -0
  8. {pyqrackising-1.28.0 → pyqrackising-1.29.0}/MANIFEST.in +0 -0
  9. {pyqrackising-1.28.0 → pyqrackising-1.29.0}/PyQrackIsing/__init__.py +0 -0
  10. {pyqrackising-1.28.0 → pyqrackising-1.29.0}/PyQrackIsing/_pyqrack_ising.cpp +0 -0
  11. {pyqrackising-1.28.0 → pyqrackising-1.29.0}/PyQrackIsing/generate_tfim_samples.py +0 -0
  12. {pyqrackising-1.28.0 → pyqrackising-1.29.0}/PyQrackIsing/kernels.cl +0 -0
  13. {pyqrackising-1.28.0 → pyqrackising-1.29.0}/PyQrackIsing/spin_glass_solver.py +0 -0
  14. {pyqrackising-1.28.0 → pyqrackising-1.29.0}/PyQrackIsing/tfim_magnetization.py +0 -0
  15. {pyqrackising-1.28.0 → pyqrackising-1.29.0}/PyQrackIsing/tfim_square_magnetization.py +0 -0
  16. {pyqrackising-1.28.0 → pyqrackising-1.29.0}/PyQrackIsing/tsp_symmetric.py +0 -0
  17. {pyqrackising-1.28.0 → pyqrackising-1.29.0}/PyQrackIsing.egg-info/SOURCES.txt +0 -0
  18. {pyqrackising-1.28.0 → pyqrackising-1.29.0}/PyQrackIsing.egg-info/dependency_links.txt +0 -0
  19. {pyqrackising-1.28.0 → pyqrackising-1.29.0}/PyQrackIsing.egg-info/not-zip-safe +0 -0
  20. {pyqrackising-1.28.0 → pyqrackising-1.29.0}/PyQrackIsing.egg-info/top_level.txt +0 -0
  21. {pyqrackising-1.28.0 → pyqrackising-1.29.0}/README.md +0 -0
  22. {pyqrackising-1.28.0 → pyqrackising-1.29.0}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: PyQrackIsing
3
- Version: 1.28.0
3
+ Version: 1.29.0
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
@@ -4,9 +4,21 @@ import numpy as np
4
4
  import os
5
5
  from numba import njit, prange
6
6
 
7
+
7
8
  IS_OPENCL_AVAILABLE = True
9
+ ctx = None
10
+ queue = None
8
11
  try:
9
12
  import pyopencl as cl
13
+
14
+ # Pick a device (GPU if available)
15
+ ctx = cl.create_some_context()
16
+ queue = cl.CommandQueue(ctx)
17
+
18
+ # Load and build OpenCL kernels
19
+ kernel_src = open(os.path.dirname(os.path.abspath(__file__)) + "/kernels.cl").read()
20
+ program = cl.Program(ctx, kernel_src).build()
21
+ maxcut_hamming_cdf_kernel = program.maxcut_hamming_cdf
10
22
  except ImportError:
11
23
  IS_OPENCL_AVAILABLE = False
12
24
 
@@ -321,14 +333,6 @@ def maxcut_tfim(
321
333
  hamming_prob = init_thresholds(n_qubits)
322
334
 
323
335
  if IS_OPENCL_AVAILABLE and grid_size >= 128:
324
- # Pick a device (GPU if available)
325
- ctx = cl.create_some_context()
326
- queue = cl.CommandQueue(ctx)
327
-
328
- # Load and build OpenCL kernels
329
- kernel_src = open(os.path.dirname(os.path.abspath(__file__)) + "/kernels.cl").read()
330
- program = cl.Program(ctx, kernel_src).build()
331
-
332
336
  delta_t = 1.0 / n_steps
333
337
  tot_t = 2.0 * n_steps * delta_t
334
338
  h_mult = 2.0 / tot_t
@@ -342,7 +346,7 @@ def maxcut_tfim(
342
346
  group_size = n_qubits - 1
343
347
  if group_size > 256:
344
348
  group_size = 256
345
- grid_dim = n_steps * n_qubits
349
+ grid_dim = n_steps * n_qubits * group_size
346
350
 
347
351
  # Move to GPU
348
352
  mf = cl.mem_flags
@@ -353,7 +357,7 @@ def maxcut_tfim(
353
357
  ham_buf = cl.Buffer(ctx, mf.READ_WRITE | mf.COPY_HOST_PTR, hostbuf=hamming_prob)
354
358
 
355
359
  # Kernel execution
356
- program.maxcut_hamming_cdf(
360
+ maxcut_hamming_cdf_kernel(
357
361
  queue, (grid_dim,), (group_size,),
358
362
  np.int32(n_qubits), deg_buf, args_buf, J_buf, theta_buf, ham_buf
359
363
  )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: PyQrackIsing
3
- Version: 1.28.0
3
+ Version: 1.29.0
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
@@ -6,13 +6,12 @@ requires = [
6
6
  "networkx",
7
7
  "numpy",
8
8
  "numba",
9
- "numba-cuda",
10
9
  ]
11
10
  build-backend = "setuptools.build_meta"
12
11
 
13
12
  [project]
14
13
  name = "PyQrackIsing"
15
- version = "1.28.0"
14
+ version = "1.29.0"
16
15
  requires-python = ">=3.8"
17
16
  description = "Near-ideal closed-form solutions for transverse field Ising model (TFIM)"
18
17
  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.28.0',
54
+ version='1.29.0',
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