pyscf.solvent package#

Subpackages#

Submodules#

pyscf.solvent.ddcosmo module#

domain decomposition COSMO

See also the code on github

filippolipparini/ddPCM

and the papers

[1] Domain decomposition for implicit solvation models. E. Cances, Y. Maday, B. Stamm J. Chem. Phys., 139, 054111 (2013) http://dx.doi.org/10.1063/1.4816767

[2] Fast Domain Decomposition Algorithm for Continuum Solvation Models: Energy and First Derivatives. F. Lipparini, B. Stamm, E. Cances, Y. Maday, B. Mennucci J. Chem. Theory Comput., 9, 3637-3648 (2013) http://dx.doi.org/10.1021/ct400280b

[3] Quantum, classical, and hybrid QM/MM calculations in solution: General implementation of the ddCOSMO linear scaling strategy. F. Lipparini, G. Scalmani, L. Lagardere, B. Stamm, E. Cances, Y. Maday, J.-P.Piquemal, M. J. Frisch, B. Mennucci J. Chem. Phys., 141, 184108 (2014) http://dx.doi.org/10.1063/1.4901304

– Dielectric constants (from https://gaussian.com/scrf/) – More dataset can be found in Minnesota Solvent Descriptor Database (https://comp.chem.umn.edu/solvation) Water 78.3553 Acetonitrile 35.688 Methanol 32.613 Ethanol 24.852 IsoQuinoline 11.00 Quinoline 9.16 Chloroform 4.7113 DiethylEther 4.2400 Dichloromethane 8.93 DiChloroEthane 10.125 CarbonTetraChloride 2.2280 Benzene 2.2706 Toluene 2.3741 ChloroBenzene 5.6968 NitroMethane 36.562 Heptane 1.9113 CycloHexane 2.0165 Aniline 6.8882 Acetone 20.493 TetraHydroFuran 7.4257 DiMethylSulfoxide 46.826 Argon 1.430 Krypton 1.519 Xenon 1.706 n-Octanol 9.8629 1,1,1-TriChloroEthane 7.0826 1,1,2-TriChloroEthane 7.1937 1,2,4-TriMethylBenzene 2.3653 1,2-DiBromoEthane 4.9313 1,2-EthaneDiol 40.245 1,4-Dioxane 2.2099 1-Bromo-2-MethylPropane 7.7792 1-BromoOctane 5.0244 1-BromoPentane 6.269 1-BromoPropane 8.0496 1-Butanol 17.332 1-ChloroHexane 5.9491 1-ChloroPentane 6.5022 1-ChloroPropane 8.3548 1-Decanol 7.5305 1-FluoroOctane 3.89 1-Heptanol 11.321 1-Hexanol 12.51 1-Hexene 2.0717 1-Hexyne 2.615 1-IodoButane 6.173 1-IodoHexaDecane 3.5338 1-IodoPentane 5.6973 1-IodoPropane 6.9626 1-NitroPropane 23.73 1-Nonanol 8.5991 1-Pentanol 15.13 1-Pentene 1.9905 1-Propanol 20.524 2,2,2-TriFluoroEthanol 26.726 2,2,4-TriMethylPentane 1.9358 2,4-DiMethylPentane 1.8939 2,4-DiMethylPyridine 9.4176 2,6-DiMethylPyridine 7.1735 2-BromoPropane 9.3610 2-Butanol 15.944 2-ChloroButane 8.3930 2-Heptanone 11.658 2-Hexanone 14.136 2-MethoxyEthanol 17.2 2-Methyl-1-Propanol 16.777 2-Methyl-2-Propanol 12.47 2-MethylPentane 1.89 2-MethylPyridine 9.9533 2-NitroPropane 25.654 2-Octanone 9.4678 2-Pentanone 15.200 2-Propanol 19.264 2-Propen-1-ol 19.011 3-MethylPyridine 11.645 3-Pentanone 16.78 4-Heptanone 12.257 4-Methyl-2-Pentanone 12.887 4-MethylPyridine 11.957 5-Nonanone 10.6 AceticAcid 6.2528 AcetoPhenone 17.44 a-ChloroToluene 6.7175 Anisole 4.2247 Benzaldehyde 18.220 BenzoNitrile 25.592 BenzylAlcohol 12.457 BromoBenzene 5.3954 BromoEthane 9.01 Bromoform 4.2488 Butanal 13.45 ButanoicAcid 2.9931 Butanone 18.246 ButanoNitrile 24.291 ButylAmine 4.6178 ButylEthanoate 4.9941 CarbonDiSulfide 2.6105 Cis-1,2-DiMethylCycloHexane 2.06 Cis-Decalin 2.2139 CycloHexanone 15.619 CycloPentane 1.9608 CycloPentanol 16.989 CycloPentanone 13.58 Decalin-mixture 2.196 DiBromomEthane 7.2273 DiButylEther 3.0473 DiEthylAmine 3.5766 DiEthylSulfide 5.723 DiIodoMethane 5.32 DiIsoPropylEther 3.38 DiMethylDiSulfide 9.6 DiPhenylEther 3.73 DiPropylAmine 2.9112 e-1,2-DiChloroEthene 2.14 e-2-Pentene 2.051 EthaneThiol 6.667 EthylBenzene 2.4339 EthylEthanoate 5.9867 EthylMethanoate 8.3310 EthylPhenylEther 4.1797 FluoroBenzene 5.42 Formamide 108.94 FormicAcid 51.1 HexanoicAcid 2.6 IodoBenzene 4.5470 IodoEthane 7.6177 IodoMethane 6.8650 IsoPropylBenzene 2.3712 m-Cresol 12.44 Mesitylene 2.2650 MethylBenzoate 6.7367 MethylButanoate 5.5607 MethylCycloHexane 2.024 MethylEthanoate 6.8615 MethylMethanoate 8.8377 MethylPropanoate 6.0777 m-Xylene 2.3478 n-ButylBenzene 2.36 n-Decane 1.9846 n-Dodecane 2.0060 n-Hexadecane 2.0402 n-Hexane 1.8819 NitroBenzene 34.809 NitroEthane 28.29 n-MethylAniline 5.9600 n-MethylFormamide-mixture 181.56 n,n-DiMethylAcetamide 37.781 n,n-DiMethylFormamide 37.219 n-Nonane 1.9605 n-Octane 1.9406 n-Pentadecane 2.0333 n-Pentane 1.8371 n-Undecane 1.9910 o-ChloroToluene 4.6331 o-Cresol 6.76 o-DiChloroBenzene 9.9949 o-NitroToluene 25.669 o-Xylene 2.5454 Pentanal 10.0 PentanoicAcid 2.6924 PentylAmine 4.2010 PentylEthanoate 4.7297 PerFluoroBenzene 2.029 p-IsoPropylToluene 2.2322 Propanal 18.5 PropanoicAcid 3.44 PropanoNitrile 29.324 PropylAmine 4.9912 PropylEthanoate 5.5205 p-Xylene 2.2705 Pyridine 12.978 sec-ButylBenzene 2.3446 tert-ButylBenzene 2.3447 TetraChloroEthene 2.268 TetraHydroThiophene-s,s-dioxide 43.962 Tetralin 2.771 Thiophene 2.7270 Thiophenol 4.2728 trans-Decalin 2.1781 TriButylPhosphate 8.1781 TriChloroEthene 3.422 TriEthylAmine 2.3832 Xylene-mixture 2.3879 z-1,2-DiChloroEthene 9.2

pyscf.solvent.ddcosmo.DDCOSMO#

alias of ddCOSMO

class pyscf.solvent.ddcosmo.Grids(mol)[source]#

Bases: Grids

DFT grids without sorting grids

alignment = 0#
build(mol=None, *args, **kwargs)[source]#
pyscf.solvent.ddcosmo.atoms_with_vdw_overlap(atm_id, atom_coords, r_vdw)[source]#
pyscf.solvent.ddcosmo.cache_fake_multipoles(grids, r_vdw, lmax)[source]#
class pyscf.solvent.ddcosmo.ddCOSMO(mol)[source]#

Bases: StreamObject

as_solver(verbose=None)#

Generate ddcosmo function to compute energy and potential matrix

build()[source]#
property dm#

Density matrix to generate the frozen ddCOSMO solvent potential.

dump_flags(verbose=None)[source]#
energy(dm)#

ddCOSMO energy Es = 1/2 f(eps) int rho(r) W(r) dr

property epcm#
gen_solver(verbose=None)#

Generate ddcosmo function to compute energy and potential matrix

get_atomic_radii()#
kernel(dm)[source]#

A single shot solvent effects for given density matrix.

nuc_grad_method(grad_method)[source]#

For grad_method in vacuum, add nuclear gradients of solvent

regularize_xt(t, eta, scale=1)[source]#
reset(mol=None)[source]#

Reset mol and clean up relevant attributes for scanner mode

to_gpu(out=None)#

Convert a method to its corresponding GPU variant, and recursively converts all attributes of a method to cupy objects or gpu4pyscf objects.

property vpcm#
pyscf.solvent.ddcosmo.ddcosmo_for_casci(mc, solvent_obj=None, dm=None)[source]#

Add solvent model to CASCI method.

Kwargs:
dmif given, solvent does not respond to the change of density

matrix. A frozen ddCOSMO potential is added to the results.

pyscf.solvent.ddcosmo.ddcosmo_for_casscf(mc, solvent_obj=None, dm=None)[source]#

Add solvent model to CASSCF method.

Kwargs:
dmif given, solvent does not respond to the change of density

matrix. A frozen ddCOSMO potential is added to the results.

pyscf.solvent.ddcosmo.ddcosmo_for_post_scf(method, solvent_obj=None, dm=None)[source]#

A wrapper of solvent model for post-SCF methods (CC, CI, MP etc.)

NOTE: this implementation often causes (macro iteration) convergence issue

Kwargs:
dmif given, solvent does not respond to the change of density

matrix. A frozen ddCOSMO potential is added to the results.

pyscf.solvent.ddcosmo.ddcosmo_for_scf(mf, solvent_obj=None, dm=None)[source]#

Add solvent model to SCF (HF and DFT) method.

Kwargs:
dmif given, solvent does not respond to the change of density

matrix. A frozen ddCOSMO potential is added to the results.

pyscf.solvent.ddcosmo.ddcosmo_for_tdscf(method, solvent_obj=None, dm=None)[source]#

Add solvent model in TDDFT calculations.

Kwargs:
dmif given, solvent does not respond to the change of density

matrix. A frozen ddCOSMO potential is added to the results.

pyscf.solvent.ddcosmo.energy(pcmobj, dm)[source]#

ddCOSMO energy Es = 1/2 f(eps) int rho(r) W(r) dr

pyscf.solvent.ddcosmo.gen_ddcosmo_solver(pcmobj, verbose=None)[source]#

Generate ddcosmo function to compute energy and potential matrix

pyscf.solvent.ddcosmo.get_atomic_radii(pcmobj)[source]#
pyscf.solvent.ddcosmo.make_L(pcmobj, r_vdw, ylm_1sph, fi)[source]#
pyscf.solvent.ddcosmo.make_fi(pcmobj, r_vdw)[source]#
pyscf.solvent.ddcosmo.make_grids_one_sphere(lebedev_order)[source]#
pyscf.solvent.ddcosmo.make_phi(pcmobj, dm, r_vdw, ui, ylm_1sph, with_nuc=True)[source]#

Induced potential of ddCOSMO model

Kwargs:
with_nuc (bool): Mute the contribution of nuclear charges when

computing the second order derivatives of energy

pyscf.solvent.ddcosmo.make_psi_vmat(pcmobj, dm, r_vdw, ui, ylm_1sph, cached_pol, Xvec, L, with_nuc=True)[source]#

The first order derivative of E_ddCOSMO wrt density matrix

Kwargs:
with_nuc (bool): Mute the contribution of nuclear charges when

computing the second order derivatives of energy.

pyscf.solvent.ddcosmo.regularize_xt(t, eta)[source]#

pyscf.solvent.ddpcm module#

domain decomposition PCM (In testing)

See also JCP, 144, 054101 JCP, 144, 160901

pyscf.solvent.ddpcm.DDPCM#

alias of ddPCM

class pyscf.solvent.ddpcm.ddPCM(mol)[source]#

Bases: ddCOSMO

as_solver(verbose=None)#

Generate ddcosmo function to compute energy and potential matrix

build()[source]#
dump_flags(verbose=None)[source]#
gen_solver(verbose=None)#

Generate ddcosmo function to compute energy and potential matrix

nuc_grad_method(grad_method)[source]#

For grad_method in vacuum, add nuclear gradients of solvent

regularize_xt(t, eta, scale=1)[source]#
pyscf.solvent.ddpcm.ddpcm_for_casci(mc, solvent_obj=None, dm=None)[source]#

Add solvent model to CASCI method.

Kwargs:
dmif given, solvent does not respond to the change of density

matrix. A frozen ddCOSMO potential is added to the results.

pyscf.solvent.ddpcm.ddpcm_for_casscf(mc, solvent_obj=None, dm=None)[source]#

Add solvent model to CASSCF method.

Kwargs:
dmif given, solvent does not respond to the change of density

matrix. A frozen ddCOSMO potential is added to the results.

pyscf.solvent.ddpcm.ddpcm_for_post_scf(method, solvent_obj=None, dm=None)[source]#

A wrapper of solvent model for post-SCF methods (CC, CI, MP etc.)

NOTE: this implementation often causes (macro iteration) convergence issue

Kwargs:
dmif given, solvent does not respond to the change of density

matrix. A frozen ddCOSMO potential is added to the results.

pyscf.solvent.ddpcm.ddpcm_for_scf(mf, solvent_obj=None, dm=None)[source]#

Add solvent model to SCF (HF and DFT) method.

Kwargs:
dmif given, solvent does not respond to the change of density

matrix. A frozen ddCOSMO potential is added to the results.

pyscf.solvent.ddpcm.ddpcm_for_tdscf(method, solvent_obj=None, dm=None)[source]#

Add solvent model in TDDFT calculations.

Kwargs:
dmif given, solvent does not respond to the change of density

matrix. A frozen ddCOSMO potential is added to the results.

pyscf.solvent.ddpcm.energy(pcmobj, dm)[source]#

ddPCM energy Es = 1/2 f(eps) int rho(r) W(r) dr

pyscf.solvent.ddpcm.gen_ddpcm_solver(pcmobj, verbose=None)[source]#
pyscf.solvent.ddpcm.make_A(pcmobj, r_vdw, ylm_1sph, ui)[source]#
pyscf.solvent.ddpcm.regularize_xt(t, eta)[source]#

pyscf.solvent.pcm module#

PCM family solvent models

class pyscf.solvent.pcm.PCM(mol)[source]#

Bases: StreamObject

Hessian(hess_method)[source]#
build(ng=None)[source]#
dump_flags(verbose=None)[source]#
kernel(dm)#

A single shot solvent effects for given density matrix.

nuc_grad_method(grad_method)[source]#
reset(mol=None)[source]#
to_gpu()[source]#
pyscf.solvent.pcm.gen_surface(mol, ng=302, rad=array([3.77945036, 2.07869874, 2.64561657, 3.43930155, 2.89128097, 3.62827416, 3.21253441, 2.92907549, 2.87238371, 2.7778974, 2.91017823, 4.2896783, 3.2692262, 3.47709607, 3.96842486, 3.40150702, 3.40150702, 3.30702072, 3.55268511, 5.19674684, 4.36526735, 3.77945036, 3.77945036, 3.77945036, 3.77945036, 3.77945036, 3.77945036, 3.77945036, 3.08025358, 2.64561657, 2.62671931, 3.53378785, 3.98732212, 3.49599333, 3.59047964, 3.49599333, 3.81724677, 5.72587016, 4.70541805, 3.77945036, 3.77945036, 3.77945036, 3.77945036, 3.77945036, 3.77945036, 3.77945036, 3.08025358, 3.25032893, 2.98576728, 3.64717142, 4.10070569, 3.89283582, 3.89283582, 3.74165773, 4.08180843, 6.48176061, 4.70541805, 3.77945036, 3.77945036, 3.77945036, 3.77945036, 3.77945036, 3.77945036, 3.77945036, 3.77945036, 3.77945036, 3.77945036, 3.77945036, 3.77945036, 3.77945036, 3.77945036, 3.77945036, 3.77945036, 3.77945036, 3.77945036, 3.77945036, 3.77945036, 3.77945036, 3.30702072, 3.13694537, 2.92907549, 3.7038632, 3.81724677, 3.91173308, 3.72276047, 3.81724677, 4.15739747, 6.57624691, 5.34792493, 3.77945036, 3.77945036, 3.77945036, 3.51489059, 3.77945036, 3.77945036, 3.77945036, 3.77945036, 3.77945036, 3.77945036, 3.77945036, 3.77945036, 3.77945036, 3.77945036, 3.77945036]), vdw_scale=1.2)[source]#
  1. Phys. Chem. A 1999, 103, 11060-11079

pyscf.solvent.pcm.get_D_S(surface, with_S=True, with_D=False)[source]#

generate D and S matrix in J. Chem. Phys. 133, 244111 (2010) The diagonal entries of S is not filled

pyscf.solvent.pcm.get_F_A(surface)[source]#

generate F and A matrix in J. Chem. Phys. 133, 244111 (2010)

pyscf.solvent.pcm.pcm_for_casci(mc, solvent_obj=None, dm=None)[source]#

Add solvent model to CASCI method.

Kwargs:
dmif given, solvent does not respond to the change of density

matrix. A frozen ddCOSMO potential is added to the results.

pyscf.solvent.pcm.pcm_for_casscf(mc, solvent_obj=None, dm=None)[source]#

Add solvent model to CASSCF method.

Kwargs:
dmif given, solvent does not respond to the change of density

matrix. A frozen ddCOSMO potential is added to the results.

pyscf.solvent.pcm.pcm_for_post_scf(method, solvent_obj=None, dm=None)[source]#

A wrapper of solvent model for post-SCF methods (CC, CI, MP etc.)

NOTE: this implementation often causes (macro iteration) convergence issue

Kwargs:
dmif given, solvent does not respond to the change of density

matrix. A frozen ddCOSMO potential is added to the results.

pyscf.solvent.pcm.pcm_for_scf(mf, solvent_obj=None, dm=None)[source]#

Add solvent model to SCF (HF and DFT) method.

Kwargs:
dmif given, solvent does not respond to the change of density

matrix. A frozen ddCOSMO potential is added to the results.

pyscf.solvent.pcm.pcm_for_tdscf(method, solvent_obj=None, dm=None)[source]#

Add solvent model in TDDFT calculations.

Kwargs:
dmif given, solvent does not respond to the change of density

matrix. A frozen ddCOSMO potential is added to the results.

pyscf.solvent.pcm.switch_h(x)[source]#

switching function (eq. 3.19) J. Chem. Phys. 133, 244111 (2010) notice the typo in the paper

pyscf.solvent.pol_embed module#

pyscf.solvent.smd module#

SMD solvent model, copied from GPU4PYSCF with modification for CPU

class pyscf.solvent.smd.SMD(mol, solvent='')[source]#

Bases: PCM

Hessian(hess_method)[source]#
build(ng=None)[source]#
dump_flags(verbose=None)[source]#
get_cds()[source]#
nuc_grad_method(grad_method)[source]#
reset(mol=None)[source]#
property sol_desc#
property solvent#
pyscf.solvent.smd.get_cds_legacy(smdobj)[source]#
pyscf.solvent.smd.smd_for_scf(mf, solvent_obj=None, dm=None)[source]#

Add solvent model to SCF (HF and DFT) method.

Kwargs:
dmif given, solvent does not respond to the change of density

matrix. A frozen ddCOSMO potential is added to the results.

pyscf.solvent.smd.smd_radii(alpha)[source]#

eq. (16) use smd radii if defined use Bondi radii if defined use 2.0 otherwise

pyscf.solvent.smd_experiment module#

SMD solvent model (for experiment and education) copied from GPU4PySCF with modification for CPU

pyscf.solvent.smd_experiment.atomic_surface_tension(symbols, coords, n, alpha, beta, water=True)[source]#
  • list of atomic symbols

  • atomic coordinates in Anstrong

  • solvent descriptors: n, alpha, beta

pyscf.solvent.smd_experiment.get_cds(smdobj)[source]#
pyscf.solvent.smd_experiment.molecular_surface_tension(beta, gamma, phi, psi)[source]#
pyscf.solvent.smd_experiment.naive_sasa(mol, rad)[source]#
pyscf.solvent.smd_experiment.swtich_function(R, r, dr)[source]#

Module contents#

pyscf.solvent.DDCOSMO(method_or_mol, solvent_obj=None, dm=None)#

Initialize ddCOSMO model.

Examples:

>>> mf = ddCOSMO(scf.RHF(mol))
>>> mf.kernel()
>>> sol = ddCOSMO(mol)
>>> mc = ddCOSMO(CASCI(mf, 6, 6), sol)
>>> mc.kernel()
pyscf.solvent.DDPCM(method_or_mol, solvent_obj=None, dm=None)#

Initialize ddPCM model.

Examples:

>>> mf = ddPCM(scf.RHF(mol))
>>> mf.kernel()
>>> sol = ddPCM(mol)
>>> mc = ddPCM(CASCI(mf, 6, 6), sol)
>>> mc.kernel()
pyscf.solvent.PCM(method_or_mol, solvent_obj=None, dm=None)[source]#

Initialize PCM model.

Examples:

>>> mf = PCM(scf.RHF(mol))
>>> mf.kernel()
>>> sol = PCM(mol)
>>> mc = PCM(CASCI(mf, 6, 6), sol)
>>> mc.kernel()
pyscf.solvent.PE(method_or_mol, solvent_obj, dm=None)[source]#

Initialize polarizable embedding model.

Args:
method_or_mol (pyscf method object or gto.Mole object)

If method_or_mol is gto.Mole object, this function returns a PolEmbed object constructed with this Mole object.

solvent_obj (PolEmbed object or dictionary with options or str)

If solvent_obj is an object of PolEmbed class, the PE-enabled method will be created using solvent_obj. If solvent_obj is dict or str, a PolEmbed object will be created first with the solvent_obj, on top of which PE-enabled method will be created.

Examples:

>>> pe_options = {"potfile": "pyframe.pot"}
>>> mf = PE(scf.RHF(mol), pe_options)
>>> mf.kernel()
pyscf.solvent.SMD(method_or_mol, solvent_obj=None, dm=None)[source]#

Initialize PCM model.

Examples:

>>> mf = PCM(scf.RHF(mol))
>>> mf.kernel()
>>> sol = PCM(mol)
>>> mc = PCM(CASCI(mf, 6, 6), sol)
>>> mc.kernel()
pyscf.solvent.ddCOSMO(method_or_mol, solvent_obj=None, dm=None)[source]#

Initialize ddCOSMO model.

Examples:

>>> mf = ddCOSMO(scf.RHF(mol))
>>> mf.kernel()
>>> sol = ddCOSMO(mol)
>>> mc = ddCOSMO(CASCI(mf, 6, 6), sol)
>>> mc.kernel()
pyscf.solvent.ddPCM(method_or_mol, solvent_obj=None, dm=None)[source]#

Initialize ddPCM model.

Examples:

>>> mf = ddPCM(scf.RHF(mol))
>>> mf.kernel()
>>> sol = ddPCM(mol)
>>> mc = ddPCM(CASCI(mf, 6, 6), sol)
>>> mc.kernel()