fcdmft.gw.mol.ugw_ac module#

Spin-restricted G0W0-AC QP eigenvalues This implementation has N^4 scaling, and is faster than GW-CD (N^4) and analytic GW (N^6) methods. GW-AC is recommended for valence states only, and is inaccurate for core states.

Method:

T. Zhu and G.K.-L. Chan, J. Chem. Theory. Comput. 17, 727-741 (2021) Compute self-energy on imaginary frequency with density fitting, then analytically continued to real frequency

Other useful references:

J. Chem. Theory Comput. 12, 3623-3635 (2016) New J. Phys. 14, 053020 (2012)

class fcdmft.gw.mol.ugw_ac.UGWAC(mf, frozen=None, auxbasis=None)[source]#

Bases: GWAC

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.

check_sanity()

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

copy()

Returns a shallow copy

energy_tot()

Compute GW total energy according to Galitskii-Migdal formula.

get_ef([mo_energy])

Get Fermi level.

get_frozen_mask()

Get boolean mask for the unrestricted reference orbitals.

get_sigma_exchange(mo_coeff)

Get exchange self-energy (EXX).

initialize_df([auxbasis])

Initialize density fitting.

kernel()

Do one-shot spin-unrestricted GW calculation using analytical continuation.

loop_ao2mo([mo_coeff, spin, ijslicea, ijsliceb])

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

make_gf(omega[, eta, mode])

Get G0W0 Green's function by AC fitting.

make_rdm1([ao_repr, mode])

Get GW density matrix from G(it=0).

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.

setup_evaluation_grid([fallback_freqs, ...])

Set up self-energy grid, aka freqs2, aka gw.freqs.

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

dump_flags(verbose=None)[source]#
get_ef(mo_energy=None)[source]#

Get Fermi level. For gapped systems, Fermi level is computed as the average between HOMO and LUMO. For metallic systems, Fermi level is optmized according to mo_energy.

Parameters:
mo_energydouble 2d array, optional

orbital energy, by default None

Returns:
efdouble

Fermi level

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_nmo()#
get_nocc()#
kernel()[source]#

Do one-shot spin-unrestricted GW calculation using analytical continuation.

loop_ao2mo(mo_coeff=None, spin=None, ijslicea=None, ijsliceb=None)[source]#

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

Parameters:
mo_coeffdouble 3d array, optional

coefficient from AO to MO, by default None

spinstr, optional

spin channel, by default None

ijsliceatuple, optional

tuples for (1st idx start, 1st idx end, 2nd idx start, 2nd idx end) of alpha spin, by default None

ijslicebtuple, optional

tuples for (1st idx start, 1st idx end, 2nd idx start, 2nd idx end) of beta spin, by default None

Returns:
eri_3ddouble 3d or 4d array

three-center density-fitting matrix in MO in a block

make_gf(omega, eta=0.0, mode='dyson')[source]#

Get G0W0 Green’s function by AC fitting.

Parameters:
omegacomplex 1d array

frequency on which to evaluate the Green’s function

etadouble, optional

broadening parameter. Defaults to 0.

modestr, optional

mode for Dyson equation, ‘linear’ or ‘dyson’, by default ‘dyson’

Returns:
gfcomplex 4d array

GW Green’s function

gf0complex 4d array

non-interacting Green’s function

sigmacomplex 4d array

self-energy

make_rdm1(ao_repr=False, mode='linear')[source]#

Get GW density matrix from G(it=0). G(it=0) = int G(iw) dw As shown in doi.org/10.1021/acs.jctc.0c01264, calculate G0W0 Green’s function using Dyson equation is not particle number conserving. The linear mode G = G0 + G0 Sigma G0 is particle number conserving.

Parameters:
ao_reprbool, optional

return dm in AO space instead of MO space, by default False

modestr, optional

mode for Dyson equation, ‘linear’ or ‘dyson’, by default ‘linear’

Returns:
rdm1double 3d array

one-particle density matrix

fcdmft.gw.mol.ugw_ac.get_g0(omega, mo_energy, eta)[source]#

Get non-interacting Green’s function.

Parameters:
omegadouble or complex array

frequency grids

mo_energydouble 2d array

orbital energy

etadouble

broadening parameter

Returns:
gf0complex 4d array

non-interacting Green’s function

fcdmft.gw.mol.ugw_ac.get_rho_response(omega, mo_energy, Lpqa, Lpqb)[source]#

Compute density-density response function in auxiliary basis at freq iw. See equation 58 in 10.1088/1367-2630/14/5/053020, and equation 24 in doi.org/10.1021/acs.jctc.0c00704.

Parameters:
omegadouble

imaginary part of a frequency point

mo_energydouble 2d array

orbital energy

Lpqadouble 3d array

occ-vir block of three-center density-fitting matrix of alpha spin

Lpqbdouble 3d array

occ-vir block of three-center density-fitting matrix of beta spin

Returns:
Pidouble 2d array

density-density response function in auxiliary basis at freq iw

fcdmft.gw.mol.ugw_ac.get_rho_response_metal(omega, mo_energy, mo_occ, Lpqa, Lpqb)[source]#

Get response function in auxiliary basis for metallic systems.

Parameters:
omegadouble

imaginary part of a frequency point

mo_energydouble 2d array

orbital energy

mo_occdouble 2d array

occupation number

Lpqadouble 3d array

three-center density-fitting matrix of alpha spin

Lpqbdouble 3d array

three-center density-fitting matrix of beta spin

Returns:
Pidouble 2d array

density-density response function in auxiliary basis at freq iw

fcdmft.gw.mol.ugw_ac.get_sigma(gw, orbs, Lpq, quad_freqs, quad_wts, ef, mo_energy, mo_occ=None, iw_cutoff=None, eval_freqs=None, mo_energy_w=None, fullsigma=False)[source]#

Compute GW correlation self-energy on imaginary axis. See equation 62 and 62 in 10.1088/1367-2630/14/5/053020, and equation 27 in doi.org/10.1021/acs.jctc.0c00704.

Parameters:
gwUGWAC

GW object

orbslist

list of orbital indexes

Lpqdouble 4d array

three-center density-fitting matrix in MO space

quad_freqsdouble 1d array

position of imaginary frequency grids used for integration

quad_wtsdouble 1d array

weight of imaginary frequency grids

efdouble

Fermi level

mo_energydouble 2d array

orbital energy in G

mo_occdouble 2d array, optional

occupation number, by default None

iw_cutoffdouble, optional

imaginary grid cutoff for fitting, by default None

eval_freqsdouble 1d array, optional

position of imaginary frequency grids to be integrated, by default None

mo_energy_wdouble 2d array, optional

orbital energy in W, by default None

fullsigmabool, optional

calculate off-diagonal elements, by default False

Returns:
sigmacomplex 3d or 4d array

self-energy on the imaginary axis

omegacomplex 1d array

imaginary frequency grids of self-energy

fcdmft.gw.mol.ugw_ac.get_sigma_outcore(gw, orbs, quad_freqs, quad_wts, ef, mo_energy, mo_coeff, mo_occ=None, iw_cutoff=None, eval_freqs=None, mo_energy_w=None, fullsigma=False)[source]#

Low-memory routine to compute GW correlation self-energy (diagonal elements) MO basis on imaginary axis. See equation 62 and 62 in 10.1088/1367-2630/14/5/053020, and equation 27 in doi.org/10.1021/acs.jctc.0c00704.

Parameters:
gwUGWAC

GW object

orbslist

list of orbital indexes

quad_freqsdouble 1d array

position of imaginary frequency grids used for integration

quad_wtsdouble 1d array

weight of imaginary frequency grids

efdouble

Fermi level

mo_energydouble 2d array

orbital energy in G

mo_coeffdouble 3d array

coefficient from AO to MO

mo_occdouble 2d array, optional

occupation number, by default None

iw_cutoffdouble, optional

imaginary grid cutoff for fitting, by default None

eval_freqsdouble 1d array, optional

position of imaginary frequency grids to be integrated, by default None

mo_energy_wdouble 2d array, optional

orbital energy in W, by default None

fullsigmabool, optional

calculate off-diagonal elements, by default False

Returns:
sigmacomplex 3d or 4d array

self-energy on the imaginary axis

omegacomplex 1d array

imaginary frequency grids of self-energy

fcdmft.gw.mol.ugw_ac.kernel(gw)[source]#
fcdmft.gw.mol.ugw_ac.set_frozen_orbs(gw)[source]#

Set .frozen attribute from frozen mask. orbs: list of orbital index in all orbitals orbs_frz: list of orbital index in non-frozen orbitals

Parameters:
gwUGWAC

unrestricted GW object