PySCF Calculator Decoration
make_cider_calc() decorates a restricted or
unrestricted PySCF Kohn–Sham object with a mapped CIDER functional. The
mlfunc argument accepts a packaged name, trusted model path, or loaded
MappedXC/
MappedXC2 object. The decorator selects
its numerical integrator from the stored feature settings and supplies CIDER
energy, potential, checkpoint, density-fitting, and supported gradient
behavior.
Exchange models use xmix, xkernel, and ckernel to define their
surrogate-hybrid composition. Full-XC models use their serialized energy
composition. D4 metadata is reconciled after the SCF energy as described in
Choosing a CIDER Functional.
The basic full-XC use case is:
from pyscf import gto
from pyscf.dft import RKS
from ciderpress.pyscf.dft import make_cider_calc
mol = gto.M(...)
ks = RKS(mol)
ks = make_cider_calc(ks, "CIDER26XCCHEM")
etot = ks.kernel()
See examples/pyscf/production_calc.py and Molecular Calculations with PySCF for a complete example.
- ciderpress.pyscf.dft.make_cider_calc(ks, mlfunc, xmix=1.0, xc=None, xkernel=None, ckernel=None, mlfunc_format=None, nlc_coeff=None, nldf_init=None, sdmx_init=None, rhocut=None)
Decorate the PySCF DFT object ks with a CIDER functional mlfunc. If xc, xkernel, ckernel, and xmix are not specified, the equivalent of HF with CIDER in place of EXX is performed. The XC energy is:
E_xc = xmix * E_x^CIDER + (1-xmix) * xkernel + ckernel + xc
Mapped full-XC models already contain their complete baseline and require
xmix=1.0,xc=None,xkernel=None, andckernel=None(the defaults). Other compositions are rejected to prevent double counting.NOTE: Only GGA-level XC functionals can be used with GGA-level (orbital-independent) CIDER functionals currently.
- Parameters:
ks (pyscf.dft.KohnShamDFT) – DFT object
mlfunc (MappedXC, MappedXC2, str) – CIDER exchange functional or file name
xmix (float) – Fraction of CIDER exchange used.
xc (str or None) – If specified, this semi-local XC code is evaluated and added to the total XC energy.
xkernel (str or None) – Semi-local X code in libxc. Scaled by (1-xmix).
ckernel (str or None) – Semi-local C code in libxc.
mlfunc_format (str or None) – ‘joblib’ or ‘yaml’, specifies the format of mlfunc if it is a string corresponding to a file name. If unspecified, infer from file extension and raise error if file type cannot be determined.
nlc_coeff (tuple or None) – VV10 coefficients. If None, VV10 term is not evaluated.
nldf_init (PySCFNLDFInitializer)
sdmx_init (PySCFSDMXInitializer)
rhocut (float)
- Returns:
A decorated Kohn-Sham object for performing a CIDER calculation.