analyzers

The ciderpress.pyscf.analyzers module provides post-processing tools for analyzing PySCF DFT calculations. In particular, sub-classes of ciderpress.pyscf.analyzers.ElectronAnalyzer can generate densities, kinetic energy densities, exchange energy densities, etc. on a real-space grid.

class ciderpress.pyscf.analyzers.ElectronAnalyzer(mol, dm, grids_level=3, mo_occ=None, mo_coeff=None, mo_energy=None)

A class for generating and storing data derived from a PySCF electronic structure calculation, in particular distributions on a real-space grid such as the density, exchange (correlation) energy density, Coulomb energy density, etc.

calculate_vxc(xcname, xcfunc=None, grids=None, xctype='MGGA')

Computes the XC potential matrix for a functional, store it, and return it.

Parameters:
  • xcname (str) – XC functional

  • xcfunc (callable) – XC function in case one wants to use an XC functional not in libxc

  • grids (optional) – Grid to use to calculate XC.

Returns:

XC potential matrix

Return type:

vxc (nspin x nao x nao)

calculate_vxc_on_mo(xcname, orbs=None, **kwargs)

Compute contributions of XC potential to the eigenvalues. If VXC_{xcname} is not in _data, calculate_vxc is called first.

Parameters:
  • xcname (str) – Name of XC functional (for libxc)

  • orbs – Orbital index dictionary for computing orbital derivatives, in the format use for descriptors.get_descriptors.

  • **kwargs – extra arguments to pass to calculate_vxc, if it is called.

Returns:

eigenvalue contributions. If orbs is provided, it will be in

the same format used by descritpors.get_descriptors. Otherwise, it will be a numpy array with all the eigenvalue contributions.

dump(fname)

Dump self to an hdf5 file called fname.

Parameters:

fname (str) – Name of file to dump to

static from_calc(calc, grids_level=None, store_energy_orig=True)

NOTE: This has side effects on calc, see notes below.

Parameters:
  • calc – SCF object from PySCF

  • grids_level – Size of PySCF grids for XC integration

  • store_energy_orig – Whether to store original xc energy.

Returns:

analyzer constructed from calc

Return type:

ElectronAnalyzer

static load(fname)

Load instance of cls from hdf5

Parameters:

fname (str) – Name of file from which to load

class ciderpress.pyscf.analyzers.RHFAnalyzer(mol, dm, grids_level=3, mo_occ=None, mo_coeff=None, mo_energy=None)
get_ee_energy_density()

Returns the sum of E_{Ha} and E_{X}, i.e. the Coulomb repulsion energy of the HF or KS Slater determinant.

get_rs(term, omega, tol=1e-09)

Function for accessing range-separated data from _data Finds match based on a tolerance, in case rounding issues arise with floats.

get_xc(xcname)

Function for accessing XC functional data from _data

get_xc_energy(xcname)

Store and return the XC energy for the functional given by xcname

ciderpress.pyscf.analyzers.RKSAnalyzer

alias of RHFAnalyzer

class ciderpress.pyscf.analyzers.UHFAnalyzer(mol, dm, grids_level=3, mo_occ=None, mo_coeff=None, mo_energy=None)
ciderpress.pyscf.analyzers.UKSAnalyzer

alias of UHFAnalyzer