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.
- pyscf/__init__.py +2 -2
- pyscf/adc/__init__.py +3 -8
- pyscf/adc/dfadc.py +22 -6
- pyscf/adc/radc.py +106 -15
- pyscf/adc/radc_amplitudes.py +7 -1
- pyscf/adc/radc_ao2mo.py +4 -2
- pyscf/adc/radc_ea.py +524 -8
- pyscf/adc/radc_ip.py +492 -60
- pyscf/adc/radc_ip_cvs.py +4 -2
- pyscf/adc/uadc.py +116 -27
- pyscf/adc/uadc_amplitudes.py +215 -20
- pyscf/adc/uadc_ao2mo.py +30 -9
- pyscf/adc/uadc_ea.py +34 -44
- pyscf/adc/uadc_ip.py +9 -4
- pyscf/adc/uadc_ip_cvs.py +4 -1
- pyscf/agf2/__init__.py +2 -2
- pyscf/agf2/aux_space.py +1 -1
- pyscf/agf2/chkfile.py +1 -1
- pyscf/ao2mo/__init__.py +13 -2
- pyscf/ao2mo/_ao2mo.py +10 -1
- pyscf/ao2mo/incore.py +3 -0
- pyscf/ao2mo/nrr_outcore.py +2 -2
- pyscf/ao2mo/outcore.py +9 -7
- pyscf/ao2mo/r_outcore.py +2 -2
- pyscf/cc/__init__.py +21 -3
- pyscf/cc/bccd.py +0 -46
- pyscf/cc/ccsd.py +29 -13
- pyscf/cc/ccsd_rdm.py +6 -1
- pyscf/cc/gccsd.py +2 -2
- pyscf/cc/uccsd.py +7 -7
- pyscf/cc/uccsd_rdm.py +2 -2
- pyscf/data/elements.py +1 -1
- pyscf/df/__init__.py +2 -1
- pyscf/df/addons.py +79 -51
- pyscf/df/autoaux.py +195 -0
- pyscf/df/df.py +5 -1
- pyscf/df/df_jk.py +27 -25
- pyscf/df/grad/casscf.py +0 -41
- pyscf/df/grad/rhf.py +31 -1
- pyscf/df/hessian/rhf.py +2 -10
- pyscf/df/hessian/rks.py +1 -7
- pyscf/df/hessian/uhf.py +3 -13
- pyscf/df/hessian/uks.py +1 -8
- pyscf/df/incore.py +18 -6
- pyscf/df/outcore.py +6 -6
- pyscf/dft/dks.py +1 -1
- pyscf/dft/gks.py +25 -21
- pyscf/dft/libxc.py +91 -645
- pyscf/dft/numint.py +40 -19
- pyscf/dft/radi.py +48 -7
- pyscf/dft/rks.py +29 -25
- pyscf/dft/roks.py +7 -1
- pyscf/dft/uks.py +34 -25
- pyscf/dft/xc_deriv.py +1 -1
- pyscf/dft/xcfun.py +53 -2
- pyscf/eph/eph_fd.py +1 -1
- pyscf/eph/rhf.py +6 -36
- pyscf/eph/rks.py +0 -4
- pyscf/eph/uhf.py +1 -7
- pyscf/eph/uks.py +1 -7
- pyscf/fci/addons.py +117 -2
- pyscf/fci/cistring.py +1 -1
- pyscf/fci/direct_nosym.py +3 -3
- pyscf/fci/direct_spin0_symm.py +22 -43
- pyscf/fci/direct_spin1.py +65 -10
- pyscf/fci/direct_spin1_symm.py +49 -14
- pyscf/fci/direct_uhf.py +4 -4
- pyscf/fci/selected_ci_symm.py +1 -1
- pyscf/grad/ccsd.py +3 -7
- pyscf/grad/ccsd_slow.py +2 -3
- pyscf/grad/lagrange.py +11 -3
- pyscf/grad/mp2.py +13 -4
- pyscf/grad/sacasscf.py +1 -1
- pyscf/grad/tdrks.py +1 -1
- pyscf/grad/uccsd.py +3 -7
- pyscf/grad/ump2.py +2 -4
- pyscf/gto/basis/__init__.py +17 -4
- pyscf/gto/basis/bse.py +68 -15
- pyscf/gto/basis/def2-mtzvp.dat +4719 -0
- pyscf/gto/basis/def2-mtzvpp.dat +4739 -0
- pyscf/gto/basis/dyall-basis/__init__.py +0 -0
- pyscf/gto/basis/dyall-basis/dyall_2zp.py +6492 -0
- pyscf/gto/basis/dyall-basis/dyall_3zp.py +8343 -0
- pyscf/gto/basis/dyall-basis/dyall_4zp.py +10055 -0
- pyscf/gto/basis/dyall-basis/dyall_aae2z.py +1818 -0
- pyscf/gto/basis/dyall-basis/dyall_aae3z.py +2521 -0
- pyscf/gto/basis/dyall-basis/dyall_aae4z.py +3351 -0
- pyscf/gto/basis/dyall-basis/dyall_acv2z.py +1790 -0
- pyscf/gto/basis/dyall-basis/dyall_acv3z.py +2417 -0
- pyscf/gto/basis/dyall-basis/dyall_acv4z.py +3085 -0
- pyscf/gto/basis/dyall-basis/dyall_ae2z.py +6619 -0
- pyscf/gto/basis/dyall-basis/dyall_ae3z.py +9027 -0
- pyscf/gto/basis/dyall-basis/dyall_ae4z.py +11839 -0
- pyscf/gto/basis/dyall-basis/dyall_av2z.py +1742 -0
- pyscf/gto/basis/dyall-basis/dyall_av3z.py +2318 -0
- pyscf/gto/basis/dyall-basis/dyall_av4z.py +2905 -0
- pyscf/gto/basis/dyall-basis/dyall_cv2z.py +6558 -0
- pyscf/gto/basis/dyall-basis/dyall_cv3z.py +8767 -0
- pyscf/gto/basis/dyall-basis/dyall_cv4z.py +11098 -0
- pyscf/gto/basis/dyall-basis/dyall_v2z.py +6472 -0
- pyscf/gto/basis/dyall-basis/dyall_v3z.py +8539 -0
- pyscf/gto/basis/dyall-basis/dyall_v4z.py +10658 -0
- pyscf/gto/basis/ma-def2-qzvp.dat +5959 -0
- pyscf/gto/basis/ma-def2-qzvpp.dat +6195 -0
- pyscf/gto/basis/ma-def2-svp.dat +3504 -0
- pyscf/gto/basis/ma-def2-svpp.dat +3504 -0
- pyscf/gto/basis/ma-def2-tzvp.dat +4347 -0
- pyscf/gto/basis/ma-def2-tzvpp.dat +4549 -0
- pyscf/gto/basis/parse_cp2k.py +8 -7
- pyscf/gto/basis/parse_cp2k_pp.py +1 -1
- pyscf/gto/basis/parse_nwchem.py +26 -11
- pyscf/gto/basis/parse_nwchem_ecp.py +2 -1
- pyscf/gto/basis/sap_grasp_large.dat +2438 -0
- pyscf/gto/basis/sap_grasp_small.dat +1434 -0
- pyscf/gto/eval_gto.py +1 -1
- pyscf/gto/ft_ao.py +6 -6
- pyscf/gto/mole.py +123 -71
- pyscf/gto/moleintor.py +1 -1
- pyscf/gw/gw_ac.py +2 -2
- pyscf/gw/gw_cd.py +2 -2
- pyscf/gw/rpa.py +135 -246
- pyscf/gw/ugw_ac.py +2 -2
- pyscf/gw/urpa.py +80 -131
- pyscf/hessian/rhf.py +30 -128
- pyscf/hessian/rks.py +1 -6
- pyscf/hessian/uhf.py +28 -138
- pyscf/hessian/uks.py +1 -8
- pyscf/lib/CMakeLists.txt +6 -2
- pyscf/lib/ao2mo/nr_ao2mo.c +1 -1
- pyscf/lib/ao2mo/nrr_ao2mo.c +1 -1
- pyscf/lib/ao2mo/r_ao2mo.c +1 -1
- pyscf/lib/cc/ccsd_pack.c +1 -1
- pyscf/lib/cc/ccsd_t.c +6 -6
- pyscf/lib/cc/uccsd_t.c +4 -4
- pyscf/lib/config.h +0 -1
- pyscf/lib/config.h.in +0 -1
- pyscf/lib/deps/include/XCFun/XCFunExport.h +1 -0
- pyscf/lib/deps/include/xc.h +28 -18
- pyscf/lib/deps/include/xc_funcs.h +50 -2
- pyscf/lib/deps/include/xc_version.h +3 -3
- pyscf/lib/deps/lib/libcint.6.dylib +0 -0
- pyscf/lib/deps/lib/{libxc.12.dylib → libxc.15.dylib} +0 -0
- pyscf/lib/deps/lib/libxcfun.2.dylib +0 -0
- pyscf/lib/dft/grid_common.c +1 -1
- pyscf/lib/dft/libxc_itrf.c +10 -7
- pyscf/lib/dft/nr_numint_sparse.c +3 -3
- pyscf/lib/dft/xcfun_itrf.c +1 -1
- pyscf/lib/diis.py +2 -2
- pyscf/lib/exceptions.py +6 -0
- pyscf/lib/gto/fill_grids_int2c.c +11 -9
- pyscf/lib/gto/fill_int2e.c +7 -5
- pyscf/lib/gto/fill_r_4c.c +1 -1
- pyscf/lib/gto/ft_ao.c +1 -1
- pyscf/lib/gto/ft_ao.h +1 -1
- pyscf/lib/gto/gto.h +2 -2
- pyscf/lib/gto/nr_ecp.c +3 -2
- pyscf/lib/libagf2.dylib +0 -0
- pyscf/lib/libao2mo.dylib +0 -0
- pyscf/lib/libcc.dylib +0 -0
- pyscf/lib/libcgto.dylib +0 -0
- pyscf/lib/libcvhf.dylib +0 -0
- pyscf/lib/libdft.dylib +0 -0
- pyscf/lib/libfci.dylib +0 -0
- pyscf/lib/libmcscf.dylib +0 -0
- pyscf/lib/libmp.dylib +0 -0
- pyscf/lib/libnp_helper.dylib +0 -0
- pyscf/lib/libpbc.dylib +0 -0
- pyscf/lib/libri.dylib +0 -0
- pyscf/lib/libxc_itrf.dylib +0 -0
- pyscf/lib/libxcfun_itrf.dylib +0 -0
- pyscf/lib/linalg_helper.py +117 -198
- pyscf/lib/logger.py +2 -1
- pyscf/lib/mcscf/fci_contract.c +10 -3
- pyscf/lib/misc.py +63 -22
- pyscf/lib/mp/CMakeLists.txt +22 -0
- pyscf/lib/mp/mp2.c +518 -0
- pyscf/lib/mp/mp2.h +44 -0
- pyscf/lib/np_helper/CMakeLists.txt +1 -1
- pyscf/lib/np_helper/imatcopy.c +360 -0
- pyscf/lib/np_helper/np_helper.c +94 -0
- pyscf/lib/np_helper/np_helper.h +26 -0
- pyscf/lib/numpy_helper.py +195 -11
- pyscf/lib/pbc/nr_direct.c +2 -7
- pyscf/lib/pbc/nr_ecp.c +10 -3
- pyscf/lib/pbc/pbc.h +1 -1
- pyscf/lib/vhf/fblas.h +3 -0
- pyscf/lib/vhf/nr_sgx_direct.c +8 -6
- pyscf/lib/vhf/nr_sr_vhf.c +8 -12
- pyscf/lib/vhf/optimizer.c +2 -2
- pyscf/lib/vhf/rkb_screen.c +139 -0
- pyscf/lo/iao.py +1 -1
- pyscf/lo/ibo.py +3 -3
- pyscf/lo/pipek_jacobi.py +1 -1
- pyscf/mcscf/__init__.py +2 -2
- pyscf/mcscf/addons.py +3 -3
- pyscf/mcscf/apc.py +2 -2
- pyscf/mcscf/casci.py +13 -7
- pyscf/mcscf/chkfile.py +69 -41
- pyscf/mcscf/dmet_cas.py +2 -2
- pyscf/mcscf/mc1step.py +72 -44
- pyscf/mcscf/newton_casscf.py +5 -5
- pyscf/mcscf/ucasci.py +1 -1
- pyscf/mcscf/umc1step.py +49 -28
- pyscf/md/integrators.py +3 -3
- pyscf/mp/__init__.py +1 -0
- pyscf/mp/dfmp2.py +498 -59
- pyscf/mp/dfmp2_native.py +11 -1
- pyscf/mp/dfmp2_slow.py +133 -0
- pyscf/mp/dfump2.py +672 -0
- pyscf/mp/dfump2_native.py +9 -0
- pyscf/mp/dfump2_slow.py +161 -0
- pyscf/mp/gmp2.py +6 -47
- pyscf/mp/mp2.py +25 -10
- pyscf/mp/ump2.py +30 -24
- pyscf/pbc/adc/kadc_rhf.py +1 -1
- pyscf/pbc/adc/kadc_rhf_amplitudes.py +2 -2
- pyscf/pbc/ao2mo/eris.py +1 -1
- pyscf/pbc/cc/kccsd_rhf.py +3 -3
- pyscf/pbc/cc/kccsd_t_rhf.py +2 -2
- pyscf/pbc/ci/kcis_rhf.py +2 -2
- pyscf/pbc/df/aft.py +8 -9
- pyscf/pbc/df/aft_ao2mo.py +1 -1
- pyscf/pbc/df/df.py +85 -12
- pyscf/pbc/df/df_jk.py +6 -2
- pyscf/pbc/df/fft.py +9 -5
- pyscf/pbc/df/fft_ao2mo.py +4 -0
- pyscf/pbc/df/fft_jk.py +18 -10
- pyscf/pbc/df/ft_ao.py +4 -3
- pyscf/pbc/df/gdf_builder.py +5 -4
- pyscf/pbc/df/incore.py +2 -2
- pyscf/pbc/df/mdf.py +6 -3
- pyscf/pbc/df/mdf_jk.py +2 -1
- pyscf/pbc/df/outcore.py +10 -10
- pyscf/pbc/df/rsdf.py +2 -2
- pyscf/pbc/df/rsdf_builder.py +13 -8
- pyscf/pbc/df/rsdf_helper.py +6 -6
- pyscf/pbc/df/rsdf_jk.py +2 -1
- pyscf/pbc/dft/cdft.py +5 -5
- pyscf/pbc/dft/gen_grid.py +3 -2
- pyscf/pbc/dft/gks.py +14 -3
- pyscf/pbc/dft/kgks.py +15 -4
- pyscf/pbc/dft/krks.py +28 -10
- pyscf/pbc/dft/krks_ksymm.py +21 -9
- pyscf/pbc/dft/krkspu.py +1 -30
- pyscf/pbc/dft/krkspu_ksymm.py +0 -30
- pyscf/pbc/dft/kuks.py +30 -13
- pyscf/pbc/dft/kuks_ksymm.py +22 -10
- pyscf/pbc/dft/kukspu.py +0 -27
- pyscf/pbc/dft/kukspu_ksymm.py +0 -30
- pyscf/pbc/dft/multigrid/multigrid.py +36 -33
- pyscf/pbc/dft/multigrid/multigrid_pair.py +7 -2
- pyscf/pbc/dft/multigrid/pp.py +1 -1
- pyscf/pbc/dft/numint.py +56 -31
- pyscf/pbc/dft/rks.py +16 -24
- pyscf/pbc/dft/uks.py +21 -4
- pyscf/pbc/eph/eph_fd.py +1 -1
- pyscf/pbc/geomopt/geometric_solver.py +1 -1
- pyscf/pbc/gto/_pbcintor.py +1 -0
- pyscf/pbc/gto/cell.py +194 -23
- pyscf/pbc/gto/ecp.py +12 -12
- pyscf/pbc/gto/eval_gto.py +3 -3
- pyscf/pbc/gto/neighborlist.py +4 -1
- pyscf/pbc/gto/pseudo/pp.py +1 -1
- pyscf/pbc/gw/krgw_ac.py +4 -4
- pyscf/pbc/gw/krgw_cd.py +4 -4
- pyscf/pbc/gw/kugw_ac.py +3 -3
- pyscf/pbc/lib/kpts_helper.py +4 -3
- pyscf/pbc/lib/linalg_helper.py +1 -1
- pyscf/pbc/mp/kmp2.py +1 -1
- pyscf/pbc/mpitools/mpi.py +1 -1
- pyscf/pbc/scf/_response_functions.py +141 -34
- pyscf/pbc/scf/addons.py +15 -11
- pyscf/pbc/scf/cphf.py +1 -1
- pyscf/pbc/scf/ghf.py +1 -1
- pyscf/pbc/scf/hf.py +21 -32
- pyscf/pbc/scf/kghf.py +33 -29
- pyscf/pbc/scf/khf.py +103 -29
- pyscf/pbc/scf/khf_ksymm.py +15 -1
- pyscf/pbc/scf/krohf.py +5 -7
- pyscf/pbc/scf/kuhf.py +54 -23
- pyscf/pbc/scf/kuhf_ksymm.py +1 -1
- pyscf/pbc/scf/rsjk.py +14 -10
- pyscf/pbc/scf/scfint.py +1 -1
- pyscf/pbc/scf/stability.py +27 -15
- pyscf/pbc/scf/uhf.py +3 -1
- pyscf/pbc/symm/symmetry.py +2 -2
- pyscf/pbc/tdscf/krhf.py +238 -154
- pyscf/pbc/tdscf/krks.py +1 -45
- pyscf/pbc/tdscf/kuhf.py +319 -171
- pyscf/pbc/tdscf/kuks.py +0 -56
- pyscf/pbc/tdscf/rhf.py +116 -3
- pyscf/pbc/tdscf/rks.py +2 -1
- pyscf/pbc/tdscf/uhf.py +214 -1
- pyscf/pbc/tdscf/uks.py +2 -1
- pyscf/pbc/tools/k2gamma.py +20 -6
- pyscf/pbc/tools/lattice.py +3 -3
- pyscf/pbc/tools/pbc.py +111 -91
- pyscf/pbc/tools/pyscf_ase.py +0 -1
- pyscf/pbc/tools/pywannier90.py +1 -1
- pyscf/qmmm/mm_mole.py +1 -1
- pyscf/scf/_response_functions.py +87 -46
- pyscf/scf/_vhf.py +15 -10
- pyscf/scf/addons.py +29 -15
- pyscf/scf/cphf.py +14 -52
- pyscf/scf/dhf.py +121 -38
- pyscf/scf/dispersion.py +10 -9
- pyscf/scf/ghf.py +25 -13
- pyscf/scf/ghf_symm.py +2 -2
- pyscf/scf/hf.py +262 -30
- pyscf/scf/rohf.py +37 -5
- pyscf/scf/stability.py +142 -112
- pyscf/scf/ucphf.py +21 -16
- pyscf/scf/uhf.py +104 -61
- pyscf/sgx/sgx.py +1 -1
- pyscf/sgx/sgx_jk.py +4 -4
- pyscf/solvent/__init__.py +2 -2
- pyscf/solvent/_attach_solvent.py +2 -0
- pyscf/solvent/_ddcosmo_tdscf_grad.py +1 -1
- pyscf/solvent/cosmors.py +366 -0
- pyscf/solvent/ddcosmo.py +1 -1
- pyscf/solvent/pcm.py +4 -4
- pyscf/solvent/pol_embed.py +1 -1
- pyscf/solvent/smd.py +5 -3
- pyscf/soscf/ciah.py +3 -11
- pyscf/soscf/newton_ah.py +5 -2
- pyscf/symm/__init__.py +1 -1
- pyscf/symm/addons.py +5 -5
- pyscf/symm/geom.py +1 -5
- pyscf/tdscf/_lr_eig.py +1002 -0
- pyscf/tdscf/dhf.py +84 -87
- pyscf/tdscf/dks.py +0 -4
- pyscf/tdscf/ghf.py +139 -127
- pyscf/tdscf/gks.py +27 -25
- pyscf/tdscf/rhf.py +194 -147
- pyscf/tdscf/rks.py +26 -22
- pyscf/tdscf/uhf.py +166 -118
- pyscf/tdscf/uks.py +32 -31
- pyscf/tools/fcidump.py +3 -0
- pyscf/tools/qcschema.py +265 -0
- pyscf/x2c/sfx2c1e.py +1 -1
- pyscf/x2c/tdscf.py +41 -41
- pyscf/x2c/x2c.py +15 -11
- {pyscf-2.6.2.dist-info → pyscf-2.8.0.dist-info}/METADATA +39 -36
- {pyscf-2.6.2.dist-info → pyscf-2.8.0.dist-info}/NOTICE +14 -1
- {pyscf-2.6.2.dist-info → pyscf-2.8.0.dist-info}/RECORD +348 -316
- {pyscf-2.6.2.dist-info → pyscf-2.8.0.dist-info}/WHEEL +1 -1
- pyscf/dft/gen_libxc_param.py +0 -35
- pyscf/dft/gen_xcfun_param.py +0 -209
- pyscf/pbc/tdscf/kproxy.py +0 -189
- pyscf/pbc/tdscf/kproxy_supercell.py +0 -664
- pyscf/pbc/tdscf/krhf_slow.py +0 -300
- pyscf/pbc/tdscf/krhf_slow_gamma.py +0 -175
- pyscf/pbc/tdscf/krhf_slow_supercell.py +0 -250
- pyscf/pbc/tdscf/proxy.py +0 -39
- pyscf/pbc/tdscf/rhf_slow.py +0 -35
- pyscf/tdscf/common_slow.py +0 -799
- pyscf/tdscf/proxy.py +0 -258
- pyscf/tdscf/rhf_slow.py +0 -181
- {pyscf-2.6.2.dist-info → pyscf-2.8.0.dist-info}/LICENSE +0 -0
- {pyscf-2.6.2.dist-info → pyscf-2.8.0.dist-info}/top_level.txt +0 -0
pyscf/scf/uhf.py
CHANGED
|
@@ -26,42 +26,35 @@ from pyscf import __config__
|
|
|
26
26
|
|
|
27
27
|
WITH_META_LOWDIN = getattr(__config__, 'scf_analyze_with_meta_lowdin', True)
|
|
28
28
|
PRE_ORTH_METHOD = getattr(__config__, 'scf_analyze_pre_orth_method', 'ANO')
|
|
29
|
-
BREAKSYM = getattr(__config__, 'scf_uhf_init_guess_breaksym', True)
|
|
30
29
|
MO_BASE = getattr(__config__, 'MO_BASE', 1)
|
|
31
30
|
|
|
32
31
|
|
|
33
|
-
def init_guess_by_minao(mol, breaksym=
|
|
32
|
+
def init_guess_by_minao(mol, breaksym=None):
|
|
34
33
|
'''Generate initial guess density matrix based on ANO basis, then project
|
|
35
34
|
the density matrix to the basis set defined by ``mol``
|
|
36
35
|
|
|
37
36
|
Returns:
|
|
38
37
|
Density matrices, a list of 2D ndarrays for alpha and beta spins
|
|
39
38
|
'''
|
|
40
|
-
|
|
41
|
-
dma = dmb = dm*.5
|
|
42
|
-
if breaksym:
|
|
43
|
-
dma, dmb = _break_dm_spin_symm(mol, (dma, dmb))
|
|
44
|
-
return numpy.array((dma,dmb))
|
|
39
|
+
return UHF(mol).init_guess_by_minao(mol, breaksym)
|
|
45
40
|
|
|
46
|
-
def init_guess_by_1e(mol, breaksym=
|
|
41
|
+
def init_guess_by_1e(mol, breaksym=None):
|
|
47
42
|
return UHF(mol).init_guess_by_1e(mol, breaksym)
|
|
48
43
|
|
|
49
|
-
def init_guess_by_atom(mol, breaksym=
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
#Add off-diagonal part for alpha DM
|
|
54
|
-
dma = mol.intor_symmetric('int1e_ovlp') * 1e-2
|
|
55
|
-
for b0, b1, p0, p1 in mol.aoslice_by_atom():
|
|
56
|
-
dma[p0:p1,p0:p1] = dmb[p0:p1,p0:p1]
|
|
57
|
-
return numpy.array((dma,dmb))
|
|
58
|
-
|
|
59
|
-
def init_guess_by_huckel(mol, breaksym=BREAKSYM):
|
|
44
|
+
def init_guess_by_atom(mol, breaksym=None):
|
|
45
|
+
return UHF(mol).init_guess_by_atom(mol, breaksym)
|
|
46
|
+
|
|
47
|
+
def init_guess_by_huckel(mol, breaksym=None):
|
|
60
48
|
return UHF(mol).init_guess_by_huckel(mol, breaksym)
|
|
61
49
|
|
|
62
|
-
def init_guess_by_mod_huckel(mol, breaksym=
|
|
50
|
+
def init_guess_by_mod_huckel(mol, breaksym=None):
|
|
63
51
|
return UHF(mol).init_guess_by_mod_huckel(mol, breaksym)
|
|
64
52
|
|
|
53
|
+
def init_guess_by_sap(mol, sap_basis, breaksym=None, **kwargs):
|
|
54
|
+
mf = UHF(mol)
|
|
55
|
+
mf.sap_basis = sap_basis
|
|
56
|
+
return mf.init_guess_by_sap(mol, breaksym)
|
|
57
|
+
|
|
65
58
|
def init_guess_by_chkfile(mol, chkfile_name, project=None):
|
|
66
59
|
'''Read SCF chkfile and make the density matrix for UHF initial guess.
|
|
67
60
|
|
|
@@ -120,14 +113,24 @@ def init_guess_by_chkfile(mol, chkfile_name, project=None):
|
|
|
120
113
|
dm = make_rdm1([fproj(mo[0]),fproj(mo[1])], mo_occ)
|
|
121
114
|
return dm
|
|
122
115
|
|
|
123
|
-
def _break_dm_spin_symm(mol, dm):
|
|
116
|
+
def _break_dm_spin_symm(mol, dm, breaksym=1):
|
|
124
117
|
dma, dmb = dm
|
|
125
118
|
# For spin polarized system, no need to manually break spin symmetry
|
|
126
|
-
if mol.spin == 0 and abs(dma - dmb).max() < 1e-2:
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
119
|
+
if breaksym and mol.spin == 0 and abs(dma - dmb).max() < 1e-2:
|
|
120
|
+
if breaksym == 1:
|
|
121
|
+
#remove off-diagonal part of beta DM
|
|
122
|
+
dmb = numpy.zeros_like(dma)
|
|
123
|
+
for b0, b1, p0, p1 in mol.aoslice_by_atom():
|
|
124
|
+
dmb[...,p0:p1,p0:p1] = dma[...,p0:p1,p0:p1]
|
|
125
|
+
else:
|
|
126
|
+
# Adjust num. electrons for density matrices (issue #1839)
|
|
127
|
+
# Get overlap matrix
|
|
128
|
+
s1e = mol.intor_symmetric('int1e_ovlp')
|
|
129
|
+
# Compute norm of density matrices
|
|
130
|
+
nelec_half = numpy.einsum('ij,ji->', dma, s1e)
|
|
131
|
+
# Scale density matrices to form doublet state
|
|
132
|
+
dma = dma * (nelec_half+1) / nelec_half
|
|
133
|
+
dmb = dmb * (nelec_half-1) / nelec_half
|
|
131
134
|
return dma, dmb
|
|
132
135
|
|
|
133
136
|
def get_init_guess(mol, key='minao', **kwargs):
|
|
@@ -224,8 +227,10 @@ def get_veff(mol, dm, dm_last=0, vhf_last=0, hermi=1, vhfopt=None):
|
|
|
224
227
|
(3, 2, 2)
|
|
225
228
|
'''
|
|
226
229
|
dm = numpy.asarray(dm)
|
|
230
|
+
dm_last = numpy.asarray(dm_last)
|
|
231
|
+
assert dm_last.ndim == 0 or dm_last.ndim == dm.ndim
|
|
227
232
|
nao = dm.shape[-1]
|
|
228
|
-
ddm = dm -
|
|
233
|
+
ddm = dm - dm_last
|
|
229
234
|
# dm.reshape(-1,nao,nao) to remove first dim, compress (dma,dmb)
|
|
230
235
|
vj, vk = hf.get_jk(mol, ddm.reshape(-1,nao,nao), hermi=hermi, vhfopt=vhfopt)
|
|
231
236
|
vj = vj.reshape(dm.shape)
|
|
@@ -750,8 +755,12 @@ class UHF(hf.SCF):
|
|
|
750
755
|
If given, freeze the number of (alpha,beta) electrons to the given value.
|
|
751
756
|
level_shift : number or two-element list
|
|
752
757
|
level shift (in Eh) for alpha and beta Fock if two-element list is given.
|
|
753
|
-
init_guess_breaksym :
|
|
754
|
-
|
|
758
|
+
init_guess_breaksym : int
|
|
759
|
+
This configuration controls the algorithm used to break the spin
|
|
760
|
+
symmetry of the initial guess:
|
|
761
|
+
- 0 to disable symmetry breaking in the initial guess.
|
|
762
|
+
- 1 to use the default algorithm introduced in pyscf-1.7.
|
|
763
|
+
- 2 to adjust the num. electrons for spin-up and spin-down density matrices (issue #1839).
|
|
755
764
|
|
|
756
765
|
Examples:
|
|
757
766
|
|
|
@@ -763,7 +772,7 @@ class UHF(hf.SCF):
|
|
|
763
772
|
S^2 = 0.7570150, 2S+1 = 2.0070027
|
|
764
773
|
'''
|
|
765
774
|
|
|
766
|
-
init_guess_breaksym =
|
|
775
|
+
init_guess_breaksym = getattr(__config__, 'scf_uhf_init_guess_breaksym', 1)
|
|
767
776
|
|
|
768
777
|
_keys = {"init_guess_breaksym"}
|
|
769
778
|
|
|
@@ -840,29 +849,34 @@ class UHF(hf.SCF):
|
|
|
840
849
|
logger.debug1(self, 'Nelec from initial guess = %s', nelec)
|
|
841
850
|
return dm
|
|
842
851
|
|
|
843
|
-
def init_guess_by_minao(self, mol=None, breaksym=
|
|
852
|
+
def init_guess_by_minao(self, mol=None, breaksym=None):
|
|
844
853
|
'''Initial guess in terms of the overlap to minimal basis.'''
|
|
845
854
|
if mol is None: mol = self.mol
|
|
846
|
-
|
|
847
|
-
if user_set_breaksym is not None:
|
|
848
|
-
breaksym = user_set_breaksym
|
|
855
|
+
if breaksym is None: breaksym = self.init_guess_breaksym
|
|
849
856
|
# For spin polarized system, no need to manually break spin symmetry
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
857
|
+
dm = hf.init_guess_by_minao(mol)
|
|
858
|
+
dma = dmb = dm*.5
|
|
859
|
+
dma, dmb = _break_dm_spin_symm(mol, (dma, dmb), breaksym)
|
|
860
|
+
return numpy.array((dma, dmb))
|
|
853
861
|
|
|
854
|
-
def init_guess_by_atom(self, mol=None, breaksym=
|
|
862
|
+
def init_guess_by_atom(self, mol=None, breaksym=None):
|
|
855
863
|
if mol is None: mol = self.mol
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
864
|
+
if breaksym is None: breaksym = self.init_guess_breaksym
|
|
865
|
+
dm = hf.init_guess_by_atom(mol)
|
|
866
|
+
dma = dmb = dm*.5
|
|
867
|
+
if mol.spin == 0 and breaksym:
|
|
868
|
+
if breaksym == 1:
|
|
869
|
+
#Add off-diagonal part for alpha DM
|
|
870
|
+
dma = mol.intor_symmetric('int1e_ovlp') * 1e-2
|
|
871
|
+
for b0, b1, p0, p1 in mol.aoslice_by_atom():
|
|
872
|
+
dma[p0:p1,p0:p1] = dmb[p0:p1,p0:p1]
|
|
873
|
+
else:
|
|
874
|
+
dma, dmb = _break_dm_spin_symm(mol, (dma, dmb), breaksym)
|
|
875
|
+
return numpy.array((dma,dmb))
|
|
860
876
|
|
|
861
|
-
def init_guess_by_huckel(self, mol=None, breaksym=
|
|
877
|
+
def init_guess_by_huckel(self, mol=None, breaksym=None):
|
|
862
878
|
if mol is None: mol = self.mol
|
|
863
|
-
|
|
864
|
-
if user_set_breaksym is not None:
|
|
865
|
-
breaksym = user_set_breaksym
|
|
879
|
+
if breaksym is None: breaksym = self.init_guess_breaksym
|
|
866
880
|
logger.info(self, 'Initial guess from on-the-fly Huckel, doi:10.1021/acs.jctc.8b01089.')
|
|
867
881
|
mo_energy, mo_coeff = hf._init_guess_huckel_orbitals(mol, updated_rule = False)
|
|
868
882
|
mo_energy = (mo_energy, mo_energy)
|
|
@@ -873,11 +887,9 @@ class UHF(hf.SCF):
|
|
|
873
887
|
dma, dmb = _break_dm_spin_symm(mol, (dma, dmb))
|
|
874
888
|
return numpy.array((dma,dmb))
|
|
875
889
|
|
|
876
|
-
def init_guess_by_mod_huckel(self, mol=None, breaksym=
|
|
890
|
+
def init_guess_by_mod_huckel(self, mol=None, breaksym=None):
|
|
877
891
|
if mol is None: mol = self.mol
|
|
878
|
-
|
|
879
|
-
if user_set_breaksym is not None:
|
|
880
|
-
breaksym = user_set_breaksym
|
|
892
|
+
if breaksym is None: breaksym = self.init_guess_breaksym
|
|
881
893
|
logger.info(self, '''Initial guess from on-the-fly Huckel, doi:10.1021/acs.jctc.8b01089,
|
|
882
894
|
employing the updated GWH rule from doi:10.1021/ja00480a005.''')
|
|
883
895
|
mo_energy, mo_coeff = hf._init_guess_huckel_orbitals(mol, updated_rule = True)
|
|
@@ -886,14 +898,12 @@ employing the updated GWH rule from doi:10.1021/ja00480a005.''')
|
|
|
886
898
|
mo_occ = self.get_occ(mo_energy, mo_coeff)
|
|
887
899
|
dma, dmb = self.make_rdm1(mo_coeff, mo_occ)
|
|
888
900
|
if breaksym:
|
|
889
|
-
dma, dmb = _break_dm_spin_symm(mol, (dma, dmb))
|
|
901
|
+
dma, dmb = _break_dm_spin_symm(mol, (dma, dmb), breaksym)
|
|
890
902
|
return numpy.array((dma,dmb))
|
|
891
903
|
|
|
892
|
-
def init_guess_by_1e(self, mol=None, breaksym=
|
|
904
|
+
def init_guess_by_1e(self, mol=None, breaksym=None):
|
|
893
905
|
if mol is None: mol = self.mol
|
|
894
|
-
|
|
895
|
-
if user_set_breaksym is not None:
|
|
896
|
-
breaksym = user_set_breaksym
|
|
906
|
+
if breaksym is None: breaksym = self.init_guess_breaksym
|
|
897
907
|
logger.info(self, 'Initial guess from hcore.')
|
|
898
908
|
h1e = self.get_hcore(mol)
|
|
899
909
|
s1e = self.get_ovlp(mol)
|
|
@@ -904,7 +914,35 @@ employing the updated GWH rule from doi:10.1021/ja00480a005.''')
|
|
|
904
914
|
dma, dmb = self.make_rdm1(mo_coeff, mo_occ)
|
|
905
915
|
natm = getattr(mol, 'natm', 0) # handle custom Hamiltonian
|
|
906
916
|
if natm > 0 and breaksym:
|
|
907
|
-
dma, dmb = _break_dm_spin_symm(mol, (dma, dmb))
|
|
917
|
+
dma, dmb = _break_dm_spin_symm(mol, (dma, dmb), breaksym)
|
|
918
|
+
return numpy.array((dma,dmb))
|
|
919
|
+
|
|
920
|
+
def init_guess_by_sap(self, mol=None, breaksym=None, **kwargs):
|
|
921
|
+
from pyscf.gto.basis import load
|
|
922
|
+
if mol is None: mol = self.mol
|
|
923
|
+
if breaksym is None: breaksym = self.init_guess_breaksym
|
|
924
|
+
sap_basis = self.sap_basis
|
|
925
|
+
logger.info(self, '''Initial guess from superposition of atomic potentials (doi:10.1021/acs.jctc.8b01089)
|
|
926
|
+
This is the Gaussian fit version as described in doi:10.1063/5.0004046.''')
|
|
927
|
+
if isinstance(sap_basis, str):
|
|
928
|
+
atoms = [coord[0] for coord in mol._atom]
|
|
929
|
+
sapbas = {}
|
|
930
|
+
for atom in set(atoms):
|
|
931
|
+
single_element_bs = load(sap_basis, atom)
|
|
932
|
+
if isinstance(single_element_bs, dict):
|
|
933
|
+
sapbas[atom] = numpy.asarray(single_element_bs[atom][0][1:], dtype=float)
|
|
934
|
+
else:
|
|
935
|
+
sapbas[atom] = numpy.asarray(single_element_bs[0][1:], dtype=float)
|
|
936
|
+
logger.note(self, f'Found SAP basis {sap_basis.split("/")[-1]}')
|
|
937
|
+
elif isinstance(sap_basis, dict):
|
|
938
|
+
sapbas = {}
|
|
939
|
+
for key in sap_basis:
|
|
940
|
+
sapbas[key] = numpy.asarray(sap_basis[key][0][1:], dtype=float)
|
|
941
|
+
else:
|
|
942
|
+
raise RuntimeError('sap_basis is of an unexpected datatype.')
|
|
943
|
+
dm = hf.init_guess_by_sap(mol, sapbas)
|
|
944
|
+
dma = dmb = dm*.5
|
|
945
|
+
dma, dmb = _break_dm_spin_symm(mol, (dma, dmb), breaksym)
|
|
908
946
|
return numpy.array((dma,dmb))
|
|
909
947
|
|
|
910
948
|
def init_guess_by_chkfile(self, chkfile=None, project=None):
|
|
@@ -935,12 +973,16 @@ employing the updated GWH rule from doi:10.1021/ja00480a005.''')
|
|
|
935
973
|
if mol is None: mol = self.mol
|
|
936
974
|
if dm is None: dm = self.make_rdm1()
|
|
937
975
|
if isinstance(dm, numpy.ndarray) and dm.ndim == 2:
|
|
938
|
-
dm
|
|
976
|
+
logger.warn(self, 'Incompatible dm dimension. Treat dm as RHF density matrix.')
|
|
977
|
+
dm = numpy.repeat(dm[None]*.5, 2, axis=0)
|
|
939
978
|
if self._eri is not None or not self.direct_scf:
|
|
940
979
|
vj, vk = self.get_jk(mol, dm, hermi)
|
|
941
980
|
vhf = vj[0] + vj[1] - vk
|
|
942
981
|
else:
|
|
943
|
-
|
|
982
|
+
dm_last = numpy.asarray(dm_last)
|
|
983
|
+
dm = numpy.asarray(dm)
|
|
984
|
+
assert dm_last.ndim == 0 or dm_last.ndim == dm.ndim
|
|
985
|
+
ddm = dm - dm_last
|
|
944
986
|
vj, vk = self.get_jk(mol, ddm, hermi)
|
|
945
987
|
vhf = vj[0] + vj[1] - vk
|
|
946
988
|
vhf += numpy.asarray(vhf_last)
|
|
@@ -1025,7 +1067,8 @@ employing the updated GWH rule from doi:10.1021/ja00480a005.''')
|
|
|
1025
1067
|
internal=getattr(__config__, 'scf_stability_internal', True),
|
|
1026
1068
|
external=getattr(__config__, 'scf_stability_external', False),
|
|
1027
1069
|
verbose=None,
|
|
1028
|
-
return_status=False
|
|
1070
|
+
return_status=False,
|
|
1071
|
+
**kwargs):
|
|
1029
1072
|
'''
|
|
1030
1073
|
Stability analysis for UHF/UKS method.
|
|
1031
1074
|
|
|
@@ -1055,7 +1098,7 @@ employing the updated GWH rule from doi:10.1021/ja00480a005.''')
|
|
|
1055
1098
|
and the second corresponds to the external stability.
|
|
1056
1099
|
'''
|
|
1057
1100
|
from pyscf.scf.stability import uhf_stability
|
|
1058
|
-
return uhf_stability(self, internal, external, verbose, return_status)
|
|
1101
|
+
return uhf_stability(self, internal, external, verbose, return_status, **kwargs)
|
|
1059
1102
|
|
|
1060
1103
|
def nuc_grad_method(self):
|
|
1061
1104
|
from pyscf.grad import uhf
|
|
@@ -1089,4 +1132,4 @@ class HF1e(UHF):
|
|
|
1089
1132
|
def spin_square(self, mo_coeff=None, s=None):
|
|
1090
1133
|
return .75, 2
|
|
1091
1134
|
|
|
1092
|
-
del (WITH_META_LOWDIN, PRE_ORTH_METHOD
|
|
1135
|
+
del (WITH_META_LOWDIN, PRE_ORTH_METHOD)
|
pyscf/sgx/sgx.py
CHANGED
|
@@ -237,7 +237,7 @@ mcscf.casci.CASBase.COSX = sgx_fit
|
|
|
237
237
|
|
|
238
238
|
def _make_opt(mol, pjs=False,
|
|
239
239
|
direct_scf_tol=getattr(__config__, 'scf_hf_SCF_direct_scf_tol', 1e-13)):
|
|
240
|
-
'''Optimizer to
|
|
240
|
+
'''Optimizer to generate 3-center 2-electron integrals'''
|
|
241
241
|
if pjs:
|
|
242
242
|
vhfopt = _vhf.SGXOpt(mol, 'int1e_grids', 'SGXnr_ovlp_prescreen',
|
|
243
243
|
dmcondname='SGXnr_dm_cond',
|
pyscf/sgx/sgx_jk.py
CHANGED
|
@@ -18,10 +18,10 @@
|
|
|
18
18
|
#
|
|
19
19
|
|
|
20
20
|
'''
|
|
21
|
-
semi-grid Coulomb and eXchange without
|
|
21
|
+
semi-grid Coulomb and eXchange without differential density matrix
|
|
22
22
|
|
|
23
23
|
To lower the scaling of coulomb and exchange matrix construction for large system, one
|
|
24
|
-
coordinate is
|
|
24
|
+
coordinate is analytical and the other is grid. The traditional two electron
|
|
25
25
|
integrals turn to analytical one electron integrals and numerical integration
|
|
26
26
|
based on grid.(see Friesner, R. A. Chem. Phys. Lett. 1985, 116, 39)
|
|
27
27
|
|
|
@@ -73,7 +73,7 @@ def get_jk_favork(sgx, dm, hermi=1, with_j=True, with_k=True,
|
|
|
73
73
|
else:
|
|
74
74
|
batch_jk = _gen_jk_direct(mol, 's2', with_j, with_k, direct_scf_tol,
|
|
75
75
|
sgx._opt, sgx.pjs)
|
|
76
|
-
t1 = logger.timer_debug1(mol, "sgX
|
|
76
|
+
t1 = logger.timer_debug1(mol, "sgX initialization", *t0)
|
|
77
77
|
|
|
78
78
|
sn = numpy.zeros((nao,nao))
|
|
79
79
|
vj = numpy.zeros_like(dms)
|
|
@@ -180,7 +180,7 @@ def get_jk_favorj(sgx, dm, hermi=1, with_j=True, with_k=True,
|
|
|
180
180
|
proj = scipy.linalg.solve(sn, ovlp)
|
|
181
181
|
proj_dm = lib.einsum('ki,xij->xkj', proj, dms)
|
|
182
182
|
|
|
183
|
-
t1 = logger.timer_debug1(mol, "sgX
|
|
183
|
+
t1 = logger.timer_debug1(mol, "sgX initialization", *t0)
|
|
184
184
|
vj = numpy.zeros_like(dms)
|
|
185
185
|
vk = numpy.zeros_like(dms)
|
|
186
186
|
tnuc = 0, 0
|
pyscf/solvent/__init__.py
CHANGED
|
@@ -13,6 +13,8 @@
|
|
|
13
13
|
# limitations under the License.
|
|
14
14
|
|
|
15
15
|
from pyscf.solvent import ddcosmo
|
|
16
|
+
from pyscf.solvent import pcm
|
|
17
|
+
from pyscf.solvent import smd
|
|
16
18
|
|
|
17
19
|
def ddCOSMO(method_or_mol, solvent_obj=None, dm=None):
|
|
18
20
|
'''Initialize ddCOSMO model.
|
|
@@ -126,7 +128,6 @@ def PCM(method_or_mol, solvent_obj=None, dm=None):
|
|
|
126
128
|
from pyscf import gto
|
|
127
129
|
from pyscf import scf, mcscf
|
|
128
130
|
from pyscf import tdscf
|
|
129
|
-
from pyscf.solvent import pcm
|
|
130
131
|
|
|
131
132
|
if isinstance(method_or_mol, gto.mole.Mole):
|
|
132
133
|
return pcm.PCM(method_or_mol)
|
|
@@ -157,7 +158,6 @@ def SMD(method_or_mol, solvent_obj=None, dm=None):
|
|
|
157
158
|
'''
|
|
158
159
|
from pyscf import gto
|
|
159
160
|
from pyscf import scf
|
|
160
|
-
from pyscf.solvent import smd
|
|
161
161
|
|
|
162
162
|
if isinstance(method_or_mol, gto.mole.Mole):
|
|
163
163
|
return smd.SMD(method_or_mol)
|
pyscf/solvent/_attach_solvent.py
CHANGED
|
@@ -93,6 +93,8 @@ class SCFWithSolvent(_Solvation):
|
|
|
93
93
|
def get_fock(self, h1e=None, s1e=None, vhf=None, dm=None, cycle=-1,
|
|
94
94
|
diis=None, diis_start_cycle=None,
|
|
95
95
|
level_shift_factor=None, damp_factor=None, fock_last=None):
|
|
96
|
+
if dm is None: dm = self.make_rdm1()
|
|
97
|
+
|
|
96
98
|
# DIIS was called inside super().get_fock. v_solvent, as a function of
|
|
97
99
|
# dm, should be extrapolated as well. To enable it, v_solvent has to be
|
|
98
100
|
# added to the fock matrix before DIIS was called.
|