fcdmft.rpa.mol.urpa module#

Spin-unrestricted random phase approximation (direct RPA/dRPA in chemistry) with N^4 scaling

Method:

Main routines are based on GW-AC method described in: T. Zhu and G.K.-L. Chan, J. Chem. Theory. Comput. 17, 727-741 (2021) X. Ren et al., New J. Phys. 14, 053020 (2012)

class fcdmft.rpa.mol.urpa.URPA(mf, frozen=None, auxbasis=None)[source]#

Bases: RPA

Attributes:
nmo
nocc

Methods

__call__(*args, **kwargs)

Update the attributes of the current object.

ao2mo([mo_coeff])

Transform density-fitting integral from AO to MO.

apply(fn, *args, **kwargs)

Apply the fn to rest arguments: return fn(*args, **kwargs). The return value of method set is the object itself. This allows a series of functions/methods to be executed in pipe.

as_scanner()

Generating a scanner/solver for RPA PES.

check_sanity()

Check input of class/object attributes, check whether a class method is overwritten.

copy()

Returns a shallow copy

get_ehf()

Get Hartree-Fock energy.

get_frozen_mask()

Get boolean mask for the unrestricted reference orbitals.

get_grids([alg, nw, mo_energy])

Generate grids for integration.

initialize_df([auxbasis])

Initialize density fitting.

kernel([mo_energy, mo_coeff, Lpq, nw])

RPA correlation and total energy

loop_ao2mo([mo_coeff, ijslice])

Transform density-fitting integral from AO to MO by block.

post_kernel(envs)

A hook to be run after the main body of the kernel function.

pre_kernel(envs)

A hook to be run before the main body of kernel function is executed.

run(*args, **kwargs)

Call the kernel function of current object.

set(*args, **kwargs)

Update the attributes of the current object.

view(cls)

New view of object with the same attributes.

dump_flags

get_nmo

get_nocc

ao2mo(mo_coeff=None)[source]#

Transform density-fitting integral from AO to MO.

Parameters:
mo_coeffdouble 3d array, optional

coefficient from AO to MO, by default None

Returns:
Lpqdouble 4d array

three-center density-fitting matrix in MO

as_scanner()#

Generating a scanner/solver for RPA PES.

dump_flags(verbose=None)[source]#
get_ehf()[source]#

Get Hartree-Fock energy.

Returns:
e_hfdouble

Hartree-Fock energy

get_frozen_mask()#

Get boolean mask for the unrestricted reference orbitals.

In the returned boolean (mask) array of frozen orbital indices, the element is False if it corresponds to the frozen orbital.

get_grids(alg=None, nw=None, mo_energy=None)[source]#

Generate grids for integration.

Parameters:
algstr, optional

algorithm for generating grids, by default None

nwint, optional

number of grids, by default None

mo_energydouble 2d array, optional

orbital energy, used for minimax grids, by default None

Returns:
freqsdouble 1d array

frequency grid

wtsdouble 1d array

weight of grids

get_nmo()#
get_nocc()#
kernel(mo_energy=None, mo_coeff=None, Lpq=None, nw=None)[source]#

RPA correlation and total energy

Calculated total energy, HF energy and RPA correlation energy are stored in self.e_tot, self.e_hf, self.e_corr

Parameters:
mo_energydouble 2d array

molecular orbital energies

mo_coeffdouble 3d array

molecular orbital coefficients

Lpqdouble 4d array, optional

density fitting 3-center integral in MO basis, by default None

nwint, optional

number of frequency point on imaginary axis, by default None

Returns:
self.e_corrfloat

RPA correlation energy

fcdmft.rpa.mol.urpa.as_scanner(rpa)[source]#

Generating a scanner/solver for RPA PES.

fcdmft.rpa.mol.urpa.get_idx_metal(mo_occ, threshold=1e-06)[source]#

Get index of occupied/virtual/fractional orbitals of metals.

Parameters:
mo_occdouble 1d array

occupation number

thresholddouble, optional

threshold to determine fractionally occupied orbitals, by default 1.0e-6

Returns:
idx_occlist

list of occupied orbital indexes

idx_fraclist

list of fractionally occupied orbital indexes

idx_virlist

list of virtual orbital indexes

fcdmft.rpa.mol.urpa.get_rpa_ecorr(rpa, Lpq, freqs, wts)[source]#

Compute RPA correlation energy.

Parameters:
rpaURPA

rpa object

Lpqdouble 4d array

density fitting 3-center integral in MO basis

freqsdouble 1d array

frequency grid

wtsdouble 1d array

weight of grids

Returns:
e_corrdouble

RPA correlation energy

fcdmft.rpa.mol.urpa.kernel(rpa, mo_energy, mo_coeff, Lpq=None, nw=None)[source]#

RPA correlation and total energy

Parameters:
rpaRPA

rpa object

mo_energydouble 2d array

molecular orbital energies

mo_coeffdouble 3d array

molecular orbital coefficients

Lpqdouble array, optional

density fitting 3-center integral in MO basis, by default None

nwint, optional

number of frequency point on imaginary axis, by default None

Returns:
e_totfloat

RPA total energy

e_hffloat

HF energy (exact exchange for given mo_coeff)

e_corrfloat

RPA correlation energy