pyscf 2.4.0__py3-none-macosx_11_0_arm64.whl → 2.6.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 (356) hide show
  1. pyscf/__init__.py +1 -1
  2. pyscf/adc/__init__.py +9 -12
  3. pyscf/adc/radc.py +2 -2
  4. pyscf/adc/radc_ea.py +2 -2
  5. pyscf/adc/radc_ip.py +2 -2
  6. pyscf/adc/radc_ip_cvs.py +2 -2
  7. pyscf/adc/uadc.py +2 -2
  8. pyscf/adc/uadc_ea.py +2 -2
  9. pyscf/adc/uadc_ip.py +2 -2
  10. pyscf/adc/uadc_ip_cvs.py +2 -2
  11. pyscf/agf2/__init__.py +1 -1
  12. pyscf/agf2/chempot.py +2 -2
  13. pyscf/agf2/dfragf2.py +4 -4
  14. pyscf/agf2/dfuagf2.py +4 -4
  15. pyscf/agf2/ragf2.py +5 -5
  16. pyscf/agf2/ragf2_slow.py +2 -2
  17. pyscf/agf2/uagf2.py +3 -3
  18. pyscf/agf2/uagf2_slow.py +2 -2
  19. pyscf/ao2mo/outcore.py +6 -6
  20. pyscf/cc/__init__.py +28 -35
  21. pyscf/cc/addons.py +2 -4
  22. pyscf/cc/ccsd.py +13 -2
  23. pyscf/cc/ccsd_t.py +1 -1
  24. pyscf/cc/ccsd_t_slow.py +1 -1
  25. pyscf/cc/dfccsd.py +4 -1
  26. pyscf/cc/eom_rccsd.py +2 -2
  27. pyscf/cc/gccsd.py +5 -1
  28. pyscf/cc/gccsd_t.py +2 -2
  29. pyscf/cc/gccsd_t_rdm.py +1 -1
  30. pyscf/cc/momgfccsd.py +2 -2
  31. pyscf/cc/qcisd_t_slow.py +1 -1
  32. pyscf/cc/rccsd.py +2 -0
  33. pyscf/cc/rccsd_slow.py +1 -1
  34. pyscf/cc/uccsd.py +5 -1
  35. pyscf/cc/uccsd_slow.py +1 -1
  36. pyscf/ci/__init__.py +31 -25
  37. pyscf/ci/addons.py +1 -2
  38. pyscf/ci/cisd.py +4 -2
  39. pyscf/data/elements.py +2 -2
  40. pyscf/df/addons.py +9 -9
  41. pyscf/df/df.py +9 -2
  42. pyscf/df/df_jk.py +14 -10
  43. pyscf/df/grad/casdm2_util.py +1 -1
  44. pyscf/df/grad/casscf.py +2 -0
  45. pyscf/df/grad/rhf.py +12 -8
  46. pyscf/df/grad/rks.py +6 -5
  47. pyscf/df/grad/sacasscf.py +2 -0
  48. pyscf/df/grad/uhf.py +4 -3
  49. pyscf/df/grad/uks.py +5 -5
  50. pyscf/df/hessian/rhf.py +9 -2
  51. pyscf/df/hessian/rks.py +2 -2
  52. pyscf/df/hessian/uhf.py +3 -3
  53. pyscf/df/hessian/uks.py +2 -2
  54. pyscf/df/incore.py +6 -5
  55. pyscf/df/outcore.py +16 -2
  56. pyscf/dft/LebedevGrid.py +5047 -0
  57. pyscf/dft/__init__.py +1 -0
  58. pyscf/dft/dft_parser.py +24 -0
  59. pyscf/dft/dks.py +10 -1
  60. pyscf/dft/gen_grid.py +9 -46
  61. pyscf/dft/gks.py +3 -1
  62. pyscf/dft/gks_symm.py +3 -0
  63. pyscf/dft/libxc.py +265 -147
  64. pyscf/dft/numint.py +24 -34
  65. pyscf/dft/numint2c.py +17 -30
  66. pyscf/dft/rks.py +47 -13
  67. pyscf/dft/rks_symm.py +6 -1
  68. pyscf/dft/roks.py +2 -0
  69. pyscf/dft/uks.py +4 -2
  70. pyscf/dft/uks_symm.py +3 -0
  71. pyscf/dft/xc_deriv.py +187 -82
  72. pyscf/dft/xcfun.py +117 -86
  73. pyscf/eph/rhf.py +1 -1
  74. pyscf/eph/rks.py +1 -1
  75. pyscf/eph/uhf.py +2 -2
  76. pyscf/eph/uks.py +2 -2
  77. pyscf/fci/addons.py +18 -15
  78. pyscf/fci/cistring.py +43 -10
  79. pyscf/fci/direct_nosym.py +45 -56
  80. pyscf/fci/direct_spin0.py +4 -2
  81. pyscf/fci/direct_spin1.py +11 -7
  82. pyscf/fci/direct_spin1_cyl_sym.py +7 -3
  83. pyscf/fci/direct_spin1_symm.py +12 -0
  84. pyscf/fci/selected_ci.py +2 -2
  85. pyscf/geomopt/geometric_solver.py +1 -1
  86. pyscf/grad/__init__.py +1 -0
  87. pyscf/grad/casci.py +5 -3
  88. pyscf/grad/casscf.py +2 -0
  89. pyscf/grad/ccsd.py +2 -0
  90. pyscf/grad/cisd.py +2 -0
  91. pyscf/grad/dhf.py +3 -1
  92. pyscf/grad/dispersion.py +66 -0
  93. pyscf/grad/mp2.py +9 -3
  94. pyscf/grad/rhf.py +11 -0
  95. pyscf/grad/rks.py +4 -8
  96. pyscf/grad/tdrhf.py +3 -1
  97. pyscf/grad/uks.py +3 -4
  98. pyscf/gto/basis/__init__.py +8 -2
  99. pyscf/gto/basis/parse_cp2k.py +13 -8
  100. pyscf/gto/basis/parse_cp2k_pp.py +18 -5
  101. pyscf/gto/ecp.py +5 -5
  102. pyscf/gto/mole.py +83 -79
  103. pyscf/gto/moleintor.py +1 -0
  104. pyscf/gw/gw_ac.py +2 -2
  105. pyscf/gw/gw_cd.py +2 -2
  106. pyscf/gw/gw_exact.py +2 -2
  107. pyscf/gw/gw_slow.py +1 -1
  108. pyscf/gw/rpa.py +237 -96
  109. pyscf/gw/ugw_ac.py +2 -2
  110. pyscf/gw/urpa.py +135 -127
  111. pyscf/hessian/__init__.py +1 -0
  112. pyscf/hessian/dispersion.py +104 -0
  113. pyscf/hessian/rhf.py +44 -15
  114. pyscf/hessian/rks.py +37 -7
  115. pyscf/hessian/uhf.py +13 -8
  116. pyscf/hessian/uks.py +7 -5
  117. pyscf/lib/CMakeLists.txt +59 -10
  118. pyscf/lib/ao2mo/nr_ao2mo.c +6 -1
  119. pyscf/lib/ao2mo/nrr_ao2mo.c +6 -1
  120. pyscf/lib/ao2mo/r_ao2mo.c +6 -1
  121. pyscf/lib/cc/ccsd_t.c +37 -6
  122. pyscf/lib/cc/uccsd_t.c +25 -4
  123. pyscf/lib/chkfile.py +1 -2
  124. pyscf/lib/config.h +1 -1
  125. pyscf/lib/config.h.in +1 -1
  126. pyscf/lib/deps/include/cint.h +1 -1
  127. pyscf/lib/deps/include/cint_funcs.h +47 -16
  128. pyscf/lib/deps/lib/libcint.6.dylib +0 -0
  129. pyscf/lib/deps/lib/libxcfun.2.dylib +0 -0
  130. pyscf/lib/dft/CMakeLists.txt +10 -6
  131. pyscf/lib/dft/grid_collocate.c +655 -0
  132. pyscf/lib/dft/grid_common.c +660 -0
  133. pyscf/lib/dft/grid_common.h +109 -0
  134. pyscf/lib/dft/grid_integrate.c +1358 -0
  135. pyscf/lib/dft/libxc_itrf.c +587 -357
  136. pyscf/lib/dft/multigrid.c +744 -0
  137. pyscf/lib/dft/multigrid.h +72 -0
  138. pyscf/lib/dft/utils.c +71 -0
  139. pyscf/lib/dft/utils.h +27 -0
  140. pyscf/lib/dft/xc_deriv.c +85 -89
  141. pyscf/lib/dft/xcfun_itrf.c +24 -17
  142. pyscf/lib/diis.py +2 -0
  143. pyscf/lib/gto/fill_r_4c.c +5 -0
  144. pyscf/lib/libagf2.dylib +0 -0
  145. pyscf/lib/libao2mo.dylib +0 -0
  146. pyscf/lib/libcc.dylib +0 -0
  147. pyscf/lib/libcgto.dylib +0 -0
  148. pyscf/lib/libcvhf.dylib +0 -0
  149. pyscf/lib/libdft.dylib +0 -0
  150. pyscf/lib/libfci.dylib +0 -0
  151. pyscf/lib/libmcscf.dylib +0 -0
  152. pyscf/lib/libnp_helper.dylib +0 -0
  153. pyscf/lib/libpbc.dylib +0 -0
  154. pyscf/lib/libri.dylib +0 -0
  155. pyscf/lib/libxc_itrf.dylib +0 -0
  156. pyscf/lib/libxcfun_itrf.dylib +0 -0
  157. pyscf/lib/linalg_helper.py +2 -2
  158. pyscf/lib/mcscf/fci_contract.c +25 -19
  159. pyscf/lib/mcscf/fci_contract_nosym.c +11 -5
  160. pyscf/lib/mcscf/fci_string.c +29 -29
  161. pyscf/lib/misc.py +121 -19
  162. pyscf/lib/np_helper/np_helper.h +7 -0
  163. pyscf/lib/numpy_helper.py +11 -4
  164. pyscf/lib/pbc/CMakeLists.txt +11 -1
  165. pyscf/lib/pbc/cell.c +280 -0
  166. pyscf/lib/pbc/cell.h +29 -0
  167. pyscf/lib/pbc/fft.c +147 -0
  168. pyscf/lib/pbc/fft.h +26 -0
  169. pyscf/lib/pbc/fill_ints.c +3 -3
  170. pyscf/lib/pbc/fill_ints.h +29 -0
  171. pyscf/lib/pbc/fill_ints_screened.c +1012 -0
  172. pyscf/lib/pbc/hf_grad.c +95 -0
  173. pyscf/lib/pbc/neighbor_list.c +206 -0
  174. pyscf/lib/pbc/neighbor_list.h +41 -0
  175. pyscf/lib/pbc/optimizer.c +37 -1
  176. pyscf/lib/pbc/optimizer.h +3 -3
  177. pyscf/lib/pbc/pp.c +448 -0
  178. pyscf/lib/solvent/CMakeLists.txt +38 -0
  179. pyscf/lib/vhf/nr_sgx_direct.c +5 -0
  180. pyscf/lib/vhf/optimizer.c +10 -0
  181. pyscf/lo/boys.py +4 -1
  182. pyscf/lo/pipek.py +77 -71
  183. pyscf/lo/pipek_jacobi.py +161 -0
  184. pyscf/mcscf/__init__.py +31 -31
  185. pyscf/mcscf/addons.py +20 -12
  186. pyscf/mcscf/casci.py +5 -3
  187. pyscf/mcscf/casci_symm.py +3 -1
  188. pyscf/mcscf/df.py +2 -2
  189. pyscf/mcscf/mc1step.py +14 -8
  190. pyscf/mcscf/newton_casscf_symm.py +1 -1
  191. pyscf/mcscf/ucasci.py +1 -1
  192. pyscf/mcscf/umc1step.py +3 -3
  193. pyscf/mp/__init__.py +10 -12
  194. pyscf/mp/dfgmp2.py +3 -2
  195. pyscf/mp/dfmp2.py +3 -3
  196. pyscf/mp/dfmp2_native.py +4 -2
  197. pyscf/mp/dfump2_native.py +4 -3
  198. pyscf/mp/gmp2.py +6 -3
  199. pyscf/mp/mp2.py +48 -14
  200. pyscf/mp/ump2.py +56 -23
  201. pyscf/mrpt/nevpt2.py +2 -2
  202. pyscf/nac/__init__.py +32 -0
  203. pyscf/nac/sacasscf.py +293 -0
  204. pyscf/pbc/__all__.py +3 -0
  205. pyscf/pbc/adc/__init__.py +1 -1
  206. pyscf/pbc/adc/kadc_rhf.py +2 -2
  207. pyscf/pbc/adc/kadc_rhf_ea.py +2 -2
  208. pyscf/pbc/adc/kadc_rhf_ip.py +2 -2
  209. pyscf/pbc/cc/__init__.py +10 -7
  210. pyscf/pbc/cc/kccsd.py +3 -1
  211. pyscf/pbc/cc/kccsd_rhf.py +4 -2
  212. pyscf/pbc/cc/kccsd_rhf_ksymm.py +1 -1
  213. pyscf/pbc/cc/kccsd_uhf.py +3 -1
  214. pyscf/pbc/cc/kintermediates.py +1 -1
  215. pyscf/pbc/ci/__init__.py +4 -4
  216. pyscf/pbc/df/aft.py +5 -4
  217. pyscf/pbc/df/aft_jk.py +1 -1
  218. pyscf/pbc/df/df.py +7 -2
  219. pyscf/pbc/df/df_jk.py +12 -11
  220. pyscf/pbc/df/fft.py +7 -2
  221. pyscf/pbc/df/ft_ao.py +17 -9
  222. pyscf/pbc/df/gdf_builder.py +8 -7
  223. pyscf/pbc/df/incore.py +246 -2
  224. pyscf/pbc/df/mdf.py +3 -0
  225. pyscf/pbc/df/mdf_jk.py +0 -3
  226. pyscf/pbc/df/rsdf_builder.py +20 -11
  227. pyscf/pbc/df/rsdf_helper.py +16 -13
  228. pyscf/pbc/dft/gen_grid.py +14 -9
  229. pyscf/pbc/dft/gks.py +4 -2
  230. pyscf/pbc/dft/kgks.py +13 -4
  231. pyscf/pbc/dft/krks.py +15 -25
  232. pyscf/pbc/dft/krks_ksymm.py +16 -15
  233. pyscf/pbc/dft/krkspu.py +3 -3
  234. pyscf/pbc/dft/krkspu_ksymm.py +2 -2
  235. pyscf/pbc/dft/kroks.py +9 -19
  236. pyscf/pbc/dft/kuks.py +14 -24
  237. pyscf/pbc/dft/kuks_ksymm.py +16 -15
  238. pyscf/pbc/dft/kukspu.py +3 -3
  239. pyscf/pbc/dft/kukspu_ksymm.py +2 -2
  240. pyscf/pbc/dft/multigrid/__init__.py +57 -0
  241. pyscf/pbc/dft/{multigrid.py → multigrid/multigrid.py} +87 -94
  242. pyscf/pbc/dft/multigrid/multigrid_pair.py +1405 -0
  243. pyscf/pbc/dft/multigrid/pp.py +290 -0
  244. pyscf/pbc/dft/multigrid/utils.py +70 -0
  245. pyscf/pbc/dft/numint.py +5 -0
  246. pyscf/pbc/dft/rks.py +12 -8
  247. pyscf/pbc/dft/roks.py +2 -0
  248. pyscf/pbc/dft/uks.py +6 -4
  249. pyscf/pbc/geomopt/geometric_solver.py +1 -1
  250. pyscf/pbc/grad/__init__.py +5 -2
  251. pyscf/pbc/grad/krhf.py +7 -1
  252. pyscf/pbc/grad/krks.py +1 -1
  253. pyscf/pbc/grad/kuks.py +1 -1
  254. pyscf/pbc/grad/rhf.py +167 -0
  255. pyscf/pbc/grad/rks.py +24 -0
  256. pyscf/pbc/grad/uhf.py +92 -0
  257. pyscf/pbc/grad/uks.py +24 -0
  258. pyscf/pbc/gto/__init__.py +1 -0
  259. pyscf/pbc/gto/_pbcintor.py +14 -7
  260. pyscf/pbc/gto/cell.py +228 -23
  261. pyscf/pbc/gto/ewald_methods.py +293 -0
  262. pyscf/pbc/gto/neighborlist.py +199 -0
  263. pyscf/pbc/gto/pseudo/pp_int.py +350 -17
  264. pyscf/pbc/gw/__init__.py +44 -1
  265. pyscf/pbc/gw/kgw_slow_supercell.py +1 -1
  266. pyscf/pbc/gw/krgw_ac.py +4 -4
  267. pyscf/pbc/gw/krgw_cd.py +4 -4
  268. pyscf/pbc/gw/kugw_ac.py +7 -4
  269. pyscf/pbc/lib/kpts_helper.py +1 -1
  270. pyscf/pbc/mp/__init__.py +3 -3
  271. pyscf/pbc/mp/kmp2.py +3 -1
  272. pyscf/pbc/mpicc/__init__.py +4 -2
  273. pyscf/pbc/scf/addons.py +22 -18
  274. pyscf/pbc/scf/ghf.py +3 -1
  275. pyscf/pbc/scf/hf.py +34 -20
  276. pyscf/pbc/scf/kghf.py +3 -1
  277. pyscf/pbc/scf/khf.py +15 -15
  278. pyscf/pbc/scf/khf_ksymm.py +8 -6
  279. pyscf/pbc/scf/krohf.py +6 -4
  280. pyscf/pbc/scf/kuhf.py +14 -10
  281. pyscf/pbc/scf/kuhf_ksymm.py +4 -2
  282. pyscf/pbc/scf/rohf.py +2 -1
  283. pyscf/pbc/scf/rsjk.py +14 -4
  284. pyscf/pbc/scf/uhf.py +9 -5
  285. pyscf/pbc/symm/geom.py +1 -1
  286. pyscf/pbc/symm/pyscf_spglib.py +1 -1
  287. pyscf/pbc/symm/symmetry.py +1 -1
  288. pyscf/pbc/tdscf/__init__.py +6 -9
  289. pyscf/pbc/tdscf/krhf.py +1 -1
  290. pyscf/pbc/tdscf/krhf_slow_supercell.py +3 -3
  291. pyscf/pbc/tdscf/rhf.py +1 -1
  292. pyscf/pbc/tools/k2gamma.py +27 -15
  293. pyscf/pbc/tools/pbc.py +55 -10
  294. pyscf/pbc/x2c/sfx2c1e.py +1 -1
  295. pyscf/pbc/x2c/x2c1e.py +1 -1
  296. pyscf/post_scf.py +3 -0
  297. pyscf/qmmm/itrf.py +13 -1
  298. pyscf/scf/__init__.py +3 -1
  299. pyscf/scf/_response_functions.py +5 -4
  300. pyscf/scf/addons.py +50 -51
  301. pyscf/scf/atom_hf.py +16 -3
  302. pyscf/scf/atom_hf_pp.py +154 -0
  303. pyscf/scf/atom_ks.py +1 -1
  304. pyscf/scf/cphf.py +39 -17
  305. pyscf/scf/dhf.py +6 -8
  306. pyscf/scf/diis.py +12 -11
  307. pyscf/scf/dispersion.py +177 -0
  308. pyscf/scf/ghf.py +8 -8
  309. pyscf/scf/ghf_symm.py +3 -1
  310. pyscf/scf/hf.py +150 -54
  311. pyscf/scf/hf_symm.py +9 -4
  312. pyscf/scf/rohf.py +30 -7
  313. pyscf/scf/ucphf.py +46 -30
  314. pyscf/scf/uhf.py +17 -19
  315. pyscf/scf/uhf_symm.py +7 -5
  316. pyscf/sgx/sgx.py +9 -4
  317. pyscf/solvent/__init__.py +26 -2
  318. pyscf/solvent/_attach_solvent.py +58 -11
  319. pyscf/solvent/_ddcosmo_tdscf_grad.py +2 -2
  320. pyscf/solvent/ddcosmo.py +7 -6
  321. pyscf/solvent/ddpcm.py +1 -0
  322. pyscf/solvent/grad/__init__.py +17 -0
  323. pyscf/solvent/{ddcosmo_grad.py → grad/ddcosmo_grad.py} +1 -1
  324. pyscf/solvent/grad/pcm.py +384 -0
  325. pyscf/solvent/grad/smd.py +176 -0
  326. pyscf/solvent/grad/smd_experiment.py +216 -0
  327. pyscf/solvent/hessian/__init__.py +0 -0
  328. pyscf/solvent/hessian/pcm.py +230 -0
  329. pyscf/solvent/hessian/smd.py +171 -0
  330. pyscf/solvent/hessian/smd_experiment.py +208 -0
  331. pyscf/solvent/pcm.py +138 -57
  332. pyscf/solvent/pol_embed.py +3 -3
  333. pyscf/solvent/smd.py +433 -0
  334. pyscf/solvent/smd_experiment.py +273 -0
  335. pyscf/soscf/newton_ah.py +21 -10
  336. pyscf/symm/basis.py +1 -1
  337. pyscf/symm/geom.py +3 -7
  338. pyscf/tdscf/common_slow.py +4 -7
  339. pyscf/tdscf/dhf.py +1 -1
  340. pyscf/tdscf/ghf.py +1 -1
  341. pyscf/tdscf/proxy.py +1 -1
  342. pyscf/tdscf/rhf.py +10 -3
  343. pyscf/tdscf/rhf_slow.py +1 -1
  344. pyscf/tdscf/uhf.py +5 -1
  345. pyscf/tools/chgcar.py +1 -5
  346. pyscf/tools/molden.py +15 -2
  347. pyscf/x2c/sfx2c1e.py +8 -3
  348. pyscf/x2c/tdscf.py +1 -1
  349. pyscf/x2c/x2c.py +10 -2
  350. pyscf-2.6.0.dist-info/METADATA +140 -0
  351. {pyscf-2.4.0.dist-info → pyscf-2.6.0.dist-info}/NOTICE +8 -1
  352. {pyscf-2.4.0.dist-info → pyscf-2.6.0.dist-info}/RECORD +355 -307
  353. {pyscf-2.4.0.dist-info → pyscf-2.6.0.dist-info}/WHEEL +1 -1
  354. pyscf-2.4.0.dist-info/METADATA +0 -81
  355. {pyscf-2.4.0.dist-info → pyscf-2.6.0.dist-info}/LICENSE +0 -0
  356. {pyscf-2.4.0.dist-info → pyscf-2.6.0.dist-info}/top_level.txt +0 -0
pyscf/pbc/scf/uhf.py CHANGED
@@ -104,10 +104,10 @@ def dip_moment(cell, dm, unit='Debye', verbose=logger.NOTE,
104
104
 
105
105
  get_rho = pbchf.get_rho
106
106
 
107
- class UHF(pbchf.SCF, mol_uhf.UHF):
107
+ class UHF(pbchf.SCF):
108
108
  '''UHF class for PBCs.
109
109
  '''
110
- _keys = set(["init_guess_breaksym"])
110
+ _keys = {"init_guess_breaksym"}
111
111
 
112
112
  init_guess_by_minao = mol_uhf.UHF.init_guess_by_minao
113
113
  init_guess_by_atom = mol_uhf.UHF.init_guess_by_atom
@@ -128,6 +128,7 @@ class UHF(pbchf.SCF, mol_uhf.UHF):
128
128
  canonicalize = mol_uhf.UHF.canonicalize
129
129
  spin_square = mol_uhf.UHF.spin_square
130
130
  stability = mol_uhf.UHF.stability
131
+ to_gpu = lib.to_gpu
131
132
 
132
133
  def __init__(self, cell, kpt=np.zeros(3),
133
134
  exxdiv=getattr(__config__, 'pbc_scf_SCF_exxdiv', 'ewald')):
@@ -221,10 +222,13 @@ class UHF(pbchf.SCF, mol_uhf.UHF):
221
222
  rho = self.get_rho(dm)
222
223
  return dip_moment(cell, dm, unit, verbose, rho=rho, kpt=self.kpt, **kwargs)
223
224
 
224
- def get_init_guess(self, cell=None, key='minao'):
225
- if cell is None: cell = self.cell
225
+ def get_init_guess(self, cell=None, key='minao', s1e=None):
226
+ if cell is None:
227
+ cell = self.cell
228
+ if s1e is None:
229
+ s1e = self.get_ovlp(cell)
226
230
  dm = mol_uhf.UHF.get_init_guess(self, cell, key)
227
- ne = np.einsum('xij,ji->x', dm, self.get_ovlp(cell)).real
231
+ ne = np.einsum('xij,ji->x', dm, s1e).real
228
232
  nelec = self.nelec
229
233
  if np.any(abs(ne - nelec) > 0.01):
230
234
  logger.debug(self, 'Big error detected in the electron number '
pyscf/pbc/symm/geom.py CHANGED
@@ -77,7 +77,7 @@ def search_space_group_ops(cell, rotations=None, tol=SYMPREC):
77
77
  '''
78
78
  if rotations is None: rotations = search_point_group_ops(cell, tol=tol)
79
79
  a = cell.lattice_vectors()
80
- coords = cell.get_scaled_positions()
80
+ coords = cell.get_scaled_atom_coords()
81
81
  atmgrp = mole.atom_types(cell._atom, magmom=cell.magmom)
82
82
  atmgrp_spin_inv = {} #spin up and down inverted
83
83
  has_spin = False
@@ -29,7 +29,7 @@ def cell_to_spgcell(cell):
29
29
  Convert PySCF Cell object to spglib cell object
30
30
  '''
31
31
  a = cell.lattice_vectors()
32
- atm_pos = cell.get_scaled_positions()
32
+ atm_pos = cell.get_scaled_atom_coords()
33
33
  atm_num = []
34
34
  from pyscf.data import elements
35
35
  for symbol in cell.elements:
@@ -219,7 +219,7 @@ class Symmetry():
219
219
 
220
220
  def _get_phase(cell, op, kpt_scaled, ignore_phase=False, tol=SYMPREC):
221
221
  kpt_scaled = op.a2b(cell).dot_rot(kpt_scaled)
222
- coords_scaled = cell.get_scaled_positions().reshape(-1,3)
222
+ coords_scaled = cell.get_scaled_atom_coords().reshape(-1,3)
223
223
  natm = coords_scaled.shape[0]
224
224
  phase = np.ones((natm,), dtype=np.complex128)
225
225
  atm_map = np.arange(natm)
@@ -31,22 +31,20 @@ except (ImportError, IOError):
31
31
  pass
32
32
 
33
33
  def TDHF(mf):
34
- import numpy
35
34
  if isinstance(mf, scf.khf.KSCF):
36
35
  return KTDHF(mf)
37
36
  if isinstance(mf, scf.hf.KohnShamDFT):
38
37
  raise RuntimeError('TDHF does not support DFT object %s' % mf)
39
- #TODO: mf = mf.remove_soscf()
38
+ mf = mf.remove_soscf()
40
39
  if isinstance(mf, scf.rohf.ROHF):
41
40
  # Is it correct to call TDUHF for ROHF?
42
41
  mf = mf.to_uhf()
43
42
  return mf.TDHF()
44
43
 
45
44
  def TDA(mf):
46
- import numpy
47
45
  if isinstance(mf, scf.khf.KSCF):
48
46
  return KTDA(mf)
49
- #TODO: mf = mf.remove_soscf()
47
+ mf = mf.remove_soscf()
50
48
  if isinstance(mf, scf.rohf.ROHF):
51
49
  if isinstance(mf, scf.hf.KohnShamDFT):
52
50
  mf = mf.to_uks()
@@ -55,11 +53,10 @@ def TDA(mf):
55
53
  return mf.TDA()
56
54
 
57
55
  def TDDFT(mf):
58
- import numpy
59
56
  if isinstance(mf, scf.khf.KSCF):
60
57
  return KTDDFT(mf)
61
58
  if isinstance(mf, scf.hf.KohnShamDFT):
62
- #TODO: mf = mf.remove_soscf()
59
+ mf = mf.remove_soscf()
63
60
  if isinstance(mf, scf.rohf.ROHF):
64
61
  mf = mf.to_uks()
65
62
  return mf.TDDFT()
@@ -69,13 +66,13 @@ def TDDFT(mf):
69
66
  def KTDHF(mf):
70
67
  if isinstance(mf, scf.hf.KohnShamDFT):
71
68
  raise RuntimeError('TDHF does not support DFT object %s' % mf)
72
- #TODO: mf = mf.remove_soscf()
69
+ mf = mf.remove_soscf()
73
70
  if isinstance(mf, scf.rohf.ROHF):
74
71
  mf = mf.to_uhf()
75
72
  return mf.TDHF()
76
73
 
77
74
  def KTDA(mf):
78
- #TODO: mf = mf.remove_soscf()
75
+ mf = mf.remove_soscf()
79
76
  if isinstance(mf, scf.rohf.ROHF):
80
77
  if isinstance(mf, scf.hf.KohnShamDFT):
81
78
  mf = mf.to_uks()
@@ -85,7 +82,7 @@ def KTDA(mf):
85
82
 
86
83
  def KTDDFT(mf):
87
84
  if isinstance(mf, scf.hf.KohnShamDFT):
88
- #TODO: mf = mf.remove_soscf()
85
+ mf = mf.remove_soscf()
89
86
  if isinstance(mf, scf.rohf.ROHF):
90
87
  mf = mf.to_uks()
91
88
  return mf.TDDFT()
pyscf/pbc/tdscf/krhf.py CHANGED
@@ -38,7 +38,7 @@ from pyscf import __config__
38
38
  REAL_EIG_THRESHOLD = getattr(__config__, 'pbc_tdscf_rhf_TDDFT_pick_eig_threshold', 1e-3)
39
39
 
40
40
  class KTDBase(TDBase):
41
- _keys = set(['kconserv', 'kshift_lst'])
41
+ _keys = {'kconserv', 'kshift_lst'}
42
42
 
43
43
  def __init__(self, mf, kshift_lst=None):
44
44
  assert isinstance(mf, scf.khf.KSCF)
@@ -88,7 +88,7 @@ class PhysERI(PeriodicMFMixin, TDERIMatrixBlocks):
88
88
  The diagonal block.
89
89
  """
90
90
  # Everything is already implemented in molecular code
91
- return super(PhysERI, self).tdhf_diag(k1, k2)
91
+ return super().tdhf_diag(k1, k2)
92
92
 
93
93
  def tdhf_diag(self, pairs=None):
94
94
  """
@@ -127,7 +127,7 @@ class PhysERI(PeriodicMFMixin, TDERIMatrixBlocks):
127
127
  The corresponding block of ERI (phys notation).
128
128
  """
129
129
  # Everything is already implemented in molecular code
130
- return super(PhysERI, self).eri_mknj(item, k)
130
+ return super().eri_mknj(item, k)
131
131
 
132
132
  def eri_mknj(self, item, pairs_row=None, pairs_column=None):
133
133
  """
@@ -214,7 +214,7 @@ class PhysERI8(PhysERI4):
214
214
  frozen (int, Iterable): the number of frozen valence orbitals or the list of frozen orbitals for all
215
215
  k-points or multiple lists of frozen orbitals for each k-point;
216
216
  """
217
- super(PhysERI8, self).__init__(model, frozen=frozen)
217
+ super().__init__(model, frozen=frozen)
218
218
 
219
219
 
220
220
  def vector_to_amplitudes(vectors, nocc, nmo):
pyscf/pbc/tdscf/rhf.py CHANGED
@@ -26,7 +26,7 @@ from pyscf.pbc import scf
26
26
  from pyscf import __config__
27
27
 
28
28
  class TDBase(rhf.TDBase):
29
- _keys = set(['cell'])
29
+ _keys = {'cell'}
30
30
 
31
31
  def __init__(self, mf):
32
32
  rhf.TDBase.__init__(self, mf)
@@ -205,40 +205,52 @@ def k2gamma(kmf, kmesh=None):
205
205
  C_{\nu ' n'} = C_{\vecR\mu, \veck m} = \frac{1}{\sqrt{N_{\UC}}}
206
206
  \e^{\ii \veck\cdot\vecR} C^{\veck}_{\mu m}
207
207
  '''
208
- from pyscf.pbc import scf
208
+ from pyscf.pbc import scf, dft
209
+ if isinstance(kmf.kpts, KPoints):
210
+ kmf = kmf.to_khf()
211
+
209
212
  def transform(mo_energy, mo_coeff, mo_occ):
210
- if isinstance(kmf.kpts, KPoints):
211
- kpts = kmf.kpts.kpts
212
- else:
213
- kpts = kmf.kpts
213
+ assert not isinstance(kmf.kpts, KPoints)
214
+ kpts = kmf.kpts
214
215
  scell, E_g, C_gamma = mo_k2gamma(kmf.cell, mo_energy, mo_coeff,
215
216
  kpts, kmesh)[:3]
216
217
  E_sort_idx = np.argsort(np.hstack(mo_energy), kind='stable')
217
218
  mo_occ = np.hstack(mo_occ)[E_sort_idx]
218
219
  return scell, E_g, C_gamma, mo_occ
219
220
 
220
- if isinstance(kmf.kpts, KPoints):
221
- mo_coeff = kmf.kpts.transform_mo_coeff(kmf.mo_coeff)
222
- mo_energy = kmf.kpts.transform_mo_energy(kmf.mo_energy)
223
- mo_occ = kmf.kpts.transform_mo_occ(kmf.mo_occ)
224
- else:
225
- mo_coeff = kmf.mo_coeff
226
- mo_energy = kmf.mo_energy
227
- mo_occ = kmf.mo_occ
221
+ mo_coeff = kmf.mo_coeff
222
+ mo_energy = kmf.mo_energy
223
+ mo_occ = kmf.mo_occ
228
224
 
229
225
  if isinstance(kmf, scf.khf.KRHF):
230
226
  scell, E_g, C_gamma, mo_occ = transform(mo_energy, mo_coeff, mo_occ)
231
- mf = scf.RHF(scell)
232
227
  elif isinstance(kmf, scf.kuhf.KUHF):
233
228
  scell, Ea, Ca, occ_a = transform(mo_energy[0], mo_coeff[0], mo_occ[0])
234
229
  scell, Eb, Cb, occ_b = transform(mo_energy[1], mo_coeff[1], mo_occ[1])
235
- mf = scf.UHF(scell)
236
230
  E_g = [Ea, Eb]
237
231
  C_gamma = [Ca, Cb]
238
232
  mo_occ = [occ_a, occ_b]
239
233
  else:
240
234
  raise NotImplementedError('SCF object %s not supported' % kmf)
241
235
 
236
+ known_cls = {
237
+ dft.kuks.KUKS : dft.uks.UKS ,
238
+ dft.kroks.KROKS: dft.roks.ROKS,
239
+ dft.krks.KRKS : dft.rks.RKS ,
240
+ dft.kgks.KGKS : dft.gks.GKS ,
241
+ scf.kuhf.KUHF : scf.uhf.UHF ,
242
+ scf.krohf.KROHF: scf.rohf.ROHF,
243
+ scf.khf.KRHF : scf.hf.RHF ,
244
+ scf.kghf.KGHF : scf.ghf.GHF ,
245
+ }
246
+ if kmf.__class__ in known_cls:
247
+ mf = known_cls[kmf.__class__](scell)
248
+ mf.exxdiv = kmf.exxdiv
249
+ if isinstance(mf, dft.KohnShamDFT):
250
+ mf.xc = kmf.xc
251
+ else:
252
+ raise RuntimeError(f'k2gamma for SCF object {kmf} not supported.')
253
+
242
254
  mf.mo_coeff = C_gamma
243
255
  mf.mo_energy = E_g
244
256
  mf.mo_occ = mo_occ
pyscf/pbc/tools/pbc.py CHANGED
@@ -14,6 +14,7 @@
14
14
  # limitations under the License.
15
15
 
16
16
  import warnings
17
+ import ctypes
17
18
  import numpy as np
18
19
  import scipy.linalg
19
20
  from pyscf import lib
@@ -57,6 +58,44 @@ def _ifftn_blas(g, mesh):
57
58
  return out.reshape(-1, *mesh)
58
59
 
59
60
  if FFT_ENGINE == 'FFTW':
61
+ try:
62
+ libfft = lib.load_library('libfft')
63
+ except OSError:
64
+ raise RuntimeError("Failed to load libfft")
65
+
66
+ def _copy_d2z(a):
67
+ fn = libfft._copy_d2z
68
+ out = np.empty(a.shape, dtype=np.complex128)
69
+ fn(out.ctypes.data_as(ctypes.c_void_p),
70
+ a.ctypes.data_as(ctypes.c_void_p),
71
+ ctypes.c_size_t(a.size))
72
+ return out
73
+
74
+ def _complex_fftn_fftw(f, mesh, func):
75
+ if f.dtype == np.double and f.flags.c_contiguous:
76
+ # np.asarray or np.astype is too slow
77
+ f = _copy_d2z(f)
78
+ else:
79
+ f = np.asarray(f, order='C', dtype=np.complex128)
80
+ mesh = np.asarray(mesh, order='C', dtype=np.int32)
81
+ rank = len(mesh)
82
+ out = np.empty_like(f)
83
+ fn = getattr(libfft, func)
84
+ for i, fi in enumerate(f):
85
+ fn(fi.ctypes.data_as(ctypes.c_void_p),
86
+ out[i].ctypes.data_as(ctypes.c_void_p),
87
+ mesh.ctypes.data_as(ctypes.c_void_p),
88
+ ctypes.c_int(rank))
89
+ return out
90
+
91
+ def _fftn_wrapper(a):
92
+ mesh = a.shape[1:]
93
+ return _complex_fftn_fftw(a, mesh, 'fft')
94
+ def _ifftn_wrapper(a):
95
+ mesh = a.shape[1:]
96
+ return _complex_fftn_fftw(a, mesh, 'ifft')
97
+
98
+ elif FFT_ENGINE == 'PYFFTW':
60
99
  # pyfftw is slower than np.fft in most cases
61
100
  try:
62
101
  import pyfftw
@@ -235,8 +274,9 @@ def get_coulG(cell, k=np.zeros(3), exx=False, mf=None, mesh=None, Gv=None,
235
274
  else:
236
275
  kG = Gv
237
276
 
238
- equal2boundary = np.zeros(Gv.shape[0], dtype=bool)
277
+ equal2boundary = None
239
278
  if wrap_around and abs(k).sum() > 1e-9:
279
+ equal2boundary = np.zeros(Gv.shape[0], dtype=bool)
240
280
  # Here we 'wrap around' the high frequency k+G vectors into their lower
241
281
  # frequency counterparts. Important if you want the gamma point and k-point
242
282
  # answers to agree
@@ -357,7 +397,8 @@ def get_coulG(cell, k=np.zeros(3), exx=False, mf=None, mesh=None, Gv=None,
357
397
  if cell.dimension > 0 and exxdiv == 'ewald' and len(G0_idx) > 0:
358
398
  coulG[G0_idx] += Nk*cell.vol*madelung(cell, kpts)
359
399
 
360
- coulG[equal2boundary] = 0
400
+ if equal2boundary is not None:
401
+ coulG[equal2boundary] = 0
361
402
 
362
403
  # Scale the coulG kernel for attenuated Coulomb integrals.
363
404
  # * omega is used by RangeSeparatedJKBuilder which requires ewald probe charge
@@ -507,7 +548,7 @@ def get_lattice_Ls(cell, nimgs=None, rcut=None, dimension=None, discard=True):
507
548
 
508
549
  a = cell.lattice_vectors()
509
550
 
510
- scaled_atom_coords = np.linalg.solve(a.T, cell.atom_coords().T).T
551
+ scaled_atom_coords = cell.get_scaled_atom_coords()
511
552
  atom_boundary_max = scaled_atom_coords[:,:dimension].max(axis=0)
512
553
  atom_boundary_min = scaled_atom_coords[:,:dimension].min(axis=0)
513
554
  if (np.any(atom_boundary_max > 1) or np.any(atom_boundary_min < -1)):
@@ -542,11 +583,12 @@ def get_lattice_Ls(cell, nimgs=None, rcut=None, dimension=None, discard=True):
542
583
  np.arange(-bounds[2], bounds[2]+1)))
543
584
  Ls = np.dot(Ts[:,:dimension], a[:dimension])
544
585
 
545
- ovlp_penalty += 1e-200 # avoid /0
546
- Ts_scaled = (Ts[:,:dimension] + 1e-200) / ovlp_penalty
547
- ovlp_penalty_fac = 1. / abs(Ts_scaled).min(axis=1)
548
- Ls_mask = np.linalg.norm(Ls, axis=1) * (1-ovlp_penalty_fac) < rcut
549
- Ls = Ls[Ls_mask]
586
+ if discard:
587
+ ovlp_penalty += 1e-200 # avoid /0
588
+ Ts_scaled = (Ts[:,:dimension] + 1e-200) / ovlp_penalty
589
+ ovlp_penalty_fac = 1. / abs(Ts_scaled).min(axis=1)
590
+ Ls_mask = np.linalg.norm(Ls, axis=1) * (1-ovlp_penalty_fac) < rcut
591
+ Ls = Ls[Ls_mask]
550
592
  return np.asarray(Ls, order='C')
551
593
 
552
594
 
@@ -590,8 +632,10 @@ def super_cell(cell, ncopy, wrap_around=False):
590
632
  supcell.a = np.einsum('i,ij->ij', ncopy, a)
591
633
  mesh = np.asarray(ncopy) * np.asarray(cell.mesh)
592
634
  supcell.mesh = (mesh // 2) * 2 + 1
593
- supcell.magmom = np.repeat(np.asarray(cell.magmom).reshape(1,-1),
594
- np.prod(ncopy), axis=0).ravel()
635
+ if isinstance(cell.magmom, np.ndarray):
636
+ supcell.magmom = cell.magmom.tolist() * np.prod(ncopy)
637
+ else:
638
+ supcell.magmom = cell.magmom * np.prod(ncopy)
595
639
  return _build_supcell_(supcell, cell, Ls)
596
640
 
597
641
 
@@ -632,6 +676,7 @@ def _build_supcell_(supcell, cell, Ls):
632
676
  x, y, z = coords.T
633
677
  supcell.atom = supcell._atom = list(zip(symbs, zip(x, y, z)))
634
678
  supcell.unit = 'B'
679
+ supcell.enuc = None # reset nuclear energy
635
680
 
636
681
  # Do not call supcell.build() to initialize supcell since it may normalize
637
682
  # the basis contraction coefficients
pyscf/pbc/x2c/sfx2c1e.py CHANGED
@@ -82,7 +82,7 @@ class SFX2C1E_SCF(x2c._X2C_SCF):
82
82
 
83
83
  __name_mixin__ = 'sfX2C1e'
84
84
 
85
- _keys = set(['with_x2c'])
85
+ _keys = {'with_x2c'}
86
86
 
87
87
  def __init__(self, mf):
88
88
  self.__dict__.update(mf.__dict__)
pyscf/pbc/x2c/x2c1e.py CHANGED
@@ -84,7 +84,7 @@ class X2C1E_GSCF(x2c._X2C_SCF):
84
84
 
85
85
  __name_mixin__ = 'X2C1e'
86
86
 
87
- _keys = set(['with_x2c'])
87
+ _keys = {'with_x2c'}
88
88
 
89
89
  def __init__(self, mf):
90
90
  self.__dict__.update(mf.__dict__)
pyscf/post_scf.py CHANGED
@@ -3,3 +3,6 @@ try:
3
3
  from . import doci
4
4
  except ImportError:
5
5
  pass
6
+
7
+ # Note the agf2 module implicitly import mpi4py. This module should not be
8
+ # automatically imported until the dependency to mpi4py is completely removed.
pyscf/qmmm/itrf.py CHANGED
@@ -116,7 +116,7 @@ class QMMM:
116
116
  _QMMM = QMMM
117
117
 
118
118
  class QMMMSCF(QMMM):
119
- _keys = set(['mm_mol'])
119
+ _keys = {'mm_mol'}
120
120
 
121
121
  def __init__(self, method, mm_mol=None):
122
122
  self.__dict__.update(method.__dict__)
@@ -188,6 +188,11 @@ class QMMMSCF(QMMM):
188
188
  nuc += q2*(charges/r).sum()
189
189
  return nuc
190
190
 
191
+ def to_gpu(self):
192
+ obj = self.undo_qmmm().to_gpu()
193
+ obj = qmmm_for_scf(obj, self.mm_mol)
194
+ return lib.to_gpu(self, obj)
195
+
191
196
  def nuc_grad_method(self):
192
197
  scf_grad = super().nuc_grad_method()
193
198
  return qmmm_grad_for_scf(scf_grad)
@@ -207,6 +212,8 @@ class QMMMPostSCF(QMMM):
207
212
  obj._scf = self._scf.undo_qmmm()
208
213
  return obj
209
214
 
215
+ to_gpu = QMMMSCF.to_gpu
216
+
210
217
 
211
218
  def add_mm_charges_grad(scf_grad, atoms_or_coords, charges, radii=None, unit=None):
212
219
  '''Apply the MM charges in the QM gradients' method. It affects both the
@@ -396,6 +403,11 @@ class QMMMGrad:
396
403
  g_mm += q1 * numpy.einsum('i,ix,i->ix', charges, r1-coords, 1/r**3)
397
404
  return g_mm
398
405
 
406
+ def to_gpu(self):
407
+ obj = self.undo_qmmm().to_gpu()
408
+ obj = qmmm_grad_for_scf(obj)
409
+ return lib.to_gpu(self, obj)
410
+
399
411
  _QMMMGrad = QMMMGrad
400
412
 
401
413
  # Inject QMMM interface wrapper to other modules
pyscf/scf/__init__.py CHANGED
@@ -92,7 +92,7 @@ Saved results
92
92
  SCF converged or not
93
93
  e_tot : float
94
94
  Total HF energy (electronic energy plus nuclear repulsion)
95
- mo_energy :
95
+ mo_energy :
96
96
  Orbital energies
97
97
  mo_occ
98
98
  Orbital occupancy
@@ -115,6 +115,7 @@ from pyscf.scf import dhf
115
115
  from pyscf.scf import chkfile
116
116
  from pyscf.scf import addons
117
117
  from pyscf.scf import diis
118
+ from pyscf.scf import dispersion
118
119
  from pyscf.scf.diis import DIIS, CDIIS, EDIIS, ADIIS
119
120
  from pyscf.scf.uhf import spin_square
120
121
  from pyscf.scf.hf import get_init_guess
@@ -199,6 +200,7 @@ def X2C(mol, *args):
199
200
  return x2c.RHF(mol, *args)
200
201
  else:
201
202
  return x2c.UHF(mol, *args)
203
+ X2C_HF = X2C
202
204
  gto.Mole.X2C = gto.Mole.X2C_HF = property(X2C)
203
205
 
204
206
  def sfx2c1e(mf):
@@ -36,7 +36,7 @@ def _gen_rhf_response(mf, mo_coeff=None, mo_occ=None,
36
36
  orbital hessian or CPHF will be generated. If singlet is boolean,
37
37
  it is used in TDDFT response kernel.
38
38
  '''
39
- assert (not isinstance(mf, (uhf.UHF, rohf.ROHF)))
39
+ assert isinstance(mf, hf.RHF) and not isinstance(mf, (uhf.UHF, rohf.ROHF))
40
40
 
41
41
  if mo_coeff is None: mo_coeff = mf.mo_coeff
42
42
  if mo_occ is None: mo_occ = mf.mo_occ
@@ -45,7 +45,7 @@ def _gen_rhf_response(mf, mo_coeff=None, mo_occ=None,
45
45
  from pyscf.dft import numint
46
46
  ni = mf._numint
47
47
  ni.libxc.test_deriv_order(mf.xc, 2, raise_error=True)
48
- if mf.nlc or ni.libxc.is_nlc(mf.xc):
48
+ if mf.do_nlc():
49
49
  logger.warn(mf, 'NLC functional found in DFT object. Its second '
50
50
  'deriviative is not available. Its contribution is '
51
51
  'not included in the response function.')
@@ -148,13 +148,14 @@ def _gen_uhf_response(mf, mo_coeff=None, mo_occ=None,
148
148
  '''Generate a function to compute the product of UHF response function and
149
149
  UHF density matrices.
150
150
  '''
151
+ assert isinstance(mf, (uhf.UHF, rohf.ROHF))
151
152
  if mo_coeff is None: mo_coeff = mf.mo_coeff
152
153
  if mo_occ is None: mo_occ = mf.mo_occ
153
154
  mol = mf.mol
154
155
  if isinstance(mf, hf.KohnShamDFT):
155
156
  ni = mf._numint
156
157
  ni.libxc.test_deriv_order(mf.xc, 2, raise_error=True)
157
- if mf.nlc or ni.libxc.is_nlc(mf.xc):
158
+ if mf.do_nlc():
158
159
  logger.warn(mf, 'NLC functional found in DFT object. Its second '
159
160
  'deriviative is not available. Its contribution is '
160
161
  'not included in the response function.')
@@ -227,7 +228,7 @@ def _gen_ghf_response(mf, mo_coeff=None, mo_occ=None,
227
228
  ni = mf._numint
228
229
  assert isinstance(ni, (numint2c.NumInt2C, r_numint.RNumInt))
229
230
  ni.libxc.test_deriv_order(mf.xc, 2, raise_error=True)
230
- if mf.nlc or ni.libxc.is_nlc(mf.xc):
231
+ if mf.do_nlc():
231
232
  raise NotImplementedError('NLC')
232
233
  omega, alpha, hyb = ni.rsh_and_hybrid_coeff(mf.xc, mol.spin)
233
234
  hybrid = ni.libxc.is_hybrid_xc(mf.xc)