gpu4pyscf 1.3.2__tar.gz → 1.4.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 (195) hide show
  1. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/CHANGELOG +40 -1
  2. {gpu4pyscf-1.3.2/gpu4pyscf.egg-info → gpu4pyscf-1.4.1}/PKG-INFO +1 -1
  3. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/README.md +35 -16
  4. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/__config__.py +4 -4
  5. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/__init__.py +2 -2
  6. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/df/df.py +7 -6
  7. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/df/df_jk.py +0 -48
  8. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/df/grad/__init__.py +5 -1
  9. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/df/grad/jk.py +171 -16
  10. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/df/grad/rhf.py +12 -33
  11. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/df/grad/rks.py +24 -42
  12. gpu4pyscf-1.4.1/gpu4pyscf/df/grad/tdrhf.py +202 -0
  13. gpu4pyscf-1.4.1/gpu4pyscf/df/grad/tdrks.py +40 -0
  14. gpu4pyscf-1.4.1/gpu4pyscf/df/grad/tduhf.py +216 -0
  15. gpu4pyscf-1.4.1/gpu4pyscf/df/grad/tduks.py +40 -0
  16. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/df/grad/uhf.py +11 -32
  17. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/df/grad/uks.py +32 -38
  18. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/df/hessian/rks.py +7 -3
  19. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/df/int3c2e.py +22 -28
  20. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/df/int3c2e_bdiv.py +20 -17
  21. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/dft/__init__.py +1 -0
  22. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/dft/gen_grid.py +79 -93
  23. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/dft/libxc.py +0 -1
  24. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/dft/numint.py +378 -297
  25. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/dft/rks.py +11 -37
  26. gpu4pyscf-1.4.1/gpu4pyscf/dft/rks_lowmem.py +228 -0
  27. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/dft/xc_deriv.py +120 -2
  28. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/drivers/dft_3c_driver.py +2 -3
  29. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/drivers/dft_driver.py +17 -89
  30. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/drivers/opt_driver.py +15 -77
  31. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/grad/__init__.py +4 -0
  32. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/grad/rhf.py +58 -38
  33. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/grad/rks.py +307 -123
  34. gpu4pyscf-1.4.1/gpu4pyscf/grad/tdrhf.py +422 -0
  35. gpu4pyscf-1.4.1/gpu4pyscf/grad/tdrks.py +516 -0
  36. gpu4pyscf-1.4.1/gpu4pyscf/grad/tduhf.py +269 -0
  37. gpu4pyscf-1.4.1/gpu4pyscf/grad/tduks.py +515 -0
  38. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/grad/uhf.py +12 -9
  39. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/grad/uks.py +131 -126
  40. gpu4pyscf-1.4.1/gpu4pyscf/gto/ecp.py +317 -0
  41. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/gto/mole.py +56 -23
  42. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/hessian/jk.py +15 -15
  43. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/hessian/rhf.py +65 -68
  44. gpu4pyscf-1.4.1/gpu4pyscf/hessian/rks.py +2406 -0
  45. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/hessian/uhf.py +5 -2
  46. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/hessian/uks.py +19 -20
  47. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/lib/cupy_helper.py +113 -31
  48. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/lib/cusolver.py +3 -2
  49. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/lib/cutensor.py +2 -0
  50. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/lib/diis.py +27 -64
  51. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/lib/logger.py +15 -0
  52. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/lib/multi_gpu.py +18 -0
  53. gpu4pyscf-1.4.1/gpu4pyscf/nac/__init__.py +1 -0
  54. gpu4pyscf-1.4.1/gpu4pyscf/nac/tdrhf.py +300 -0
  55. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/pbc/df/df.py +131 -20
  56. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/pbc/df/df_jk.py +3 -24
  57. gpu4pyscf-1.4.1/gpu4pyscf/pbc/df/df_jk_real.py +137 -0
  58. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/pbc/df/ft_ao.py +108 -80
  59. gpu4pyscf-1.4.1/gpu4pyscf/pbc/df/int3c2e.py +773 -0
  60. gpu4pyscf-1.4.1/gpu4pyscf/pbc/df/rsdf_builder.py +888 -0
  61. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/pbc/dft/krks.py +4 -4
  62. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/pbc/dft/kuks.py +4 -4
  63. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/pbc/dft/multigrid.py +519 -162
  64. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/pbc/dft/rks.py +52 -20
  65. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/pbc/dft/uks.py +4 -4
  66. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/pbc/scf/hf.py +7 -4
  67. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/pbc/scf/khf.py +3 -4
  68. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/pbc/scf/kuhf.py +0 -3
  69. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/pbc/scf/uhf.py +0 -3
  70. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/properties/polarizability.py +8 -8
  71. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/qmmm/pbc/itrf.py +66 -58
  72. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/qmmm/pbc/mm_mole.py +19 -17
  73. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/scf/__init__.py +1 -0
  74. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/scf/_response_functions.py +20 -10
  75. gpu4pyscf-1.4.1/gpu4pyscf/scf/diis.py +123 -0
  76. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/scf/hf.py +234 -31
  77. gpu4pyscf-1.4.1/gpu4pyscf/scf/hf_lowmem.py +337 -0
  78. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/scf/int2c2e.py +1 -0
  79. gpu4pyscf-1.4.1/gpu4pyscf/scf/j_engine.py +439 -0
  80. gpu4pyscf-1.4.1/gpu4pyscf/scf/jk.py +910 -0
  81. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/scf/ucphf.py +26 -22
  82. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/scf/uhf.py +6 -8
  83. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/solvent/__init__.py +4 -4
  84. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/solvent/_attach_solvent.py +58 -18
  85. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/solvent/grad/pcm.py +61 -32
  86. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/solvent/grad/smd.py +1 -1
  87. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/solvent/hessian/pcm.py +153 -133
  88. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/solvent/hessian/smd.py +3 -3
  89. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/solvent/pcm.py +107 -31
  90. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/solvent/smd.py +5 -3
  91. gpu4pyscf-1.4.1/gpu4pyscf/solvent/tdscf/__init__.py +13 -0
  92. gpu4pyscf-1.4.1/gpu4pyscf/solvent/tdscf/pcm.py +146 -0
  93. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/tdscf/_lr_eig.py +498 -3
  94. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/tdscf/_uhf_resp_sf.py +2 -3
  95. gpu4pyscf-1.4.1/gpu4pyscf/tdscf/math_helper.py +686 -0
  96. gpu4pyscf-1.4.1/gpu4pyscf/tdscf/parameter.py +144 -0
  97. gpu4pyscf-1.4.1/gpu4pyscf/tdscf/rhf.py +681 -0
  98. gpu4pyscf-1.4.1/gpu4pyscf/tdscf/ris.py +1690 -0
  99. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/tdscf/rks.py +18 -7
  100. gpu4pyscf-1.4.1/gpu4pyscf/tdscf/spectralib.py +178 -0
  101. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/tdscf/uhf.py +395 -9
  102. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/tdscf/uks.py +20 -3
  103. gpu4pyscf-1.4.1/gpu4pyscf/tools/__init__.py +15 -0
  104. gpu4pyscf-1.4.1/gpu4pyscf/tools/ase_interface.py +81 -0
  105. gpu4pyscf-1.4.1/gpu4pyscf/tools/method_config.py +117 -0
  106. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1/gpu4pyscf.egg-info}/PKG-INFO +1 -1
  107. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf.egg-info/SOURCES.txt +24 -1
  108. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf.egg-info/requires.txt +1 -1
  109. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/setup.py +1 -1
  110. gpu4pyscf-1.3.2/gpu4pyscf/hessian/rks.py +0 -882
  111. gpu4pyscf-1.3.2/gpu4pyscf/pbc/df/int3c2e.py +0 -483
  112. gpu4pyscf-1.3.2/gpu4pyscf/pbc/df/rsdf_builder.py +0 -427
  113. gpu4pyscf-1.3.2/gpu4pyscf/scf/diis.py +0 -91
  114. gpu4pyscf-1.3.2/gpu4pyscf/scf/j_engine.py +0 -232
  115. gpu4pyscf-1.3.2/gpu4pyscf/scf/jk.py +0 -712
  116. gpu4pyscf-1.3.2/gpu4pyscf/tdscf/rhf.py +0 -378
  117. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/LICENSE +0 -0
  118. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/MANIFEST.in +0 -0
  119. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/cc/__init__.py +0 -0
  120. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/cc/ccsd_incore.py +0 -0
  121. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/df/__init__.py +0 -0
  122. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/df/cderi.py +0 -0
  123. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/df/hessian/__init__.py +0 -0
  124. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/df/hessian/jk.py +1 -1
  125. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/df/hessian/rhf.py +0 -0
  126. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/df/hessian/uhf.py +0 -0
  127. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/df/hessian/uks.py +0 -0
  128. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/dft/gks.py +0 -0
  129. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/dft/libxc_structs.py +0 -0
  130. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/dft/radi.py +0 -0
  131. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/dft/roks.py +0 -0
  132. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/dft/uks.py +0 -0
  133. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/dft/xc_alias.py +0 -0
  134. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/drivers/__init__.py +0 -0
  135. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/drivers/basis_vDZP_NWCHEM.dat +0 -0
  136. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/drivers/ecp_vDZP_NWCHEM.dat +0 -0
  137. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/drivers/opt_3c_driver.py +0 -0
  138. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/fci/__init__.py +0 -0
  139. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/fci/direct_spin1.py +0 -0
  140. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/grad/dispersion.py +0 -0
  141. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/gto/__init__.py +0 -0
  142. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/gto/int3c1e.py +0 -0
  143. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/gto/int3c1e_ip.py +0 -0
  144. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/gto/int3c1e_ipip.py +0 -0
  145. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/hessian/__init__.py +0 -0
  146. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/hessian/dispersion.py +0 -0
  147. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/lib/__init__.py +0 -0
  148. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/lib/cublas.py +0 -0
  149. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/lib/memcpy.py +0 -0
  150. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/lib/utils.py +0 -0
  151. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/mp/__init__.py +0 -0
  152. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/mp/dfmp2.py +0 -0
  153. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/mp/mp2.py +0 -0
  154. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/pbc/__init__.py +0 -0
  155. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/pbc/df/__init__.py +0 -0
  156. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/pbc/df/aft.py +0 -0
  157. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/pbc/df/aft_jk.py +0 -0
  158. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/pbc/df/fft.py +0 -0
  159. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/pbc/df/fft_jk.py +0 -0
  160. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/pbc/dft/__init__.py +0 -0
  161. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/pbc/dft/gen_grid.py +0 -0
  162. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/pbc/dft/numint.py +0 -0
  163. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/pbc/gto/__init__.py +0 -0
  164. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/pbc/lib/__init__.py +0 -0
  165. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/pbc/lib/kpts_helper.py +0 -0
  166. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/pbc/scf/__init__.py +0 -0
  167. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/pbc/tools/__init__.py +0 -0
  168. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/pbc/tools/k2gamma.py +0 -0
  169. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/pbc/tools/pbc.py +0 -0
  170. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/pop/__init__.py +0 -0
  171. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/pop/esp.py +0 -0
  172. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/properties/__init__.py +0 -0
  173. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/properties/ir.py +0 -0
  174. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/properties/shielding.py +0 -0
  175. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/qmmm/__init__.py +0 -0
  176. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/qmmm/chelpg.py +0 -0
  177. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/qmmm/pbc/__init__.py +0 -0
  178. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/qmmm/pbc/tools.py +0 -0
  179. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/scf/cphf.py +0 -0
  180. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/scf/dispersion.py +0 -0
  181. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/scf/ghf.py +0 -0
  182. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/scf/hf_symm.py +0 -0
  183. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/scf/int4c2e.py +0 -0
  184. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/scf/rohf.py +0 -0
  185. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/scf/soscf.py +0 -0
  186. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/scf/uhf_symm.py +0 -0
  187. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/solvent/grad/__init__.py +0 -0
  188. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/solvent/grad/smd_experiment.py +0 -0
  189. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/solvent/hessian/__init__.py +0 -0
  190. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/solvent/hessian/smd_experiment.py +0 -0
  191. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/solvent/smd_experiment.py +0 -0
  192. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf/tdscf/__init__.py +0 -0
  193. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf.egg-info/dependency_links.txt +0 -0
  194. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/gpu4pyscf.egg-info/top_level.txt +0 -0
  195. {gpu4pyscf-1.3.2 → gpu4pyscf-1.4.1}/setup.cfg +0 -0
@@ -1,8 +1,47 @@
1
+ v1.4.1 (2025-05-20)
2
+ -------------------
3
+ * New Features
4
+ - Analytical hessian for VV10 functionals
5
+ - DFT polarizability with VV10 functionals
6
+ - TDDFT for VV10 functionals
7
+ - Non-adiabatic coupling constants for TDDFT states
8
+ - TDDFT gradients and geometry optimization solver for excited states
9
+ - LR-PCM for TDDFT and TDDFT gradients
10
+ - TDDFT-ris method
11
+ * Improvements
12
+ - Optimization CUDA kernel and integral screening for MD J-engine. The MD
13
+ J-engine is utilized by default for large system HF and DFT computation.
14
+ - Optimization for PBC gaussian density fitting at gamma point.
15
+ - ECP gradients CUDA kernel
16
+ - Reduced atomicAdd overhead in Rys JK kernel
17
+ * Fixes
18
+ - MINAO initial guess for ghost atoms
19
+
20
+ v1.4.0 (2025-03-27)
21
+ -------------------
22
+ * New Features
23
+ - RKS and UKS TDDFT Gradients for density fitting and direct-SCF methods.
24
+ - ECP integrals and its first and second derivatives accelerated on GPU.
25
+ - Multigrid algorithm for Coulomb matrix and LDA, GGA, MGGA functionals computation.
26
+ - PBC Gaussian density fitting integrals.
27
+ - ASE interface for molecular systems.
28
+ * Improvements
29
+ - Reduce memory footprint in SCF driver.
30
+ - Reduce memory requirements for PCM energy and gradients.
31
+ - Reduce memory requirements for DFT gradients.
32
+ - Utilize the sparsity in cart2sph coefficients in the cart2sph transformation in scf.jk kernel
33
+ - Molecular 3c2e integrals generated using the block-divergent alogrithm.
34
+ - Support I orbitals in DFT.
35
+ * Fixes
36
+ - LRU cached cart2sph under the multiple GPU environment.
37
+ - A maxDynamicSharedMemorySize setting bug in gradient and hessian calculation under the multiple GPU environment.
38
+ - Remove the limits of 6000 GTO shells in DFT numerical integration module.
39
+
1
40
  v1.3.2 (2025-03-10)
2
41
  -------------------
3
42
  * Improvements
4
43
  - Dump xc info and grids into to log file
5
- - Optimize 4-center integral evalulation CUDA kernels using warp divergent algorithm
44
+ - Optimize 4-center integral evaluation CUDA kernels using warp divergent algorithm
6
45
  - Support up to I orbitals in DFT
7
46
  - Fix out-of-bound issue in DFT hessian for heavy atoms (>=19)
8
47
  * Deprecation
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: gpu4pyscf
3
- Version: 1.3.2
3
+ Version: 1.4.1
4
4
  Summary: GPU extensions for PySCF
5
5
  Author: PySCF developers
6
6
  License: Apache-2.0
@@ -7,18 +7,34 @@ Installation
7
7
  --------
8
8
 
9
9
  > [!NOTE]
10
- > The compiled binary packages support compute capability 6.0 and later (Pascal and later, such as Tesla P100, RTX 10 series and later).
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
@@ -27,7 +43,7 @@ cmake --build build/temp.gpu4pyscf -j 4
27
43
  CURRENT_PATH=`pwd`
28
44
  export PYTHONPATH="${PYTHONPATH}:${CURRENT_PATH}"
29
45
  ```
30
- Then install cutensor and cupy for acceleration (please switch the versions according to your nvcc version!)
46
+ Then install cutensor and cupy for acceleration (please switch the versions according to your runtime CUDA environment!)
31
47
  ```sh
32
48
  pip3 install cutensor-cu12 cupy-cuda12x
33
49
  ```
@@ -36,26 +52,28 @@ 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/);
62
+ - Atomic Simulation Environment ([ASE](https://gitlab.com/ase/ase)) interface;
48
63
  - Dispersion corrections via [DFTD3](https://github.com/dftd3/simple-dftd3) and [DFTD4](https://github.com/dftd4/dftd4);
49
- - Nonlocal functional correction (vv10) for SCF and gradient;
50
- - ECP is supported and calculated on CPU;
51
- - PCM models, SMD model, their analytical gradients, and semi-analytical Hessian matrix;
64
+ - Analytical gradient and analytical Hessian for nonlocal functional correction (vv10);
65
+ - GPU accelerated ECP;
66
+ - PCM models, their analytical gradients, and analytical Hessian matrix;
67
+ - SMD solvent model;
52
68
  - Unrestricted Hartree-Fock and unrestricted DFT, gradient, and Hessian;
53
- - MP2/DF-MP2 and CCSD (experimental);
54
- - Polarizability, IR, and NMR shielding (experimental);
55
- - QM/MM with PBC;
56
69
  - CHELPG, ESP, and RESP atomic charge;
57
- - Multi-GPU for both direct SCF and density fitting (experimental)
58
- - SCF and DFT with periodic boundary condition (experimental)
70
+
71
+ The following features are still in the experimental stage
72
+ - MP2/DF-MP2 and CCSD;
73
+ - Polarizability, IR, and NMR shielding;
74
+ - QM/MM with PBC;
75
+ - Multi-GPU for both direct SCF and density fitting
76
+ - SCF and DFT with periodic boundary condition
59
77
 
60
78
  Limitations
61
79
  --------
@@ -65,6 +83,7 @@ Limitations
65
83
  - Density fitting scheme up to ~168 atoms with def2-tzvpd basis, bounded by CPU memory;
66
84
  - meta-GGA without density laplacian;
67
85
  - Double hybrid functionals are not supported;
86
+ - Hessian of TDDFT is not supported;
68
87
 
69
88
  Examples
70
89
  --------
@@ -113,7 +132,7 @@ Find more examples in [gpu4pyscf/examples](https://github.com/pyscf/gpu4pyscf/tr
113
132
 
114
133
  Benchmarks
115
134
  --------
116
- Speedup with GPU4PySCF v0.6.0 on A100-80G over Q-Chem 6.1 on 32-cores CPU (Desity fitting, SCF, def2-tzvpp, def2-universal-jkfit, B3LYP, (99,590))
135
+ Speedup with GPU4PySCF v0.6.0 on A100-80G over Q-Chem 6.1 on 32-cores CPU (density fitting, SCF, def2-tzvpp, def2-universal-jkfit, B3LYP, (99,590))
117
136
 
118
137
  | mol | natm | LDA | PBE | B3LYP | M06 | wB97m-v |
119
138
  |:------------------|-------:|-------:|-------:|--------:|-------:|----------:|
@@ -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 = 128*128 # 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,6 @@
12
12
  # See the License for the specific language governing permissions and
13
13
  # limitations under the License.
14
14
 
15
- __version__ = '1.3.2'
15
+ __version__ = '1.4.1'
16
16
 
17
- from . import lib, grad, hessian, solvent, scf, dft
17
+ from . import lib, grad, hessian, solvent, scf, dft, tdscf, nac
@@ -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
@@ -125,7 +126,7 @@ class DF(lib.StreamObject):
125
126
  j2c_cpu = auxmol.intor('int2c2e', hermi=1)
126
127
  else:
127
128
  j2c_cpu = auxmol.intor('int2c2e', hermi=1)
128
- j2c = cupy.asarray(j2c_cpu, order='C')
129
+ j2c = asarray(j2c_cpu)
129
130
  t0 = log.timer_debug1('2c2e', *t0)
130
131
  intopt = int3c2e.VHFOpt(mol, auxmol, 'int2e')
131
132
  intopt.build(direct_scf_tol, diag_block_with_triu=False, aosym=True,
@@ -205,7 +206,7 @@ class DF(lib.StreamObject):
205
206
  if isinstance(cderi_sparse, np.ndarray):
206
207
  # first block
207
208
  if buf_prefetch is None:
208
- buf = cupy.asarray(cderi_sparse[p0:p1,:])
209
+ buf = asarray(cderi_sparse[p0:p1,:])
209
210
  buf_prefetch = cupy.empty([p2-p1,cderi_sparse.shape[1]])
210
211
  if isinstance(cderi_sparse, np.ndarray) and p1 < p2:
211
212
  buf_prefetch.set(cderi_sparse[p1:p2,:])
@@ -322,7 +323,7 @@ def _cderi_task(intopt, cd_low, task_list, _cderi, aux_blksize,
322
323
  log = logger.new_logger(mol, mol.verbose)
323
324
  t1 = log.init_timer()
324
325
  cd_low_tag = cd_low.tag
325
- cd_low = cupy.asarray(cd_low)
326
+ cd_low = asarray(cd_low)
326
327
 
327
328
  cart_ao_loc = intopt.cart_ao_loc
328
329
  aux_ao_loc = intopt.aux_ao_loc
@@ -411,7 +412,7 @@ def _cholesky_eri_bdiv(intopt, omega=None):
411
412
  if intopt.mol.cart:
412
413
  eri3c = intopt.orbital_pair_cart2sph(eri3c)
413
414
  auxmol = intopt.auxmol
414
- j2c = cupy.asarray(auxmol.intor('int2c2e', hermi=1), order='C')
415
+ j2c = asarray(auxmol.intor('int2c2e', hermi=1), order='C')
415
416
  cd_low = cholesky(j2c)
416
417
  aux_coeff = cupy.array(intopt.aux_coeff, copy=True)
417
418
  cd_low = solve_triangular(cd_low, aux_coeff.T, lower=True, overwrite_b=True)
@@ -34,35 +34,6 @@ def _pin_memory(array):
34
34
  ret[...] = array
35
35
  return ret
36
36
 
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
37
  def _density_fit(mf, auxbasis=None, with_df=None, only_dfj=False):
67
38
  '''For the given SCF object, update the J, K matrix constructor with
68
39
  corresponding density fitting integrals.
@@ -143,8 +114,6 @@ class _DFHF:
143
114
  self.with_df.reset(mol)
144
115
  return super().reset(mol)
145
116
 
146
- init_workflow = init_workflow
147
-
148
117
  def get_jk(self, mol=None, dm=None, hermi=1, with_j=True, with_k=True,
149
118
  omega=None):
150
119
  if dm is None: dm = self.make_rdm1()
@@ -517,23 +486,6 @@ def get_jk(dfobj, dms_tag, hermi=0, with_j=True, with_k=True, direct_scf_tol=1e-
517
486
  vk = vk.get()
518
487
  return vj, vk
519
488
 
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
489
  def get_j(dfobj, dm, hermi=1, direct_scf_tol=1e-13):
538
490
  intopt = getattr(dfobj, 'intopt', None)
539
491
  if intopt is None:
@@ -12,9 +12,13 @@
12
12
  # See the License for the specific language governing permissions and
13
13
  # limitations under the License.
14
14
 
15
- from . import rhf, rks, uhf, uks
15
+ from . import rhf, rks, uhf, uks, tdrhf, tdrks, tduhf, tduks
16
16
 
17
17
  RHF = rhf.Gradients
18
18
  RKS = rks.Gradients
19
19
  UHF = uhf.Gradients
20
20
  UKS = uks.Gradients
21
+ TDRHF = tdrhf.Gradients
22
+ TDRKS = tdrks.Gradients
23
+ TDUHF = tduhf.Gradients
24
+ TDUKS = tduks.Gradients
@@ -86,24 +86,23 @@ def get_rhojk(with_df, dm, orbo, with_j=True, with_k=True):
86
86
  def _jk_ip_task(intopt, rhoj_cart, dm_cart, rhok_cart, orbo_cart, task_list,
87
87
  with_j=True, with_k=True, device_id=0, omega=None):
88
88
  mol = intopt.mol
89
+ natm = mol.natm
89
90
  with cupy.cuda.Device(device_id), _streams[device_id]:
90
91
  log = logger.new_logger(mol, mol.verbose)
91
92
  t0 = (logger.process_clock(), logger.perf_counter())
92
93
 
93
94
  orbo_cart = cupy.asarray(orbo_cart)
94
95
  cart_aux_loc = intopt.cart_aux_loc
95
- nao_cart = dm_cart.shape[0]
96
- naux_cart = intopt._sorted_auxmol.nao
97
- vj = vk = vjaux = vkaux = None
96
+ ej = ek = ejaux = ekaux = None
98
97
  if with_j:
99
98
  rhoj_cart = cupy.asarray(rhoj_cart)
100
99
  dm_cart = cupy.asarray(dm_cart)
101
- vj = cupy.zeros((3,nao_cart), order='C')
102
- vjaux = cupy.zeros((3,naux_cart))
100
+ ej = cupy.zeros((natm,3), order='C')
101
+ ejaux = cupy.zeros((natm,3))
103
102
  if with_k:
104
103
  rhok_cart = cupy.asarray(rhok_cart)
105
- vk = cupy.zeros((3,nao_cart), order='C')
106
- vkaux = cupy.zeros((3,naux_cart))
104
+ ek = cupy.zeros((natm,3), order='C')
105
+ ekaux = cupy.zeros((natm,3))
107
106
 
108
107
  for cp_kl_id in task_list:
109
108
  k0, k1 = cart_aux_loc[cp_kl_id], cart_aux_loc[cp_kl_id+1]
@@ -135,16 +134,16 @@ def _jk_ip_task(intopt, rhoj_cart, dm_cart, rhok_cart, orbo_cart, task_list,
135
134
  vjaux_outcore = contract('xp,p->xp', rhoj_tmp0, rhoj_cart[k0:k1])
136
135
  vkaux_outcore = contract('xpji,pji->xp', int3c_ip, rhok_tmp)
137
136
  '''
138
- vj_tmp, vk_tmp = get_int3c2e_ip_jk(intopt, cp_kl_id, 'ip1', rhoj_tmp, rhok_tmp, dm_cart, omega=omega)
139
- if with_j: vj += vj_tmp
140
- if with_k: vk += vk_tmp
141
- vj_tmp, vk_tmp = get_int3c2e_ip_jk(intopt, cp_kl_id, 'ip2', rhoj_tmp, rhok_tmp, dm_cart, omega=omega)
142
- if with_j: vjaux[:, k0:k1] = vj_tmp
143
- if with_k: vkaux[:, k0:k1] = vk_tmp
144
-
145
- rhoj_tmp = rhok_tmp = vj_tmp = vk_tmp = None
137
+ ej_tmp, ek_tmp = get_int3c2e_ip_jk(intopt, cp_kl_id, 'ip1', rhoj_tmp, rhok_tmp, dm_cart, omega=omega)
138
+ if with_j: ej += ej_tmp
139
+ if with_k: ek += ek_tmp
140
+ ej_tmp, ek_tmp = get_int3c2e_ip_jk(intopt, cp_kl_id, 'ip2', rhoj_tmp, rhok_tmp, dm_cart, omega=omega)
141
+ if with_j: ejaux += ej_tmp
142
+ if with_k: ekaux += ek_tmp
143
+
144
+ rhoj_tmp = rhok_tmp = ej_tmp = ek_tmp = None
146
145
  t0 = log.timer_debug1(f'calculate {cp_kl_id:3d} / {len(intopt.aux_log_qs):3d}, {k1-k0:3d} slices', *t0)
147
- return vj, vk, vjaux, vkaux
146
+ return ej, ek, ejaux, ekaux
148
147
 
149
148
  def get_grad_vjk(with_df, mol, auxmol, rhoj_cart, dm_cart, rhok_cart, orbo_cart,
150
149
  with_j=True, with_k=True, omega=None):
@@ -191,3 +190,159 @@ def get_grad_vjk(with_df, mol, auxmol, rhoj_cart, dm_cart, rhok_cart, orbo_cart,
191
190
  rhok = reduce_to_device(rhok_total)
192
191
  vkaux = reduce_to_device(vkaux_total)
193
192
  return rhoj, rhok, vjaux, vkaux
193
+
194
+
195
+ def _jk_task_td(with_df, dm, orbol, orbor, with_j=True, with_k=True, device_id=0):
196
+ '''
197
+ (L|ij) -> rhoj: (L), rhok: (L|lr), for dm0 from scf, rhok is (L|oo)
198
+ '''
199
+ rhoj = rhok = None
200
+ with cupy.cuda.Device(device_id), _streams[device_id]:
201
+ log = logger.new_logger(with_df.mol, with_df.verbose)
202
+ assert isinstance(with_df.verbose, int)
203
+ t0 = log.init_timer()
204
+ dm = cupy.asarray(dm)
205
+ naux_slice = with_df._cderi[device_id].shape[0]
206
+ nl = orbol.shape[-1]
207
+ nr = orbor.shape[-1]
208
+
209
+ rows = with_df.intopt.cderi_row
210
+ cols = with_df.intopt.cderi_col
211
+ dm_sparse = dm[rows, cols]
212
+ dm_sparse[with_df.intopt.cderi_diag] *= .5
213
+
214
+ blksize = with_df.get_blksize()
215
+ if with_j:
216
+ rhoj = cupy.empty([naux_slice])
217
+ if with_k:
218
+ rhok = cupy.empty([naux_slice, nl, nr], order='C')
219
+ p0 = p1 = 0
220
+
221
+ for cderi, cderi_sparse in with_df.loop(blksize=blksize):
222
+ p1 = p0 + cderi.shape[0]
223
+ if with_j:
224
+ rhoj[p0:p1] = 2.0*dm_sparse.dot(cderi_sparse)
225
+ if with_k:
226
+ rhok[p0:p1] = 0
227
+ tmp = contract('Lij,jk->Lki', cderi, orbol)
228
+ contract('Lki,il->Lkl', tmp, orbor, out=rhok[p0:p1])
229
+ p0 = p1
230
+ cupy.cuda.get_current_stream().synchronize()
231
+ t0 = log.timer_debug1(f'rhoj and rhok on Device {device_id}', *t0)
232
+ return rhoj, rhok
233
+
234
+
235
+ def get_rhojk_td(with_df, dm, orbol, orbor, with_j=True, with_k=True):
236
+ ''' Calculate rhoj and rhok on Multi-GPU system
237
+ '''
238
+ futures = []
239
+ cupy.cuda.get_current_stream().synchronize()
240
+ with ThreadPoolExecutor(max_workers=num_devices) as executor:
241
+ for device_id in range(num_devices):
242
+ future = executor.submit(
243
+ _jk_task_td, with_df, dm, orbol, orbor,
244
+ with_j=with_j, with_k=with_k, device_id=device_id)
245
+ futures.append(future)
246
+
247
+ rhoj_total = []
248
+ rhok_total = []
249
+ for future in futures:
250
+ rhoj, rhok = future.result()
251
+ rhoj_total.append(rhoj)
252
+ rhok_total.append(rhok)
253
+
254
+ rhoj = rhok = None
255
+ if with_j:
256
+ rhoj = concatenate(rhoj_total)
257
+ if with_k:
258
+ rhok = concatenate(rhok_total)
259
+
260
+ return rhoj, rhok
261
+
262
+
263
+ def _jk_ip_task_td(intopt, rhoj_cart, dm_cart, rhok_cart, orbol_cart, orbor_cart, task_list,
264
+ with_j=True, with_k=True, device_id=0, omega=None):
265
+ mol = intopt.mol
266
+ natm = mol.natm
267
+ with cupy.cuda.Device(device_id), _streams[device_id]:
268
+ log = logger.new_logger(mol, mol.verbose)
269
+ t0 = (logger.process_clock(), logger.perf_counter())
270
+
271
+ cart_aux_loc = intopt.cart_aux_loc
272
+ ej = ek = ejaux = ekaux = None
273
+ if with_j:
274
+ rhoj_cart = cupy.asarray(rhoj_cart)
275
+ dm_cart = cupy.asarray(dm_cart)
276
+ ej = cupy.zeros((natm,3), order='C')
277
+ ejaux = cupy.zeros((natm,3))
278
+ if with_k:
279
+ rhok_cart = cupy.asarray(rhok_cart)
280
+ ek = cupy.zeros((natm,3), order='C')
281
+ ekaux = cupy.zeros((natm,3))
282
+
283
+ for cp_kl_id in task_list:
284
+ k0, k1 = cart_aux_loc[cp_kl_id], cart_aux_loc[cp_kl_id+1]
285
+ rhoj_tmp = rhok_tmp = None
286
+ if with_j:
287
+ rhoj_tmp = rhoj_cart[k0:k1]
288
+ if with_k:
289
+ rhok_tmp = contract('por,ir->pio', rhok_cart[k0:k1], orbol_cart)
290
+ rhok_tmp = contract('pio,jo->pji', rhok_tmp, orbor_cart)
291
+
292
+ ej_tmp, ek_tmp = get_int3c2e_ip_jk(intopt, cp_kl_id, 'ip1', rhoj_tmp, rhok_tmp, dm_cart, omega=omega)
293
+ if with_j: ej += ej_tmp
294
+ if with_k: ek += ek_tmp
295
+ ej_tmp, ek_tmp = get_int3c2e_ip_jk(intopt, cp_kl_id, 'ip2', rhoj_tmp, rhok_tmp, dm_cart, omega=omega)
296
+ if with_j: ejaux += ej_tmp
297
+ if with_k: ekaux += ek_tmp
298
+
299
+ rhoj_tmp = rhok_tmp = ej_tmp = ek_tmp = None
300
+ t0 = log.timer_debug1(f'calculate {cp_kl_id:3d} / {len(intopt.aux_log_qs):3d}, {k1-k0:3d} slices', *t0)
301
+ return ej, ek, ejaux, ekaux
302
+
303
+
304
+ def get_grad_vjk_td(with_df, mol, auxmol, rhoj_cart, dm_cart, rhok_cart, orbol_cart, orbor_cart,
305
+ with_j=True, with_k=True, omega=None):
306
+ '''
307
+ Calculate vj = (i'j|L)(L|kl)(ij)(kl), vk = (i'j|L)(L|kl)(ik)(jl)
308
+ vjaux = (ij|L')(L|kl)(ij)(kl), vkaux = (ij|L')(L|kl)(ik)(jl)
309
+ '''
310
+ nao_cart = dm_cart.shape[0]
311
+ block_size = with_df.get_blksize(nao=nao_cart)
312
+
313
+ intopt = VHFOpt(mol, auxmol, 'int2e')
314
+ intopt.build(1e-14, diag_block_with_triu=True, aosym=False,
315
+ group_size_aux=block_size, verbose=0)#, group_size=block_size)
316
+
317
+ aux_ao_loc = np.array(intopt.aux_ao_loc)
318
+ loads = aux_ao_loc[1:] - aux_ao_loc[:-1]
319
+ task_list = _split_tasks(loads, num_devices)
320
+
321
+ futures = []
322
+ cupy.cuda.get_current_stream().synchronize()
323
+ with ThreadPoolExecutor(max_workers=num_devices) as executor:
324
+ for device_id in range(num_devices):
325
+ future = executor.submit(
326
+ _jk_ip_task_td, intopt, rhoj_cart, dm_cart, rhok_cart, orbol_cart, orbor_cart, task_list[device_id],
327
+ with_j=with_j, with_k=with_k, device_id=device_id, omega=omega)
328
+ futures.append(future)
329
+
330
+ rhoj_total = []
331
+ rhok_total = []
332
+ ejaux_total = []
333
+ ekaux_total = []
334
+ for future in futures:
335
+ rhoj, rhok, ejaux, ekaux = future.result()
336
+ rhoj_total.append(rhoj)
337
+ rhok_total.append(rhok)
338
+ ejaux_total.append(ejaux)
339
+ ekaux_total.append(ekaux)
340
+
341
+ rhoj = rhok = ejaux = ekaux = None
342
+ if with_j:
343
+ rhoj = reduce_to_device(rhoj_total)
344
+ ejaux = reduce_to_device(ejaux_total)
345
+ if with_k:
346
+ rhok = reduce_to_device(rhok_total)
347
+ ekaux = reduce_to_device(ekaux_total)
348
+ return rhoj, rhok, ejaux, ekaux
@@ -59,7 +59,7 @@ def get_jk(mf_grad, mol=None, dm0=None, hermi=0, with_j=True, with_k=True, omega
59
59
  '''
60
60
  if mol is None: mol = mf_grad.mol
61
61
  #TODO: dm has to be the SCF density matrix in this version. dm should be
62
- # extended to any 1-particle density matrix
62
+ # extended to any 1-particle density matrix. The get_jk in tddft supports this function.
63
63
 
64
64
  if(dm0 is None): dm0 = mf_grad.base.make_rdm1()
65
65
  if omega is None:
@@ -106,6 +106,8 @@ def get_jk(mf_grad, mol=None, dm0=None, hermi=0, with_j=True, with_k=True, omega
106
106
  aux_cart2sph = intopt.aux_cart2sph
107
107
  low = with_df.cd_low
108
108
  low_t = low.T.copy()
109
+
110
+ ejaux = ekaux = None
109
111
  if with_j:
110
112
  if low.tag == 'eig':
111
113
  rhoj = cupy.dot(low_t.T, rhoj)
@@ -120,7 +122,7 @@ def get_jk(mf_grad, mol=None, dm0=None, hermi=0, with_j=True, with_k=True, omega
120
122
  rhoj = intopt.unsort_orbitals(rhoj, aux_axis=[0])
121
123
  tmp = contract('xpq,q->xp', int2c_e1, rhoj)
122
124
  vjaux = -contract('xp,p->xp', tmp, rhoj)
123
- vjaux_2c = cupy.array([-vjaux[:,p0:p1].sum(axis=1) for p0, p1 in auxslices[:,2:]])
125
+ ejaux = cupy.array([-vjaux[:,p0:p1].sum(axis=1) for p0, p1 in auxslices[:,2:]])
124
126
  rhoj = vjaux = tmp = None
125
127
  if with_k:
126
128
  nocc = orbo.shape[-1]
@@ -133,7 +135,7 @@ def get_jk(mf_grad, mol=None, dm0=None, hermi=0, with_j=True, with_k=True, omega
133
135
  tmp = contract('pij,qij->pq', rhok, rhok)
134
136
  tmp = intopt.unsort_orbitals(tmp, aux_axis=[0,1])
135
137
  vkaux = -contract('xpq,pq->xp', int2c_e1, tmp)
136
- vkaux_2c = cupy.array([-vkaux[:,p0:p1].sum(axis=1) for p0, p1 in auxslices[:,2:]])
138
+ ekaux = cupy.array([-vkaux[:,p0:p1].sum(axis=1) for p0, p1 in auxslices[:,2:]])
137
139
  vkaux = tmp = None
138
140
  if not auxmol.cart:
139
141
  rhok_cart = contract('pq,qkl->pkl', aux_cart2sph, rhok)
@@ -153,39 +155,16 @@ def get_jk(mf_grad, mol=None, dm0=None, hermi=0, with_j=True, with_k=True, omega
153
155
  dm_cart = cart2sph @ dm @ cart2sph.T
154
156
 
155
157
  with_df._cderi = None # release GPU memory
156
- vj, vk, vjaux, vkaux = get_grad_vjk(with_df, mol, auxmol, rhoj_cart, dm_cart, rhok_cart, orbo_cart,
158
+ ej, ek, ejaux_3c, ekaux_3c = get_grad_vjk(with_df, mol, auxmol, rhoj_cart, dm_cart, rhok_cart, orbo_cart,
157
159
  with_j=with_j, with_k=with_k, omega=omega)
158
- # NOTE: vj and vk are still in cartesian
159
- _sorted_mol = intopt._sorted_mol
160
- natm = _sorted_mol.natm
161
- nao_cart = _sorted_mol.nao
162
- ao2atom = numpy.zeros([nao_cart, natm])
163
- ao_loc = _sorted_mol.ao_loc
164
- for ibas, iatm in enumerate(_sorted_mol._bas[:,gto.ATOM_OF]):
165
- ao2atom[ao_loc[ibas]:ao_loc[ibas+1],iatm] = 1
166
- ao2atom = cupy.asarray(ao2atom)
167
160
  if with_j:
168
- vj = -ao2atom.T @ vj.T
161
+ ej = -ej
162
+ ejaux -= ejaux_3c
169
163
  if with_k:
170
- vk = -ao2atom.T @ vk.T
164
+ ek = -ek
165
+ ekaux -= ekaux_3c
171
166
  t0 = log.timer_debug1('(di,j|P) and (i,j|dP)', *t0)
172
-
173
- _sorted_auxmol = intopt._sorted_auxmol
174
- natm = _sorted_auxmol.natm
175
- naux_cart = _sorted_auxmol.nao
176
- aux2atom = numpy.zeros([naux_cart, natm])
177
- ao_loc = _sorted_auxmol.ao_loc
178
- for ibas, iatm in enumerate(_sorted_auxmol._bas[:,gto.ATOM_OF]):
179
- aux2atom[ao_loc[ibas]:ao_loc[ibas+1],iatm] = 1
180
- aux2atom = cupy.asarray(aux2atom)
181
- if with_j:
182
- vjaux_3c = aux2atom.T @ vjaux.T
183
- vjaux = vjaux_2c - vjaux_3c
184
-
185
- if with_k:
186
- vkaux_3c = aux2atom.T @ vkaux.T
187
- vkaux = vkaux_2c - vkaux_3c
188
- return vj, vk, vjaux, vkaux
167
+ return ej, ek, ejaux, ekaux
189
168
 
190
169
 
191
170
  class Gradients(rhf_grad.Gradients):
@@ -228,4 +207,4 @@ class Gradients(rhf_grad.Gradients):
228
207
  else:
229
208
  return 0
230
209
 
231
- Grad = Gradients
210
+ Grad = Gradients