nvalchemi-toolkit-ops 0.6.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 (190) hide show
  1. nvalchemi_toolkit_ops-0.6.0/.gitignore +138 -0
  2. nvalchemi_toolkit_ops-0.6.0/LICENSE +14 -0
  3. nvalchemi_toolkit_ops-0.6.0/PKG-INFO +275 -0
  4. nvalchemi_toolkit_ops-0.6.0/README.md +243 -0
  5. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/__init__.py +27 -0
  6. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/batch_utils.py +854 -0
  7. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/dynamics/__init__.py +64 -0
  8. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/dynamics/integrators/__init__.py +292 -0
  9. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/dynamics/integrators/csvr.py +334 -0
  10. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/dynamics/integrators/langevin.py +1301 -0
  11. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/dynamics/integrators/nose_hoover.py +1816 -0
  12. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/dynamics/integrators/npt.py +3995 -0
  13. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/dynamics/integrators/velocity_rescaling.py +257 -0
  14. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/dynamics/integrators/velocity_verlet.py +927 -0
  15. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/dynamics/optimizers/__init__.py +140 -0
  16. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/dynamics/optimizers/fire.py +2342 -0
  17. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/dynamics/optimizers/fire2.py +1416 -0
  18. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/dynamics/optimizers/lbfgs.py +3649 -0
  19. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/dynamics/utils/__init__.py +249 -0
  20. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/dynamics/utils/cell_filter.py +1942 -0
  21. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/dynamics/utils/cell_utils.py +1137 -0
  22. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/dynamics/utils/constraints.py +1321 -0
  23. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/dynamics/utils/kernel_functions.py +581 -0
  24. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/dynamics/utils/launch_helpers.py +294 -0
  25. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/dynamics/utils/shared_kernels.py +367 -0
  26. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/dynamics/utils/thermostat_utils.py +1936 -0
  27. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/interactions/__init__.py +45 -0
  28. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/interactions/dispersion/__init__.py +105 -0
  29. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/interactions/dispersion/_c6_decomposition.py +463 -0
  30. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/interactions/dispersion/_dftd3.py +3331 -0
  31. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/interactions/dispersion/_fourier_dftd3.py +2061 -0
  32. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/interactions/electrostatics/__init__.py +265 -0
  33. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/interactions/electrostatics/_factory_common.py +683 -0
  34. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/interactions/electrostatics/_pme_mesh.py +123 -0
  35. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/interactions/electrostatics/coulomb.py +1256 -0
  36. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/interactions/electrostatics/dsf.py +1127 -0
  37. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/interactions/electrostatics/ewald_kernels.py +5496 -0
  38. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/interactions/electrostatics/ewald_real_factory.py +2188 -0
  39. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/interactions/electrostatics/ewald_recip_factory.py +2854 -0
  40. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/interactions/electrostatics/multipole_direct_kspace_kernels.py +16044 -0
  41. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/interactions/electrostatics/multipole_ewald_cell_grad.py +1591 -0
  42. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/interactions/electrostatics/multipole_ewald_kernels.py +8691 -0
  43. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/interactions/electrostatics/multipole_ewald_quadrupole_2nd_backward.py +2836 -0
  44. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/interactions/electrostatics/pme_factory.py +997 -0
  45. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/interactions/electrostatics/pme_kernels.py +2182 -0
  46. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/interactions/electrostatics/pme_multipole_kernels.py +9453 -0
  47. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/interactions/electrostatics/slab_kernels.py +3787 -0
  48. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/interactions/lj.py +2142 -0
  49. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/interactions/switching.py +92 -0
  50. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/jax/__init__.py +48 -0
  51. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/jax/_lazy_jax_kernels.py +112 -0
  52. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/jax/interactions/__init__.py +25 -0
  53. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/jax/interactions/dispersion/__init__.py +34 -0
  54. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/jax/interactions/dispersion/_dftd3.py +2124 -0
  55. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/jax/interactions/dispersion/_fourier_dftd3.py +843 -0
  56. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/jax/interactions/electrostatics/__init__.py +248 -0
  57. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/jax/interactions/electrostatics/_autograd.py +173 -0
  58. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/jax/interactions/electrostatics/_utils.py +249 -0
  59. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/jax/interactions/electrostatics/coulomb.py +578 -0
  60. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/jax/interactions/electrostatics/ewald.py +3427 -0
  61. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/jax/interactions/electrostatics/k_vectors.py +488 -0
  62. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/jax/interactions/electrostatics/parameters.py +405 -0
  63. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/jax/interactions/electrostatics/pme.py +3455 -0
  64. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/jax/interactions/electrostatics/slab.py +1077 -0
  65. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/jax/lbfgs.py +1068 -0
  66. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/jax/neighbors/__init__.py +754 -0
  67. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/jax/neighbors/_autograd.py +229 -0
  68. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/jax/neighbors/_cell_grid.py +101 -0
  69. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/jax/neighbors/_cluster_tile_preload.py +380 -0
  70. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/jax/neighbors/_dispatch.py +707 -0
  71. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/jax/neighbors/_registration.py +787 -0
  72. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/jax/neighbors/_resolution.py +62 -0
  73. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/jax/neighbors/_status.py +77 -0
  74. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/jax/neighbors/batch_cell_list.py +2934 -0
  75. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/jax/neighbors/batch_cluster_tile.py +3200 -0
  76. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/jax/neighbors/batch_naive.py +2105 -0
  77. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/jax/neighbors/batch_naive_dual_cutoff.py +824 -0
  78. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/jax/neighbors/cell_list.py +3790 -0
  79. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/jax/neighbors/cluster_tile.py +2849 -0
  80. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/jax/neighbors/naive.py +3094 -0
  81. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/jax/neighbors/naive_dual_cutoff.py +752 -0
  82. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/jax/neighbors/neighbor_utils.py +871 -0
  83. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/jax/neighbors/prepared_neighbor_list.py +3588 -0
  84. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/jax/neighbors/rebuild_detection.py +756 -0
  85. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/jax/segment_mm.py +586 -0
  86. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/jax/segment_ops.py +1139 -0
  87. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/jax/spline.py +1514 -0
  88. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/jax/types.py +219 -0
  89. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/math/__init__.py +194 -0
  90. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/math/gto.py +761 -0
  91. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/math/math.py +176 -0
  92. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/math/solid_harmonics.py +226 -0
  93. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/math/spherical_harmonics.py +813 -0
  94. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/math/spline.py +3735 -0
  95. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/neighborlist/__init__.py +192 -0
  96. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/neighbors/__init__.py +157 -0
  97. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/neighbors/base_dispatch.py +1181 -0
  98. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/neighbors/batch_cell_list.py +48 -0
  99. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/neighbors/batch_naive.py +36 -0
  100. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/neighbors/batch_naive_dual_cutoff.py +36 -0
  101. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/neighbors/cell_list/__init__.py +62 -0
  102. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/neighbors/cell_list/_grid_selection.py +398 -0
  103. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/neighbors/cell_list/dispatch.py +415 -0
  104. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/neighbors/cell_list/kernels.py +2376 -0
  105. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/neighbors/cell_list/launchers.py +1817 -0
  106. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/neighbors/cluster_tile/__init__.py +46 -0
  107. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/neighbors/cluster_tile/kernels.py +2866 -0
  108. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/neighbors/cluster_tile/launchers.py +1898 -0
  109. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/neighbors/naive/__init__.py +42 -0
  110. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/neighbors/naive/dispatch.py +193 -0
  111. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/neighbors/naive/kernels.py +1252 -0
  112. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/neighbors/naive/launchers.py +2316 -0
  113. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/neighbors/naive_dual_cutoff.py +38 -0
  114. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/neighbors/neighbor_utils.py +2093 -0
  115. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/neighbors/output_args.py +322 -0
  116. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/neighbors/rebuild/__init__.py +34 -0
  117. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/neighbors/rebuild/kernels.py +497 -0
  118. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/neighbors/rebuild/launchers.py +448 -0
  119. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/neighbors/rebuild_detection.py +46 -0
  120. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/segment_mm.py +1319 -0
  121. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/segment_ops.py +2524 -0
  122. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/segment_ops_backward.py +2965 -0
  123. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/torch/__init__.py +102 -0
  124. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/torch/_warnings.py +64 -0
  125. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/torch/_warp_op_helpers.py +725 -0
  126. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/torch/autograd.py +1133 -0
  127. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/torch/fire2.py +1886 -0
  128. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/torch/interactions/__init__.py +20 -0
  129. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/torch/interactions/dispersion/__init__.py +30 -0
  130. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/torch/interactions/dispersion/_dftd3.py +1653 -0
  131. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/torch/interactions/dispersion/_fourier_dftd3.py +1309 -0
  132. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/torch/interactions/electrostatics/__init__.py +228 -0
  133. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/torch/interactions/electrostatics/_ewald_corrections_chain.py +346 -0
  134. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/torch/interactions/electrostatics/_ewald_direct.py +632 -0
  135. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/torch/interactions/electrostatics/_ewald_real_chain.py +2524 -0
  136. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/torch/interactions/electrostatics/_ewald_recip_chain.py +1840 -0
  137. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/torch/interactions/electrostatics/_multipole_moments.py +428 -0
  138. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/torch/interactions/electrostatics/_registration.py +50 -0
  139. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/torch/interactions/electrostatics/_slab_chain.py +858 -0
  140. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/torch/interactions/electrostatics/_util.py +970 -0
  141. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/torch/interactions/electrostatics/coulomb.py +1142 -0
  142. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/torch/interactions/electrostatics/dsf.py +638 -0
  143. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/torch/interactions/electrostatics/ewald.py +1992 -0
  144. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/torch/interactions/electrostatics/k_vectors.py +480 -0
  145. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/torch/interactions/electrostatics/multipole_autograd.py +3198 -0
  146. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/torch/interactions/electrostatics/multipole_autograd_batch.py +3220 -0
  147. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/torch/interactions/electrostatics/multipole_autograd_kernels.py +581 -0
  148. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/torch/interactions/electrostatics/multipole_electrostatics.py +651 -0
  149. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/torch/interactions/electrostatics/multipole_ewald.py +5406 -0
  150. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/torch/interactions/electrostatics/multipole_ewald_quadrupole.py +1497 -0
  151. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/torch/interactions/electrostatics/multipole_features.py +323 -0
  152. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/torch/interactions/electrostatics/multipole_scf_cache.py +896 -0
  153. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/torch/interactions/electrostatics/multipole_scf_step.py +1015 -0
  154. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/torch/interactions/electrostatics/parameters.py +744 -0
  155. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/torch/interactions/electrostatics/pme.py +4251 -0
  156. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/torch/interactions/electrostatics/pme_multipole.py +6612 -0
  157. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/torch/interactions/electrostatics/slab.py +528 -0
  158. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/torch/lbfgs.py +813 -0
  159. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/torch/math/__init__.py +68 -0
  160. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/torch/math/gto.py +255 -0
  161. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/torch/math/gto_self_overlap.py +268 -0
  162. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/torch/math/solid_harmonics.py +132 -0
  163. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/torch/math/spherical_harmonics.py +111 -0
  164. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/torch/neighbors/__init__.py +687 -0
  165. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/torch/neighbors/_autograd.py +438 -0
  166. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/torch/neighbors/_cell_grid.py +166 -0
  167. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/torch/neighbors/_cluster_tile_state.py +840 -0
  168. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/torch/neighbors/_compiled_pair_fn.py +197 -0
  169. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/torch/neighbors/_dispatch.py +502 -0
  170. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/torch/neighbors/_fixed_cell.py +39 -0
  171. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/torch/neighbors/_naive_partial.py +348 -0
  172. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/torch/neighbors/_naive_prepared_guard.py +115 -0
  173. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/torch/neighbors/_resolution.py +28 -0
  174. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/torch/neighbors/batch_cell_list.py +2717 -0
  175. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/torch/neighbors/batch_cluster_tile.py +4987 -0
  176. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/torch/neighbors/batch_naive.py +2033 -0
  177. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/torch/neighbors/batch_naive_dual_cutoff.py +981 -0
  178. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/torch/neighbors/cell_list.py +2635 -0
  179. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/torch/neighbors/cluster_tile.py +4184 -0
  180. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/torch/neighbors/naive.py +1977 -0
  181. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/torch/neighbors/naive_dual_cutoff.py +879 -0
  182. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/torch/neighbors/neighbor_utils.py +1189 -0
  183. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/torch/neighbors/prepared_neighbor_list.py +2467 -0
  184. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/torch/neighbors/rebuild_detection.py +923 -0
  185. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/torch/segment_mm.py +673 -0
  186. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/torch/segment_ops.py +946 -0
  187. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/torch/spline.py +3253 -0
  188. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/torch/types.py +110 -0
  189. nvalchemi_toolkit_ops-0.6.0/nvalchemiops/warp_dispatch.py +287 -0
  190. nvalchemi_toolkit_ops-0.6.0/pyproject.toml +256 -0
@@ -0,0 +1,138 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ *.manifest
31
+ *.spec
32
+
33
+ # Installer logs
34
+ pip-log.txt
35
+ pip-delete-this-directory.txt
36
+
37
+ # Unit test / coverage reports
38
+ htmlcov/
39
+ .tox/
40
+ .nox/
41
+ .coverage
42
+ .coverage.*
43
+ .cache
44
+ .tmp/
45
+ # Local review files, docs builds, and validation output
46
+ /tmp/
47
+ nosetests.xml
48
+ coverage.xml
49
+ nvalchemiops.coverage.xml
50
+ *.cover
51
+ .hypothesis/
52
+ .pytest_cache/
53
+ cover/
54
+
55
+ # Jupyter Notebook
56
+ .ipynb_checkpoints
57
+
58
+ # IPython
59
+ profile_default/
60
+ ipython_config.py
61
+
62
+ # Environments
63
+ .env
64
+ .venv
65
+ .venv-*
66
+ env/
67
+ venv/
68
+ ENV/
69
+ env.bak/
70
+ venv.bak/
71
+
72
+ # PyCharm
73
+ .idea/
74
+
75
+ # VsCode
76
+ .vscode/
77
+
78
+ # VIM
79
+ *.swp
80
+ *~
81
+
82
+ # nvalchemiops specific
83
+ *.xyz
84
+ *.npy
85
+ *.npz
86
+ *.tar.gz
87
+ *.png
88
+ docs/benchmarks/_static/nl-*.svg
89
+ *.csv
90
+ !docs/benchmarks/benchmark_results/nl-*.csv
91
+ !docs/benchmarks/benchmark_results/d3-*.csv
92
+ !docs/benchmarks/benchmark_results/el-*.csv
93
+ *.log
94
+ *.cif
95
+ benchmarks/nh3/ammonia_pbc_*.inp
96
+ benchmarks/nh3/ammonia_pbc_*.pdb
97
+
98
+ # GPU profiling
99
+ nsight-systems*
100
+ *.nvprof
101
+ *.qdrep
102
+
103
+ # Examples output
104
+ outputs/
105
+ results/
106
+ checkpoints/
107
+
108
+ # Sphinx documentation
109
+ _build
110
+ docs/_build
111
+ docs/_build*/
112
+ docs/modules/generated
113
+ docs/modules/backreferences
114
+ docs/examples
115
+ docs/sg_execution_times.rst
116
+
117
+ # Lightning and training logs
118
+ lightning_logs/
119
+ mlruns/
120
+ wandb/
121
+
122
+ # Slurm logs
123
+ slurm-*.out
124
+
125
+ # Exclude version file from VCS
126
+ nvalchemiops/_version.py
127
+
128
+ # Warp kernel cache (CI persists this via actions/cache at $GITHUB_WORKSPACE/.warp-cache)
129
+ .warp-cache/
130
+
131
+ # Per-test coverage databases and the duration table behind `make
132
+ # minimal-suite-report`. Regenerate rather than commit; they are large and
133
+ # machine-specific.
134
+ .covctx/
135
+ ci_durations.json
136
+
137
+ # Slow-test verification logs (see tools/verify_slow_tests.sh)
138
+ .slowcheck/
@@ -0,0 +1,14 @@
1
+ # SPDX-FileCopyrightText: Copyright (c) 2025 - 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2
+ # SPDX-License-Identifier: Apache-2.0
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
@@ -0,0 +1,275 @@
1
+ Metadata-Version: 2.5
2
+ Name: nvalchemi-toolkit-ops
3
+ Version: 0.6.0
4
+ Summary: High-performance NVIDIA Warp primitives for GPU-enabled computational chemistry and atomistic simulation workflows.
5
+ Author: nvalchemiops Team
6
+ License-Expression: Apache-2.0
7
+ License-File: LICENSE
8
+ Keywords: atomic simulation,batched operations,computational chemistry,cuda,gpu,molecular dynamics,neighborlist,nvidia-warp,optimization
9
+ Classifier: Environment :: GPU
10
+ Classifier: Intended Audience :: Science/Research
11
+ Classifier: License :: OSI Approved :: Apache Software License
12
+ Classifier: Operating System :: OS Independent
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Topic :: Scientific/Engineering :: Chemistry
15
+ Classifier: Topic :: Scientific/Engineering :: Physics
16
+ Requires-Python: <3.15,>=3.11
17
+ Requires-Dist: numpy
18
+ Requires-Dist: warp-lang>=1.16.0
19
+ Provides-Extra: jax
20
+ Requires-Dist: jax[cuda13]<0.10.2,>=0.10.0; extra == 'jax'
21
+ Provides-Extra: jax-cu12
22
+ Requires-Dist: jax[cuda12]<0.10.2,>=0.10.0; extra == 'jax-cu12'
23
+ Provides-Extra: jax-cu13
24
+ Requires-Dist: jax[cuda13]<0.10.2,>=0.10.0; extra == 'jax-cu13'
25
+ Provides-Extra: torch
26
+ Requires-Dist: torch>=2.10.0; extra == 'torch'
27
+ Provides-Extra: torch-cu12
28
+ Requires-Dist: torch<2.15.0,>=2.10.0; extra == 'torch-cu12'
29
+ Provides-Extra: torch-cu13
30
+ Requires-Dist: torch>=2.10.0; extra == 'torch-cu13'
31
+ Description-Content-Type: text/markdown
32
+
33
+ <!-- markdownlint-disable MD033 MD007 -->
34
+
35
+ # NVIDIA ALCHEMI Toolkit-Ops
36
+
37
+ [![PyPI version](https://badge.fury.io/py/nvalchemi-toolkit-ops.svg)](https://badge.fury.io/py/nvalchemi-toolkit-ops)
38
+ [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
39
+ [![codecov](https://codecov.io/gh/NVIDIA/nvalchemi-toolkit-ops/branch/main/graph/badge.svg)](https://codecov.io/gh/NVIDIA/nvalchemi-toolkit-ops)
40
+ [![Documentation](https://img.shields.io/badge/docs-github%20pages-blue)](https://nvidia.github.io/nvalchemi-toolkit-ops/)
41
+
42
+ ## High-performance NVIDIA Warp primitives for computational chemistry
43
+
44
+ NVIDIA ALCHEMI Toolkit-Ops is a collection of **GPU-optimized**, **batched**
45
+ primitives for accelerating atomistic simulations. High performance compute
46
+ kernels are written in [NVIDIA `warp-lang`](https://github.com/NVIDIA/warp).
47
+
48
+ ### Key Features
49
+
50
+ - **Neighbor lists**
51
+ - Naive, cell-list, and tiled cluster-pair methods
52
+ - Matrix and COO formats
53
+ - Automatic method selection and custom pair functions
54
+ - **Molecular dynamics**
55
+ - NVE, NVT, NPT, and NPH ensembles
56
+ - Langevin, Nosé-Hoover Chain, CSVR, and velocity-rescaling thermostats
57
+ - **Geometry optimization with FIRE2 and L-BFGS**, supporting coordinate and
58
+ lattice relaxation
59
+ - **Interatomic interactions**
60
+ - Standard and periodic Fourier DFT-D3(BJ) dispersion
61
+ - DSF, Ewald, and PME electrostatics
62
+ - Ewald and PME for charges and multipoles (Warp/PyTorch)
63
+ - **Differentiable electrostatics for PyTorch training**, with automatic
64
+ differentiation for forces, charge gradients, virials, and stress
65
+ - **Core kernels written in `warp-lang`** with PyTorch and JAX bindings
66
+
67
+ Kernels are naturally intended to be highly scalable (>100,000 atoms) and generally
68
+ optimized for high throughput operations (on the order of several microseconds per
69
+ atom) on GPUs, with batching support.
70
+
71
+ ### Use Cases
72
+
73
+ There are currently three primary use cases where we imagine `nvalchemi-toolkit-ops` to
74
+ fit into the ecosystem:
75
+
76
+ - Library maintainers and developers are encouraged to benchmark and explore
77
+ integrating functionality like neighbor list computation to accelerate
78
+ existing workflows;
79
+ - Researchers and model developers ideally should be able to rely on
80
+ this package (and not implement their own!) for neighbor list computation,
81
+ interatomic interactions, and so on during method development;
82
+ - Engineers looking to build applications that involve molecular dynamics,
83
+ interatomic potentials, and the like can take advantage of optimized and
84
+ maintained low-level kernels. `warp-lang` kernels should be sufficiently
85
+ modular to allow for a high degree of flexibility and reusability.
86
+
87
+ The combination of being GPU-first and batched should enable the kernels contained
88
+ in `nvalchemi-toolkit-ops` to be ready for a wide range of research and production
89
+ applications.
90
+
91
+ ### Example Snippets
92
+
93
+ We encourage interested readers to browse our hosted
94
+ [documentation](https://nvidia.github.io/nvalchemi-toolkit-ops). Below are some
95
+ short snippets that highlight our straightforward API and use cases
96
+ for PyTorch: see the hosted documentation for Jax details.
97
+
98
+ <details>
99
+ <summary>Neighbor list in a 2D unit cell with 50,000 atoms</summary>
100
+
101
+ This example uses PyTorch:
102
+
103
+ ```python
104
+ import torch
105
+ from nvalchemiops.torch.neighbors import neighbor_list
106
+
107
+ torch.set_default_dtype(torch.float32)
108
+ device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
109
+ torch.set_default_device(device)
110
+
111
+ NUM_ATOMS = 50_000
112
+ # distribute positions inside the cell
113
+ positions = torch.rand((NUM_ATOMS, 3)) * 100.0
114
+ cell = (torch.eye(3, dtype=torch.float32) * 100.0).unsqueeze(0)
115
+ pbc = torch.tensor([True, True, False], dtype=torch.bool)
116
+ cutoff = 6.0
117
+ # use padded matrix representation for neighbors, optimal for
118
+ # compiled applications that need constant shapes
119
+ neighbor_matrix, num_neighbors, shift_matrix = neighbor_list(
120
+ positions,
121
+ cutoff,
122
+ cell=cell,
123
+ pbc=pbc,
124
+ method="cell_list"
125
+ )
126
+ # ...or pass `return_neighbor_list=True` for the familiar COO
127
+ # `edge_index` format. `method` will also automatically determine
128
+ # neighbor algorithm based off system size
129
+ edge_index, neighbor_ptr, shifts = neighbor_list(
130
+ positions,
131
+ cutoff,
132
+ cell=cell,
133
+ pbc=pbc,
134
+ return_neighbor_list=True
135
+ )
136
+
137
+ ```
138
+
139
+ </details>
140
+
141
+ <details>
142
+ <summary>DFT-D3(BJ) corrections on a batch of molecules</summary>
143
+
144
+ This example assumes you already have concatenated a set of molecules
145
+ into combined tensors, and have computed some form of neighborhood
146
+ using the `neighbor_list` API. Here, we'll demonstrate using the
147
+ matrix representation:
148
+
149
+ ```python
150
+ import torch
151
+ from nvalchemiops.torch.interactions.dispersion import dftd3
152
+ from nvalchemiops.torch.neighbors import neighbor_list
153
+
154
+ # the following parameters need to be constructed ahead of time
155
+ positions = ... # [num_atoms, 3]
156
+ atomic_numbers = ... # [num_atoms]
157
+ cell = ... # [num_systems, 3, 3]
158
+ pbc = ... # [num_systems, 3]
159
+ batch_idx = ... # [num_atoms]
160
+ batch_ptr = ... # [num_systems + 1]
161
+ # construct neighbor matrix
162
+ neighbor_matrix, num_neighbors, shift_matrix = neighbor_list(
163
+ positions,
164
+ cutoff=..., # on the order of ~20 Angstroms
165
+ cell=cell,
166
+ pbc=pbc,
167
+ batch_idx=batch_idx,
168
+ batch_ptr=batch_ptr
169
+ )
170
+ # DFT-D3 parameters need to be provided, which comprises reference C6 parameters.
171
+ # Refer to the user documentation to see the expected structure and data source.
172
+ d3_params = ...
173
+ # pass everything to the functional interface
174
+ d3_energies, d3_forces, coord_nums, d3_virials = dftd3(
175
+ positions=positions,
176
+ numbers=atomic_numbers,
177
+ neighbor_matrix=neighbor_matrix,
178
+ neighbor_matrix_shifts=shift_matrix,
179
+ batch_idx=batch_idx,
180
+ cell=cell,
181
+ # functional specific DFT-D3 parameters (PBE shown)
182
+ a1=0.4289, a2=4.4407, s8=0.7875,
183
+ d3_params=d3_params,
184
+ compute_virial=True
185
+ )
186
+ ```
187
+
188
+ </details>
189
+
190
+ <details>
191
+ <summary>Electrostatics via particle mesh Ewald</summary>
192
+
193
+ This example shows how to compute the per-atom and system energies
194
+ as well as the forces using the particle mesh Ewald interface.
195
+
196
+ ```python
197
+ import torch
198
+ from nvalchemiops.torch.interactions.electrostatics import particle_mesh_ewald
199
+ from nvalchemiops.torch.neighbors import neighbor_list
200
+
201
+ # the following parameters need to be constructed ahead of time
202
+ positions = ... # [num_atoms, 3]
203
+ atomic_numbers = ... # [num_atoms]
204
+ cell = ... # [num_systems, 3, 3]
205
+ pbc = ... # [num_systems, 3]
206
+ atomic_charges = ... # [num_atoms]
207
+ positions = positions.requires_grad_(True)
208
+ # construct neighbor matrix
209
+ neighbor_matrix, num_neighbors, shift_matrix = neighbor_list(
210
+ positions,
211
+ cutoff=..., # on the order of ~20 Angstroms
212
+ cell=cell,
213
+ pbc=pbc,
214
+ )
215
+ # call PME, using automatic parameter tuning
216
+ atom_energies = particle_mesh_ewald(
217
+ positions=positions,
218
+ charges=atomic_charges,
219
+ cell=cell,
220
+ neighbor_matrix=neighbor_matrix,
221
+ neighbor_matrix_shifts=shift_matrix,
222
+ accuracy=1e-6
223
+ )
224
+ system_energy = atom_energies.sum()
225
+ atom_forces = -torch.autograd.grad(system_energy, positions)[0]
226
+ ```
227
+
228
+ </details>
229
+
230
+ ## CUDA 13 Support
231
+
232
+ CUDA 13 is required for Blackwell GPUs. `torch>=2.11.0` and `jax[cuda13]`
233
+ publish CUDA 13 wheels on the default PyPI index for Linux x86_64 and
234
+ aarch64 platforms.
235
+
236
+ The `torch` and `jax` extras use CUDA 13 by default and are equivalent to the
237
+ explicit `torch-cu13` and `jax-cu13` extras. Use `torch-cu12` and `jax-cu12`
238
+ when CUDA 12.6 PyTorch wheels or CUDA 12 JAX plugins are required. The PyTorch
239
+ indexes used for explicit CUDA selection are `cu130` for CUDA 13 and `cu126`
240
+ for the CUDA 12 fallback. pip and `uv pip` read only the published package
241
+ metadata, so `torch-cu12` needs the `cu126` index on the command line.
242
+ PyTorch publishes no CUDA 12 build of PyTorch 2.15 or newer.
243
+
244
+ ```bash
245
+ # Standalone install
246
+ uv venv --seed --python 3.12
247
+ uv pip install nvalchemi-toolkit-ops torch==2.11.0
248
+
249
+ # Explicit CUDA 13 PyTorch wheel index
250
+ uv pip install nvalchemi-toolkit-ops \
251
+ torch==2.11.0+cu130 \
252
+ --extra-index-url https://download.pytorch.org/whl/cu130
253
+
254
+ # CUDA 12 PyTorch wheels
255
+ pip install 'nvalchemi-toolkit-ops[torch-cu12]' \
256
+ --extra-index-url https://download.pytorch.org/whl/cu126
257
+ uv pip install 'nvalchemi-toolkit-ops[torch-cu12]' --torch-backend cu126
258
+ ```
259
+
260
+ See the [installation guide](https://nvidia.github.io/nvalchemi-toolkit-ops/userguide/about/install.html#cuda-13-installation)
261
+ for details.
262
+
263
+ ## Contributions & Disclaimers
264
+
265
+ Feature requests, discussions, and general feedback are
266
+ welcome and encouraged via
267
+ [Github Issues](https://www.github.com/NVIDIA/nvalchemi-toolkit-ops). Before submitting a
268
+ pull request, we highly encourage you to create an issue to discuss
269
+ with developers first so we can understand your use case and collaborate
270
+ on features and bug fixes. Contributors must read [CONTRIBUTING.md](./CONTRIBUTING.md) to
271
+ understand and follow the development workflow and logistics.
272
+
273
+ NVIDIA ALCHEMI Toolkit-Ops is under active development; while we strive to
274
+ ensure public facing APIs do not break, they are subject to change as we
275
+ are trying to continuously improve performance and user experience.
@@ -0,0 +1,243 @@
1
+ <!-- markdownlint-disable MD033 MD007 -->
2
+
3
+ # NVIDIA ALCHEMI Toolkit-Ops
4
+
5
+ [![PyPI version](https://badge.fury.io/py/nvalchemi-toolkit-ops.svg)](https://badge.fury.io/py/nvalchemi-toolkit-ops)
6
+ [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
7
+ [![codecov](https://codecov.io/gh/NVIDIA/nvalchemi-toolkit-ops/branch/main/graph/badge.svg)](https://codecov.io/gh/NVIDIA/nvalchemi-toolkit-ops)
8
+ [![Documentation](https://img.shields.io/badge/docs-github%20pages-blue)](https://nvidia.github.io/nvalchemi-toolkit-ops/)
9
+
10
+ ## High-performance NVIDIA Warp primitives for computational chemistry
11
+
12
+ NVIDIA ALCHEMI Toolkit-Ops is a collection of **GPU-optimized**, **batched**
13
+ primitives for accelerating atomistic simulations. High performance compute
14
+ kernels are written in [NVIDIA `warp-lang`](https://github.com/NVIDIA/warp).
15
+
16
+ ### Key Features
17
+
18
+ - **Neighbor lists**
19
+ - Naive, cell-list, and tiled cluster-pair methods
20
+ - Matrix and COO formats
21
+ - Automatic method selection and custom pair functions
22
+ - **Molecular dynamics**
23
+ - NVE, NVT, NPT, and NPH ensembles
24
+ - Langevin, Nosé-Hoover Chain, CSVR, and velocity-rescaling thermostats
25
+ - **Geometry optimization with FIRE2 and L-BFGS**, supporting coordinate and
26
+ lattice relaxation
27
+ - **Interatomic interactions**
28
+ - Standard and periodic Fourier DFT-D3(BJ) dispersion
29
+ - DSF, Ewald, and PME electrostatics
30
+ - Ewald and PME for charges and multipoles (Warp/PyTorch)
31
+ - **Differentiable electrostatics for PyTorch training**, with automatic
32
+ differentiation for forces, charge gradients, virials, and stress
33
+ - **Core kernels written in `warp-lang`** with PyTorch and JAX bindings
34
+
35
+ Kernels are naturally intended to be highly scalable (>100,000 atoms) and generally
36
+ optimized for high throughput operations (on the order of several microseconds per
37
+ atom) on GPUs, with batching support.
38
+
39
+ ### Use Cases
40
+
41
+ There are currently three primary use cases where we imagine `nvalchemi-toolkit-ops` to
42
+ fit into the ecosystem:
43
+
44
+ - Library maintainers and developers are encouraged to benchmark and explore
45
+ integrating functionality like neighbor list computation to accelerate
46
+ existing workflows;
47
+ - Researchers and model developers ideally should be able to rely on
48
+ this package (and not implement their own!) for neighbor list computation,
49
+ interatomic interactions, and so on during method development;
50
+ - Engineers looking to build applications that involve molecular dynamics,
51
+ interatomic potentials, and the like can take advantage of optimized and
52
+ maintained low-level kernels. `warp-lang` kernels should be sufficiently
53
+ modular to allow for a high degree of flexibility and reusability.
54
+
55
+ The combination of being GPU-first and batched should enable the kernels contained
56
+ in `nvalchemi-toolkit-ops` to be ready for a wide range of research and production
57
+ applications.
58
+
59
+ ### Example Snippets
60
+
61
+ We encourage interested readers to browse our hosted
62
+ [documentation](https://nvidia.github.io/nvalchemi-toolkit-ops). Below are some
63
+ short snippets that highlight our straightforward API and use cases
64
+ for PyTorch: see the hosted documentation for Jax details.
65
+
66
+ <details>
67
+ <summary>Neighbor list in a 2D unit cell with 50,000 atoms</summary>
68
+
69
+ This example uses PyTorch:
70
+
71
+ ```python
72
+ import torch
73
+ from nvalchemiops.torch.neighbors import neighbor_list
74
+
75
+ torch.set_default_dtype(torch.float32)
76
+ device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
77
+ torch.set_default_device(device)
78
+
79
+ NUM_ATOMS = 50_000
80
+ # distribute positions inside the cell
81
+ positions = torch.rand((NUM_ATOMS, 3)) * 100.0
82
+ cell = (torch.eye(3, dtype=torch.float32) * 100.0).unsqueeze(0)
83
+ pbc = torch.tensor([True, True, False], dtype=torch.bool)
84
+ cutoff = 6.0
85
+ # use padded matrix representation for neighbors, optimal for
86
+ # compiled applications that need constant shapes
87
+ neighbor_matrix, num_neighbors, shift_matrix = neighbor_list(
88
+ positions,
89
+ cutoff,
90
+ cell=cell,
91
+ pbc=pbc,
92
+ method="cell_list"
93
+ )
94
+ # ...or pass `return_neighbor_list=True` for the familiar COO
95
+ # `edge_index` format. `method` will also automatically determine
96
+ # neighbor algorithm based off system size
97
+ edge_index, neighbor_ptr, shifts = neighbor_list(
98
+ positions,
99
+ cutoff,
100
+ cell=cell,
101
+ pbc=pbc,
102
+ return_neighbor_list=True
103
+ )
104
+
105
+ ```
106
+
107
+ </details>
108
+
109
+ <details>
110
+ <summary>DFT-D3(BJ) corrections on a batch of molecules</summary>
111
+
112
+ This example assumes you already have concatenated a set of molecules
113
+ into combined tensors, and have computed some form of neighborhood
114
+ using the `neighbor_list` API. Here, we'll demonstrate using the
115
+ matrix representation:
116
+
117
+ ```python
118
+ import torch
119
+ from nvalchemiops.torch.interactions.dispersion import dftd3
120
+ from nvalchemiops.torch.neighbors import neighbor_list
121
+
122
+ # the following parameters need to be constructed ahead of time
123
+ positions = ... # [num_atoms, 3]
124
+ atomic_numbers = ... # [num_atoms]
125
+ cell = ... # [num_systems, 3, 3]
126
+ pbc = ... # [num_systems, 3]
127
+ batch_idx = ... # [num_atoms]
128
+ batch_ptr = ... # [num_systems + 1]
129
+ # construct neighbor matrix
130
+ neighbor_matrix, num_neighbors, shift_matrix = neighbor_list(
131
+ positions,
132
+ cutoff=..., # on the order of ~20 Angstroms
133
+ cell=cell,
134
+ pbc=pbc,
135
+ batch_idx=batch_idx,
136
+ batch_ptr=batch_ptr
137
+ )
138
+ # DFT-D3 parameters need to be provided, which comprises reference C6 parameters.
139
+ # Refer to the user documentation to see the expected structure and data source.
140
+ d3_params = ...
141
+ # pass everything to the functional interface
142
+ d3_energies, d3_forces, coord_nums, d3_virials = dftd3(
143
+ positions=positions,
144
+ numbers=atomic_numbers,
145
+ neighbor_matrix=neighbor_matrix,
146
+ neighbor_matrix_shifts=shift_matrix,
147
+ batch_idx=batch_idx,
148
+ cell=cell,
149
+ # functional specific DFT-D3 parameters (PBE shown)
150
+ a1=0.4289, a2=4.4407, s8=0.7875,
151
+ d3_params=d3_params,
152
+ compute_virial=True
153
+ )
154
+ ```
155
+
156
+ </details>
157
+
158
+ <details>
159
+ <summary>Electrostatics via particle mesh Ewald</summary>
160
+
161
+ This example shows how to compute the per-atom and system energies
162
+ as well as the forces using the particle mesh Ewald interface.
163
+
164
+ ```python
165
+ import torch
166
+ from nvalchemiops.torch.interactions.electrostatics import particle_mesh_ewald
167
+ from nvalchemiops.torch.neighbors import neighbor_list
168
+
169
+ # the following parameters need to be constructed ahead of time
170
+ positions = ... # [num_atoms, 3]
171
+ atomic_numbers = ... # [num_atoms]
172
+ cell = ... # [num_systems, 3, 3]
173
+ pbc = ... # [num_systems, 3]
174
+ atomic_charges = ... # [num_atoms]
175
+ positions = positions.requires_grad_(True)
176
+ # construct neighbor matrix
177
+ neighbor_matrix, num_neighbors, shift_matrix = neighbor_list(
178
+ positions,
179
+ cutoff=..., # on the order of ~20 Angstroms
180
+ cell=cell,
181
+ pbc=pbc,
182
+ )
183
+ # call PME, using automatic parameter tuning
184
+ atom_energies = particle_mesh_ewald(
185
+ positions=positions,
186
+ charges=atomic_charges,
187
+ cell=cell,
188
+ neighbor_matrix=neighbor_matrix,
189
+ neighbor_matrix_shifts=shift_matrix,
190
+ accuracy=1e-6
191
+ )
192
+ system_energy = atom_energies.sum()
193
+ atom_forces = -torch.autograd.grad(system_energy, positions)[0]
194
+ ```
195
+
196
+ </details>
197
+
198
+ ## CUDA 13 Support
199
+
200
+ CUDA 13 is required for Blackwell GPUs. `torch>=2.11.0` and `jax[cuda13]`
201
+ publish CUDA 13 wheels on the default PyPI index for Linux x86_64 and
202
+ aarch64 platforms.
203
+
204
+ The `torch` and `jax` extras use CUDA 13 by default and are equivalent to the
205
+ explicit `torch-cu13` and `jax-cu13` extras. Use `torch-cu12` and `jax-cu12`
206
+ when CUDA 12.6 PyTorch wheels or CUDA 12 JAX plugins are required. The PyTorch
207
+ indexes used for explicit CUDA selection are `cu130` for CUDA 13 and `cu126`
208
+ for the CUDA 12 fallback. pip and `uv pip` read only the published package
209
+ metadata, so `torch-cu12` needs the `cu126` index on the command line.
210
+ PyTorch publishes no CUDA 12 build of PyTorch 2.15 or newer.
211
+
212
+ ```bash
213
+ # Standalone install
214
+ uv venv --seed --python 3.12
215
+ uv pip install nvalchemi-toolkit-ops torch==2.11.0
216
+
217
+ # Explicit CUDA 13 PyTorch wheel index
218
+ uv pip install nvalchemi-toolkit-ops \
219
+ torch==2.11.0+cu130 \
220
+ --extra-index-url https://download.pytorch.org/whl/cu130
221
+
222
+ # CUDA 12 PyTorch wheels
223
+ pip install 'nvalchemi-toolkit-ops[torch-cu12]' \
224
+ --extra-index-url https://download.pytorch.org/whl/cu126
225
+ uv pip install 'nvalchemi-toolkit-ops[torch-cu12]' --torch-backend cu126
226
+ ```
227
+
228
+ See the [installation guide](https://nvidia.github.io/nvalchemi-toolkit-ops/userguide/about/install.html#cuda-13-installation)
229
+ for details.
230
+
231
+ ## Contributions & Disclaimers
232
+
233
+ Feature requests, discussions, and general feedback are
234
+ welcome and encouraged via
235
+ [Github Issues](https://www.github.com/NVIDIA/nvalchemi-toolkit-ops). Before submitting a
236
+ pull request, we highly encourage you to create an issue to discuss
237
+ with developers first so we can understand your use case and collaborate
238
+ on features and bug fixes. Contributors must read [CONTRIBUTING.md](./CONTRIBUTING.md) to
239
+ understand and follow the development workflow and logistics.
240
+
241
+ NVIDIA ALCHEMI Toolkit-Ops is under active development; while we strive to
242
+ ensure public facing APIs do not break, they are subject to change as we
243
+ are trying to continuously improve performance and user experience.
@@ -0,0 +1,27 @@
1
+ # SPDX-FileCopyrightText: Copyright (c) 2025 - 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2
+ # SPDX-License-Identifier: Apache-2.0
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+
16
+ __version__ = "0.6.0"
17
+
18
+ import warp as wp
19
+
20
+ wp.config.log_level = wp.LOG_WARNING
21
+ try:
22
+ wp.init()
23
+ except RuntimeError as e:
24
+ raise RuntimeError(
25
+ "Failed to initialize warp, likely due to missing drivers and/or devices."
26
+ " Make sure you have the correct CUDA version, and that GPUs are available."
27
+ ) from e