dft

The ciderpress.pyscf.dft module provides the function make_cider_calc(), which takes a Pyscf KohnShamDFT object and a CIDER functional object (MappedXC or MappedXC2) and returns an instance of a KohnShamDFT subclass that uses the CIDER functional. The function is similar to native PySCF routines like density_fit(), in which the input SCF object is “decorated” with the necessary routines to evaluate the CIDER functional.

The basic use case is:

from pyscf.dft import RKS
from pyscf import gto
mol = gto.M(...)
ks = dft.RKS(mol)
ks = make_cider_calc(ks, mlfunc, ...)
etot = ks.kernel()

For a complete example, please see examples/pyscf/simple_calc.py and the other examples in examples/pyscf.

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

Note the above formula applies even if E_x^CIDER is a full XC functional. If E_x^CIDER is a full XC functional that does not need a baseline, the user should pass xmix=1.0, xc=None, xkernel=None, ckernel=None (the defaults).

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.