fcdmft.rpa.pbc.krpa_slow module#

Periodic k-point spin-restricted random phase approximation (direct RPA/dRPA in chemistry) with N^4 scaling

Method:

Main routines are based on GW-AC method descirbed 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.pbc.krpa_slow.KRPA(mf, frozen=None)[source]#

Bases: StreamObject

Attributes:
nmo
nocc

Methods

__call__(*args, **kwargs)

Update the attributes of the current object.

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.

check_sanity()

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

copy()

Returns a shallow copy

get_frozen_mask()

Boolean mask for orbitals in k-point post-HF method.

get_nmo([per_kpoint])

Number of orbitals for k-point calculations.

get_nocc([per_kpoint])

Number of occupied orbitals for k-point calculations.

kernel([mo_energy, mo_coeff, nw])

Args:

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

dump_flags()[source]#
get_frozen_mask()#

Boolean mask for orbitals in k-point post-HF method.

Creates a boolean mask to remove frozen orbitals and keep other orbitals for post-HF calculations.

Args:

mp (MP2): An instantiation of an SCF or post-Hartree-Fock object.

Returns:

moidx (list of ndarray of bool): Boolean mask of orbitals to include.

get_nmo(per_kpoint=False)#

Number of orbitals for k-point calculations.

Number of orbitals for use in a calculation with k-points, taking into account frozen orbitals.

Note:

If per_kpoint is False, then the number of orbitals here is equal to max(nocc) + max(nvir), where each max is done over all k-points. Otherwise the number of orbitals is returned as a list of number of orbitals at each k-point.

Args:

mp (MP2): An instantiation of an SCF or post-Hartree-Fock object. per_kpoint (bool, optional): True returns the number of orbitals at each k-point.

For a description of False, see Note.

Returns:
nmo (int, list of int): Number of orbitals. For return type, see description of arg

per_kpoint.

get_nocc(per_kpoint=False)#

Number of occupied orbitals for k-point calculations.

Number of occupied orbitals for use in a calculation with k-points, taking into account frozen orbitals.

Args:

mp (MP2): An instantiation of an SCF or post-Hartree-Fock object. per_kpoint (bool, optional): True returns the number of occupied

orbitals at each k-point. False gives the max of this list.

Returns:
nocc (int, list of int): Number of occupied orbitals. For return type, see description of arg

per_kpoint.

kernel(mo_energy=None, mo_coeff=None, nw=40)[source]#
Args:

mo_energy : 2D array (nkpts, nmo), mean-field mo energy mo_coeff : 3D array (nkpts, nmo, nmo), mean-field mo coefficient nw: integer, grid number

Returns:

self.e_tot : RPA total eenrgy self.e_hf : EXX energy self.e_corr : RPA correlation energy

property nmo#
property nocc#
fcdmft.rpa.pbc.krpa_slow.get_rho_response(rpa, omega, mo_energy, Lpq, kL, kidx)[source]#

Compute density response function in auxiliary basis at freq iw (for gapped systems with integer occupations)

fcdmft.rpa.pbc.krpa_slow.get_rho_response_metal(rpa, omega, mo_energy, mo_occ, Lpq, kL, kidx)[source]#

Compute density response function in auxiliary basis at freq iw (for metallic systems with fractional occupations)

fcdmft.rpa.pbc.krpa_slow.get_rpa_ecorr(rpa, freqs, wts, max_memory=8000)[source]#

Compute RPA correlation energy

fcdmft.rpa.pbc.krpa_slow.get_rpa_ecorr_outcore(rpa, freqs, wts, max_memory=8000)[source]#

Compute RPA correlation energy

fcdmft.rpa.pbc.krpa_slow.get_rpa_ecorr_outcore_metal(rpa, freqs, wts, max_memory=8000)[source]#

Compute RPA correlation energy

fcdmft.rpa.pbc.krpa_slow.kernel(rpa, mo_energy, mo_coeff, nw=None, verbose=3)[source]#

RPA correlation and total energy

Returns:

e_tot : RPA total energy e_hf : EXX energy e_corr : RPA correlation energy