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/__init__.py CHANGED
@@ -35,7 +35,7 @@ to try out the package::
35
35
 
36
36
  '''
37
37
 
38
- __version__ = '2.4.0'
38
+ __version__ = '2.6.0'
39
39
 
40
40
  import os
41
41
  import sys
pyscf/adc/__init__.py CHANGED
@@ -23,7 +23,6 @@ Algebraic Diagrammatic Construction
23
23
  ===================================
24
24
  '''
25
25
 
26
- from pyscf import scf
27
26
  from pyscf import lib
28
27
  from pyscf.adc import uadc
29
28
  from pyscf.adc import radc
@@ -41,15 +40,15 @@ def ADC(mf, frozen=None, mo_coeff=None, mo_occ=None):
41
40
  if not (frozen is None or frozen == 0):
42
41
  raise NotImplementedError
43
42
 
44
- if isinstance(mf, scf.uhf.UHF):
43
+ if mf.istype('UHF'):
45
44
  return UADC(mf, frozen, mo_coeff, mo_occ)
46
45
  #elif isinstance(mf, scf.rohf.ROHF):
47
46
  # lib.logger.warn(mf, 'RADC method does not support ROHF reference. ROHF object '
48
47
  # 'is converted to UHF object and UADC method is called.')
49
- # mf = scf.addons.convert_to_uhf(mf)
48
+ # mf = mf.to_uhf(mf)
50
49
  # return UADC(mf, frozen, mo_coeff, mo_occ)
51
50
  # TODO add ROHF functionality
52
- elif isinstance(mf, scf.rhf.RHF):
51
+ elif mf.istype('RHF'):
53
52
  return RADC(mf, frozen, mo_coeff, mo_occ)
54
53
  else :
55
54
  raise RuntimeError('ADC code only supports RHF, ROHF, and UHF references')
@@ -62,10 +61,9 @@ def UADC(mf, frozen=None, mo_coeff=None, mo_occ=None):
62
61
  if not (frozen is None or frozen == 0):
63
62
  raise NotImplementedError
64
63
 
65
- from pyscf.soscf import newton_ah
66
-
67
- if isinstance(mf, newton_ah._CIAH_SOSCF) or not isinstance(mf, scf.uhf.UHF):
68
- mf = scf.addons.convert_to_uhf(mf)
64
+ mf = mf.remove_soscf()
65
+ if not mf.istype('UHF'):
66
+ mf = mf.to_uhf()
69
67
 
70
68
  return uadc.UADC(mf, frozen, mo_coeff, mo_occ)
71
69
 
@@ -77,10 +75,9 @@ def RADC(mf, frozen=None, mo_coeff=None, mo_occ=None):
77
75
  if not (frozen is None or frozen == 0):
78
76
  raise NotImplementedError
79
77
 
80
- from pyscf.soscf import newton_ah
81
-
82
- if isinstance(mf, newton_ah._CIAH_SOSCF) or not isinstance(mf, scf.rhf.RHF):
83
- mf = scf.addons.convert_to_rhf(mf)
78
+ mf = mf.remove_soscf()
79
+ if not mf.istype('RHF'):
80
+ mf = mf.to_rhf()
84
81
 
85
82
  return radc.RADC(mf, frozen, mo_coeff, mo_occ)
86
83
 
pyscf/adc/radc.py CHANGED
@@ -111,7 +111,7 @@ class RADC(lib.StreamObject):
111
111
  blkmin = getattr(__config__, 'adc_radc_RADC_blkmin', 4)
112
112
  memorymin = getattr(__config__, 'adc_radc_RADC_memorymin', 2000)
113
113
 
114
- _keys = set((
114
+ _keys = {
115
115
  'tol_residual','conv_tol', 'e_corr', 'method', 'mo_coeff',
116
116
  'mol', 'mo_energy', 'incore_complete',
117
117
  'scf_energy', 'e_tot', 't1', 'frozen', 'chkfile',
@@ -119,7 +119,7 @@ class RADC(lib.StreamObject):
119
119
  'imds', 'method', 'method_type', 'with_df', 'compute_properties',
120
120
  'approx_trans_moments', 'evec_print_tol', 'spec_factor_print_tol',
121
121
  'ncvs', 'E', 'U', 'P', 'X',
122
- ))
122
+ }
123
123
 
124
124
  def __init__(self, mf, frozen=0, mo_coeff=None, mo_occ=None):
125
125
  from pyscf import gto
pyscf/adc/radc_ea.py CHANGED
@@ -966,13 +966,13 @@ class RADCEA(radc.RADC):
966
966
  Spectroscopic amplitudes for each EA transition.
967
967
  '''
968
968
 
969
- _keys = set((
969
+ _keys = {
970
970
  'tol_residual','conv_tol', 'e_corr', 'method', 'mo_coeff',
971
971
  'mo_energy', 't1', 'max_space', 't2', 'max_cycle',
972
972
  'nmo', 'transform_integrals', 'with_df', 'compute_properties',
973
973
  'approx_trans_moments', 'E', 'U', 'P', 'X',
974
974
  'evec_print_tol', 'spec_factor_print_tol',
975
- ))
975
+ }
976
976
 
977
977
  def __init__(self, adc):
978
978
  self.mol = adc.mol
pyscf/adc/radc_ip.py CHANGED
@@ -921,14 +921,14 @@ class RADCIP(radc.RADC):
921
921
  Spectroscopic amplitudes for each IP transition.
922
922
  '''
923
923
 
924
- _keys = set((
924
+ _keys = {
925
925
  'tol_residual','conv_tol', 'e_corr', 'method', 'mo_coeff',
926
926
  'mo_energy_b', 't1', 'mo_energy_a',
927
927
  'max_space', 't2', 'max_cycle',
928
928
  'nmo', 'transform_integrals', 'with_df', 'compute_properties',
929
929
  'approx_trans_moments', 'E', 'U', 'P', 'X',
930
930
  'evec_print_tol', 'spec_factor_print_tol',
931
- ))
931
+ }
932
932
 
933
933
  def __init__(self, adc):
934
934
  self.mol = adc.mol
pyscf/adc/radc_ip_cvs.py CHANGED
@@ -938,14 +938,14 @@ class RADCIPCVS(radc.RADC):
938
938
  Spectroscopic amplitudes for each IP transition.
939
939
  '''
940
940
 
941
- _keys = set((
941
+ _keys = {
942
942
  'tol_residual','conv_tol', 'e_corr', 'method', 'mo_coeff',
943
943
  'mo_energy_b', 't1', 'mo_energy_a',
944
944
  'max_space', 't2', 'max_cycle',
945
945
  'nmo', 'transform_integrals', 'with_df', 'compute_properties',
946
946
  'approx_trans_moments', 'E', 'U', 'P', 'X',
947
947
  'evec_print_tol', 'spec_factor_print_tol', 'ncvs',
948
- ))
948
+ }
949
949
 
950
950
  def __init__(self, adc):
951
951
  self.mol = adc.mol
pyscf/adc/uadc.py CHANGED
@@ -113,7 +113,7 @@ class UADC(lib.StreamObject):
113
113
  '''
114
114
  incore_complete = getattr(__config__, 'adc_uadc_UADC_incore_complete', False)
115
115
 
116
- _keys = set((
116
+ _keys = {
117
117
  'tol_residual','conv_tol', 'e_corr', 'method',
118
118
  'method_type', 'mo_coeff', 'mol', 'mo_energy_b',
119
119
  'scf_energy', 'e_tot', 't1', 'frozen',
@@ -122,7 +122,7 @@ class UADC(lib.StreamObject):
122
122
  'compute_mpn_energy', 'compute_spec', 'compute_properties',
123
123
  'approx_trans_moments', 'evec_print_tol', 'spec_factor_print_tol',
124
124
  'E', 'U', 'P', 'X', 'ncvs',
125
- ))
125
+ }
126
126
 
127
127
  def __init__(self, mf, frozen=None, mo_coeff=None, mo_occ=None):
128
128
  from pyscf import gto
pyscf/adc/uadc_ea.py CHANGED
@@ -1960,7 +1960,7 @@ class UADCEA(uadc.UADC):
1960
1960
  Spectroscopic amplitudes for each EA transition.
1961
1961
  '''
1962
1962
 
1963
- _keys = set((
1963
+ _keys = {
1964
1964
  'tol_residual','conv_tol', 'e_corr', 'method',
1965
1965
  'method_type', 'mo_coeff', 'mo_energy_b', 'max_memory',
1966
1966
  't1', 'mo_energy_a', 'max_space', 't2', 'max_cycle',
@@ -1968,7 +1968,7 @@ class UADCEA(uadc.UADC):
1968
1968
  'mo_energy_b', 'nmo_a', 'nmo_b', 'mol', 'transform_integrals',
1969
1969
  'with_df', 'spec_factor_print_tol', 'evec_print_tol',
1970
1970
  'compute_properties', 'approx_trans_moments', 'E', 'U', 'P', 'X',
1971
- ))
1971
+ }
1972
1972
 
1973
1973
  def __init__(self, adc):
1974
1974
  self.verbose = adc.verbose
pyscf/adc/uadc_ip.py CHANGED
@@ -1838,7 +1838,7 @@ class UADCIP(uadc.UADC):
1838
1838
  Spectroscopic amplitudes for each IP transition.
1839
1839
  '''
1840
1840
 
1841
- _keys = set((
1841
+ _keys = {
1842
1842
  'tol_residual','conv_tol', 'e_corr', 'method',
1843
1843
  'method_type', 'mo_coeff', 'mo_energy_b', 'max_memory',
1844
1844
  't1', 'mo_energy_a', 'max_space', 't2', 'max_cycle',
@@ -1846,7 +1846,7 @@ class UADCIP(uadc.UADC):
1846
1846
  'mo_energy_b', 'nmo_a', 'nmo_b', 'mol', 'transform_integrals',
1847
1847
  'with_df', 'spec_factor_print_tol', 'evec_print_tol',
1848
1848
  'compute_properties', 'approx_trans_moments', 'E', 'U', 'P', 'X',
1849
- ))
1849
+ }
1850
1850
 
1851
1851
  def __init__(self, adc):
1852
1852
  self.verbose = adc.verbose
pyscf/adc/uadc_ip_cvs.py CHANGED
@@ -2035,7 +2035,7 @@ class UADCIPCVS(uadc.UADC):
2035
2035
  Spectroscopic amplitudes for each IP transition.
2036
2036
  '''
2037
2037
 
2038
- _keys = set((
2038
+ _keys = {
2039
2039
  'tol_residual','conv_tol', 'e_corr', 'method',
2040
2040
  'method_type', 'mo_coeff', 'mo_energy_b', 'max_memory',
2041
2041
  't1', 'mo_energy_a', 'max_space', 't2', 'max_cycle',
@@ -2043,7 +2043,7 @@ class UADCIPCVS(uadc.UADC):
2043
2043
  'mo_energy_b', 'nmo_a', 'nmo_b', 'mol', 'transform_integrals',
2044
2044
  'with_df', 'spec_factor_print_tol', 'evec_print_tol', 'ncvs',
2045
2045
  'compute_properties', 'approx_trans_moments', 'E', 'U', 'P', 'X',
2046
- ))
2046
+ }
2047
2047
 
2048
2048
  def __init__(self, adc):
2049
2049
  self.verbose = adc.verbose
pyscf/agf2/__init__.py CHANGED
@@ -102,7 +102,7 @@ def AGF2(mf, nmom=(None,0), frozen=None, mo_energy=None, mo_coeff=None, mo_occ=N
102
102
  elif isinstance(mf, scf.rohf.ROHF):
103
103
  lib.logger.warn(mf, 'RAGF2 method does not support ROHF reference. '
104
104
  'Converting to UHF and using UAGF2.')
105
- mf = scf.addons.convert_to_uhf(mf)
105
+ mf = mf.to_uhf()
106
106
  return UAGF2(mf, nmom, frozen, mo_energy, mo_coeff, mo_occ)
107
107
 
108
108
  elif isinstance(mf, scf.rhf.RHF):
pyscf/agf2/chempot.py CHANGED
@@ -154,8 +154,8 @@ def minimize_chempot(se, fock, nelec, occupancy=2, x0=0.0, tol=1e-6, maxiter=200
154
154
  buf = np.zeros((se.nphys+se.naux, se.nphys+se.naux), dtype=dtype)
155
155
  fargs = (se, fock, nelec, occupancy, buf)
156
156
 
157
- options = dict(maxiter=maxiter, ftol=tol, xtol=tol, gtol=tol)
158
- kwargs = dict(x0=x0, method='TNC', jac=jac, options=options)
157
+ options = {'maxiter': maxiter, 'ftol': tol, 'xtol': tol, 'gtol': tol}
158
+ kwargs = {'x0': x0, 'method': 'TNC', 'jac': jac, 'options': options}
159
159
  fun = _objective if not jac else _gradient
160
160
 
161
161
  opt = optimize.minimize(fun, args=fargs, **kwargs)
pyscf/agf2/dfragf2.py CHANGED
@@ -67,7 +67,7 @@ def build_se_part(agf2, eri, gf_occ, gf_vir, os_factor=1.0, ss_factor=1.0):
67
67
  nocc, nvir = gf_occ.naux, gf_vir.naux
68
68
  naux = agf2.with_df.get_naoaux()
69
69
  tol = agf2.weight_tol
70
- facs = dict(os_factor=os_factor, ss_factor=ss_factor)
70
+ facs = {'os_factor': os_factor, 'ss_factor': ss_factor}
71
71
 
72
72
  ei, ci = gf_occ.energy, gf_occ.coupling
73
73
  ea, ca = gf_vir.energy, gf_vir.coupling
@@ -258,7 +258,7 @@ class DFRAGF2(ragf2.RAGF2):
258
258
  Auxiliaries of the Green's function
259
259
  '''
260
260
 
261
- _keys = set(['_with_df', 'allow_lowmem_build'])
261
+ _keys = {'_with_df', 'allow_lowmem_build'}
262
262
 
263
263
  def __init__(self, mf, frozen=None, mo_energy=None, mo_coeff=None, mo_occ=None):
264
264
  ragf2.RAGF2.__init__(self, mf, frozen=frozen, mo_energy=mo_energy,
@@ -335,7 +335,7 @@ def _make_mo_eris_incore(agf2, mo_coeff=None):
335
335
  qxy = np.zeros((naux, npair))
336
336
  mo = np.asarray(eris.mo_coeff, order='F')
337
337
  sij = (0, nmo, 0, nmo)
338
- sym = dict(aosym='s2', mosym='s2')
338
+ sym = {'aosym': 's2', 'mosym': 's2'}
339
339
 
340
340
  for p0, p1 in with_df.prange():
341
341
  eri0 = with_df._cderi[p0:p1]
@@ -370,7 +370,7 @@ def _make_qmo_eris_incore(agf2, eri, coeffs):
370
370
 
371
371
  xisym, nxi, cxi, sxi = ao2mo.incore._conc_mos(cx, ci, compact=False)
372
372
  jasym, nja, cja, sja = ao2mo.incore._conc_mos(cj, ca, compact=False)
373
- sym = dict(aosym='s2', mosym='s1')
373
+ sym = {'aosym': 's2', 'mosym': 's1'}
374
374
 
375
375
  qxi = np.zeros((naux, nxi))
376
376
  qja = np.zeros((naux, nja))
pyscf/agf2/dfuagf2.py CHANGED
@@ -70,7 +70,7 @@ def build_se_part(agf2, eri, gf_occ, gf_vir, os_factor=1.0, ss_factor=1.0):
70
70
  noccb, nvirb = gf_occ[1].naux, gf_vir[1].naux
71
71
  naux = agf2.with_df.get_naoaux()
72
72
  tol = agf2.weight_tol
73
- facs = dict(os_factor=os_factor, ss_factor=ss_factor)
73
+ facs = {'os_factor': os_factor, 'ss_factor': ss_factor}
74
74
 
75
75
  ci_a, ei_a = gf_occ[0].coupling, gf_occ[0].energy
76
76
  ci_b, ei_b = gf_occ[1].coupling, gf_occ[1].energy
@@ -209,7 +209,7 @@ class DFUAGF2(uagf2.UAGF2):
209
209
  Auxiliaries of the Green's function for each spin
210
210
  '''
211
211
 
212
- _keys = set(['_with_df', 'allow_lowmem_build'])
212
+ _keys = {'_with_df', 'allow_lowmem_build'}
213
213
 
214
214
  def __init__(self, mf, frozen=None, mo_energy=None, mo_coeff=None, mo_occ=None):
215
215
  uagf2.UAGF2.__init__(self, mf, frozen=frozen, mo_energy=mo_energy,
@@ -277,7 +277,7 @@ def _make_mo_eris_incore(agf2, mo_coeff=None):
277
277
  mob = np.asarray(mob, order='F')
278
278
  sija = (0, nmoa, 0, nmoa)
279
279
  sijb = (0, nmob, 0, nmob)
280
- sym = dict(aosym='s2', mosym='s2')
280
+ sym = {'aosym': 's2', 'mosym': 's2'}
281
281
 
282
282
  for p0, p1 in with_df.prange():
283
283
  eri0 = with_df._cderi[p0:p1]
@@ -324,7 +324,7 @@ def _make_qmo_eris_incore(agf2, eri, coeffs_a, coeffs_b):
324
324
  jasym_a, nja_a, cja_a, sja_a = ao2mo.incore._conc_mos(cja, caa, compact=False)
325
325
  xisym_b, nxi_b, cxi_b, sxi_b = ao2mo.incore._conc_mos(cxb, cib, compact=False)
326
326
  jasym_b, nja_b, cja_b, sja_b = ao2mo.incore._conc_mos(cjb, cab, compact=False)
327
- sym = dict(aosym='s2', mosym='s1')
327
+ sym = {'aosym': 's2', 'mosym': 's1'}
328
328
 
329
329
  qxi_a = np.zeros((naux, nxi_a))
330
330
  qxi_b = np.zeros((naux, nxi_b))
pyscf/agf2/ragf2.py CHANGED
@@ -150,7 +150,7 @@ def build_se_part(agf2, eri, gf_occ, gf_vir, os_factor=1.0, ss_factor=1.0):
150
150
 
151
151
  nmo = eri.nmo
152
152
  tol = agf2.weight_tol
153
- facs = dict(os_factor=os_factor, ss_factor=ss_factor)
153
+ facs = {'os_factor': os_factor, 'ss_factor': ss_factor}
154
154
 
155
155
  ci, ei = gf_occ.coupling, gf_occ.energy
156
156
  ca, ea = gf_vir.coupling, gf_vir.energy
@@ -304,7 +304,7 @@ def fock_loop(agf2, eri, gf, se):
304
304
  nqmo = nmo + naux
305
305
  buf = np.zeros((nqmo, nqmo))
306
306
  converged = False
307
- opts = dict(tol=agf2.conv_tol_nelec, maxiter=agf2.max_cycle_inner)
307
+ opts = {'tol': agf2.conv_tol_nelec, 'maxiter': agf2.max_cycle_inner}
308
308
  rdm1_prev = 0
309
309
 
310
310
  for niter1 in range(1, agf2.max_cycle_outer+1):
@@ -507,7 +507,7 @@ class RAGF2(lib.StreamObject):
507
507
  async_io = getattr(__config__, 'agf2_async_io', True)
508
508
  incore_complete = getattr(__config__, 'agf2_incore_complete', False)
509
509
 
510
- _keys = set((
510
+ _keys = {
511
511
  'async_io', 'mol', 'incore_complete',
512
512
  'conv_tol', 'conv_tol_rdm1', 'conv_tol_nelec', 'max_cycle',
513
513
  'max_cycle_outer', 'max_cycle_inner', 'weight_tol', 'fock_diis_space',
@@ -515,7 +515,7 @@ class RAGF2(lib.StreamObject):
515
515
  'os_factor', 'ss_factor', 'damping',
516
516
  'mo_energy', 'mo_coeff', 'mo_occ', 'se', 'gf', 'e_1b', 'e_2b', 'e_init',
517
517
  'frozen', 'converged', 'chkfile',
518
- ))
518
+ }
519
519
 
520
520
  def __init__(self, mf, frozen=None, mo_energy=None, mo_coeff=None, mo_occ=None):
521
521
 
@@ -697,7 +697,7 @@ class RAGF2(lib.StreamObject):
697
697
  if os_factor is None: os_factor = self.os_factor
698
698
  if ss_factor is None: ss_factor = self.ss_factor
699
699
 
700
- facs = dict(os_factor=os_factor, ss_factor=ss_factor)
700
+ facs = {'os_factor': os_factor, 'ss_factor': ss_factor}
701
701
  gf_occ = gf.get_occupied()
702
702
  gf_vir = gf.get_virtual()
703
703
 
pyscf/agf2/ragf2_slow.py CHANGED
@@ -177,7 +177,7 @@ class RAGF2(ragf2.RAGF2):
177
177
  Auxiliaries of the Green's function
178
178
  '''
179
179
 
180
- _keys = set(['nmom'])
180
+ _keys = {'nmom'}
181
181
 
182
182
  def __init__(self, mf, nmom=(None,0), frozen=None, mo_energy=None, mo_coeff=None, mo_occ=None):
183
183
 
@@ -222,7 +222,7 @@ class RAGF2(ragf2.RAGF2):
222
222
  if os_factor is None: os_factor = self.os_factor
223
223
  if ss_factor is None: ss_factor = self.ss_factor
224
224
 
225
- facs = dict(os_factor=os_factor, ss_factor=ss_factor)
225
+ facs = {'os_factor': os_factor, 'ss_factor': ss_factor}
226
226
  gf_occ = gf.get_occupied()
227
227
  gf_vir = gf.get_virtual()
228
228
 
pyscf/agf2/uagf2.py CHANGED
@@ -73,7 +73,7 @@ def build_se_part(agf2, eri, gf_occ, gf_vir, os_factor=1.0, ss_factor=1.0):
73
73
  noa, nob = gf_occ[0].naux, gf_occ[1].naux
74
74
  nva, nvb = gf_vir[0].naux, gf_vir[1].naux
75
75
  tol = agf2.weight_tol
76
- facs = dict(os_factor=os_factor, ss_factor=ss_factor)
76
+ facs = {'os_factor': os_factor, 'ss_factor': ss_factor}
77
77
 
78
78
  ci_a, ei_a = gf_occ[0].coupling, gf_occ[0].energy
79
79
  ci_b, ei_b = gf_occ[1].coupling, gf_occ[1].energy
@@ -206,7 +206,7 @@ def fock_loop(agf2, eri, gf, se):
206
206
  rdm1a_prev = 0
207
207
  rdm1b_prev = 0
208
208
  converged = False
209
- opts = dict(tol=agf2.conv_tol_nelec, maxiter=agf2.max_cycle_inner)
209
+ opts = {'tol': agf2.conv_tol_nelec, 'maxiter': agf2.max_cycle_inner}
210
210
 
211
211
  for niter1 in range(1, agf2.max_cycle_outer+1):
212
212
  sea, opt = minimize_chempot(sea, focka, nalph, x0=sea.chempot,
@@ -557,7 +557,7 @@ class UAGF2(ragf2.RAGF2):
557
557
  if os_factor is None: os_factor = self.os_factor
558
558
  if ss_factor is None: ss_factor = self.ss_factor
559
559
 
560
- facs = dict(os_factor=os_factor, ss_factor=ss_factor)
560
+ facs = {'os_factor': os_factor, 'ss_factor': ss_factor}
561
561
  gf_occ = (gf[0].get_occupied(), gf[1].get_occupied())
562
562
  gf_vir = (gf[0].get_virtual(), gf[1].get_virtual())
563
563
 
pyscf/agf2/uagf2_slow.py CHANGED
@@ -205,7 +205,7 @@ class UAGF2(uagf2.UAGF2):
205
205
  Auxiliaries of the Green's function for each spin
206
206
  '''
207
207
 
208
- _keys = set(['nmom'])
208
+ _keys = {'nmom'}
209
209
 
210
210
  def __init__(self, mf, nmom=(None,0), frozen=None, mo_energy=None, mo_coeff=None, mo_occ=None):
211
211
 
@@ -250,7 +250,7 @@ class UAGF2(uagf2.UAGF2):
250
250
  if os_factor is None: os_factor = self.os_factor
251
251
  if ss_factor is None: ss_factor = self.ss_factor
252
252
 
253
- facs = dict(os_factor=os_factor, ss_factor=ss_factor)
253
+ facs = {'os_factor': os_factor, 'ss_factor': ss_factor}
254
254
  gf_occ = (gf[0].get_occupied(), gf[1].get_occupied())
255
255
  gf_vir = (gf[0].get_virtual(), gf[1].get_virtual())
256
256
 
pyscf/ao2mo/outcore.py CHANGED
@@ -486,16 +486,16 @@ def _load_from_h5g(h5group, row0, row1, out=None):
486
486
  out = numpy.ndarray((row1-row0, ncol), dat.dtype, buffer=out)
487
487
  col1 = 0
488
488
  for key in range(nkeys):
489
- dat = h5group[str(key)][row0:row1]
490
- col0, col1 = col1, col1 + dat.shape[1]
491
- out[:,col0:col1] = dat
489
+ col0, col1 = col1, col1 + h5group[str(key)].shape[1]
490
+ h5group[str(key)].read_direct(out, dest_sel=numpy.s_[:,col0:col1],
491
+ source_sel=numpy.s_[row0:row1])
492
492
  else: # multiple components
493
493
  out = numpy.ndarray((dat.shape[0], row1-row0, ncol), dat.dtype, buffer=out)
494
494
  col1 = 0
495
495
  for key in range(nkeys):
496
- dat = h5group[str(key)][:,row0:row1]
497
- col0, col1 = col1, col1 + dat.shape[2]
498
- out[:,:,col0:col1] = dat
496
+ col0, col1 = col1, col1 + h5group[str(key)].shape[2]
497
+ h5group[str(key)].read_direct(out, dest_sel=numpy.s_[:,:,col0:col1],
498
+ source_sel=numpy.s_[:,row0:row1])
499
499
  return out
500
500
 
501
501
  def _transpose_to_h5g(h5group, key, dat, blksize, chunks=None):
pyscf/cc/__init__.py CHANGED
@@ -75,13 +75,12 @@ from pyscf.cc import eom_rccsd
75
75
  from pyscf.cc import eom_uccsd
76
76
  from pyscf.cc import eom_gccsd
77
77
  from pyscf.cc import qcisd
78
- from pyscf.cc import momgfccsd
79
78
  from pyscf import scf
80
79
 
81
80
  def CCSD(mf, frozen=None, mo_coeff=None, mo_occ=None):
82
- if isinstance(mf, scf.uhf.UHF):
81
+ if mf.istype('UHF'):
83
82
  return UCCSD(mf, frozen, mo_coeff, mo_occ)
84
- elif isinstance(mf, scf.ghf.GHF):
83
+ elif mf.istype('GHF'):
85
84
  return GCCSD(mf, frozen, mo_coeff, mo_occ)
86
85
  else:
87
86
  return RCCSD(mf, frozen, mo_coeff, mo_occ)
@@ -93,21 +92,22 @@ scf.hf.SCF.CCSD = CCSD
93
92
  def RCCSD(mf, frozen=None, mo_coeff=None, mo_occ=None):
94
93
  import numpy
95
94
  from pyscf import lib
96
- from pyscf.soscf import newton_ah
95
+ from pyscf.df.df_jk import _DFHF
97
96
  from pyscf.cc import dfccsd
98
97
 
99
- if isinstance(mf, scf.uhf.UHF):
98
+ if mf.istype('UHF'):
100
99
  raise RuntimeError('RCCSD cannot be used with UHF method.')
101
- elif isinstance(mf, scf.rohf.ROHF):
100
+ elif mf.istype('ROHF'):
102
101
  lib.logger.warn(mf, 'RCCSD method does not support ROHF method. ROHF object '
103
102
  'is converted to UHF object and UCCSD method is called.')
104
- mf = scf.addons.convert_to_uhf(mf)
103
+ mf = mf.to_uhf()
105
104
  return UCCSD(mf, frozen, mo_coeff, mo_occ)
106
105
 
107
- if isinstance(mf, newton_ah._CIAH_SOSCF) or not isinstance(mf, scf.hf.RHF):
108
- mf = scf.addons.convert_to_rhf(mf)
106
+ mf = mf.remove_soscf()
107
+ if not mf.istype('RHF'):
108
+ mf = mf.to_rhf()
109
109
 
110
- if getattr(mf, 'with_df', None):
110
+ if isinstance(mf, _DFHF) and mf.with_df:
111
111
  return dfccsd.RCCSD(mf, frozen, mo_coeff, mo_occ)
112
112
 
113
113
  elif numpy.iscomplexobj(mo_coeff) or numpy.iscomplexobj(mf.mo_coeff):
@@ -119,12 +119,13 @@ RCCSD.__doc__ = ccsd.CCSD.__doc__
119
119
 
120
120
 
121
121
  def UCCSD(mf, frozen=None, mo_coeff=None, mo_occ=None):
122
- from pyscf.soscf import newton_ah
122
+ from pyscf.df.df_jk import _DFHF
123
123
 
124
- if isinstance(mf, newton_ah._CIAH_SOSCF) or not isinstance(mf, scf.uhf.UHF):
125
- mf = scf.addons.convert_to_uhf(mf)
124
+ mf = mf.remove_soscf()
125
+ if not mf.istype('UHF'):
126
+ mf = mf.to_uhf()
126
127
 
127
- if getattr(mf, 'with_df', None):
128
+ if isinstance(mf, _DFHF) and mf.with_df:
128
129
  # TODO: DF-UCCSD with memory-efficient particle-particle ladder,
129
130
  # similar to dfccsd.RCCSD
130
131
  return uccsd.UCCSD(mf, frozen, mo_coeff, mo_occ)
@@ -134,12 +135,13 @@ UCCSD.__doc__ = uccsd.UCCSD.__doc__
134
135
 
135
136
 
136
137
  def GCCSD(mf, frozen=None, mo_coeff=None, mo_occ=None):
137
- from pyscf.soscf import newton_ah
138
+ from pyscf.df.df_jk import _DFHF
138
139
 
139
- if isinstance(mf, newton_ah._CIAH_SOSCF) or not isinstance(mf, scf.ghf.GHF):
140
- mf = scf.addons.convert_to_ghf(mf)
140
+ mf = mf.remove_soscf()
141
+ if not mf.istype('GHF'):
142
+ mf = mf.to_ghf()
141
143
 
142
- if getattr(mf, 'with_df', None):
144
+ if isinstance(mf, _DFHF) and mf.with_df:
143
145
  raise NotImplementedError('DF-GCCSD')
144
146
  else:
145
147
  return gccsd.GCCSD(mf, frozen, mo_coeff, mo_occ)
@@ -147,9 +149,9 @@ GCCSD.__doc__ = gccsd.GCCSD.__doc__
147
149
 
148
150
 
149
151
  def QCISD(mf, frozen=None, mo_coeff=None, mo_occ=None):
150
- if isinstance(mf, scf.uhf.UHF):
152
+ if mf.istype('UHF'):
151
153
  raise NotImplementedError
152
- elif isinstance(mf, scf.ghf.GHF):
154
+ elif mf.istype('GHF'):
153
155
  raise NotImplementedError
154
156
  else:
155
157
  return RQCISD(mf, frozen, mo_coeff, mo_occ)
@@ -160,18 +162,17 @@ scf.hf.SCF.QCISD = QCISD
160
162
  def RQCISD(mf, frozen=None, mo_coeff=None, mo_occ=None):
161
163
  import numpy
162
164
  from pyscf import lib
163
- from pyscf.soscf import newton_ah
164
165
 
165
- if isinstance(mf, scf.uhf.UHF):
166
+ if mf.istype('UHF'):
166
167
  raise RuntimeError('RQCISD cannot be used with UHF method.')
167
- elif isinstance(mf, scf.rohf.ROHF):
168
+ elif mf.istype('ROHF'):
168
169
  lib.logger.warn(mf, 'RQCISD method does not support ROHF method. ROHF object '
169
170
  'is converted to UHF object and UQCISD method is called.')
170
- mf = scf.addons.convert_to_uhf(mf)
171
171
  raise NotImplementedError
172
172
 
173
- if isinstance(mf, newton_ah._CIAH_SOSCF) or not isinstance(mf, scf.hf.RHF):
174
- mf = scf.addons.convert_to_rhf(mf)
173
+ mf = mf.remove_soscf()
174
+ if not mf.istype('RHF'):
175
+ mf = mf.to_rhf()
175
176
 
176
177
  elif numpy.iscomplexobj(mo_coeff) or numpy.iscomplexobj(mf.mo_coeff):
177
178
  raise NotImplementedError
@@ -193,15 +194,9 @@ def FNOCCSD(mf, thresh=1e-6, pct_occ=None, nvir_act=None, frozen=None):
193
194
  Number of virtual NOs to keep. Default is None. If present, overrides `thresh` and `pct_occ`.
194
195
  """
195
196
  import numpy
196
- if frozen is None:
197
- frozenocc = 0
198
- else:
199
- assert(isinstance(frozen, (int,numpy.int64)))
200
- frozenocc = frozen
201
197
  from pyscf import mp
202
- pt = mp.MP2(mf).set(verbose=0).run()
198
+ pt = mp.MP2(mf, frozen=frozen).set(verbose=0).run()
203
199
  frozen, no_coeff = pt.make_fno(thresh=thresh, pct_occ=pct_occ, nvir_act=nvir_act)
204
- frozen = numpy.hstack([numpy.arange(frozenocc),frozen])
205
200
  if len(frozen) == 0: frozen = None
206
201
  pt_no = mp.MP2(mf, frozen=frozen, mo_coeff=no_coeff).set(verbose=0).run()
207
202
  mycc = CCSD(mf, frozen=frozen, mo_coeff=no_coeff)
@@ -221,5 +216,3 @@ def FNOCCSD(mf, thresh=1e-6, pct_occ=None, nvir_act=None, frozen=None):
221
216
  return self
222
217
  mycc._finalize = _finalize.__get__(mycc, mycc.__class__)
223
218
  return mycc
224
-
225
- MomGFCCSD = momgfccsd.MomGFCCSD
pyscf/cc/addons.py CHANGED
@@ -122,14 +122,13 @@ def spin2spatial(tx, orbspin):
122
122
  return t2aa,t2ab,t2bb
123
123
 
124
124
  def convert_to_uccsd(mycc):
125
- from pyscf import scf
126
125
  from pyscf.cc import uccsd, gccsd
127
126
  if isinstance(mycc, uccsd.UCCSD):
128
127
  return mycc
129
128
  elif isinstance(mycc, gccsd.GCCSD):
130
129
  raise NotImplementedError
131
130
 
132
- mf = scf.addons.convert_to_uhf(mycc._scf)
131
+ mf = mycc._scf.to_uhf()
133
132
  ucc = uccsd.UCCSD(mf)
134
133
  assert (mycc._nocc is None)
135
134
  assert (mycc._nmo is None)
@@ -143,12 +142,11 @@ def convert_to_uccsd(mycc):
143
142
  return ucc
144
143
 
145
144
  def convert_to_gccsd(mycc):
146
- from pyscf import scf
147
145
  from pyscf.cc import gccsd
148
146
  if isinstance(mycc, gccsd.GCCSD):
149
147
  return mycc
150
148
 
151
- mf = scf.addons.convert_to_ghf(mycc._scf)
149
+ mf = mycc._scf.to_ghf()
152
150
  gcc = gccsd.GCCSD(mf)
153
151
  assert (mycc._nocc is None)
154
152
  assert (mycc._nmo is None)