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
pyscf/hessian/uhf.py CHANGED
@@ -53,29 +53,15 @@ def hess_elec(hessobj, mo_energy=None, mo_coeff=None, mo_occ=None,
53
53
  max_memory, log)
54
54
 
55
55
  if h1ao is None:
56
- h1ao = hessobj.make_h1(mo_coeff, mo_occ, hessobj.chkfile, atmlst, log)
56
+ h1ao = hessobj.make_h1(mo_coeff, mo_occ, None, atmlst, log)
57
57
  t1 = log.timer_debug1('making H1', *time0)
58
58
  if mo1 is None or mo_e1 is None:
59
59
  mo1, mo_e1 = hessobj.solve_mo1(mo_energy, mo_coeff, mo_occ, h1ao,
60
60
  None, atmlst, max_memory, log)
61
61
  t1 = log.timer_debug1('solving MO1', *t1)
62
62
 
63
- if isinstance(h1ao, str):
64
- h1ao = lib.chkfile.load(h1ao, 'scf_f1ao')
65
- h1aoa = h1ao['0']
66
- h1aob = h1ao['1']
67
- h1aoa = {int(k): h1aoa[k] for k in h1aoa}
68
- h1aob = {int(k): h1aob[k] for k in h1aob}
69
- else:
70
- h1aoa, h1aob = h1ao
71
- if isinstance(mo1, str):
72
- mo1 = lib.chkfile.load(mo1, 'scf_mo1')
73
- mo1a = mo1['0']
74
- mo1b = mo1['1']
75
- mo1a = {int(k): mo1a[k] for k in mo1a}
76
- mo1b = {int(k): mo1b[k] for k in mo1b}
77
- else:
78
- mo1a, mo1b = mo1
63
+ h1aoa, h1aob = h1ao
64
+ mo1a, mo1b = mo1
79
65
  mo_e1a, mo_e1b = mo_e1
80
66
 
81
67
  nao, nmo = mo_coeff[0].shape
@@ -159,9 +145,12 @@ def _partial_hess_ejk(hessobj, mo_energy=None, mo_coeff=None, mo_occ=None,
159
145
  ip1ip2_opt = _make_vhfopt(mol, dm0, 'ip1ip2', 'int2e_ip1ip2')
160
146
  ipvip1_opt = _make_vhfopt(mol, dm0, 'ipvip1', 'int2e_ipvip1ipvip2')
161
147
  aoslices = mol.aoslice_by_atom()
162
- e1 = numpy.zeros((mol.natm,mol.natm,3,3)) # (A,B,dR_A,dR_B)
163
- ej = numpy.zeros((mol.natm,mol.natm,3,3))
164
- ek = numpy.zeros((mol.natm,mol.natm,3,3))
148
+
149
+ natm = len(atmlst)
150
+ e1 = numpy.zeros((natm, natm, 3, 3)) # (A,B,dR_A,dR_B)
151
+ ej = numpy.zeros((natm, natm, 3, 3))
152
+ ek = numpy.zeros((natm, natm, 3, 3))
153
+
165
154
  for i0, ia in enumerate(atmlst):
166
155
  shl0, shl1, p0, p1 = aoslices[ia]
167
156
  shls_slice = (shl0, shl1) + (0, mol.nbas)*3
@@ -242,21 +231,11 @@ def make_h1(hessobj, mo_coeff, mo_occ, chkfile=None, atmlst=None, verbose=None):
242
231
  vhfa[:,p0:p1] += vj2 - vk2a
243
232
  vhfb[:,p0:p1] += vj2 - vk2b
244
233
  h1 = hcore_deriv(ia)
245
- h1a = h1 + vhfa + vhfa.transpose(0,2,1)
246
- h1b = h1 + vhfb + vhfb.transpose(0,2,1)
247
-
248
- if chkfile is None:
249
- h1aoa[ia] = h1a
250
- h1aob[ia] = h1b
251
- else:
252
- lib.chkfile.save(chkfile, 'scf_f1ao/0/%d' % ia, h1a)
253
- lib.chkfile.save(chkfile, 'scf_f1ao/1/%d' % ia, h1b)
254
- if chkfile is None:
255
- return (h1aoa,h1aob)
256
- else:
257
- return chkfile
258
-
259
- def solve_mo1(mf, mo_energy, mo_coeff, mo_occ, h1ao_or_chkfile,
234
+ h1aoa[ia] = h1 + vhfa + vhfa.transpose(0,2,1)
235
+ h1aob[ia] = h1 + vhfb + vhfb.transpose(0,2,1)
236
+ return (h1aoa,h1aob)
237
+
238
+ def solve_mo1(mf, mo_energy, mo_coeff, mo_occ, h1ao,
260
239
  fx=None, atmlst=None, max_memory=4000, verbose=None,
261
240
  max_cycle=50, level_shift=0):
262
241
  mol = mf.mol
@@ -271,6 +250,7 @@ def solve_mo1(mf, mo_energy, mo_coeff, mo_occ, h1ao_or_chkfile,
271
250
  if fx is None:
272
251
  fx = gen_vind(mf, mo_coeff, mo_occ)
273
252
  s1a = -mol.intor('int1e_ipovlp', comp=3)
253
+ h1aoa, h1aob = h1ao
274
254
 
275
255
  def _ao2mo(mat, mo_coeff, mocc):
276
256
  return numpy.asarray([reduce(numpy.dot, (mo_coeff.T, x, mocc)) for x in mat])
@@ -296,14 +276,8 @@ def solve_mo1(mf, mo_energy, mo_coeff, mo_occ, h1ao_or_chkfile,
296
276
  s1ao[:,:,p0:p1] += s1a[:,p0:p1].transpose(0,2,1)
297
277
  s1voa.append(_ao2mo(s1ao, mo_coeff[0], mocca))
298
278
  s1vob.append(_ao2mo(s1ao, mo_coeff[1], moccb))
299
- if isinstance(h1ao_or_chkfile, str):
300
- h1aoa = lib.chkfile.load(h1ao_or_chkfile, 'scf_f1ao/0/%d'%ia)
301
- h1aob = lib.chkfile.load(h1ao_or_chkfile, 'scf_f1ao/1/%d'%ia)
302
- else:
303
- h1aoa = h1ao_or_chkfile[0][ia]
304
- h1aob = h1ao_or_chkfile[1][ia]
305
- h1voa.append(_ao2mo(h1aoa, mo_coeff[0], mocca))
306
- h1vob.append(_ao2mo(h1aob, mo_coeff[1], moccb))
279
+ h1voa.append(_ao2mo(h1aoa[ia], mo_coeff[0], mocca))
280
+ h1vob.append(_ao2mo(h1aob[ia], mo_coeff[1], moccb))
307
281
 
308
282
  h1vo = (numpy.vstack(h1voa), numpy.vstack(h1vob))
309
283
  s1vo = (numpy.vstack(s1voa), numpy.vstack(s1vob))
@@ -317,20 +291,13 @@ def solve_mo1(mf, mo_energy, mo_coeff, mo_occ, h1ao_or_chkfile,
317
291
 
318
292
  for k in range(ia1-ia0):
319
293
  ia = atmlst[k+ia0]
320
- if isinstance(h1ao_or_chkfile, str):
321
- lib.chkfile.save(h1ao_or_chkfile, 'scf_mo1/0/%d'%ia, mo1a[k])
322
- lib.chkfile.save(h1ao_or_chkfile, 'scf_mo1/1/%d'%ia, mo1b[k])
323
- else:
324
- mo1sa[ia] = mo1a[k]
325
- mo1sb[ia] = mo1b[k]
294
+ mo1sa[ia] = mo1a[k]
295
+ mo1sb[ia] = mo1b[k]
326
296
  e1sa[ia] = e1a[k].reshape(3,nocca,nocca)
327
297
  e1sb[ia] = e1b[k].reshape(3,noccb,noccb)
328
298
  mo1 = e1 = mo1a = mo1b = e1a = e1b = None
329
299
 
330
- if isinstance(h1ao_or_chkfile, str):
331
- return h1ao_or_chkfile, (e1sa,e1sb)
332
- else:
333
- return (mo1sa,mo1sb), (e1sa,e1sb)
300
+ return (mo1sa,mo1sb), (e1sa,e1sb)
334
301
 
335
302
  def gen_vind(mf, mo_coeff, mo_occ):
336
303
  nao, nmoa = mo_coeff[0].shape
@@ -385,8 +352,8 @@ def gen_hop(hobj, mo_energy=None, mo_coeff=None, mo_occ=None, verbose=None):
385
352
  max_memory, log)
386
353
  de2 += hobj.hess_nuc()
387
354
 
388
- # Compute H1 integrals and store in hobj.chkfile
389
- hobj.make_h1(mo_coeff, mo_occ, hobj.chkfile, atmlst, log)
355
+ h1ao_cache = hobj.make_h1(mo_coeff, mo_occ, None, atmlst, log)
356
+ h1aoa_cache, h1aob_cache = h1ao_cache
390
357
 
391
358
  aoslices = mol.aoslice_by_atom()
392
359
  s1a = -mol.intor('int1e_ipovlp', comp=3)
@@ -400,10 +367,8 @@ def gen_hop(hobj, mo_energy=None, mo_coeff=None, mo_occ=None, verbose=None):
400
367
  s1ao = 0
401
368
  for ia in range(natm):
402
369
  shl0, shl1, p0, p1 = aoslices[ia]
403
- h1ao_i = lib.chkfile.load(hobj.chkfile, 'scf_f1ao/0/%d' % ia)
404
- h1aoa += numpy.einsum('x,xij->ij', x[ia], h1ao_i)
405
- h1ao_i = lib.chkfile.load(hobj.chkfile, 'scf_f1ao/1/%d' % ia)
406
- h1aob += numpy.einsum('x,xij->ij', x[ia], h1ao_i)
370
+ h1aoa += numpy.einsum('x,xij->ij', x[ia], h1aoa_cache[ia])
371
+ h1aob += numpy.einsum('x,xij->ij', x[ia], h1aob_cache[ia])
407
372
  s1ao_i = numpy.zeros((3,nao,nao))
408
373
  s1ao_i[:,p0:p1] += s1a[:,p0:p1]
409
374
  s1ao_i[:,:,p0:p1] += s1a[:,p0:p1].transpose(0,2,1)
@@ -429,10 +394,8 @@ def gen_hop(hobj, mo_energy=None, mo_coeff=None, mo_occ=None, verbose=None):
429
394
 
430
395
  for ja in range(natm):
431
396
  q0, q1 = aoslices[ja][2:]
432
- h1aoa = lib.chkfile.load(hobj.chkfile, 'scf_f1ao/0/%d' % ja)
433
- h1aob = lib.chkfile.load(hobj.chkfile, 'scf_f1ao/1/%d' % ja)
434
- hx[ja] += numpy.einsum('xpq,pq->x', h1aoa, dm1a) * 2
435
- hx[ja] += numpy.einsum('xpq,pq->x', h1aob, dm1b) * 2
397
+ hx[ja] += numpy.einsum('xpq,pq->x', h1aoa_cache[ja], dm1a) * 2
398
+ hx[ja] += numpy.einsum('xpq,pq->x', h1aob_cache[ja], dm1b) * 2
436
399
  hx[ja] -= numpy.einsum('xpq,pq->x', s1a[:,q0:q1], dme1[q0:q1])
437
400
  hx[ja] -= numpy.einsum('xpq,qp->x', s1a[:,q0:q1], dme1[:,q0:q1])
438
401
  return hx.ravel()
@@ -449,84 +412,11 @@ class Hessian(rhf_hess.HessianBase):
449
412
  make_h1 = make_h1
450
413
  gen_hop = gen_hop
451
414
 
452
- def solve_mo1(self, mo_energy, mo_coeff, mo_occ, h1ao_or_chkfile,
415
+ def solve_mo1(self, mo_energy, mo_coeff, mo_occ, h1ao,
453
416
  fx=None, atmlst=None, max_memory=4000, verbose=None):
454
- return solve_mo1(self.base, mo_energy, mo_coeff, mo_occ, h1ao_or_chkfile,
417
+ return solve_mo1(self.base, mo_energy, mo_coeff, mo_occ, h1ao,
455
418
  fx, atmlst, max_memory, verbose,
456
419
  max_cycle=self.max_cycle, level_shift=self.level_shift)
457
420
 
458
421
  from pyscf import scf
459
422
  scf.uhf.UHF.Hessian = lib.class_as_method(Hessian)
460
-
461
- if __name__ == '__main__':
462
- from pyscf import gto
463
- from pyscf import scf
464
-
465
- mol = gto.Mole()
466
- mol.verbose = 0
467
- mol.output = None
468
- mol.atom = [
469
- [1 , (1. , 0. , 0.000)],
470
- [1 , (0. , 1. , 0.000)],
471
- [1 , (0. , -1.517 , 1.177)],
472
- [1 , (0. , 1.517 , 1.177)] ]
473
- mol.basis = '631g'
474
- mol.unit = 'B'
475
- mol.build()
476
- mf = scf.UHF(mol)
477
- mf.conv_tol = 1e-14
478
- mf.scf()
479
- n3 = mol.natm * 3
480
- hobj = mf.Hessian()
481
- e2 = hobj.kernel().transpose(0,2,1,3).reshape(n3,n3)
482
- print(lib.fp(e2) - -0.50693144355876429)
483
-
484
- mol.spin = 2
485
- mf = scf.UHF(mol)
486
- mf.conv_tol = 1e-14
487
- mf.scf()
488
- n3 = mol.natm * 3
489
- hobj = Hessian(mf)
490
- e2 = hobj.kernel().transpose(0,2,1,3).reshape(n3,n3)
491
-
492
- def grad_full(ia, inc):
493
- coord = mol.atom_coord(ia).copy()
494
- ptr = mol._atm[ia,gto.PTR_COORD]
495
- de = []
496
- for i in range(3):
497
- mol._env[ptr+i] = coord[i] + inc
498
- mf = scf.UHF(mol).run(conv_tol=1e-14)
499
- e1a = mf.nuc_grad_method().kernel()
500
- mol._env[ptr+i] = coord[i] - inc
501
- mf = scf.UHF(mol).run(conv_tol=1e-14)
502
- e1b = mf.nuc_grad_method().kernel()
503
- mol._env[ptr+i] = coord[i]
504
- de.append((e1a-e1b)/(2*inc))
505
- return de
506
- e2ref = [grad_full(ia, .5e-3) for ia in range(mol.natm)]
507
- e2ref = numpy.asarray(e2ref).reshape(n3,n3)
508
- print(numpy.linalg.norm(e2-e2ref))
509
- print(abs(e2-e2ref).max())
510
- print(numpy.allclose(e2,e2ref,atol=1e-4))
511
-
512
- # \partial^2 E / \partial R \partial R'
513
- e2 = hobj.partial_hess_elec(mf.mo_energy, mf.mo_coeff, mf.mo_occ)
514
- e2 += hobj.hess_nuc(mol)
515
- e2 = e2.transpose(0,2,1,3).reshape(n3,n3)
516
- def grad_partial_R(ia, inc):
517
- coord = mol.atom_coord(ia).copy()
518
- ptr = mol._atm[ia,gto.PTR_COORD]
519
- de = []
520
- for i in range(3):
521
- mol._env[ptr+i] = coord[i] + inc
522
- e1a = mf.nuc_grad_method().kernel()
523
- mol._env[ptr+i] = coord[i] - inc
524
- e1b = mf.nuc_grad_method().kernel()
525
- mol._env[ptr+i] = coord[i]
526
- de.append((e1a-e1b)/(2*inc))
527
- return de
528
- e2ref = [grad_partial_R(ia, .5e-4) for ia in range(mol.natm)]
529
- e2ref = numpy.asarray(e2ref).reshape(n3,n3)
530
- print(numpy.linalg.norm(e2-e2ref))
531
- print(abs(e2-e2ref).max())
532
- print(numpy.allclose(e2,e2ref,atol=1e-8))
pyscf/hessian/uks.py CHANGED
@@ -192,14 +192,7 @@ def make_h1(hessobj, mo_coeff, mo_occ, chkfile=None, atmlst=None, verbose=None):
192
192
  h1aoa[ia] += h1 + veffa + veffa.transpose(0,2,1)
193
193
  h1aob[ia] += h1 + veffb + veffb.transpose(0,2,1)
194
194
 
195
- if chkfile is None:
196
- return h1aoa, h1aob
197
- else:
198
- for ia in atmlst:
199
- lib.chkfile.save(chkfile, 'scf_f1ao/0/%d'%ia, h1aoa[ia])
200
- lib.chkfile.save(chkfile, 'scf_f1ao/1/%d'%ia, h1aob[ia])
201
- return chkfile
202
-
195
+ return h1aoa, h1aob
203
196
 
204
197
  XX, XY, XZ = 4, 5, 6
205
198
  YX, YY, YZ = 5, 7, 8
pyscf/lib/CMakeLists.txt CHANGED
@@ -15,6 +15,8 @@
15
15
  cmake_minimum_required (VERSION 3.5)
16
16
  project (pyscf)
17
17
 
18
+ include(CheckSymbolExists)
19
+
18
20
  if (NOT CMAKE_BUILD_TYPE)
19
21
  set(CMAKE_BUILD_TYPE RELWITHDEBINFO)
20
22
  endif()
@@ -69,8 +71,9 @@ endif()
69
71
  if (NOT BLAS_LIBRARIES)
70
72
  #enable_language(Fortran)
71
73
  find_package(BLAS)
72
- check_function_exists(ffsll HAVE_FFS)
73
74
  endif()
75
+ check_symbol_exists(ffsll "strings.h" HAVE_FFS)
76
+ #check_function_exists(ffsll HAVE_FFS)
74
77
 
75
78
  if (NOT BLAS_LIBRARIES)
76
79
  message(FATAL_ERROR "A required library with BLAS API not found.")
@@ -145,6 +148,7 @@ add_subdirectory(vhf)
145
148
  add_subdirectory(ao2mo)
146
149
  add_subdirectory(mcscf)
147
150
  add_subdirectory(cc)
151
+ add_subdirectory(mp)
148
152
  add_subdirectory(ri)
149
153
  #add_subdirectory(localizer)
150
154
  add_subdirectory(pbc)
@@ -219,7 +223,7 @@ if(ENABLE_LIBXC AND BUILD_LIBXC)
219
223
  ExternalProject_Add(libxc
220
224
  #GIT_REPOSITORY https://gitlab.com/libxc/libxc.git
221
225
  #GIT_TAG master
222
- URL https://gitlab.com/libxc/libxc/-/archive/6.1.0/libxc-6.1.0.tar.gz
226
+ URL https://gitlab.com/libxc/libxc/-/archive/7.0.0/libxc-7.0.0.tar.gz
223
227
  PREFIX ${PROJECT_BINARY_DIR}/deps
224
228
  INSTALL_DIR ${PROJECT_SOURCE_DIR}/deps
225
229
  CMAKE_ARGS -DCMAKE_BUILD_TYPE=RELEASE -DBUILD_SHARED_LIBS=1
@@ -1225,7 +1225,7 @@ void AO2MOnr_e1_drv(int (*intor)(), void (*fill)(), void (*ftrans)(), int (*fmmm
1225
1225
  int nao = ao_loc[nbas];
1226
1226
  double *eri_ao = malloc(sizeof(double) * nao*nao*nkl*ncomp);
1227
1227
  if (eri_ao == NULL) {
1228
- fprintf(stderr, "malloc(%zu) falied in AO2MOnr_e1_drv\n",
1228
+ fprintf(stderr, "malloc(%zu) failed in AO2MOnr_e1_drv\n",
1229
1229
  sizeof(double) * nao*nao*nkl*ncomp);
1230
1230
  exit(1);
1231
1231
  }
@@ -239,7 +239,7 @@ void AO2MOnrr_e1_drv(int (*intor)(), void (*fill)(),
239
239
 
240
240
  double *eri_ao = malloc(sizeof(double)* nao*nao*nkl*ncomp);
241
241
  if (eri_ao == NULL) {
242
- fprintf(stderr, "malloc(%zu) falied in AO2MOnrr_e1_drv\n",
242
+ fprintf(stderr, "malloc(%zu) failed in AO2MOnrr_e1_drv\n",
243
243
  sizeof(double) * nao*nao*nkl*ncomp);
244
244
  exit(1);
245
245
  }
pyscf/lib/ao2mo/r_ao2mo.c CHANGED
@@ -835,7 +835,7 @@ void AO2MOr_e1_drv(int (*intor)(), void (*fill)(),
835
835
  double complex *eri_ao = malloc(sizeof(double complex)
836
836
  * nao*nao*nkl*ncomp);
837
837
  if (eri_ao == NULL) {
838
- fprintf(stderr, "malloc(%zu) falied in AO2MOr_e1_drv\n",
838
+ fprintf(stderr, "malloc(%zu) failed in AO2MOr_e1_drv\n",
839
839
  sizeof(double complex) * nao*nao*nkl*ncomp);
840
840
  exit(1);
841
841
  }
pyscf/lib/cc/ccsd_pack.c CHANGED
@@ -106,7 +106,7 @@ void CCmake_021(double *out, double *v1, double *v2, int count, int m,
106
106
  /*
107
107
  * if matrix B is symmetric for the contraction A_ij B_ij,
108
108
  * Tr(AB) ~ A_ii B_ii + (A_ij + A_ji) B_ij where i > j
109
- * This function extract the A_ii and the lower triangluar part of A_ij + A_ji
109
+ * This function extract the A_ii and the lower triangular part of A_ij + A_ji
110
110
  */
111
111
  void CCprecontract(double *out, double *in, int count, int m, double diagfac)
112
112
  {
pyscf/lib/cc/ccsd_t.c CHANGED
@@ -400,7 +400,7 @@ void CCsd_t_contract(double *e_tot,
400
400
  size_t k;
401
401
  double *cache1 = malloc(sizeof(double) * (nocc*nocc*nocc*3+2));
402
402
  if (cache1 == NULL) {
403
- fprintf(stderr, "malloc(%zu) falied in CCsd_t_contract\n",
403
+ fprintf(stderr, "malloc(%zu) failed in CCsd_t_contract\n",
404
404
  sizeof(double) * nocc*nocc*nocc*3);
405
405
  exit(1);
406
406
  }
@@ -455,7 +455,7 @@ void QCIsd_t_contract(double *e_tot,
455
455
  size_t k;
456
456
  double *cache1 = malloc(sizeof(double) * (nocc*nocc*nocc*3+2));
457
457
  if (cache1 == NULL) {
458
- fprintf(stderr, "malloc(%zu) falied in QCIsd_t_contract\n",
458
+ fprintf(stderr, "malloc(%zu) failed in QCIsd_t_contract\n",
459
459
  sizeof(double) * nocc*nocc*nocc*3);
460
460
  exit(1);
461
461
  }
@@ -636,7 +636,7 @@ void CCsd_t_zcontract(double complex *e_tot,
636
636
  size_t k;
637
637
  double complex *cache1 = malloc(sizeof(double complex) * (nocc*nocc*nocc*3+2));
638
638
  if (cache1 == NULL) {
639
- fprintf(stderr, "malloc(%zu) falied in CCsd_t_zcontract\n",
639
+ fprintf(stderr, "malloc(%zu) failed in CCsd_t_zcontract\n",
640
640
  sizeof(double complex) * nocc*nocc*nocc*3);
641
641
  exit(1);
642
642
  }
@@ -694,7 +694,7 @@ void QCIsd_t_zcontract(double complex *e_tot,
694
694
  size_t k;
695
695
  double complex *cache1 = malloc(sizeof(double complex) * (nocc*nocc*nocc*3+2));
696
696
  if (cache1 == NULL) {
697
- fprintf(stderr, "malloc(%zu) falied in QCIsd_t_zcontract\n",
697
+ fprintf(stderr, "malloc(%zu) failed in QCIsd_t_zcontract\n",
698
698
  sizeof(double complex) * nocc*nocc*nocc*3);
699
699
  exit(1);
700
700
  }
@@ -880,7 +880,7 @@ void MPICCsd_t_contract(double *e_tot, double *mo_energy, double *t1T,
880
880
  size_t k;
881
881
  double *cache1 = malloc(sizeof(double) * (nocc*nocc*nocc*3+2));
882
882
  if (cache1 == NULL) {
883
- fprintf(stderr, "malloc(%zu) falied in MPICCsd_t_contract\n",
883
+ fprintf(stderr, "malloc(%zu) failed in MPICCsd_t_contract\n",
884
884
  sizeof(double) * nocc*nocc*nocc*3);
885
885
  exit(1);
886
886
  }
@@ -1113,7 +1113,7 @@ void CCsd_zcontract_t3T(double complex *t3Tw, double complex *t3Tv, double *mo_e
1113
1113
  size_t k;
1114
1114
  complex double *cache1 = malloc(sizeof(double complex) * (nocc*nocc*nocc*3+2));
1115
1115
  if (cache1 == NULL) {
1116
- fprintf(stderr, "malloc(%zu) falied in CCsd_zcontract_t3T\n",
1116
+ fprintf(stderr, "malloc(%zu) failed in CCsd_zcontract_t3T\n",
1117
1117
  sizeof(double complex) * nocc*nocc*nocc*3);
1118
1118
  exit(1);
1119
1119
  }
pyscf/lib/cc/uccsd_t.c CHANGED
@@ -308,7 +308,7 @@ void CCuccsd_t_aaa(double complex *e_tot,
308
308
  size_t k;
309
309
  double *cache1 = malloc(sizeof(double) * (nocc*nocc*nocc*3+2));
310
310
  if (cache1 == NULL) {
311
- fprintf(stderr, "malloc(%zu) falied in CCuccsd_t_aaa\n",
311
+ fprintf(stderr, "malloc(%zu) failed in CCuccsd_t_aaa\n",
312
312
  sizeof(double) * nocc*nocc*nocc*3);
313
313
  exit(1);
314
314
  }
@@ -557,7 +557,7 @@ void CCuccsd_t_baa(double complex *e_tot,
557
557
  double *cache1 = malloc(sizeof(double) * (noccb*nocca*nocca*5+1 +
558
558
  nocca*2+noccb*2));
559
559
  if (cache1 == NULL) {
560
- fprintf(stderr, "malloc(%zu) falied in CCuccsd_t_baa\n",
560
+ fprintf(stderr, "malloc(%zu) failed in CCuccsd_t_baa\n",
561
561
  sizeof(double) * noccb*nocca*nocca*5);
562
562
  exit(1);
563
563
  }
@@ -715,7 +715,7 @@ void CCuccsd_t_zaaa(double complex *e_tot,
715
715
  double complex *cache1 = malloc(sizeof(double complex) *
716
716
  (nocc*nocc*nocc*3+2));
717
717
  if (cache1 == NULL) {
718
- fprintf(stderr, "malloc(%zu) falied in CCuccsd_t_zaaa\n",
718
+ fprintf(stderr, "malloc(%zu) failed in CCuccsd_t_zaaa\n",
719
719
  sizeof(double complex) * nocc*nocc*nocc*3);
720
720
  exit(1);
721
721
  }
@@ -924,7 +924,7 @@ void CCuccsd_t_zbaa(double complex *e_tot,
924
924
  (noccb*nocca*nocca*5+1 +
925
925
  nocca*2+noccb*2));
926
926
  if (cache1 == NULL) {
927
- fprintf(stderr, "malloc(%zu) falied in CCuccsd_t_zbaa\n",
927
+ fprintf(stderr, "malloc(%zu) failed in CCuccsd_t_zbaa\n",
928
928
  sizeof(double complex) * noccb*nocca*nocca*5);
929
929
  exit(1);
930
930
  }
pyscf/lib/config.h CHANGED
@@ -5,5 +5,4 @@
5
5
  #define omp_get_num_threads() 1
6
6
  #endif
7
7
 
8
- #define HAVE_FFS
9
8
  #define XCFUN_MAX_DERIV_ORDER 3
pyscf/lib/config.h.in CHANGED
@@ -5,5 +5,4 @@
5
5
  #define omp_get_num_threads() 1
6
6
  #endif
7
7
 
8
- #cmakedefine HAVE_FFS
9
8
  #define XCFUN_MAX_DERIV_ORDER @XCFUN_MAX_ORDER@
@@ -33,6 +33,7 @@
33
33
  # define XCFUN_DEPRECATED_NO_EXPORT XCFUN_NO_EXPORT XCFUN_DEPRECATED
34
34
  #endif
35
35
 
36
+ /* NOLINTNEXTLINE(readability-avoid-unconditional-preprocessor-if) */
36
37
  #if 1 /* DEFINE_NO_DEPRECATED */
37
38
  # ifndef XCFUN_NO_DEPRECATED
38
39
  # define XCFUN_NO_DEPRECATED
@@ -14,16 +14,16 @@ extern "C" {
14
14
  #endif
15
15
 
16
16
  /* Get the literature reference for libxc */
17
- const char *xc_reference();
17
+ const char *xc_reference(void);
18
18
  /* Get the doi for the literature reference for libxc */
19
- const char *xc_reference_doi();
19
+ const char *xc_reference_doi(void);
20
20
  /* Get the key for the literature reference for libxc */
21
- const char *xc_reference_key();
21
+ const char *xc_reference_key(void);
22
22
 
23
23
  /* Get the major, minor, and micro version of libxc */
24
24
  void xc_version(int *major, int *minor, int *micro);
25
25
  /* Get the version of libxc as a string */
26
- const char *xc_version_string();
26
+ const char *xc_version_string(void);
27
27
 
28
28
  #include "xc_version.h"
29
29
  #include <stddef.h>
@@ -72,18 +72,18 @@ const char *xc_version_string();
72
72
  /* functionals marked with the development flag may have significant problems in the implementation */
73
73
  #define XC_FLAGS_DEVELOPMENT (1 << 14) /* 16384 */
74
74
  #define XC_FLAGS_NEEDS_LAPLACIAN (1 << 15) /* 32768 */
75
+ #define XC_FLAGS_NEEDS_TAU (1 << 16) /* 65536 */
76
+ /* enforce Fermi hole curvature? (Only affects meta-GGA routines) */
77
+ #define XC_FLAGS_ENFORCE_FHC (1 << 17) /* 131072 */
75
78
 
76
- /* This is the case for most functionals in libxc */
79
+ /* This is the case for most functionals in libxc */
77
80
  #define XC_FLAGS_HAVE_ALL (XC_FLAGS_HAVE_EXC | XC_FLAGS_HAVE_VXC | \
78
81
  XC_FLAGS_HAVE_FXC | XC_FLAGS_HAVE_KXC | \
79
82
  XC_FLAGS_HAVE_LXC)
80
83
 
81
- /* This magic value means use default parameter */
84
+ /* This magic value means use default parameter */
82
85
  #define XC_EXT_PARAMS_DEFAULT -999998888
83
86
 
84
- #define XC_TAU_EXPLICIT 0
85
- #define XC_TAU_EXPANSION 1
86
-
87
87
  #define XC_MAX_REFERENCES 5
88
88
 
89
89
  /* This are the derivatives that a functional returns */
@@ -310,7 +310,7 @@ typedef struct xc_dimensions xc_dimensions;
310
310
 
311
311
 
312
312
  struct xc_func_type{
313
- const xc_func_info_type *info; /* all the information concerning this functional */
313
+ xc_func_info_type *info; /* all the information concerning this functional */
314
314
  int nspin; /* XC_UNPOLARIZED or XC_POLARIZED */
315
315
 
316
316
  int n_func_aux; /* how many auxiliary functions we need */
@@ -337,7 +337,10 @@ struct xc_func_type{
337
337
 
338
338
  xc_dimensions dim; /* the dimensions of all input and output arrays */
339
339
 
340
- void *params; /* this allows us to fix parameters in the functional */
340
+ /* This is where the values of the external parameters are stored */
341
+ double *ext_params;
342
+ /* This is a placeholder for structs of parameters that are used in the Maple generated sources */
343
+ void *params;
341
344
 
342
345
  double dens_threshold; /* functional is put to zero for spin-densities smaller than this */
343
346
  double zeta_threshold; /* idem for the absolute value of zeta */
@@ -356,9 +359,9 @@ char *xc_functional_get_name(int number);
356
359
  int xc_family_from_id(int id, int *family, int *number);
357
360
 
358
361
  /** The number of functionals implemented in this version of libxc */
359
- int xc_number_of_functionals();
362
+ int xc_number_of_functionals(void);
360
363
  /** The maximum name length of any functional */
361
- int xc_maximum_name_length();
364
+ int xc_maximum_name_length(void);
362
365
  /** Returns the available functional number sorted by id */
363
366
  void xc_available_functional_numbers(int *list);
364
367
  /** Returns the available functional number sorted by the functionals'
@@ -369,7 +372,7 @@ void xc_available_functional_numbers_by_name(int *list);
369
372
  void xc_available_functional_names(char **list);
370
373
 
371
374
  /** Dynamically allocates a libxc functional; which will also need to be initialized. */
372
- xc_func_type *xc_func_alloc();
375
+ xc_func_type *xc_func_alloc(void);
373
376
  /** Initializes a functional by id with nspin spin channels */
374
377
  int xc_func_init(xc_func_type *p, int functional, int nspin);
375
378
  /** Destructor for an initialized functional */
@@ -387,21 +390,28 @@ void xc_func_set_zeta_threshold(xc_func_type *p, double t_zeta);
387
390
  void xc_func_set_sigma_threshold(xc_func_type *p, double t_sigma);
388
391
  /** Sets the kinetic energy density threshold for a functional */
389
392
  void xc_func_set_tau_threshold(xc_func_type *p, double t_tau);
393
+ /** Turns the Fermi hole curvature enforcement on or off: 0 is off, != 0 is on */
394
+ void xc_func_set_fhc_enforcement(xc_func_type *p, int on);
390
395
 
391
396
  /** Sets all external parameters for a functional */
392
397
  void xc_func_set_ext_params(xc_func_type *p, const double *ext_params);
398
+ /** Gets all external parameters for a functional. Array needs to be preallocated */
399
+ void xc_func_get_ext_params(const xc_func_type *p, double *ext_params);
393
400
  /** Sets an external parameter by name for a functional */
394
401
  void xc_func_set_ext_params_name(xc_func_type *p, const char *name, double par);
395
-
396
-
397
- #include "xc_funcs.h"
398
- #include "xc_funcs_removed.h"
402
+ /** Gets an external parameter by name for a functional */
403
+ double xc_func_get_ext_params_name(const xc_func_type *p, const char *name);
404
+ /** Gets an external parameter by index */
405
+ double xc_func_get_ext_params_value(const xc_func_type *p, int number);
399
406
 
400
407
  /** New API */
401
408
  void xc_lda_new (const xc_func_type *p, int order, size_t np,
402
409
  const double *rho, xc_lda_out_params *out);
403
410
  void xc_gga_new (const xc_func_type *p, int order, size_t np,
404
411
  const double *rho, const double *sigma, xc_gga_out_params *out);
412
+ void xc_mgga_new(const xc_func_type *func, int order, size_t np,
413
+ const double *rho, const double *sigma, const double *lapl,
414
+ const double *tau, xc_mgga_out_params *out);
405
415
 
406
416
  /** Evaluate an LDA functional */
407
417
  void xc_lda (const xc_func_type *p, size_t np, const double *rho,
@@ -322,7 +322,18 @@
322
322
  #define XC_MGGA_C_TPSS_GAUSSIAN 323 /* Tao, Perdew, Staroverov & Scuseria with parameters from Gaussian */
323
323
  #define XC_GGA_X_NCAPR 324 /* Nearly correct asymptotic potential revised */
324
324
  #define XC_HYB_GGA_XC_RELPBE0 325 /* relPBE0 a.k.a. relPBE: PBE0 refitted for actinide compounds */
325
+ #define XC_MGGA_X_EEL 326 /* Exact exchange-like exchange of Aschebrock et al */
325
326
  #define XC_GGA_XC_B97_3C 327 /* Becke 97-3c by Grimme et. al. */
327
+ #define XC_LDA_C_EPC17 328 /* epc17(-1): electron-proton correlation 2017 */
328
+ #define XC_LDA_C_EPC17_2 329 /* epc17-2: electron-proton correlation 2017 for proton affinities */
329
+ #define XC_LDA_C_EPC18_1 330 /* epc18-1: electron-proton correlation 2018 */
330
+ #define XC_LDA_C_EPC18_2 331 /* epc18-2: electron-proton correlation 2018 for proton affinities */
331
+ #define XC_GGA_X_BKL1 338 /* Type-I band gap functional by Bhattacharjee, Koshi and Lee */
332
+ #define XC_GGA_X_BKL2 339 /* Type-II band gap functional by Bhattacharjee, Koshi and Lee */
333
+ #define XC_HYB_MGGA_X_CF22D 340 /* Minnesota CF22D hybrid exchange functional */
334
+ #define XC_MGGA_C_CF22D 341 /* Minnesota CF22D correlation functional */
335
+ #define XC_MGGA_X_LAK 342 /* Lebeda-Aschebrock-Kummel meta-GGA exchange */
336
+ #define XC_HYB_GGA_XC_OPB3LYP 386 /* opB3LYP: B3LYP reoptimized in 6-311++G(2d,2p) basis set */
326
337
  #define XC_MGGA_C_CC 387 /* Self-interaction corrected correlation functional by Schmidt et al */
327
338
  #define XC_MGGA_C_CCALDA 388 /* Iso-orbital corrected LDA correlation by Lebeda et al */
328
339
  #define XC_HYB_MGGA_XC_BR3P86 389 /* BR3P86 hybrid meta-GGA from Neumann and Handy */
@@ -432,7 +443,7 @@
432
443
  #define XC_MGGA_X_RSCAN 493 /* Regularized SCAN exchange by Bartok and Yates */
433
444
  #define XC_MGGA_C_RSCAN 494 /* Regularized SCAN correlation by Bartok and Yates */
434
445
  #define XC_GGA_X_S12G 495 /* Swart 2012 GGA exchange */
435
- #define XC_HYB_GGA_X_S12H 496 /* Swart 2012 hybrid exchange */
446
+ #define XC_HYB_GGA_X_S12H 496 /* Swart 2012 hybrid GGA exchange */
436
447
  #define XC_MGGA_X_R2SCAN 497 /* Re-regularized SCAN exchange by Furness et al */
437
448
  #define XC_MGGA_C_R2SCAN 498 /* Re-regularized SCAN correlation by Furness et al */
438
449
  #define XC_HYB_GGA_XC_BLYP35 499 /* BLYP35 */
@@ -495,7 +506,7 @@
495
506
  #define XC_GGA_C_GAPLOC 556 /* Gaploc */
496
507
  #define XC_GGA_C_ZVPBEINT 557 /* another spin-dependent correction to PBEint */
497
508
  #define XC_GGA_C_ZVPBESOL 558 /* another spin-dependent correction to PBEsol */
498
- #define XC_GGA_C_TM_LYP 559 /* Takkar and McCarthy reparametrization */
509
+ #define XC_GGA_C_TM_LYP 559 /* Takkar and McCarthy reparametrization, also known as reLYP */
499
510
  #define XC_GGA_C_TM_PBE 560 /* Thakkar and McCarthy reparametrization */
500
511
  #define XC_GGA_C_W94 561 /* Wilson 94 (Eq. 25) */
501
512
  #define XC_MGGA_C_KCIS 562 /* Krieger, Chen, Iafrate, and Savin */
@@ -589,6 +600,11 @@
589
600
  #define XC_MGGA_X_R4SCAN 650 /* r$^{4}$SCAN, a functional that satisfies the same exact constraints that SCAN does */
590
601
  #define XC_MGGA_X_VCML 651 /* Exchange part of VCML-rVV10 by Trepte and Voss */
591
602
  #define XC_MGGA_XC_VCML_RVV10 652 /* VCML-rVV10 by Trepte and Voss */
603
+ #define XC_HYB_LDA_X_ERF 653 /* Long-range corrected functional based on short-range LDA exchange (erfc) */
604
+ #define XC_LDA_C_PW_ERF 654 /* Short ranged correlation LDA (erfc) */
605
+ #define XC_GGA_X_PBE_ERF_GWS 655 /* Short ranged PBE exchange (erfc) */
606
+ #define XC_HYB_GGA_X_PBE_ERF_GWS 656 /* Short-range PBE (GWS) exchange (erfc) + long-range exact exchange */
607
+ #define XC_GGA_C_PBE_ERF_GWS 657 /* Short ranged PBE correlation (erfc) */
592
608
  #define XC_HYB_MGGA_XC_GAS22 658 /* Google Accelerated Science 22 */
593
609
  #define XC_HYB_MGGA_XC_R2SCANH 659 /* r2SCANh: r2SCAN hybrid like TPSSh with 10% exact exchange */
594
610
  #define XC_HYB_MGGA_XC_R2SCAN0 660 /* r2SCAN0: r2SCAN hybrid like PBE0 with 25% exact exchange */
@@ -628,3 +644,35 @@
628
644
  #define XC_HYB_MGGA_XC_LC_TMLYP 720 /* Long-range corrected TM-LYP by Jana et al */
629
645
  #define XC_MGGA_X_MTASK 724 /* modified TASK exchange */
630
646
  #define XC_GGA_X_Q1D 734 /* Functional for quasi-1D systems */
647
+ #define XC_MGGA_X_KTBM_0 735 /* KTBM learned exchange - 0 */
648
+ #define XC_MGGA_X_KTBM_1 736 /* KTBM learned exchange - 1 */
649
+ #define XC_MGGA_X_KTBM_2 737 /* KTBM learned exchange - 2 */
650
+ #define XC_MGGA_X_KTBM_3 738 /* KTBM learned exchange - 3 */
651
+ #define XC_MGGA_X_KTBM_4 739 /* KTBM learned exchange - 4 */
652
+ #define XC_MGGA_X_KTBM_5 740 /* KTBM learned exchange - 5 */
653
+ #define XC_MGGA_X_KTBM_6 741 /* KTBM learned exchange - 6 */
654
+ #define XC_MGGA_X_KTBM_7 742 /* KTBM learned exchange - 7 */
655
+ #define XC_MGGA_X_KTBM_8 743 /* KTBM learned exchange - 8 */
656
+ #define XC_MGGA_X_KTBM_9 744 /* KTBM learned exchange - 9 */
657
+ #define XC_MGGA_X_KTBM_10 745 /* KTBM learned exchange - 10 */
658
+ #define XC_MGGA_X_KTBM_11 746 /* KTBM learned exchange - 11 */
659
+ #define XC_MGGA_X_KTBM_12 747 /* KTBM learned exchange - 12 */
660
+ #define XC_MGGA_X_KTBM_13 748 /* KTBM learned exchange - 13 */
661
+ #define XC_MGGA_X_KTBM_14 749 /* KTBM learned exchange - 14 */
662
+ #define XC_MGGA_X_KTBM_15 750 /* KTBM learned exchange - 15 */
663
+ #define XC_MGGA_X_KTBM_16 751 /* KTBM learned exchange - 16 */
664
+ #define XC_MGGA_X_KTBM_17 752 /* KTBM learned exchange - 17 */
665
+ #define XC_MGGA_X_KTBM_18 753 /* KTBM learned exchange - 18 */
666
+ #define XC_MGGA_X_KTBM_19 754 /* KTBM learned exchange - 19 */
667
+ #define XC_MGGA_X_KTBM_20 755 /* KTBM learned exchange - 20 */
668
+ #define XC_MGGA_X_KTBM_21 756 /* KTBM learned exchange - 21 */
669
+ #define XC_MGGA_X_KTBM_22 757 /* KTBM learned exchange - 22 */
670
+ #define XC_MGGA_X_KTBM_23 758 /* KTBM learned exchange - 23 */
671
+ #define XC_MGGA_X_KTBM_24 759 /* KTBM learned exchange - 24 */
672
+ #define XC_MGGA_X_KTBM_GAP 760 /* KTBM learned exchange - GAP */
673
+ #define XC_MGGA_X_MSPBEL 761 /* MS-PBEl, a PBE-like meta-GGA exchange */
674
+ #define XC_MGGA_X_RMSPBEL 762 /* regularized MS-PBEl */
675
+ #define XC_MGGA_X_MSRPBEL 763 /* MS-RPBEl, a RPBE-like meta-GGA exchange */
676
+ #define XC_MGGA_X_RMSRPBEL 764 /* regularized MS-RPBEl */
677
+ #define XC_MGGA_X_MSB86BL 765 /* MS-B86bl, a B86b-like meta-GGA exchange */
678
+ #define XC_MGGA_X_RMSB86BL 766 /* regularized MS-B86bl */