pyscf 2.6.2__py3-none-macosx_11_0_arm64.whl → 2.8.0__py3-none-macosx_11_0_arm64.whl

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 (360) hide show
  1. pyscf/__init__.py +2 -2
  2. pyscf/adc/__init__.py +3 -8
  3. pyscf/adc/dfadc.py +22 -6
  4. pyscf/adc/radc.py +106 -15
  5. pyscf/adc/radc_amplitudes.py +7 -1
  6. pyscf/adc/radc_ao2mo.py +4 -2
  7. pyscf/adc/radc_ea.py +524 -8
  8. pyscf/adc/radc_ip.py +492 -60
  9. pyscf/adc/radc_ip_cvs.py +4 -2
  10. pyscf/adc/uadc.py +116 -27
  11. pyscf/adc/uadc_amplitudes.py +215 -20
  12. pyscf/adc/uadc_ao2mo.py +30 -9
  13. pyscf/adc/uadc_ea.py +34 -44
  14. pyscf/adc/uadc_ip.py +9 -4
  15. pyscf/adc/uadc_ip_cvs.py +4 -1
  16. pyscf/agf2/__init__.py +2 -2
  17. pyscf/agf2/aux_space.py +1 -1
  18. pyscf/agf2/chkfile.py +1 -1
  19. pyscf/ao2mo/__init__.py +13 -2
  20. pyscf/ao2mo/_ao2mo.py +10 -1
  21. pyscf/ao2mo/incore.py +3 -0
  22. pyscf/ao2mo/nrr_outcore.py +2 -2
  23. pyscf/ao2mo/outcore.py +9 -7
  24. pyscf/ao2mo/r_outcore.py +2 -2
  25. pyscf/cc/__init__.py +21 -3
  26. pyscf/cc/bccd.py +0 -46
  27. pyscf/cc/ccsd.py +29 -13
  28. pyscf/cc/ccsd_rdm.py +6 -1
  29. pyscf/cc/gccsd.py +2 -2
  30. pyscf/cc/uccsd.py +7 -7
  31. pyscf/cc/uccsd_rdm.py +2 -2
  32. pyscf/data/elements.py +1 -1
  33. pyscf/df/__init__.py +2 -1
  34. pyscf/df/addons.py +79 -51
  35. pyscf/df/autoaux.py +195 -0
  36. pyscf/df/df.py +5 -1
  37. pyscf/df/df_jk.py +27 -25
  38. pyscf/df/grad/casscf.py +0 -41
  39. pyscf/df/grad/rhf.py +31 -1
  40. pyscf/df/hessian/rhf.py +2 -10
  41. pyscf/df/hessian/rks.py +1 -7
  42. pyscf/df/hessian/uhf.py +3 -13
  43. pyscf/df/hessian/uks.py +1 -8
  44. pyscf/df/incore.py +18 -6
  45. pyscf/df/outcore.py +6 -6
  46. pyscf/dft/dks.py +1 -1
  47. pyscf/dft/gks.py +25 -21
  48. pyscf/dft/libxc.py +91 -645
  49. pyscf/dft/numint.py +40 -19
  50. pyscf/dft/radi.py +48 -7
  51. pyscf/dft/rks.py +29 -25
  52. pyscf/dft/roks.py +7 -1
  53. pyscf/dft/uks.py +34 -25
  54. pyscf/dft/xc_deriv.py +1 -1
  55. pyscf/dft/xcfun.py +53 -2
  56. pyscf/eph/eph_fd.py +1 -1
  57. pyscf/eph/rhf.py +6 -36
  58. pyscf/eph/rks.py +0 -4
  59. pyscf/eph/uhf.py +1 -7
  60. pyscf/eph/uks.py +1 -7
  61. pyscf/fci/addons.py +117 -2
  62. pyscf/fci/cistring.py +1 -1
  63. pyscf/fci/direct_nosym.py +3 -3
  64. pyscf/fci/direct_spin0_symm.py +22 -43
  65. pyscf/fci/direct_spin1.py +65 -10
  66. pyscf/fci/direct_spin1_symm.py +49 -14
  67. pyscf/fci/direct_uhf.py +4 -4
  68. pyscf/fci/selected_ci_symm.py +1 -1
  69. pyscf/grad/ccsd.py +3 -7
  70. pyscf/grad/ccsd_slow.py +2 -3
  71. pyscf/grad/lagrange.py +11 -3
  72. pyscf/grad/mp2.py +13 -4
  73. pyscf/grad/sacasscf.py +1 -1
  74. pyscf/grad/tdrks.py +1 -1
  75. pyscf/grad/uccsd.py +3 -7
  76. pyscf/grad/ump2.py +2 -4
  77. pyscf/gto/basis/__init__.py +17 -4
  78. pyscf/gto/basis/bse.py +68 -15
  79. pyscf/gto/basis/def2-mtzvp.dat +4719 -0
  80. pyscf/gto/basis/def2-mtzvpp.dat +4739 -0
  81. pyscf/gto/basis/dyall-basis/__init__.py +0 -0
  82. pyscf/gto/basis/dyall-basis/dyall_2zp.py +6492 -0
  83. pyscf/gto/basis/dyall-basis/dyall_3zp.py +8343 -0
  84. pyscf/gto/basis/dyall-basis/dyall_4zp.py +10055 -0
  85. pyscf/gto/basis/dyall-basis/dyall_aae2z.py +1818 -0
  86. pyscf/gto/basis/dyall-basis/dyall_aae3z.py +2521 -0
  87. pyscf/gto/basis/dyall-basis/dyall_aae4z.py +3351 -0
  88. pyscf/gto/basis/dyall-basis/dyall_acv2z.py +1790 -0
  89. pyscf/gto/basis/dyall-basis/dyall_acv3z.py +2417 -0
  90. pyscf/gto/basis/dyall-basis/dyall_acv4z.py +3085 -0
  91. pyscf/gto/basis/dyall-basis/dyall_ae2z.py +6619 -0
  92. pyscf/gto/basis/dyall-basis/dyall_ae3z.py +9027 -0
  93. pyscf/gto/basis/dyall-basis/dyall_ae4z.py +11839 -0
  94. pyscf/gto/basis/dyall-basis/dyall_av2z.py +1742 -0
  95. pyscf/gto/basis/dyall-basis/dyall_av3z.py +2318 -0
  96. pyscf/gto/basis/dyall-basis/dyall_av4z.py +2905 -0
  97. pyscf/gto/basis/dyall-basis/dyall_cv2z.py +6558 -0
  98. pyscf/gto/basis/dyall-basis/dyall_cv3z.py +8767 -0
  99. pyscf/gto/basis/dyall-basis/dyall_cv4z.py +11098 -0
  100. pyscf/gto/basis/dyall-basis/dyall_v2z.py +6472 -0
  101. pyscf/gto/basis/dyall-basis/dyall_v3z.py +8539 -0
  102. pyscf/gto/basis/dyall-basis/dyall_v4z.py +10658 -0
  103. pyscf/gto/basis/ma-def2-qzvp.dat +5959 -0
  104. pyscf/gto/basis/ma-def2-qzvpp.dat +6195 -0
  105. pyscf/gto/basis/ma-def2-svp.dat +3504 -0
  106. pyscf/gto/basis/ma-def2-svpp.dat +3504 -0
  107. pyscf/gto/basis/ma-def2-tzvp.dat +4347 -0
  108. pyscf/gto/basis/ma-def2-tzvpp.dat +4549 -0
  109. pyscf/gto/basis/parse_cp2k.py +8 -7
  110. pyscf/gto/basis/parse_cp2k_pp.py +1 -1
  111. pyscf/gto/basis/parse_nwchem.py +26 -11
  112. pyscf/gto/basis/parse_nwchem_ecp.py +2 -1
  113. pyscf/gto/basis/sap_grasp_large.dat +2438 -0
  114. pyscf/gto/basis/sap_grasp_small.dat +1434 -0
  115. pyscf/gto/eval_gto.py +1 -1
  116. pyscf/gto/ft_ao.py +6 -6
  117. pyscf/gto/mole.py +123 -71
  118. pyscf/gto/moleintor.py +1 -1
  119. pyscf/gw/gw_ac.py +2 -2
  120. pyscf/gw/gw_cd.py +2 -2
  121. pyscf/gw/rpa.py +135 -246
  122. pyscf/gw/ugw_ac.py +2 -2
  123. pyscf/gw/urpa.py +80 -131
  124. pyscf/hessian/rhf.py +30 -128
  125. pyscf/hessian/rks.py +1 -6
  126. pyscf/hessian/uhf.py +28 -138
  127. pyscf/hessian/uks.py +1 -8
  128. pyscf/lib/CMakeLists.txt +6 -2
  129. pyscf/lib/ao2mo/nr_ao2mo.c +1 -1
  130. pyscf/lib/ao2mo/nrr_ao2mo.c +1 -1
  131. pyscf/lib/ao2mo/r_ao2mo.c +1 -1
  132. pyscf/lib/cc/ccsd_pack.c +1 -1
  133. pyscf/lib/cc/ccsd_t.c +6 -6
  134. pyscf/lib/cc/uccsd_t.c +4 -4
  135. pyscf/lib/config.h +0 -1
  136. pyscf/lib/config.h.in +0 -1
  137. pyscf/lib/deps/include/XCFun/XCFunExport.h +1 -0
  138. pyscf/lib/deps/include/xc.h +28 -18
  139. pyscf/lib/deps/include/xc_funcs.h +50 -2
  140. pyscf/lib/deps/include/xc_version.h +3 -3
  141. pyscf/lib/deps/lib/libcint.6.dylib +0 -0
  142. pyscf/lib/deps/lib/{libxc.12.dylib → libxc.15.dylib} +0 -0
  143. pyscf/lib/deps/lib/libxcfun.2.dylib +0 -0
  144. pyscf/lib/dft/grid_common.c +1 -1
  145. pyscf/lib/dft/libxc_itrf.c +10 -7
  146. pyscf/lib/dft/nr_numint_sparse.c +3 -3
  147. pyscf/lib/dft/xcfun_itrf.c +1 -1
  148. pyscf/lib/diis.py +2 -2
  149. pyscf/lib/exceptions.py +6 -0
  150. pyscf/lib/gto/fill_grids_int2c.c +11 -9
  151. pyscf/lib/gto/fill_int2e.c +7 -5
  152. pyscf/lib/gto/fill_r_4c.c +1 -1
  153. pyscf/lib/gto/ft_ao.c +1 -1
  154. pyscf/lib/gto/ft_ao.h +1 -1
  155. pyscf/lib/gto/gto.h +2 -2
  156. pyscf/lib/gto/nr_ecp.c +3 -2
  157. pyscf/lib/libagf2.dylib +0 -0
  158. pyscf/lib/libao2mo.dylib +0 -0
  159. pyscf/lib/libcc.dylib +0 -0
  160. pyscf/lib/libcgto.dylib +0 -0
  161. pyscf/lib/libcvhf.dylib +0 -0
  162. pyscf/lib/libdft.dylib +0 -0
  163. pyscf/lib/libfci.dylib +0 -0
  164. pyscf/lib/libmcscf.dylib +0 -0
  165. pyscf/lib/libmp.dylib +0 -0
  166. pyscf/lib/libnp_helper.dylib +0 -0
  167. pyscf/lib/libpbc.dylib +0 -0
  168. pyscf/lib/libri.dylib +0 -0
  169. pyscf/lib/libxc_itrf.dylib +0 -0
  170. pyscf/lib/libxcfun_itrf.dylib +0 -0
  171. pyscf/lib/linalg_helper.py +117 -198
  172. pyscf/lib/logger.py +2 -1
  173. pyscf/lib/mcscf/fci_contract.c +10 -3
  174. pyscf/lib/misc.py +63 -22
  175. pyscf/lib/mp/CMakeLists.txt +22 -0
  176. pyscf/lib/mp/mp2.c +518 -0
  177. pyscf/lib/mp/mp2.h +44 -0
  178. pyscf/lib/np_helper/CMakeLists.txt +1 -1
  179. pyscf/lib/np_helper/imatcopy.c +360 -0
  180. pyscf/lib/np_helper/np_helper.c +94 -0
  181. pyscf/lib/np_helper/np_helper.h +26 -0
  182. pyscf/lib/numpy_helper.py +195 -11
  183. pyscf/lib/pbc/nr_direct.c +2 -7
  184. pyscf/lib/pbc/nr_ecp.c +10 -3
  185. pyscf/lib/pbc/pbc.h +1 -1
  186. pyscf/lib/vhf/fblas.h +3 -0
  187. pyscf/lib/vhf/nr_sgx_direct.c +8 -6
  188. pyscf/lib/vhf/nr_sr_vhf.c +8 -12
  189. pyscf/lib/vhf/optimizer.c +2 -2
  190. pyscf/lib/vhf/rkb_screen.c +139 -0
  191. pyscf/lo/iao.py +1 -1
  192. pyscf/lo/ibo.py +3 -3
  193. pyscf/lo/pipek_jacobi.py +1 -1
  194. pyscf/mcscf/__init__.py +2 -2
  195. pyscf/mcscf/addons.py +3 -3
  196. pyscf/mcscf/apc.py +2 -2
  197. pyscf/mcscf/casci.py +13 -7
  198. pyscf/mcscf/chkfile.py +69 -41
  199. pyscf/mcscf/dmet_cas.py +2 -2
  200. pyscf/mcscf/mc1step.py +72 -44
  201. pyscf/mcscf/newton_casscf.py +5 -5
  202. pyscf/mcscf/ucasci.py +1 -1
  203. pyscf/mcscf/umc1step.py +49 -28
  204. pyscf/md/integrators.py +3 -3
  205. pyscf/mp/__init__.py +1 -0
  206. pyscf/mp/dfmp2.py +498 -59
  207. pyscf/mp/dfmp2_native.py +11 -1
  208. pyscf/mp/dfmp2_slow.py +133 -0
  209. pyscf/mp/dfump2.py +672 -0
  210. pyscf/mp/dfump2_native.py +9 -0
  211. pyscf/mp/dfump2_slow.py +161 -0
  212. pyscf/mp/gmp2.py +6 -47
  213. pyscf/mp/mp2.py +25 -10
  214. pyscf/mp/ump2.py +30 -24
  215. pyscf/pbc/adc/kadc_rhf.py +1 -1
  216. pyscf/pbc/adc/kadc_rhf_amplitudes.py +2 -2
  217. pyscf/pbc/ao2mo/eris.py +1 -1
  218. pyscf/pbc/cc/kccsd_rhf.py +3 -3
  219. pyscf/pbc/cc/kccsd_t_rhf.py +2 -2
  220. pyscf/pbc/ci/kcis_rhf.py +2 -2
  221. pyscf/pbc/df/aft.py +8 -9
  222. pyscf/pbc/df/aft_ao2mo.py +1 -1
  223. pyscf/pbc/df/df.py +85 -12
  224. pyscf/pbc/df/df_jk.py +6 -2
  225. pyscf/pbc/df/fft.py +9 -5
  226. pyscf/pbc/df/fft_ao2mo.py +4 -0
  227. pyscf/pbc/df/fft_jk.py +18 -10
  228. pyscf/pbc/df/ft_ao.py +4 -3
  229. pyscf/pbc/df/gdf_builder.py +5 -4
  230. pyscf/pbc/df/incore.py +2 -2
  231. pyscf/pbc/df/mdf.py +6 -3
  232. pyscf/pbc/df/mdf_jk.py +2 -1
  233. pyscf/pbc/df/outcore.py +10 -10
  234. pyscf/pbc/df/rsdf.py +2 -2
  235. pyscf/pbc/df/rsdf_builder.py +13 -8
  236. pyscf/pbc/df/rsdf_helper.py +6 -6
  237. pyscf/pbc/df/rsdf_jk.py +2 -1
  238. pyscf/pbc/dft/cdft.py +5 -5
  239. pyscf/pbc/dft/gen_grid.py +3 -2
  240. pyscf/pbc/dft/gks.py +14 -3
  241. pyscf/pbc/dft/kgks.py +15 -4
  242. pyscf/pbc/dft/krks.py +28 -10
  243. pyscf/pbc/dft/krks_ksymm.py +21 -9
  244. pyscf/pbc/dft/krkspu.py +1 -30
  245. pyscf/pbc/dft/krkspu_ksymm.py +0 -30
  246. pyscf/pbc/dft/kuks.py +30 -13
  247. pyscf/pbc/dft/kuks_ksymm.py +22 -10
  248. pyscf/pbc/dft/kukspu.py +0 -27
  249. pyscf/pbc/dft/kukspu_ksymm.py +0 -30
  250. pyscf/pbc/dft/multigrid/multigrid.py +36 -33
  251. pyscf/pbc/dft/multigrid/multigrid_pair.py +7 -2
  252. pyscf/pbc/dft/multigrid/pp.py +1 -1
  253. pyscf/pbc/dft/numint.py +56 -31
  254. pyscf/pbc/dft/rks.py +16 -24
  255. pyscf/pbc/dft/uks.py +21 -4
  256. pyscf/pbc/eph/eph_fd.py +1 -1
  257. pyscf/pbc/geomopt/geometric_solver.py +1 -1
  258. pyscf/pbc/gto/_pbcintor.py +1 -0
  259. pyscf/pbc/gto/cell.py +194 -23
  260. pyscf/pbc/gto/ecp.py +12 -12
  261. pyscf/pbc/gto/eval_gto.py +3 -3
  262. pyscf/pbc/gto/neighborlist.py +4 -1
  263. pyscf/pbc/gto/pseudo/pp.py +1 -1
  264. pyscf/pbc/gw/krgw_ac.py +4 -4
  265. pyscf/pbc/gw/krgw_cd.py +4 -4
  266. pyscf/pbc/gw/kugw_ac.py +3 -3
  267. pyscf/pbc/lib/kpts_helper.py +4 -3
  268. pyscf/pbc/lib/linalg_helper.py +1 -1
  269. pyscf/pbc/mp/kmp2.py +1 -1
  270. pyscf/pbc/mpitools/mpi.py +1 -1
  271. pyscf/pbc/scf/_response_functions.py +141 -34
  272. pyscf/pbc/scf/addons.py +15 -11
  273. pyscf/pbc/scf/cphf.py +1 -1
  274. pyscf/pbc/scf/ghf.py +1 -1
  275. pyscf/pbc/scf/hf.py +21 -32
  276. pyscf/pbc/scf/kghf.py +33 -29
  277. pyscf/pbc/scf/khf.py +103 -29
  278. pyscf/pbc/scf/khf_ksymm.py +15 -1
  279. pyscf/pbc/scf/krohf.py +5 -7
  280. pyscf/pbc/scf/kuhf.py +54 -23
  281. pyscf/pbc/scf/kuhf_ksymm.py +1 -1
  282. pyscf/pbc/scf/rsjk.py +14 -10
  283. pyscf/pbc/scf/scfint.py +1 -1
  284. pyscf/pbc/scf/stability.py +27 -15
  285. pyscf/pbc/scf/uhf.py +3 -1
  286. pyscf/pbc/symm/symmetry.py +2 -2
  287. pyscf/pbc/tdscf/krhf.py +238 -154
  288. pyscf/pbc/tdscf/krks.py +1 -45
  289. pyscf/pbc/tdscf/kuhf.py +319 -171
  290. pyscf/pbc/tdscf/kuks.py +0 -56
  291. pyscf/pbc/tdscf/rhf.py +116 -3
  292. pyscf/pbc/tdscf/rks.py +2 -1
  293. pyscf/pbc/tdscf/uhf.py +214 -1
  294. pyscf/pbc/tdscf/uks.py +2 -1
  295. pyscf/pbc/tools/k2gamma.py +20 -6
  296. pyscf/pbc/tools/lattice.py +3 -3
  297. pyscf/pbc/tools/pbc.py +111 -91
  298. pyscf/pbc/tools/pyscf_ase.py +0 -1
  299. pyscf/pbc/tools/pywannier90.py +1 -1
  300. pyscf/qmmm/mm_mole.py +1 -1
  301. pyscf/scf/_response_functions.py +87 -46
  302. pyscf/scf/_vhf.py +15 -10
  303. pyscf/scf/addons.py +29 -15
  304. pyscf/scf/cphf.py +14 -52
  305. pyscf/scf/dhf.py +121 -38
  306. pyscf/scf/dispersion.py +10 -9
  307. pyscf/scf/ghf.py +25 -13
  308. pyscf/scf/ghf_symm.py +2 -2
  309. pyscf/scf/hf.py +262 -30
  310. pyscf/scf/rohf.py +37 -5
  311. pyscf/scf/stability.py +142 -112
  312. pyscf/scf/ucphf.py +21 -16
  313. pyscf/scf/uhf.py +104 -61
  314. pyscf/sgx/sgx.py +1 -1
  315. pyscf/sgx/sgx_jk.py +4 -4
  316. pyscf/solvent/__init__.py +2 -2
  317. pyscf/solvent/_attach_solvent.py +2 -0
  318. pyscf/solvent/_ddcosmo_tdscf_grad.py +1 -1
  319. pyscf/solvent/cosmors.py +366 -0
  320. pyscf/solvent/ddcosmo.py +1 -1
  321. pyscf/solvent/pcm.py +4 -4
  322. pyscf/solvent/pol_embed.py +1 -1
  323. pyscf/solvent/smd.py +5 -3
  324. pyscf/soscf/ciah.py +3 -11
  325. pyscf/soscf/newton_ah.py +5 -2
  326. pyscf/symm/__init__.py +1 -1
  327. pyscf/symm/addons.py +5 -5
  328. pyscf/symm/geom.py +1 -5
  329. pyscf/tdscf/_lr_eig.py +1002 -0
  330. pyscf/tdscf/dhf.py +84 -87
  331. pyscf/tdscf/dks.py +0 -4
  332. pyscf/tdscf/ghf.py +139 -127
  333. pyscf/tdscf/gks.py +27 -25
  334. pyscf/tdscf/rhf.py +194 -147
  335. pyscf/tdscf/rks.py +26 -22
  336. pyscf/tdscf/uhf.py +166 -118
  337. pyscf/tdscf/uks.py +32 -31
  338. pyscf/tools/fcidump.py +3 -0
  339. pyscf/tools/qcschema.py +265 -0
  340. pyscf/x2c/sfx2c1e.py +1 -1
  341. pyscf/x2c/tdscf.py +41 -41
  342. pyscf/x2c/x2c.py +15 -11
  343. {pyscf-2.6.2.dist-info → pyscf-2.8.0.dist-info}/METADATA +39 -36
  344. {pyscf-2.6.2.dist-info → pyscf-2.8.0.dist-info}/NOTICE +14 -1
  345. {pyscf-2.6.2.dist-info → pyscf-2.8.0.dist-info}/RECORD +348 -316
  346. {pyscf-2.6.2.dist-info → pyscf-2.8.0.dist-info}/WHEEL +1 -1
  347. pyscf/dft/gen_libxc_param.py +0 -35
  348. pyscf/dft/gen_xcfun_param.py +0 -209
  349. pyscf/pbc/tdscf/kproxy.py +0 -189
  350. pyscf/pbc/tdscf/kproxy_supercell.py +0 -664
  351. pyscf/pbc/tdscf/krhf_slow.py +0 -300
  352. pyscf/pbc/tdscf/krhf_slow_gamma.py +0 -175
  353. pyscf/pbc/tdscf/krhf_slow_supercell.py +0 -250
  354. pyscf/pbc/tdscf/proxy.py +0 -39
  355. pyscf/pbc/tdscf/rhf_slow.py +0 -35
  356. pyscf/tdscf/common_slow.py +0 -799
  357. pyscf/tdscf/proxy.py +0 -258
  358. pyscf/tdscf/rhf_slow.py +0 -181
  359. {pyscf-2.6.2.dist-info → pyscf-2.8.0.dist-info}/LICENSE +0 -0
  360. {pyscf-2.6.2.dist-info → pyscf-2.8.0.dist-info}/top_level.txt +0 -0
@@ -1,250 +0,0 @@
1
- # Author: Artem Pulkin
2
- """
3
- This and other `_slow` modules implement the time-dependent Hartree-Fock procedure. The primary performance drawback is
4
- that, unlike other 'fast' routines with an implicit construction of the eigenvalue problem, these modules construct
5
- TDHF matrices explicitly via an AO-MO transformation, i.e. with a O(N^5) complexity scaling. As a result, regular
6
- `numpy.linalg.eig` can be used to retrieve TDHF roots in a reliable fashion without any issues related to the Davidson
7
- procedure. Several variants of TDHF are available:
8
-
9
- * `pyscf.tdscf.rhf_slow`: the molecular implementation;
10
- * `pyscf.pbc.tdscf.rhf_slow`: PBC (periodic boundary condition) implementation for RHF objects of `pyscf.pbc.scf`
11
- modules;
12
- * (this module) `pyscf.pbc.tdscf.krhf_slow_supercell`: PBC implementation for KRHF objects of `pyscf.pbc.scf` modules.
13
- Works with an arbitrary number of k-points but has a overhead due to an effective construction of a supercell.
14
- * `pyscf.pbc.tdscf.krhf_slow_gamma`: A Gamma-point calculation resembling the original `pyscf.pbc.tdscf.krhf`
15
- module. Despite its name, it accepts KRHF objects with an arbitrary number of k-points but finds only few TDHF roots
16
- corresponding to collective oscillations without momentum transfer;
17
- * `pyscf.pbc.tdscf.krhf_slow`: PBC implementation for KRHF objects of `pyscf.pbc.scf` modules. Works with
18
- an arbitrary number of k-points and employs k-point conservation (diagonalizes matrix blocks separately).
19
- """
20
-
21
- from pyscf.tdscf.common_slow import TDERIMatrixBlocks, PeriodicMFMixin
22
- from pyscf.tdscf import rhf_slow
23
-
24
- from pyscf.pbc.lib.kpts_helper import loop_kkk
25
- from pyscf.lib import logger
26
-
27
- import numpy
28
- import scipy
29
- from itertools import product
30
-
31
-
32
- # Convention for these modules:
33
- # * PhysERI, PhysERI4, PhysERI8 are 2-electron integral routines computed directly (for debug purposes), with a 4-fold
34
- # symmetry and with an 8-fold symmetry
35
- # * vector_to_amplitudes reshapes and normalizes the solution
36
- # * TDRHF provides a container
37
-
38
-
39
- class PhysERI(PeriodicMFMixin, TDERIMatrixBlocks):
40
-
41
- def __init__(self, model, frozen=None):
42
- """
43
- The TDHF ERI implementation performing a full transformation of integrals to Bloch functions. No symmetries are
44
- employed in this class.
45
-
46
- Args:
47
- model (KRHF): the base model;
48
- frozen (int, Iterable): the number of frozen valence orbitals or the list of frozen orbitals for all
49
- k-points or multiple lists of frozen orbitals for each k-point;
50
- """
51
- TDERIMatrixBlocks.__init__(self)
52
- PeriodicMFMixin.__init__(self, model, frozen=frozen)
53
- # Phys representation
54
- self.__full_eri_k__ = {}
55
- for k in loop_kkk(len(model.kpts)):
56
- k = k + (self.kconserv[k],)
57
- self.__full_eri_k__[k] = self.ao2mo_k(tuple(self.mo_coeff[j] for j in k), k)
58
-
59
- def ao2mo_k(self, coeff, k):
60
- """
61
- Phys ERI in MO basis.
62
- Args:
63
- coeff (Iterable): MO orbitals;
64
- k (Iterable): the 4 k-points MOs correspond to;
65
-
66
- Returns:
67
- ERI in MO basis.
68
- """
69
- coeff = (coeff[0], coeff[2], coeff[1], coeff[3])
70
- k = (k[0], k[2], k[1], k[3])
71
- result = self.model.with_df.ao2mo(coeff, tuple(self.model.kpts[i] for i in k), compact=False)
72
- return result.reshape(
73
- tuple(i.shape[1] for i in coeff)
74
- ).swapaxes(1, 2)
75
-
76
- def __get_mo_energies__(self, k1, k2):
77
- """This routine collects occupied and virtual MO energies."""
78
- return self.mo_energy[k1][:self.nocc[k1]], self.mo_energy[k2][self.nocc[k2]:]
79
-
80
- def tdhf_diag_k(self, k1, k2):
81
- """
82
- Retrieves the diagonal block.
83
- Args:
84
- k1 (int): first k-index (row);
85
- k2 (int): second k-index (column);
86
-
87
- Returns:
88
- The diagonal block.
89
- """
90
- # Everything is already implemented in molecular code
91
- return super().tdhf_diag(k1, k2)
92
-
93
- def tdhf_diag(self, pairs=None):
94
- """
95
- Retrieves the merged diagonal block with specified or all possible k-index pairs.
96
- Args:
97
- pairs (Iterable): pairs of k-points to assmble;
98
-
99
- Returns:
100
- The diagonal block.
101
- """
102
- if pairs is None:
103
- pairs = product(range(len(self.model.kpts)), range(len(self.model.kpts)))
104
- result = []
105
- for k1, k2 in pairs:
106
- result.append(self.tdhf_diag_k(k1, k2))
107
- return scipy.linalg.block_diag(*result)
108
-
109
- def __calc_block__(self, item, k):
110
- if k in self.__full_eri_k__:
111
- slc = tuple(slice(self.nocc[_k]) if i == 'o' else slice(self.nocc[_k], None) for i, _k in zip(item, k))
112
- return self.__full_eri_k__[k][slc]
113
- else:
114
- return numpy.zeros(tuple(
115
- self.nocc[_k] if i == 'o' else self.nmo[_k] - self.nocc[_k]
116
- for i, _k in zip(item, k)
117
- ))
118
-
119
- def eri_mknj_k(self, item, k):
120
- """
121
- Retrieves ERI block using 'mknj' notation.
122
- Args:
123
- item (str): a 4-character string of 'mknj' letters;
124
- k (Iterable): k indexes;
125
-
126
- Returns:
127
- The corresponding block of ERI (phys notation).
128
- """
129
- # Everything is already implemented in molecular code
130
- return super().eri_mknj(item, k)
131
-
132
- def eri_mknj(self, item, pairs_row=None, pairs_column=None):
133
- """
134
- Retrieves the merged ERI block using 'mknj' notation with all k-indexes.
135
- Args:
136
- item (str): a 4-character string of 'mknj' letters;
137
- pairs_row (Iterable): iterator for pairs of row k-points (first index in the output matrix);
138
- pairs_column (Iterable): iterator for pairs of column k-points (second index in the output matrix);
139
-
140
- Returns:
141
- The corresponding block of ERI (phys notation).
142
- """
143
- if pairs_row is None:
144
- pairs_row = product(range(len(self.model.kpts)), range(len(self.model.kpts)))
145
- if pairs_column is None:
146
- pairs_column = product(range(len(self.model.kpts)), range(len(self.model.kpts)))
147
- # Second index has to support re-iterations
148
- pairs_column = tuple(pairs_column)
149
- result = []
150
- for k1, k2 in pairs_row:
151
- result.append([])
152
- for k3, k4 in pairs_column:
153
- result[-1].append(self.eri_mknj_k(item, (k1, k2, k3, k4)))
154
-
155
- r = numpy.block(result)
156
- return r / len(self.model.kpts)
157
-
158
-
159
- class PhysERI4(PhysERI):
160
- symmetries = [
161
- ((0, 1, 2, 3), False),
162
- ((1, 0, 3, 2), False),
163
- ((2, 3, 0, 1), True),
164
- ((3, 2, 1, 0), True),
165
- ]
166
-
167
- def __init__(self, model, frozen=None):
168
- """
169
- The TDHF ERI implementation performing a partial transformation of integrals to Bloch functions. A 4-fold
170
- symmetry of complex-valued wavefunctions is employed in this class.
171
-
172
- Args:
173
- model (KRHF): the base model;
174
- frozen (int, Iterable): the number of frozen valence orbitals or the list of frozen orbitals for all
175
- k-points or multiple lists of frozen orbitals for each k-point;
176
- """
177
- TDERIMatrixBlocks.__init__(self)
178
- PeriodicMFMixin.__init__(self, model, frozen=frozen)
179
-
180
- def __calc_block__(self, item, k):
181
- if self.kconserv[k[:3]] == k[3]:
182
- logger.info(self.model, "Computing {} {} ...".format(''.join(item), repr(k)))
183
- return self.ao2mo_k(tuple(
184
- self.mo_coeff[_k][:, :self.nocc[_k]] if i == "o" else self.mo_coeff[_k][:, self.nocc[_k]:]
185
- for i, _k in zip(item, k)
186
- ), k)
187
- else:
188
- return numpy.zeros(tuple(
189
- self.nocc[_k] if i == 'o' else self.nmo[_k] - self.nocc[_k]
190
- for i, _k in zip(item, k)
191
- ))
192
-
193
-
194
- class PhysERI8(PhysERI4):
195
- symmetries = [
196
- ((0, 1, 2, 3), False),
197
- ((1, 0, 3, 2), False),
198
- ((2, 3, 0, 1), False),
199
- ((3, 2, 1, 0), False),
200
-
201
- ((2, 1, 0, 3), False),
202
- ((3, 0, 1, 2), False),
203
- ((0, 3, 2, 1), False),
204
- ((1, 2, 3, 0), False),
205
- ]
206
-
207
- def __init__(self, model, frozen=None):
208
- """
209
- The TDHF ERI implementation performing a partial transformation of integrals to Bloch functions. An 8-fold
210
- symmetry of real-valued wavefunctions is employed in this class.
211
-
212
- Args:
213
- model (KRHF): the base model;
214
- frozen (int, Iterable): the number of frozen valence orbitals or the list of frozen orbitals for all
215
- k-points or multiple lists of frozen orbitals for each k-point;
216
- """
217
- super().__init__(model, frozen=frozen)
218
-
219
-
220
- def vector_to_amplitudes(vectors, nocc, nmo):
221
- """
222
- Transforms (reshapes) and normalizes vectors into amplitudes.
223
- Args:
224
- vectors (numpy.ndarray): raw eigenvectors to transform;
225
- nocc (tuple): numbers of occupied orbitals;
226
- nmo (tuple): the total numbers of AOs per k-point;
227
-
228
- Returns:
229
- Amplitudes with the following shape: (# of roots, 2 (x or y), # of kpts, # of kpts, # of occupied orbitals,
230
- # of virtual orbitals).
231
- """
232
- if not all(i == nocc[0] for i in nocc):
233
- raise NotImplementedError("Varying occupation numbers are not implemented yet")
234
- nk = len(nocc)
235
- nocc = nocc[0]
236
- if not all(i == nmo[0] for i in nmo):
237
- raise NotImplementedError("Varying AO spaces are not implemented yet")
238
- nmo = nmo[0]
239
- vectors = numpy.asanyarray(vectors)
240
- vectors = vectors.reshape(2, nk, nk, nocc, nmo-nocc, vectors.shape[1])
241
- norm = (abs(vectors) ** 2).sum(axis=(1, 2, 3, 4))
242
- norm = 2 * (norm[0] - norm[1])
243
- vectors /= norm ** .5
244
- return vectors.transpose(5, 0, 1, 2, 3, 4)
245
-
246
-
247
- class TDRHF(rhf_slow.TDRHF):
248
- eri4 = PhysERI4
249
- eri8 = PhysERI8
250
- v2a = staticmethod(vector_to_amplitudes)
pyscf/pbc/tdscf/proxy.py DELETED
@@ -1,39 +0,0 @@
1
- # Author: Artem Pulkin
2
- """
3
- This and other `proxy` modules implement the time-dependent mean-field procedure using the existing pyscf
4
- implementations as a black box. The main purpose of these modules is to overcome the existing limitations in pyscf
5
- (i.e. real-only orbitals, davidson diagonalizer, incomplete Bloch space, etc). The primary performance drawback is that,
6
- unlike the original pyscf routines with an implicit construction of the eigenvalue problem, these modules construct TD
7
- matrices explicitly by proxying to pyscf density response routines with a O(N^4) complexity scaling. As a result,
8
- regular `numpy.linalg.eig` can be used to retrieve TD roots. Several variants of proxy-TD are available:
9
-
10
- * `pyscf.tdscf.proxy`: the molecular implementation;
11
- * (this module) `pyscf.pbc.tdscf.proxy`: PBC (periodic boundary condition) Gamma-point-only implementation;
12
- * `pyscf.pbc.tdscf.kproxy_supercell`: PBC implementation constructing supercells. Works with an arbitrary number of
13
- k-points but has an overhead due to ignoring the momentum conservation law. In addition, works only with
14
- time reversal invariant (TRI) models: i.e. the k-point grid has to be aligned and contain at least one TRI momentum.
15
- * `pyscf.pbc.tdscf.kproxy`: same as the above but respect the momentum conservation and, thus, diagonlizes smaller
16
- matrices (the performance gain is the total number of k-points in the model).
17
- """
18
-
19
- # Convention for these modules:
20
- # * PhysERI is the proxying class constructing time-dependent matrices
21
- # * vector_to_amplitudes reshapes and normalizes the solution
22
- # * TDProxy provides a container
23
-
24
- from pyscf.tdscf import proxy as mol_proxy, rhf_slow, common_slow
25
- from pyscf.pbc.tdscf import KTDDFT, KTDHF
26
-
27
-
28
- class PhysERI(mol_proxy.PhysERI):
29
- proxy_choices = {
30
- "hf": KTDHF,
31
- "dft": KTDDFT,
32
- }
33
-
34
-
35
- vector_to_amplitudes = rhf_slow.vector_to_amplitudes
36
-
37
-
38
- class TDProxy(mol_proxy.TDProxy):
39
- proxy_eri = PhysERI
@@ -1,35 +0,0 @@
1
- # Author: Artem Pulkin
2
- """
3
- This and other `_slow` modules implement the time-dependent Hartree-Fock procedure. The primary performance drawback is
4
- that, unlike other 'fast' routines with an implicit construction of the eigenvalue problem, these modules construct
5
- TDHF matrices explicitly via an AO-MO transformation, i.e. with a O(N^5) complexity scaling. As a result, regular
6
- `numpy.linalg.eig` can be used to retrieve TDHF roots in a reliable fashion without any issues related to the Davidson
7
- procedure. Several variants of TDHF are available:
8
-
9
- * `pyscf.tdscf.rhf_slow`: the molecular implementation;
10
- * (this module) `pyscf.pbc.tdscf.rhf_slow`: PBC (periodic boundary condition) implementation for RHF objects of
11
- `pyscf.pbc.scf` modules;
12
- * `pyscf.pbc.tdscf.krhf_slow_supercell`: PBC implementation for KRHF objects of `pyscf.pbc.scf` modules. Works with
13
- an arbitrary number of k-points but has a overhead due to an effective construction of a supercell.
14
- * `pyscf.pbc.tdscf.krhf_slow_gamma`: A Gamma-point calculation resembling the original `pyscf.pbc.tdscf.krhf`
15
- module. Despite its name, it accepts KRHF objects with an arbitrary number of k-points but finds only few TDHF roots
16
- corresponding to collective oscillations without momentum transfer;
17
- * `pyscf.pbc.tdscf.krhf_slow`: PBC implementation for KRHF objects of `pyscf.pbc.scf` modules. Works with
18
- an arbitrary number of k-points and employs k-point conservation (diagonalizes matrix blocks separately).
19
- """
20
-
21
- # Convention for these modules:
22
- # * PhysERI, PhysERI4, PhysERI8 are 2-electron integral routines computed directly (for debug purposes), with a 4-fold
23
- # symmetry and with an 8-fold symmetry
24
- # * vector_to_amplitudes reshapes and normalizes the solution
25
- # * TDRHF provides a container
26
-
27
- # This module is simply an alias of the molecular code
28
- from pyscf.tdscf.rhf_slow import PhysERI, PhysERI4, PhysERI8, vector_to_amplitudes, TDRHF
29
-
30
- PhysERI = PhysERI
31
- PhysERI4 = PhysERI4
32
- PhysERI8 = PhysERI8
33
-
34
- vector_to_amplitudes = vector_to_amplitudes
35
- TDRHF = TDRHF