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.
- pyscf/__init__.py +1 -1
- pyscf/adc/__init__.py +9 -12
- pyscf/adc/radc.py +2 -2
- pyscf/adc/radc_ea.py +2 -2
- pyscf/adc/radc_ip.py +2 -2
- pyscf/adc/radc_ip_cvs.py +2 -2
- pyscf/adc/uadc.py +2 -2
- pyscf/adc/uadc_ea.py +2 -2
- pyscf/adc/uadc_ip.py +2 -2
- pyscf/adc/uadc_ip_cvs.py +2 -2
- pyscf/agf2/__init__.py +1 -1
- pyscf/agf2/chempot.py +2 -2
- pyscf/agf2/dfragf2.py +4 -4
- pyscf/agf2/dfuagf2.py +4 -4
- pyscf/agf2/ragf2.py +5 -5
- pyscf/agf2/ragf2_slow.py +2 -2
- pyscf/agf2/uagf2.py +3 -3
- pyscf/agf2/uagf2_slow.py +2 -2
- pyscf/ao2mo/outcore.py +6 -6
- pyscf/cc/__init__.py +28 -35
- pyscf/cc/addons.py +2 -4
- pyscf/cc/ccsd.py +13 -2
- pyscf/cc/ccsd_t.py +1 -1
- pyscf/cc/ccsd_t_slow.py +1 -1
- pyscf/cc/dfccsd.py +4 -1
- pyscf/cc/eom_rccsd.py +2 -2
- pyscf/cc/gccsd.py +5 -1
- pyscf/cc/gccsd_t.py +2 -2
- pyscf/cc/gccsd_t_rdm.py +1 -1
- pyscf/cc/momgfccsd.py +2 -2
- pyscf/cc/qcisd_t_slow.py +1 -1
- pyscf/cc/rccsd.py +2 -0
- pyscf/cc/rccsd_slow.py +1 -1
- pyscf/cc/uccsd.py +5 -1
- pyscf/cc/uccsd_slow.py +1 -1
- pyscf/ci/__init__.py +31 -25
- pyscf/ci/addons.py +1 -2
- pyscf/ci/cisd.py +4 -2
- pyscf/data/elements.py +2 -2
- pyscf/df/addons.py +9 -9
- pyscf/df/df.py +9 -2
- pyscf/df/df_jk.py +14 -10
- pyscf/df/grad/casdm2_util.py +1 -1
- pyscf/df/grad/casscf.py +2 -0
- pyscf/df/grad/rhf.py +12 -8
- pyscf/df/grad/rks.py +6 -5
- pyscf/df/grad/sacasscf.py +2 -0
- pyscf/df/grad/uhf.py +4 -3
- pyscf/df/grad/uks.py +5 -5
- pyscf/df/hessian/rhf.py +9 -2
- pyscf/df/hessian/rks.py +2 -2
- pyscf/df/hessian/uhf.py +3 -3
- pyscf/df/hessian/uks.py +2 -2
- pyscf/df/incore.py +6 -5
- pyscf/df/outcore.py +16 -2
- pyscf/dft/LebedevGrid.py +5047 -0
- pyscf/dft/__init__.py +1 -0
- pyscf/dft/dft_parser.py +24 -0
- pyscf/dft/dks.py +10 -1
- pyscf/dft/gen_grid.py +9 -46
- pyscf/dft/gks.py +3 -1
- pyscf/dft/gks_symm.py +3 -0
- pyscf/dft/libxc.py +265 -147
- pyscf/dft/numint.py +24 -34
- pyscf/dft/numint2c.py +17 -30
- pyscf/dft/rks.py +47 -13
- pyscf/dft/rks_symm.py +6 -1
- pyscf/dft/roks.py +2 -0
- pyscf/dft/uks.py +4 -2
- pyscf/dft/uks_symm.py +3 -0
- pyscf/dft/xc_deriv.py +187 -82
- pyscf/dft/xcfun.py +117 -86
- pyscf/eph/rhf.py +1 -1
- pyscf/eph/rks.py +1 -1
- pyscf/eph/uhf.py +2 -2
- pyscf/eph/uks.py +2 -2
- pyscf/fci/addons.py +18 -15
- pyscf/fci/cistring.py +43 -10
- pyscf/fci/direct_nosym.py +45 -56
- pyscf/fci/direct_spin0.py +4 -2
- pyscf/fci/direct_spin1.py +11 -7
- pyscf/fci/direct_spin1_cyl_sym.py +7 -3
- pyscf/fci/direct_spin1_symm.py +12 -0
- pyscf/fci/selected_ci.py +2 -2
- pyscf/geomopt/geometric_solver.py +1 -1
- pyscf/grad/__init__.py +1 -0
- pyscf/grad/casci.py +5 -3
- pyscf/grad/casscf.py +2 -0
- pyscf/grad/ccsd.py +2 -0
- pyscf/grad/cisd.py +2 -0
- pyscf/grad/dhf.py +3 -1
- pyscf/grad/dispersion.py +66 -0
- pyscf/grad/mp2.py +9 -3
- pyscf/grad/rhf.py +11 -0
- pyscf/grad/rks.py +4 -8
- pyscf/grad/tdrhf.py +3 -1
- pyscf/grad/uks.py +3 -4
- pyscf/gto/basis/__init__.py +8 -2
- pyscf/gto/basis/parse_cp2k.py +13 -8
- pyscf/gto/basis/parse_cp2k_pp.py +18 -5
- pyscf/gto/ecp.py +5 -5
- pyscf/gto/mole.py +83 -79
- pyscf/gto/moleintor.py +1 -0
- pyscf/gw/gw_ac.py +2 -2
- pyscf/gw/gw_cd.py +2 -2
- pyscf/gw/gw_exact.py +2 -2
- pyscf/gw/gw_slow.py +1 -1
- pyscf/gw/rpa.py +237 -96
- pyscf/gw/ugw_ac.py +2 -2
- pyscf/gw/urpa.py +135 -127
- pyscf/hessian/__init__.py +1 -0
- pyscf/hessian/dispersion.py +104 -0
- pyscf/hessian/rhf.py +44 -15
- pyscf/hessian/rks.py +37 -7
- pyscf/hessian/uhf.py +13 -8
- pyscf/hessian/uks.py +7 -5
- pyscf/lib/CMakeLists.txt +59 -10
- pyscf/lib/ao2mo/nr_ao2mo.c +6 -1
- pyscf/lib/ao2mo/nrr_ao2mo.c +6 -1
- pyscf/lib/ao2mo/r_ao2mo.c +6 -1
- pyscf/lib/cc/ccsd_t.c +37 -6
- pyscf/lib/cc/uccsd_t.c +25 -4
- pyscf/lib/chkfile.py +1 -2
- pyscf/lib/config.h +1 -1
- pyscf/lib/config.h.in +1 -1
- pyscf/lib/deps/include/cint.h +1 -1
- pyscf/lib/deps/include/cint_funcs.h +47 -16
- pyscf/lib/deps/lib/libcint.6.dylib +0 -0
- pyscf/lib/deps/lib/libxcfun.2.dylib +0 -0
- pyscf/lib/dft/CMakeLists.txt +10 -6
- pyscf/lib/dft/grid_collocate.c +655 -0
- pyscf/lib/dft/grid_common.c +660 -0
- pyscf/lib/dft/grid_common.h +109 -0
- pyscf/lib/dft/grid_integrate.c +1358 -0
- pyscf/lib/dft/libxc_itrf.c +587 -357
- pyscf/lib/dft/multigrid.c +744 -0
- pyscf/lib/dft/multigrid.h +72 -0
- pyscf/lib/dft/utils.c +71 -0
- pyscf/lib/dft/utils.h +27 -0
- pyscf/lib/dft/xc_deriv.c +85 -89
- pyscf/lib/dft/xcfun_itrf.c +24 -17
- pyscf/lib/diis.py +2 -0
- pyscf/lib/gto/fill_r_4c.c +5 -0
- 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/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 +2 -2
- pyscf/lib/mcscf/fci_contract.c +25 -19
- pyscf/lib/mcscf/fci_contract_nosym.c +11 -5
- pyscf/lib/mcscf/fci_string.c +29 -29
- pyscf/lib/misc.py +121 -19
- pyscf/lib/np_helper/np_helper.h +7 -0
- pyscf/lib/numpy_helper.py +11 -4
- pyscf/lib/pbc/CMakeLists.txt +11 -1
- pyscf/lib/pbc/cell.c +280 -0
- pyscf/lib/pbc/cell.h +29 -0
- pyscf/lib/pbc/fft.c +147 -0
- pyscf/lib/pbc/fft.h +26 -0
- pyscf/lib/pbc/fill_ints.c +3 -3
- pyscf/lib/pbc/fill_ints.h +29 -0
- pyscf/lib/pbc/fill_ints_screened.c +1012 -0
- pyscf/lib/pbc/hf_grad.c +95 -0
- pyscf/lib/pbc/neighbor_list.c +206 -0
- pyscf/lib/pbc/neighbor_list.h +41 -0
- pyscf/lib/pbc/optimizer.c +37 -1
- pyscf/lib/pbc/optimizer.h +3 -3
- pyscf/lib/pbc/pp.c +448 -0
- pyscf/lib/solvent/CMakeLists.txt +38 -0
- pyscf/lib/vhf/nr_sgx_direct.c +5 -0
- pyscf/lib/vhf/optimizer.c +10 -0
- pyscf/lo/boys.py +4 -1
- pyscf/lo/pipek.py +77 -71
- pyscf/lo/pipek_jacobi.py +161 -0
- pyscf/mcscf/__init__.py +31 -31
- pyscf/mcscf/addons.py +20 -12
- pyscf/mcscf/casci.py +5 -3
- pyscf/mcscf/casci_symm.py +3 -1
- pyscf/mcscf/df.py +2 -2
- pyscf/mcscf/mc1step.py +14 -8
- pyscf/mcscf/newton_casscf_symm.py +1 -1
- pyscf/mcscf/ucasci.py +1 -1
- pyscf/mcscf/umc1step.py +3 -3
- pyscf/mp/__init__.py +10 -12
- pyscf/mp/dfgmp2.py +3 -2
- pyscf/mp/dfmp2.py +3 -3
- pyscf/mp/dfmp2_native.py +4 -2
- pyscf/mp/dfump2_native.py +4 -3
- pyscf/mp/gmp2.py +6 -3
- pyscf/mp/mp2.py +48 -14
- pyscf/mp/ump2.py +56 -23
- pyscf/mrpt/nevpt2.py +2 -2
- pyscf/nac/__init__.py +32 -0
- pyscf/nac/sacasscf.py +293 -0
- pyscf/pbc/__all__.py +3 -0
- pyscf/pbc/adc/__init__.py +1 -1
- pyscf/pbc/adc/kadc_rhf.py +2 -2
- pyscf/pbc/adc/kadc_rhf_ea.py +2 -2
- pyscf/pbc/adc/kadc_rhf_ip.py +2 -2
- pyscf/pbc/cc/__init__.py +10 -7
- pyscf/pbc/cc/kccsd.py +3 -1
- pyscf/pbc/cc/kccsd_rhf.py +4 -2
- pyscf/pbc/cc/kccsd_rhf_ksymm.py +1 -1
- pyscf/pbc/cc/kccsd_uhf.py +3 -1
- pyscf/pbc/cc/kintermediates.py +1 -1
- pyscf/pbc/ci/__init__.py +4 -4
- pyscf/pbc/df/aft.py +5 -4
- pyscf/pbc/df/aft_jk.py +1 -1
- pyscf/pbc/df/df.py +7 -2
- pyscf/pbc/df/df_jk.py +12 -11
- pyscf/pbc/df/fft.py +7 -2
- pyscf/pbc/df/ft_ao.py +17 -9
- pyscf/pbc/df/gdf_builder.py +8 -7
- pyscf/pbc/df/incore.py +246 -2
- pyscf/pbc/df/mdf.py +3 -0
- pyscf/pbc/df/mdf_jk.py +0 -3
- pyscf/pbc/df/rsdf_builder.py +20 -11
- pyscf/pbc/df/rsdf_helper.py +16 -13
- pyscf/pbc/dft/gen_grid.py +14 -9
- pyscf/pbc/dft/gks.py +4 -2
- pyscf/pbc/dft/kgks.py +13 -4
- pyscf/pbc/dft/krks.py +15 -25
- pyscf/pbc/dft/krks_ksymm.py +16 -15
- pyscf/pbc/dft/krkspu.py +3 -3
- pyscf/pbc/dft/krkspu_ksymm.py +2 -2
- pyscf/pbc/dft/kroks.py +9 -19
- pyscf/pbc/dft/kuks.py +14 -24
- pyscf/pbc/dft/kuks_ksymm.py +16 -15
- pyscf/pbc/dft/kukspu.py +3 -3
- pyscf/pbc/dft/kukspu_ksymm.py +2 -2
- pyscf/pbc/dft/multigrid/__init__.py +57 -0
- pyscf/pbc/dft/{multigrid.py → multigrid/multigrid.py} +87 -94
- pyscf/pbc/dft/multigrid/multigrid_pair.py +1405 -0
- pyscf/pbc/dft/multigrid/pp.py +290 -0
- pyscf/pbc/dft/multigrid/utils.py +70 -0
- pyscf/pbc/dft/numint.py +5 -0
- pyscf/pbc/dft/rks.py +12 -8
- pyscf/pbc/dft/roks.py +2 -0
- pyscf/pbc/dft/uks.py +6 -4
- pyscf/pbc/geomopt/geometric_solver.py +1 -1
- pyscf/pbc/grad/__init__.py +5 -2
- pyscf/pbc/grad/krhf.py +7 -1
- pyscf/pbc/grad/krks.py +1 -1
- pyscf/pbc/grad/kuks.py +1 -1
- pyscf/pbc/grad/rhf.py +167 -0
- pyscf/pbc/grad/rks.py +24 -0
- pyscf/pbc/grad/uhf.py +92 -0
- pyscf/pbc/grad/uks.py +24 -0
- pyscf/pbc/gto/__init__.py +1 -0
- pyscf/pbc/gto/_pbcintor.py +14 -7
- pyscf/pbc/gto/cell.py +228 -23
- pyscf/pbc/gto/ewald_methods.py +293 -0
- pyscf/pbc/gto/neighborlist.py +199 -0
- pyscf/pbc/gto/pseudo/pp_int.py +350 -17
- pyscf/pbc/gw/__init__.py +44 -1
- pyscf/pbc/gw/kgw_slow_supercell.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 +7 -4
- pyscf/pbc/lib/kpts_helper.py +1 -1
- pyscf/pbc/mp/__init__.py +3 -3
- pyscf/pbc/mp/kmp2.py +3 -1
- pyscf/pbc/mpicc/__init__.py +4 -2
- pyscf/pbc/scf/addons.py +22 -18
- pyscf/pbc/scf/ghf.py +3 -1
- pyscf/pbc/scf/hf.py +34 -20
- pyscf/pbc/scf/kghf.py +3 -1
- pyscf/pbc/scf/khf.py +15 -15
- pyscf/pbc/scf/khf_ksymm.py +8 -6
- pyscf/pbc/scf/krohf.py +6 -4
- pyscf/pbc/scf/kuhf.py +14 -10
- pyscf/pbc/scf/kuhf_ksymm.py +4 -2
- pyscf/pbc/scf/rohf.py +2 -1
- pyscf/pbc/scf/rsjk.py +14 -4
- pyscf/pbc/scf/uhf.py +9 -5
- pyscf/pbc/symm/geom.py +1 -1
- pyscf/pbc/symm/pyscf_spglib.py +1 -1
- pyscf/pbc/symm/symmetry.py +1 -1
- pyscf/pbc/tdscf/__init__.py +6 -9
- pyscf/pbc/tdscf/krhf.py +1 -1
- pyscf/pbc/tdscf/krhf_slow_supercell.py +3 -3
- pyscf/pbc/tdscf/rhf.py +1 -1
- pyscf/pbc/tools/k2gamma.py +27 -15
- pyscf/pbc/tools/pbc.py +55 -10
- pyscf/pbc/x2c/sfx2c1e.py +1 -1
- pyscf/pbc/x2c/x2c1e.py +1 -1
- pyscf/post_scf.py +3 -0
- pyscf/qmmm/itrf.py +13 -1
- pyscf/scf/__init__.py +3 -1
- pyscf/scf/_response_functions.py +5 -4
- pyscf/scf/addons.py +50 -51
- pyscf/scf/atom_hf.py +16 -3
- pyscf/scf/atom_hf_pp.py +154 -0
- pyscf/scf/atom_ks.py +1 -1
- pyscf/scf/cphf.py +39 -17
- pyscf/scf/dhf.py +6 -8
- pyscf/scf/diis.py +12 -11
- pyscf/scf/dispersion.py +177 -0
- pyscf/scf/ghf.py +8 -8
- pyscf/scf/ghf_symm.py +3 -1
- pyscf/scf/hf.py +150 -54
- pyscf/scf/hf_symm.py +9 -4
- pyscf/scf/rohf.py +30 -7
- pyscf/scf/ucphf.py +46 -30
- pyscf/scf/uhf.py +17 -19
- pyscf/scf/uhf_symm.py +7 -5
- pyscf/sgx/sgx.py +9 -4
- pyscf/solvent/__init__.py +26 -2
- pyscf/solvent/_attach_solvent.py +58 -11
- pyscf/solvent/_ddcosmo_tdscf_grad.py +2 -2
- pyscf/solvent/ddcosmo.py +7 -6
- pyscf/solvent/ddpcm.py +1 -0
- pyscf/solvent/grad/__init__.py +17 -0
- pyscf/solvent/{ddcosmo_grad.py → grad/ddcosmo_grad.py} +1 -1
- pyscf/solvent/grad/pcm.py +384 -0
- pyscf/solvent/grad/smd.py +176 -0
- pyscf/solvent/grad/smd_experiment.py +216 -0
- pyscf/solvent/hessian/__init__.py +0 -0
- pyscf/solvent/hessian/pcm.py +230 -0
- pyscf/solvent/hessian/smd.py +171 -0
- pyscf/solvent/hessian/smd_experiment.py +208 -0
- pyscf/solvent/pcm.py +138 -57
- pyscf/solvent/pol_embed.py +3 -3
- pyscf/solvent/smd.py +433 -0
- pyscf/solvent/smd_experiment.py +273 -0
- pyscf/soscf/newton_ah.py +21 -10
- pyscf/symm/basis.py +1 -1
- pyscf/symm/geom.py +3 -7
- pyscf/tdscf/common_slow.py +4 -7
- pyscf/tdscf/dhf.py +1 -1
- pyscf/tdscf/ghf.py +1 -1
- pyscf/tdscf/proxy.py +1 -1
- pyscf/tdscf/rhf.py +10 -3
- pyscf/tdscf/rhf_slow.py +1 -1
- pyscf/tdscf/uhf.py +5 -1
- pyscf/tools/chgcar.py +1 -5
- pyscf/tools/molden.py +15 -2
- pyscf/x2c/sfx2c1e.py +8 -3
- pyscf/x2c/tdscf.py +1 -1
- pyscf/x2c/x2c.py +10 -2
- pyscf-2.6.0.dist-info/METADATA +140 -0
- {pyscf-2.4.0.dist-info → pyscf-2.6.0.dist-info}/NOTICE +8 -1
- {pyscf-2.4.0.dist-info → pyscf-2.6.0.dist-info}/RECORD +355 -307
- {pyscf-2.4.0.dist-info → pyscf-2.6.0.dist-info}/WHEEL +1 -1
- pyscf-2.4.0.dist-info/METADATA +0 -81
- {pyscf-2.4.0.dist-info → pyscf-2.6.0.dist-info}/LICENSE +0 -0
- {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
|
|
107
|
+
class UHF(pbchf.SCF):
|
|
108
108
|
'''UHF class for PBCs.
|
|
109
109
|
'''
|
|
110
|
-
_keys =
|
|
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:
|
|
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,
|
|
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.
|
|
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
|
pyscf/pbc/symm/pyscf_spglib.py
CHANGED
|
@@ -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.
|
|
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:
|
pyscf/pbc/symm/symmetry.py
CHANGED
|
@@ -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.
|
|
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)
|
pyscf/pbc/tdscf/__init__.py
CHANGED
|
@@ -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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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 =
|
|
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(
|
|
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(
|
|
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(
|
|
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
pyscf/pbc/tools/k2gamma.py
CHANGED
|
@@ -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
|
-
|
|
211
|
-
|
|
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
|
-
|
|
221
|
-
|
|
222
|
-
|
|
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 =
|
|
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
|
-
|
|
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 =
|
|
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
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
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
|
-
|
|
594
|
-
|
|
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
pyscf/pbc/x2c/x2c1e.py
CHANGED
pyscf/post_scf.py
CHANGED
pyscf/qmmm/itrf.py
CHANGED
|
@@ -116,7 +116,7 @@ class QMMM:
|
|
|
116
116
|
_QMMM = QMMM
|
|
117
117
|
|
|
118
118
|
class QMMMSCF(QMMM):
|
|
119
|
-
_keys =
|
|
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):
|
pyscf/scf/_response_functions.py
CHANGED
|
@@ -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.
|
|
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.
|
|
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.
|
|
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)
|