gpu4pyscf 1.4.0__tar.gz → 1.4.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.
Files changed (212) hide show
  1. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/CHANGELOG +42 -0
  2. {gpu4pyscf-1.4.0/gpu4pyscf.egg-info → gpu4pyscf-1.4.2}/PKG-INFO +1 -1
  3. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/README.md +26 -9
  4. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/__config__.py +4 -4
  5. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/__init__.py +6 -2
  6. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/df/df.py +11 -34
  7. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/df/df_jk.py +91 -72
  8. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/df/grad/rks.py +7 -20
  9. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/df/grad/tdrhf.py +11 -6
  10. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/df/hessian/rks.py +7 -3
  11. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/df/int3c2e.py +9 -14
  12. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/df/int3c2e_bdiv.py +138 -37
  13. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/dft/gen_grid.py +127 -4
  14. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/dft/numint.py +304 -279
  15. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/dft/rks.py +50 -65
  16. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/dft/rks_lowmem.py +45 -34
  17. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/dft/roks.py +1 -15
  18. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/dft/uks.py +38 -46
  19. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/grad/__init__.py +2 -1
  20. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/grad/rhf.py +12 -14
  21. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/grad/rks.py +295 -116
  22. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/grad/tdrhf.py +81 -4
  23. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/grad/tdrks.py +36 -7
  24. gpu4pyscf-1.4.2/gpu4pyscf/grad/tdrks_ris.py +374 -0
  25. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/grad/tduhf.py +5 -1
  26. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/grad/tduks.py +10 -1
  27. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/grad/uhf.py +12 -9
  28. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/grad/uks.py +81 -81
  29. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/gto/mole.py +35 -31
  30. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/hessian/jk.py +1 -1
  31. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/hessian/rhf.py +1 -1
  32. gpu4pyscf-1.4.2/gpu4pyscf/hessian/rks.py +2407 -0
  33. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/lib/cupy_helper.py +90 -16
  34. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/lib/cusolver.py +4 -1
  35. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/lib/cutensor.py +2 -0
  36. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/lib/logger.py +27 -0
  37. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/lib/multi_gpu.py +2 -0
  38. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/mp/dfmp2.py +1 -0
  39. gpu4pyscf-1.4.2/gpu4pyscf/nac/__init__.py +2 -0
  40. gpu4pyscf-1.4.2/gpu4pyscf/nac/tdrhf.py +608 -0
  41. gpu4pyscf-1.4.2/gpu4pyscf/nac/tdrks.py +624 -0
  42. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/pbc/df/aft.py +4 -7
  43. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/pbc/df/aft_jk.py +1 -1
  44. gpu4pyscf-1.4.2/gpu4pyscf/pbc/df/df.py +302 -0
  45. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/pbc/df/df_jk.py +4 -25
  46. gpu4pyscf-1.4.2/gpu4pyscf/pbc/df/df_jk_real.py +137 -0
  47. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/pbc/df/fft.py +20 -6
  48. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/pbc/df/fft_jk.py +60 -4
  49. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/pbc/df/ft_ao.py +255 -150
  50. gpu4pyscf-1.4.2/gpu4pyscf/pbc/df/int3c2e.py +938 -0
  51. gpu4pyscf-1.4.2/gpu4pyscf/pbc/df/rsdf_builder.py +1078 -0
  52. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/pbc/dft/gen_grid.py +34 -1
  53. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/pbc/dft/krks.py +20 -12
  54. gpu4pyscf-1.4.2/gpu4pyscf/pbc/dft/krkspu.py +259 -0
  55. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/pbc/dft/kuks.py +15 -14
  56. gpu4pyscf-1.4.2/gpu4pyscf/pbc/dft/kukspu.py +208 -0
  57. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/pbc/dft/multigrid.py +428 -190
  58. gpu4pyscf-1.4.2/gpu4pyscf/pbc/dft/multigrid_v2.py +1322 -0
  59. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/pbc/dft/numint.py +187 -19
  60. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/pbc/dft/rks.py +78 -27
  61. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/pbc/dft/uks.py +18 -14
  62. gpu4pyscf-1.4.2/gpu4pyscf/pbc/grad/krhf.py +365 -0
  63. gpu4pyscf-1.4.2/gpu4pyscf/pbc/grad/krks.py +146 -0
  64. gpu4pyscf-1.4.2/gpu4pyscf/pbc/grad/kuhf.py +96 -0
  65. gpu4pyscf-1.4.2/gpu4pyscf/pbc/grad/kuks.py +144 -0
  66. gpu4pyscf-1.4.2/gpu4pyscf/pbc/grad/rhf.py +91 -0
  67. gpu4pyscf-1.4.2/gpu4pyscf/pbc/grad/rks.py +21 -0
  68. gpu4pyscf-1.4.2/gpu4pyscf/pbc/grad/uhf.py +89 -0
  69. gpu4pyscf-1.4.2/gpu4pyscf/pbc/grad/uks.py +21 -0
  70. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/pbc/scf/hf.py +37 -7
  71. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/pbc/scf/khf.py +6 -7
  72. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/pbc/scf/kuhf.py +0 -4
  73. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/pbc/scf/uhf.py +3 -2
  74. gpu4pyscf-1.4.2/gpu4pyscf/pbc/tools/pbc.py +289 -0
  75. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/properties/__init__.py +1 -1
  76. gpu4pyscf-1.4.2/gpu4pyscf/properties/eda.py +1171 -0
  77. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/properties/polarizability.py +8 -8
  78. gpu4pyscf-1.4.2/gpu4pyscf/properties/raman.py +278 -0
  79. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/qmmm/pbc/itrf.py +47 -40
  80. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/scf/_response_functions.py +20 -10
  81. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/scf/diis.py +5 -4
  82. gpu4pyscf-1.4.2/gpu4pyscf/scf/ghf.py +155 -0
  83. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/scf/hf.py +67 -31
  84. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/scf/hf_lowmem.py +75 -31
  85. gpu4pyscf-1.4.2/gpu4pyscf/scf/j_engine.py +446 -0
  86. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/scf/jk.py +49 -49
  87. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/scf/rohf.py +1 -22
  88. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/scf/soscf.py +19 -1
  89. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/scf/uhf.py +9 -11
  90. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/solvent/__init__.py +4 -4
  91. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/solvent/_attach_solvent.py +36 -11
  92. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/solvent/grad/pcm.py +72 -18
  93. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/solvent/grad/smd.py +27 -11
  94. gpu4pyscf-1.4.2/gpu4pyscf/solvent/hessian/__init__.py +0 -0
  95. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/solvent/hessian/pcm.py +28 -15
  96. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/solvent/hessian/smd.py +26 -18
  97. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/solvent/pcm.py +95 -35
  98. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/solvent/smd.py +40 -20
  99. gpu4pyscf-1.4.2/gpu4pyscf/solvent/tdscf/__init__.py +13 -0
  100. gpu4pyscf-1.4.2/gpu4pyscf/solvent/tdscf/pcm.py +182 -0
  101. gpu4pyscf-1.4.2/gpu4pyscf/tdscf/_krylov_tools.py +641 -0
  102. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/tdscf/_lr_eig.py +508 -3
  103. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/tdscf/_uhf_resp_sf.py +2 -3
  104. gpu4pyscf-1.4.2/gpu4pyscf/tdscf/math_helper.py +695 -0
  105. gpu4pyscf-1.4.2/gpu4pyscf/tdscf/parameter.py +144 -0
  106. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/tdscf/rhf.py +121 -14
  107. gpu4pyscf-1.4.2/gpu4pyscf/tdscf/ris.py +1814 -0
  108. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/tdscf/rks.py +15 -1
  109. gpu4pyscf-1.4.2/gpu4pyscf/tdscf/spectralib.py +178 -0
  110. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/tdscf/uhf.py +90 -12
  111. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/tdscf/uks.py +1 -1
  112. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2/gpu4pyscf.egg-info}/PKG-INFO +1 -1
  113. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf.egg-info/SOURCES.txt +26 -0
  114. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf.egg-info/requires.txt +1 -1
  115. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/setup.py +1 -1
  116. gpu4pyscf-1.4.0/gpu4pyscf/hessian/rks.py +0 -884
  117. gpu4pyscf-1.4.0/gpu4pyscf/pbc/df/df.py +0 -180
  118. gpu4pyscf-1.4.0/gpu4pyscf/pbc/df/int3c2e.py +0 -483
  119. gpu4pyscf-1.4.0/gpu4pyscf/pbc/df/rsdf_builder.py +0 -427
  120. gpu4pyscf-1.4.0/gpu4pyscf/pbc/tools/pbc.py +0 -100
  121. gpu4pyscf-1.4.0/gpu4pyscf/scf/ghf.py +0 -59
  122. gpu4pyscf-1.4.0/gpu4pyscf/scf/j_engine.py +0 -233
  123. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/LICENSE +0 -0
  124. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/MANIFEST.in +0 -0
  125. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/cc/__init__.py +0 -0
  126. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/cc/ccsd_incore.py +0 -0
  127. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/df/__init__.py +0 -0
  128. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/df/cderi.py +0 -0
  129. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/df/grad/__init__.py +0 -0
  130. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/df/grad/jk.py +0 -0
  131. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/df/grad/rhf.py +0 -0
  132. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/df/grad/tdrks.py +0 -0
  133. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/df/grad/tduhf.py +0 -0
  134. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/df/grad/tduks.py +0 -0
  135. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/df/grad/uhf.py +0 -0
  136. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/df/grad/uks.py +0 -0
  137. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/df/hessian/__init__.py +0 -0
  138. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/df/hessian/jk.py +0 -0
  139. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/df/hessian/rhf.py +0 -0
  140. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/df/hessian/uhf.py +0 -0
  141. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/df/hessian/uks.py +0 -0
  142. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/dft/__init__.py +0 -0
  143. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/dft/gks.py +0 -0
  144. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/dft/libxc.py +0 -0
  145. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/dft/libxc_structs.py +0 -0
  146. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/dft/radi.py +0 -0
  147. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/dft/xc_alias.py +0 -0
  148. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/dft/xc_deriv.py +0 -0
  149. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/drivers/__init__.py +0 -0
  150. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/drivers/basis_vDZP_NWCHEM.dat +0 -0
  151. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/drivers/dft_3c_driver.py +0 -0
  152. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/drivers/dft_driver.py +0 -0
  153. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/drivers/ecp_vDZP_NWCHEM.dat +0 -0
  154. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/drivers/opt_3c_driver.py +0 -0
  155. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/drivers/opt_driver.py +0 -0
  156. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/fci/__init__.py +0 -0
  157. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/fci/direct_spin1.py +0 -0
  158. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/grad/dispersion.py +0 -0
  159. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/gto/__init__.py +0 -0
  160. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/gto/ecp.py +0 -0
  161. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/gto/int3c1e.py +0 -0
  162. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/gto/int3c1e_ip.py +0 -0
  163. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/gto/int3c1e_ipip.py +0 -0
  164. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/hessian/__init__.py +0 -0
  165. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/hessian/dispersion.py +0 -0
  166. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/hessian/uhf.py +0 -0
  167. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/hessian/uks.py +0 -0
  168. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/lib/__init__.py +0 -0
  169. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/lib/cublas.py +0 -0
  170. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/lib/diis.py +0 -0
  171. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/lib/memcpy.py +0 -0
  172. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/lib/utils.py +0 -0
  173. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/mp/__init__.py +0 -0
  174. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/mp/mp2.py +0 -0
  175. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/pbc/__init__.py +0 -0
  176. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/pbc/df/__init__.py +0 -0
  177. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/pbc/dft/__init__.py +0 -0
  178. {gpu4pyscf-1.4.0/gpu4pyscf/pbc/gto → gpu4pyscf-1.4.2/gpu4pyscf/pbc/grad}/__init__.py +0 -0
  179. {gpu4pyscf-1.4.0/gpu4pyscf/pbc/lib → gpu4pyscf-1.4.2/gpu4pyscf/pbc/gto}/__init__.py +0 -0
  180. {gpu4pyscf-1.4.0/gpu4pyscf/pop → gpu4pyscf-1.4.2/gpu4pyscf/pbc/lib}/__init__.py +0 -0
  181. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/pbc/lib/kpts_helper.py +0 -0
  182. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/pbc/scf/__init__.py +0 -0
  183. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/pbc/tools/__init__.py +0 -0
  184. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/pbc/tools/k2gamma.py +0 -0
  185. {gpu4pyscf-1.4.0/gpu4pyscf/solvent/hessian → gpu4pyscf-1.4.2/gpu4pyscf/pop}/__init__.py +0 -0
  186. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/pop/esp.py +0 -0
  187. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/properties/ir.py +0 -0
  188. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/properties/shielding.py +0 -0
  189. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/qmmm/__init__.py +0 -0
  190. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/qmmm/chelpg.py +0 -0
  191. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/qmmm/pbc/__init__.py +0 -0
  192. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/qmmm/pbc/mm_mole.py +0 -0
  193. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/qmmm/pbc/tools.py +0 -0
  194. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/scf/__init__.py +0 -0
  195. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/scf/cphf.py +0 -0
  196. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/scf/dispersion.py +0 -0
  197. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/scf/hf_symm.py +0 -0
  198. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/scf/int2c2e.py +0 -0
  199. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/scf/int4c2e.py +0 -0
  200. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/scf/ucphf.py +0 -0
  201. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/scf/uhf_symm.py +0 -0
  202. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/solvent/grad/__init__.py +0 -0
  203. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/solvent/grad/smd_experiment.py +0 -0
  204. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/solvent/hessian/smd_experiment.py +0 -0
  205. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/solvent/smd_experiment.py +0 -0
  206. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/tdscf/__init__.py +0 -0
  207. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/tools/__init__.py +0 -0
  208. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/tools/ase_interface.py +0 -0
  209. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf/tools/method_config.py +0 -0
  210. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf.egg-info/dependency_links.txt +0 -0
  211. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/gpu4pyscf.egg-info/top_level.txt +0 -0
  212. {gpu4pyscf-1.4.0 → gpu4pyscf-1.4.2}/setup.cfg +0 -0
@@ -1,3 +1,45 @@
1
+ v1.4.2 (2025-07-20)
2
+ -------------------
3
+ * New Features
4
+ - Raman spectrum calculations.
5
+ - Non-adiabatic coupling vector for time-dependent RKS, including the coupling.
6
+ between ground state and excited states as well as among excited states.
7
+ - DFT+U for molecule and PBC systems.
8
+ - ALMO EDA 2 method.
9
+ - Analytical gradients for TDDFT-ris method.
10
+ - Analytical gradients for PBC k-point DFT.
11
+ - Efficient analytical gradients for PBC Gamma-point DFT using the multigrid algorithm.
12
+ - A custom CuPy memory pool to reduce GPU memory usage.
13
+ * Improvements
14
+ - Improved PBC GDF integral computation at the Gamma point, including reduced.
15
+ GPU memory usage and enhanced computational efficiency.
16
+ - Set the J engine as the defult Coulomb matrix algorithm in the direct SCF driver.
17
+ - Efficient Multigrid integral algorithm for various functions in PBC DFT.
18
+ Gamma point computation such as get_nuc, get_pp, and GGA functionals.
19
+ - Supporting xc='HF' setting in DFT.
20
+ * Fixes
21
+ - Ensured compatibility with CUDA 12.3.
22
+ - Issues related to the combination of density fitting, PCM solvent, and TDDFT.
23
+
24
+ v1.4.1 (2025-05-20)
25
+ -------------------
26
+ * New Features
27
+ - Analytical hessian for VV10 functionals
28
+ - DFT polarizability with VV10 functionals
29
+ - TDDFT for VV10 functionals
30
+ - Non-adiabatic coupling constants for TDDFT states
31
+ - TDDFT gradients and geometry optimization solver for excited states
32
+ - LR-PCM for TDDFT and TDDFT gradients
33
+ - TDDFT-ris method
34
+ * Improvements
35
+ - Optimization CUDA kernel and integral screening for MD J-engine. The MD
36
+ J-engine is utilized by default for large system HF and DFT computation.
37
+ - Optimization for PBC gaussian density fitting at gamma point.
38
+ - ECP gradients CUDA kernel
39
+ - Reduced atomicAdd overhead in Rys JK kernel
40
+ * Fixes
41
+ - MINAO initial guess for ghost atoms
42
+
1
43
  v1.4.0 (2025-03-27)
2
44
  -------------------
3
45
  * New Features
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: gpu4pyscf
3
- Version: 1.4.0
3
+ Version: 1.4.2
4
4
  Summary: GPU extensions for PySCF
5
5
  Author: PySCF developers
6
6
  License: Apache-2.0
@@ -9,16 +9,32 @@ Installation
9
9
  > [!NOTE]
10
10
  > The compiled binary packages support compute capability 7.0 and later (Volta and later, such as Tesla V100, RTX 20 series and later).
11
11
 
12
- Run ```nvcc --version``` in your terminal to check the installed CUDA toolkit version. Then, choose the proper package based on your CUDA toolkit version.
12
+ To check your installed CUDA Toolkit version, run
13
+ ```sh
14
+ nvcc --version
15
+ ```
16
+ Then, install the appropriate package based on your CUDA version:
13
17
 
14
18
  | Platform | Command | cutensor (**highly recommended**)|
15
19
  ----------------| --------------------------------------|----------------------------------|
16
20
  | **CUDA 11.x** | ```pip3 install gpu4pyscf-cuda11x``` | ```pip3 install cutensor-cu11``` |
17
21
  | **CUDA 12.x** | ```pip3 install gpu4pyscf-cuda12x``` | ```pip3 install cutensor-cu12``` |
18
22
 
23
+ The versions of CuPy and cuTENSOR are strongly interdependent and should not be combined arbitrarily.
24
+ The recommended combinations include:
25
+ 1. CuPy 13.3.0 + cuTENSOR 2.0.2
26
+ 2. CuPy 13.4.1 + cuTENSOR 2.2.0
27
+
28
+ Using other versions or combinations may lead to failures in functionality.
29
+ We **recommend** creating a dedicated environment using:
30
+ ```sh
31
+ pip3 install --no-cache-dir -r requirements.txt
32
+ ```
33
+ This ensures compatibility and reproducibility, especially since this configuration is used in our nightly benchmarks.
34
+
19
35
  Compilation
20
36
  --------
21
- One can compile the package with
37
+ To compile the package, run the following commands:
22
38
  ```sh
23
39
  git clone https://github.com/pyscf/gpu4pyscf.git
24
40
  cd gpu4pyscf
@@ -36,19 +52,17 @@ There shouldn't be cupy or cutensor compilation during pip install process. If y
36
52
  <repo_path>/gpu4pyscf/lib/cutensor.py:<line_number>: UserWarning: using cupy as the tensor contraction engine.
37
53
  ```
38
54
 
39
- The package also provides multiple dockerfiles in ```dockerfiles```. One can use them as references to create the compilation envrionment.
40
-
41
55
  Features
42
56
  --------
43
57
  - Density fitting scheme and direct SCF scheme;
44
58
  - SCF, analytical gradient, and analytical Hessian calculations for Hartree-Fock and DFT;
45
59
  - LDA, GGA, mGGA, hybrid, and range-separated functionals via [libXC](https://gitlab.com/libxc/libxc/-/tree/master/);
46
- - Spin-conserved and spin-flip TDA and TDDFT for excitated states
60
+ - Spin-conserved and spin-flip TDA and TDDFT for excitated states;
47
61
  - Geometry optimization and transition state search via [geomeTRIC](https://geometric.readthedocs.io/en/latest/);
48
62
  - Atomic Simulation Environment ([ASE](https://gitlab.com/ase/ase)) interface;
49
63
  - Dispersion corrections via [DFTD3](https://github.com/dftd3/simple-dftd3) and [DFTD4](https://github.com/dftd4/dftd4);
50
- - Nonlocal functional correction (vv10) for SCF and gradient;
51
- - ECP is supported and calculated on GPU;
64
+ - Analytical gradient and analytical Hessian for nonlocal functional correction (vv10);
65
+ - GPU accelerated ECP;
52
66
  - PCM models, their analytical gradients, and analytical Hessian matrix;
53
67
  - SMD solvent model;
54
68
  - Unrestricted Hartree-Fock and unrestricted DFT, gradient, and Hessian;
@@ -57,9 +71,12 @@ Features
57
71
  The following features are still in the experimental stage
58
72
  - MP2/DF-MP2 and CCSD;
59
73
  - Polarizability, IR, and NMR shielding;
74
+ - Raman spectrum;
60
75
  - QM/MM with PBC;
61
- - Multi-GPU for both direct SCF and density fitting
62
- - SCF and DFT with periodic boundary condition
76
+ - Multi-GPU for both direct SCF and density fitting;
77
+ - SCF and DFT with periodic boundary condition;
78
+ - Non-adiabatic coupling for TDDFT;
79
+ - Energy decomposition analysis;
63
80
 
64
81
  Limitations
65
82
  --------
@@ -24,10 +24,10 @@ for device_id in range(num_devices):
24
24
 
25
25
  props = cupy.cuda.runtime.getDeviceProperties(0)
26
26
  GB = 1024*1024*1024
27
- min_ao_blksize = 128
28
- min_grid_blksize = 128*128
29
- ao_aligned = 32
30
- grid_aligned = 256
27
+ min_ao_blksize = 256 # maxisum batch size of AOs
28
+ min_grid_blksize = 64*64 # maximum batch size of grids for DFT
29
+ ao_aligned = 32 # global AO alignment for slicing
30
+ grid_aligned = 256 # 256 alignment for grids globally
31
31
 
32
32
  # Use smaller blksize for old gaming GPUs
33
33
  if props['totalGlobalMem'] < 16 * GB:
@@ -12,6 +12,10 @@
12
12
  # See the License for the specific language governing permissions and
13
13
  # limitations under the License.
14
14
 
15
- __version__ = '1.4.0'
15
+ __version__ = '1.4.2'
16
16
 
17
- from . import lib, grad, hessian, solvent, scf, dft, tdscf
17
+ from . import lib, grad, hessian, solvent, scf, dft, tdscf, nac
18
+
19
+ # Overwrite the cupy memory allocator. Make memory pool manage small-sized
20
+ # arrays only.
21
+ lib.cupy_helper.set_conditional_mempool_malloc()
@@ -20,8 +20,9 @@ import numpy as np
20
20
  from cupyx.scipy.linalg import solve_triangular
21
21
  from pyscf import lib
22
22
  from pyscf.df import df, addons, incore
23
- from gpu4pyscf.lib.cupy_helper import (cholesky, tag_array, get_avail_mem,
24
- cart2sph, p2p_transfer, copy_array)
23
+ from gpu4pyscf.lib.cupy_helper import (
24
+ cholesky, tag_array, get_avail_mem, cart2sph, p2p_transfer, copy_array,
25
+ asarray)
25
26
  from gpu4pyscf.df import int3c2e, df_jk
26
27
  from gpu4pyscf.df import int3c2e_bdiv
27
28
  from gpu4pyscf.lib import logger
@@ -88,35 +89,10 @@ class DF(lib.StreamObject):
88
89
  self.intopt = intopt = int3c2e_bdiv.Int3c2eOpt(mol, auxmol)
89
90
  self._cderi = {}
90
91
  self._cderi[0] = _cholesky_eri_bdiv(intopt, omega=omega)
91
- ao_pair_mapping = intopt.create_ao_pair_mapping(cart=mol.cart)
92
- rows, cols = divmod(cupy.asarray(ao_pair_mapping), mol.nao)
92
+ rows, cols, diags = intopt.orbital_pair_nonzero_indices()
93
93
  intopt.cderi_row = rows
94
94
  intopt.cderi_col = cols
95
-
96
- # intopt.cderi_diag stores the indices for cderi_row that
97
- # corresponds to the diagonal blocks. Note this index array can
98
- # contain some of the off-diagonal elements which happen to be the
99
- # off-diagonal elements while within the diagonal blocks.
100
- uniq_l = intopt.uniq_l_ctr[:,0]
101
- if mol.cart:
102
- nf = (uniq_l + 1) * (uniq_l + 2) // 2
103
- else:
104
- nf = uniq_l * 2 + 1
105
- n_groups = len(uniq_l)
106
- ij_tasks = ((i, j) for i in range(n_groups) for j in range(i+1))
107
- nbas = intopt.sorted_mol.nbas
108
- offset = 0
109
- cderi_diag = []
110
- for (i, j), bas_ij_idx in zip(ij_tasks, intopt.shl_pair_idx):
111
- nfi = nf[i]
112
- nfj = nf[j]
113
- if i == j: # the diagonal blocks
114
- ish, jsh = divmod(bas_ij_idx, nbas)
115
- idx = np.where(ish == jsh)[0]
116
- addr = offset + idx[:,None] * (nfi*nfi) + np.arange(nfi*nfi)
117
- cderi_diag.append(addr.ravel())
118
- offset += bas_ij_idx.size * nfi * nfj
119
- intopt.cderi_diag = cupy.asarray(np.hstack(cderi_diag))
95
+ intopt.cderi_diag = diags
120
96
  log.timer_debug1('cholesky_eri', *t0)
121
97
  return self
122
98
 
@@ -125,7 +101,7 @@ class DF(lib.StreamObject):
125
101
  j2c_cpu = auxmol.intor('int2c2e', hermi=1)
126
102
  else:
127
103
  j2c_cpu = auxmol.intor('int2c2e', hermi=1)
128
- j2c = cupy.asarray(j2c_cpu, order='C')
104
+ j2c = asarray(j2c_cpu)
129
105
  t0 = log.timer_debug1('2c2e', *t0)
130
106
  intopt = int3c2e.VHFOpt(mol, auxmol, 'int2e')
131
107
  intopt.build(direct_scf_tol, diag_block_with_triu=False, aosym=True,
@@ -161,6 +137,7 @@ class DF(lib.StreamObject):
161
137
  assert omega >= 0.0
162
138
 
163
139
  # A temporary treatment for RSH-DF integrals
140
+ # TODO: use the range_coulomb context from pyscf
164
141
  key = '%.6f' % omega
165
142
  if key in self._rsh_df:
166
143
  rsh_df = self._rsh_df[key]
@@ -205,7 +182,7 @@ class DF(lib.StreamObject):
205
182
  if isinstance(cderi_sparse, np.ndarray):
206
183
  # first block
207
184
  if buf_prefetch is None:
208
- buf = cupy.asarray(cderi_sparse[p0:p1,:])
185
+ buf = asarray(cderi_sparse[p0:p1,:])
209
186
  buf_prefetch = cupy.empty([p2-p1,cderi_sparse.shape[1]])
210
187
  if isinstance(cderi_sparse, np.ndarray) and p1 < p2:
211
188
  buf_prefetch.set(cderi_sparse[p1:p2,:])
@@ -322,7 +299,7 @@ def _cderi_task(intopt, cd_low, task_list, _cderi, aux_blksize,
322
299
  log = logger.new_logger(mol, mol.verbose)
323
300
  t1 = log.init_timer()
324
301
  cd_low_tag = cd_low.tag
325
- cd_low = cupy.asarray(cd_low)
302
+ cd_low = asarray(cd_low)
326
303
 
327
304
  cart_ao_loc = intopt.cart_ao_loc
328
305
  aux_ao_loc = intopt.aux_ao_loc
@@ -407,11 +384,11 @@ def _cderi_task(intopt, cd_low, task_list, _cderi, aux_blksize,
407
384
  def _cholesky_eri_bdiv(intopt, omega=None):
408
385
  assert isinstance(intopt, int3c2e_bdiv.Int3c2eOpt)
409
386
  assert omega is None
410
- eri3c = intopt.int3c2e_bdiv_kernel()
387
+ eri3c = next(intopt.int3c2e_bdiv_generator())
411
388
  if intopt.mol.cart:
412
389
  eri3c = intopt.orbital_pair_cart2sph(eri3c)
413
390
  auxmol = intopt.auxmol
414
- j2c = cupy.asarray(auxmol.intor('int2c2e', hermi=1), order='C')
391
+ j2c = asarray(auxmol.intor('int2c2e', hermi=1), order='C')
415
392
  cd_low = cholesky(j2c)
416
393
  aux_coeff = cupy.array(intopt.aux_coeff, copy=True)
417
394
  cd_low = solve_triangular(cd_low, aux_coeff.T, lower=True, overwrite_b=True)
@@ -22,7 +22,8 @@ import numpy
22
22
  from pyscf import lib, __config__
23
23
  from pyscf.scf import dhf
24
24
  from gpu4pyscf.lib import logger
25
- from gpu4pyscf.lib.cupy_helper import contract, transpose_sum, reduce_to_device
25
+ from gpu4pyscf.lib.cupy_helper import (
26
+ contract, transpose_sum, reduce_to_device, tag_array)
26
27
  from gpu4pyscf.dft import rks, uks, numint
27
28
  from gpu4pyscf.scf import hf, uhf
28
29
  from gpu4pyscf.df import df, int3c2e
@@ -34,35 +35,6 @@ def _pin_memory(array):
34
35
  ret[...] = array
35
36
  return ret
36
37
 
37
- def init_workflow(mf, dm0=None):
38
- # build CDERI for omega = 0 and omega ! = 0
39
- def build_df():
40
- mf.with_df.build()
41
- if hasattr(mf, '_numint'):
42
- omega, _, _ = mf._numint.rsh_and_hybrid_coeff(mf.xc, spin=mf.mol.spin)
43
- if abs(omega) <= 1e-10: return
44
- key = '%.6f' % omega
45
- if key in mf.with_df._rsh_df:
46
- rsh_df = mf.with_df._rsh_df[key]
47
- else:
48
- rsh_df = mf.with_df._rsh_df[key] = mf.with_df.copy().reset()
49
- rsh_df.build(omega=omega)
50
- return
51
-
52
- mf.h1e = cupy.asarray(mf.get_hcore(mf.mol))
53
- mf.s1e = cupy.asarray(mf.get_ovlp(mf.mol))
54
- # pre-compute h1e and s1e and cderi for async workflow
55
- with lib.call_in_background(build_df) as build:
56
- build()
57
- # for DFT object
58
- if hasattr(mf, '_numint'):
59
- ni = mf._numint
60
- rks.initialize_grids(mf, mf.mol, dm0)
61
- ni.build(mf.mol, mf.grids.coords)
62
- mf._numint.xcfuns = numint._init_xcfuns(mf.xc, dm0.ndim==3)
63
- dm0 = cupy.asarray(dm0)
64
- return
65
-
66
38
  def _density_fit(mf, auxbasis=None, with_df=None, only_dfj=False):
67
39
  '''For the given SCF object, update the J, K matrix constructor with
68
40
  corresponding density fitting integrals.
@@ -143,7 +115,8 @@ class _DFHF:
143
115
  self.with_df.reset(mol)
144
116
  return super().reset(mol)
145
117
 
146
- init_workflow = init_workflow
118
+ def get_j(self, mol=None, dm=None, hermi=1, omega=None):
119
+ return self.with_df.get_jk(dm, hermi, True, False, self.direct_scf_tol, omega)[0]
147
120
 
148
121
  def get_jk(self, mol=None, dm=None, hermi=1, with_j=True, with_k=True,
149
122
  omega=None):
@@ -151,8 +124,7 @@ class _DFHF:
151
124
  if self.with_df and self.only_dfj:
152
125
  vj = vk = None
153
126
  if with_j:
154
- vj, vk = self.with_df.get_jk(dm, hermi, True, False,
155
- self.direct_scf_tol, omega)
127
+ vj = self.get_j(mol, dm, hermi, omega)
156
128
  if with_k:
157
129
  vk = super().get_jk(mol, dm, hermi, False, True, omega)[1]
158
130
  elif self.with_df:
@@ -163,6 +135,11 @@ class _DFHF:
163
135
  return vj, vk
164
136
 
165
137
  def nuc_grad_method(self):
138
+ if self.istype('_Solvation'):
139
+ raise NotImplementedError(
140
+ 'Gradients of solvent are not computed. '
141
+ 'Solvent must be applied after density fitting method, e.g.\n'
142
+ 'mf = mol.RKS().to_gpu().density_fit().PCM()')
166
143
  if isinstance(self, rks.RKS):
167
144
  from gpu4pyscf.df.grad import rks as rks_grad
168
145
  return rks_grad.Gradients(self)
@@ -180,6 +157,11 @@ class _DFHF:
180
157
  Gradients = nuc_grad_method
181
158
 
182
159
  def Hessian(self):
160
+ if self.istype('_Solvation'):
161
+ raise NotImplementedError(
162
+ 'Hessian of solvent are not computed. '
163
+ 'Solvent must be applied after density fitting method, e.g.\n'
164
+ 'mf = mol.RKS().to_gpu().density_fit().PCM()')
183
165
  from gpu4pyscf.dft.rks import KohnShamDFT
184
166
  if isinstance(self, hf.RHF):
185
167
  if isinstance(self, KohnShamDFT):
@@ -208,32 +190,84 @@ class _DFHF:
208
190
  '''
209
191
  if mol is None: mol = self.mol
210
192
  if dm is None: dm = self.make_rdm1()
193
+ assert not self.direct_scf
211
194
 
212
195
  # for DFT
213
196
  if isinstance(self, rks.KohnShamDFT):
214
- if dm.ndim == 2:
215
- return rks.get_veff(self, dm=dm)
216
- elif dm.ndim == 3:
217
- return uks.get_veff(self, dm=dm)
197
+ t0 = logger.init_timer(self)
198
+ rks.initialize_grids(self, mol, dm)
199
+ ni = self._numint
200
+ if dm.ndim == 2: # RKS
201
+ n, exc, vxc = ni.nr_rks(mol, self.grids, self.xc, dm)
202
+ logger.debug(self, 'nelec by numeric integration = %s', n)
203
+ if self.do_nlc():
204
+ if ni.libxc.is_nlc(self.xc):
205
+ xc = self.xc
206
+ else:
207
+ assert ni.libxc.is_nlc(self.nlc)
208
+ xc = self.nlc
209
+ n, enlc, vnlc = ni.nr_nlc_vxc(mol, self.nlcgrids, xc, dm)
210
+ exc += enlc
211
+ vxc += vnlc
212
+ logger.debug(self, 'nelec with nlc grids = %s', n)
213
+ t0 = logger.timer_debug1(self, 'vxc tot', *t0)
214
+
215
+ if not ni.libxc.is_hybrid_xc(self.xc):
216
+ vj = self.get_j(mol, dm, hermi)
217
+ vxc += vj
218
+ else:
219
+ omega, alpha, hyb = ni.rsh_and_hybrid_coeff(self.xc, spin=mol.spin)
220
+ vj, vk = self.get_jk(mol, dm, hermi)
221
+ vxc += vj
222
+ vk *= hyb
223
+ if omega != 0:
224
+ vklr = self.get_k(mol, dm, hermi, omega=abs(omega))
225
+ vklr *= (alpha - hyb)
226
+ vk += vklr
227
+ vxc -= vk * .5
228
+ exc -= cupy.einsum('ij,ji', dm, vk).real * .25
229
+ ecoul = cupy.einsum('ij,ji', dm, vj).real * .5
230
+
231
+ elif dm.ndim == 3: # UKS
232
+ n, exc, vxc = ni.nr_uks(mol, self.grids, self.xc, dm)
233
+ logger.debug(self, 'nelec by numeric integration = %s', n)
234
+ if self.do_nlc():
235
+ if ni.libxc.is_nlc(self.xc):
236
+ xc = self.xc
237
+ else:
238
+ assert ni.libxc.is_nlc(self.nlc)
239
+ xc = self.nlc
240
+ n, enlc, vnlc = ni.nr_nlc_vxc(mol, self.nlcgrids, xc, dm[0]+dm[1])
241
+ exc += enlc
242
+ vxc += vnlc
243
+ logger.debug(self, 'nelec with nlc grids = %s', n)
244
+ t0 = logger.timer(self, 'vxc', *t0)
245
+
246
+ if not ni.libxc.is_hybrid_xc(self.xc):
247
+ vj = self.get_j(mol, dm[0]+dm[1], hermi)
248
+ vxc += vj
249
+ else:
250
+ omega, alpha, hyb = ni.rsh_and_hybrid_coeff(self.xc, spin=mol.spin)
251
+ vj, vk = self.get_jk(mol, dm, hermi)
252
+ vj = vj[0] + vj[1]
253
+ vxc += vj
254
+ vk *= hyb
255
+ if abs(omega) > 1e-10:
256
+ vklr = self.get_k(mol, dm, hermi, omega=omega)
257
+ vklr *= (alpha - hyb)
258
+ vk += vklr
259
+ vxc -= vk
260
+ exc -= cupy.einsum('sij,sji->', dm, vk).real * .5
261
+ ecoul = cupy.einsum('sij,ji->', dm, vj).real * .5
262
+ t0 = logger.timer_debug1(self, 'jk total', *t0)
263
+ return tag_array(vxc, ecoul=ecoul, exc=exc, vj=None, vk=None)
218
264
 
219
265
  if dm.ndim == 2:
220
- if self.direct_scf:
221
- ddm = cupy.asarray(dm) - dm_last
222
- vj, vk = self.get_jk(mol, ddm, hermi=hermi)
223
- return vhf_last + vj - vk * .5
224
- else:
225
- vj, vk = self.get_jk(mol, dm, hermi=hermi)
226
- return vj - vk * .5
266
+ vj, vk = self.get_jk(mol, dm, hermi=hermi)
267
+ return vj - vk * .5
227
268
  elif dm.ndim == 3:
228
- if self.direct_scf:
229
- ddm = cupy.asarray(dm) - dm_last
230
- vj, vk = self.get_jk(mol, ddm, hermi=hermi)
231
- vhf = vj[0] + vj[1] - vk
232
- vhf += cupy.asarray(vhf_last)
233
- return vhf
234
- else:
235
- vj, vk = self.get_jk(mol, dm, hermi=hermi)
236
- return vj[0] + vj[1] - vk
269
+ vj, vk = self.get_jk(mol, dm, hermi=hermi)
270
+ return vj[0] + vj[1] - vk
237
271
  else:
238
272
  raise NotImplementedError("Please check the dimension of the density matrix, it should not reach here.")
239
273
 
@@ -278,7 +312,7 @@ def _jk_task_with_mo(dfobj, dms, mo_coeff, mo_occ,
278
312
  for i in range(nset):
279
313
  occ_idx = mo_occ[i] > 0
280
314
  occ_coeff[i] = mo_coeff[i][:,occ_idx] * mo_occ[i][occ_idx]**0.5
281
- nocc += mo_occ[i].sum()
315
+ nocc += int(mo_occ[i].sum())
282
316
  blksize = dfobj.get_blksize(extra=nao*nocc)
283
317
  if with_j:
284
318
  vj_packed = cupy.zeros_like(dm_sparse)
@@ -443,7 +477,6 @@ def get_jk(dfobj, dms_tag, hermi=0, with_j=True, with_k=True, direct_scf_tol=1e-
443
477
  intopt = dfobj.intopt
444
478
  dms = intopt.sort_orbitals(dms, axis=[1,2])
445
479
 
446
- cupy.cuda.get_current_stream().synchronize()
447
480
  if getattr(dms_tag, 'mo_coeff', None) is not None:
448
481
  mo_occ = dms_tag.mo_occ
449
482
  mo_coeff = dms_tag.mo_coeff
@@ -451,6 +484,7 @@ def get_jk(dfobj, dms_tag, hermi=0, with_j=True, with_k=True, direct_scf_tol=1e-
451
484
  mo_coeff = mo_coeff.reshape(-1,nao,nmo)
452
485
  mo_occ = mo_occ.reshape(-1,nmo)
453
486
  mo_coeff = intopt.sort_orbitals(mo_coeff, axis=[1])
487
+ cupy.cuda.get_current_stream().synchronize()
454
488
 
455
489
  futures = []
456
490
  with ThreadPoolExecutor(max_workers=num_devices) as executor:
@@ -472,6 +506,7 @@ def get_jk(dfobj, dms_tag, hermi=0, with_j=True, with_k=True, direct_scf_tol=1e-
472
506
  mo1s = [mo1s]
473
507
  occ_coeffs = [intopt.sort_orbitals(occ_coeff, axis=[0]) for occ_coeff in occ_coeffs]
474
508
  mo1s = [intopt.sort_orbitals(mo1, axis=[1]) for mo1 in mo1s]
509
+ cupy.cuda.get_current_stream().synchronize()
475
510
 
476
511
  futures = []
477
512
  with ThreadPoolExecutor(max_workers=num_devices) as executor:
@@ -485,6 +520,7 @@ def get_jk(dfobj, dms_tag, hermi=0, with_j=True, with_k=True, direct_scf_tol=1e-
485
520
 
486
521
  # general K matrix with density matrix
487
522
  else:
523
+ cupy.cuda.Stream.null.synchronize()
488
524
  futures = []
489
525
  with ThreadPoolExecutor(max_workers=num_devices) as executor:
490
526
  for device_id in range(num_devices):
@@ -517,23 +553,6 @@ def get_jk(dfobj, dms_tag, hermi=0, with_j=True, with_k=True, direct_scf_tol=1e-
517
553
  vk = vk.get()
518
554
  return vj, vk
519
555
 
520
- def _get_jk(dfobj, dm, hermi=1, with_j=True, with_k=True,
521
- direct_scf_tol=getattr(__config__, 'scf_hf_SCF_direct_scf_tol', 1e-13),
522
- omega=None):
523
- if omega is None:
524
- return get_jk(dfobj, dm, hermi, with_j, with_k, direct_scf_tol)
525
-
526
- # A temporary treatment for RSH-DF integrals
527
- key = '%.6f' % omega
528
- if key in dfobj._rsh_df:
529
- rsh_df = dfobj._rsh_df[key]
530
- else:
531
- rsh_df = dfobj._rsh_df[key] = dfobj.copy().reset()
532
- logger.info(dfobj, 'Create RSH-DF object %s for omega=%s', rsh_df, omega)
533
-
534
- with rsh_df.mol.with_range_coulomb(omega):
535
- return get_jk(rsh_df, dm, hermi, with_j, with_k, direct_scf_tol)
536
-
537
556
  def get_j(dfobj, dm, hermi=1, direct_scf_tol=1e-13):
538
557
  intopt = getattr(dfobj, 'intopt', None)
539
558
  if intopt is None:
@@ -40,15 +40,6 @@ def get_veff(ks_grad, mol=None, dm=None, verbose=None):
40
40
  if grids.coords is None:
41
41
  grids.build(with_non0tab=False)
42
42
 
43
- nlcgrids = None
44
- if mf.do_nlc():
45
- if ks_grad.nlcgrids is not None:
46
- nlcgrids = ks_grad.nlcgrids
47
- else:
48
- nlcgrids = mf.nlcgrids
49
- if nlcgrids.coords is None:
50
- nlcgrids.build(with_non0tab=False)
51
-
52
43
  #enabling range-separated hybrids
53
44
  omega, alpha, hyb = ni.rsh_and_hybrid_coeff(mf.xc, spin=mol.spin)
54
45
 
@@ -59,26 +50,22 @@ def get_veff(ks_grad, mol=None, dm=None, verbose=None):
59
50
  ni, mol, grids, mf.xc, dm,
60
51
  max_memory=max_memory, verbose=ks_grad.verbose)
61
52
  #logger.debug1(ks_grad, 'sum(grids response) %s', exc.sum(axis=0))
62
- if mf.do_nlc():
63
- raise NotImplementedError
64
53
  else:
65
54
  exc, exc1 = rks_grad.get_exc(
66
55
  ni, mol, grids, mf.xc, dm,
67
56
  max_memory=max_memory, verbose=ks_grad.verbose)
68
- if mf.do_nlc():
69
- if ni.libxc.is_nlc(mf.xc):
70
- xc = mf.xc
71
- else:
72
- xc = mf.nlc
73
- enlc, exc1_nlc = rks_grad.get_nlc_exc(
74
- ni, mol, nlcgrids, xc, dm,
75
- max_memory=max_memory, verbose=ks_grad.verbose)
76
- exc1 += exc1_nlc
77
57
  t0 = logger.timer(ks_grad, 'vxc total', *t0)
78
58
 
79
59
  aoslices = mol.aoslice_by_atom()
80
60
  exc1 = [exc1[:,p0:p1].sum(axis=1) for p0, p1 in aoslices[:,2:]]
81
61
  exc1 = cupy.asarray(exc1)
62
+
63
+ if mf.do_nlc():
64
+ enlc1_per_atom, enlc1_grid = rks_grad._get_denlc(ks_grad, mol, dm, max_memory)
65
+ exc1 += enlc1_per_atom
66
+ if ks_grad.grid_response:
67
+ exc += enlc1_grid
68
+
82
69
  if abs(hyb) < 1e-10 and abs(alpha) < 1e-10:
83
70
  ej, ejaux = ks_grad.get_j(mol, dm)
84
71
  exc1 += ej
@@ -53,13 +53,18 @@ def get_jk(mf_grad, mol=None, dm0=None, hermi=0, with_j=True, with_k=True, omega
53
53
  In the CPU version, get_jk returns the first order derivatives of J/K matrices.
54
54
  '''
55
55
  if mol is None: mol = mf_grad.mol
56
- if isinstance(mf_grad.base, scf_gpu.rohf.ROHF):
57
- raise NotImplementedError()
58
- elif isinstance(mf_grad.base, scf_gpu.hf.SCF):
59
- mf = mf_grad.base
56
+ if getattr(mf_grad, "base", None) is not None:
57
+ if isinstance(mf_grad.base, scf_gpu.rohf.ROHF):
58
+ raise NotImplementedError()
59
+ elif isinstance(mf_grad.base, scf_gpu.hf.SCF):
60
+ mf = mf_grad.base
61
+ else:
62
+ mf = mf_grad.base._scf
60
63
  else:
61
- mf = mf_grad.base._scf
62
-
64
+ if isinstance(mf_grad, scf_gpu.hf.SCF):
65
+ mf = mf_grad
66
+ else:
67
+ raise RuntimeError("Should not reach here.")
63
68
  if(dm0 is None): dm0 = mf.make_rdm1()
64
69
  if omega is None:
65
70
  with_df = mf.with_df
@@ -26,6 +26,7 @@ from pyscf import lib
26
26
  from gpu4pyscf.grad import rhf as rhf_grad
27
27
  from gpu4pyscf.hessian import rhf as rhf_hess
28
28
  from gpu4pyscf.hessian import rks as rks_hess
29
+ from gpu4pyscf.hessian.rks import _get_enlc_deriv2, _get_vnlc_deriv1
29
30
  from gpu4pyscf.df.hessian import rhf as df_rhf_hess
30
31
  from gpu4pyscf.df.hessian.rhf import _get_jk_ip, _partial_hess_ejk
31
32
  from gpu4pyscf.lib import logger
@@ -46,9 +47,6 @@ def partial_hess_elec(hessobj, mo_energy=None, mo_coeff=None, mo_occ=None,
46
47
  mocc = mo_coeff[:,mo_occ>0]
47
48
  dm0 = numpy.dot(mocc, mocc.T) * 2
48
49
 
49
- if mf.do_nlc():
50
- raise NotImplementedError("2nd derivative of NLC is not implemented.")
51
-
52
50
  omega, alpha, hyb = mf._numint.rsh_and_hybrid_coeff(mf.xc, spin=mol.spin)
53
51
  with_k = mf._numint.libxc.is_hybrid_xc(mf.xc)
54
52
  de2, ej, ek = _partial_hess_ejk(hessobj, mo_energy, mo_coeff, mo_occ,
@@ -81,6 +79,10 @@ def partial_hess_elec(hessobj, mo_energy=None, mo_coeff=None, mo_occ=None,
81
79
  de2[i0,j0] += 2.0*cupy.sum(veff_dm[:,:,q0:q1], axis=2)
82
80
  for j0 in range(i0):
83
81
  de2[j0,i0] = de2[i0,j0].T
82
+
83
+ if mf.do_nlc():
84
+ de2 += _get_enlc_deriv2(hessobj, mo_coeff, mo_occ, max_memory)
85
+
84
86
  log.timer('RKS partial hessian', *time0)
85
87
  return de2
86
88
 
@@ -111,6 +113,8 @@ def make_h1(hessobj, mo_coeff, mo_occ, chkfile=None, atmlst=None, verbose=None):
111
113
 
112
114
  h1mo += rhf_grad.get_grad_hcore(hessobj.base.nuc_grad_method())
113
115
  h1mo += rks_hess._get_vxc_deriv1(hessobj, mo_coeff, mo_occ, max_memory)
116
+ if mf.do_nlc():
117
+ h1mo += _get_vnlc_deriv1(hessobj, mo_coeff, mo_occ, max_memory)
114
118
  return h1mo
115
119
 
116
120
  class Hessian(rks_hess.Hessian):