pyscf.gw package#

Subpackages#

Submodules#

pyscf.gw.gw_ac module#

Spin-restricted G0W0 method based on the analytic continuation scheme. This implementation has N^4 scaling, and is faster than GW-CD (N^4~N^5) and fully analytic GW (N^6) methods. GW-AC is recommended for valence states only, and is inaccurate for core states.

References:

T. Zhu and G.K.-L. Chan, J. Chem. Theory. Comput. 17, 727-741 (2021) New J. Phys. 14 053020 (2012)

class pyscf.gw.gw_ac.GWAC(mf, frozen=None, auxbasis=None)[source]#

Bases: StreamObject

ao2mo(mo_coeff=None)[source]#

Transform density-fitting integral from AO to MO.

Parameters#

mo_coeffdouble 2d array, optional

coefficient from AO to MO, by default None

Returns#

Lpqdouble 3d array

three-center density-fitting matrix in MO

dump_flags()[source]#
energy_tot()[source]#

Compute GW total energy according to Galitskii-Migdal formula. See equation 6 in doi.org/10.1103/PhysRevB.86.081102, and equation 11 in doi.org/10.1021/acs.jctc.0c01264. NOTE: self-energy evaluted by numerical integration at large frequency is difficult to be accurate, so this function is numerically unstable.

Returns#

E_totdouble

GW total energy

E_hfdouble

Hartree-Fock total energy

Ecdouble

GW correlation energy

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 1d array, optional

orbital energy, by default None

Returns#

efdouble

Fermi level

get_frozen_mask()#

Get boolean mask for the restricted 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()#
get_sigma_exchange(mo_coeff)[source]#

Get exchange self-energy (EXX).

Parameters#

mo_coeffdouble 2d array

orbital coefficient

Returns#

vkdouble 2d array

exchange self-energy

initialize_df(auxbasis=None)[source]#

Initialize density fitting.

Parameters#

auxbasisstr, optional

name of auxiliary basis set, by default None

kernel()[source]#

Do one-shot GW calculation using analytical continuation.

loop_ao2mo(mo_coeff=None, ijslice=None, blksize=None)[source]#

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

Parameters#

mo_coeffdouble 2d array, optional

coefficient from AO to MO, by default None

ijslicetuple, optional

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

Returns#

eri_3ddouble 3d 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 3d array

GW Green’s function

gf0complex 3d array

non-interacting Green’s function

sigmacomplex 3d 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 2d array

one-particle density matrix

property nmo#
property nocc#
setup_evaluation_grid(fallback_freqs=None, fallback_wts=None)[source]#

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

Parameters#

fallback_freqsdouble 1d array

These are used as last resort if neither gw.nw2 nor gw.freqs is set.

fallback_wtsdouble 1d array

weights corresponding to fallback_freqs.

Returns#

eval_freqs_with_zerodouble 1d array

self.freqs prepended with 0 for convenience.

pyscf.gw.gw_ac.get_g0(omega, mo_energy, eta)[source]#

Get non-interacting Green’s function.

Parameters#

omegadouble or complex array

frequency grids

mo_energydouble 1d array

orbital energy

etadouble

broadening parameter

Returns#

gf0complex 3d array

non-interacting Green’s function

pyscf.gw.gw_ac.get_rho_response(omega, mo_energy, Lia, out=None)[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 1d array

orbital energy

Liadouble 3d ndarray

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

outdouble 2d array, optional

a location into which the result is stored, by default None

Returns#

Pidouble 2d array

density-density response function in auxiliary basis at freq iw

pyscf.gw.gw_ac.get_rho_response_metal(omega, mo_energy, mo_occ, Lpq, out=None)[source]#

Get response function in auxiliary basis for metallic systems. Also applicable to molecular SCF with smearing.

Parameters#

omegadouble

imaginary part of a frequency point

mo_energydouble 1d array

orbital energy

mo_occdouble 1d array

occupation number with a factor of 2

Lpqdouble 3d array

three-center density-fitting matrix in MO

outdouble ndarray, optional

a location into which the result is stored, by default None

Returns#

Pidouble 2d array

density-density response function in auxiliary basis at freq iw

pyscf.gw.gw_ac.get_sigma(gw, orbs, Lpq, quad_freqs, quad_wts, ef, mo_energy, mo_coeff=None, 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#

gwGWAC

GW object

orbslist

list of orbital indexes

Lpqdouble 3d 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 1d array

orbital energy in G

mo_coeffdouble 2d array

coefficient from AO to MO

mo_occdouble 1d array, optional

occupation number, by default None

iw_cutoffdouble, optional

imaginary grid cutoff for fitting, by default None

eval_freqsdouble 1d array, optional

imaginary frequency points at which to evaluate self energy. Self energy is evaluated at ef + 1j * eval_freqs.

mo_energy_wdouble 1d array, optional

orbital energy in W, by default None

fullsigmabool, optional

calculate off-diagonal elements, by default False

Returns#

sigmacomplex 2d or 3d ndarray

self-energy on the imaginary axis

omegacomplex 1d array

imaginary frequency grids of self-energy

pyscf.gw.gw_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 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#

gwGWAC

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 1d array

orbital energy in G

mo_coeffdouble 2d 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

imaginary frequency points at which to evaluate self energy. Self energy is evaluated at ef + 1j * eval_freqs.

mo_energy_wdouble array, optional

orbital energy in W, by default None

fullsigmabool, optional

calculate off-diagonal elements, by default False

Returns#

sigmacomplex 2d or 3d array

self-energy on the imaginary axis

omegacomplex 1d array

imaginary frequency grids of self-energy

pyscf.gw.gw_ac.kernel(gw)[source]#
pyscf.gw.gw_ac.set_frozen_orbs(gw)[source]#

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

Parameters#

gwGWAC

restricted GW object

pyscf.gw.gw_cd module#

Spin-restricted G0W0 approximation with contour deformation

This implementation has the same scaling (N^4) as GW-AC, more robust but slower. GW-CD is particularly recommended for accurate core and high-energy states.

Method:

See T. Zhu and G.K.-L. Chan, arxiv:2007.03148 (2020) for details Compute Sigma directly on real axis with density fitting through a contour deformation method

Useful References:
  1. Chem. Theory Comput. 14, 4856-4869 (2018)

class pyscf.gw.gw_cd.GWCD(mf, frozen=None)[source]#

Bases: StreamObject

ao2mo(mo_coeff=None)[source]#
dump_flags()[source]#
eta = 0.001#
get_frozen_mask()#

Get boolean mask for the restricted 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(mo_energy=None, mo_coeff=None, Lpq=None, orbs=None, nw=100, vhf_df=False)[source]#
Input:

orbs: self-energy orbs nw: grid number

Output:

mo_energy: GW quasiparticle energy

linearized = False#
property nmo#
property nocc#
pyscf.gw.gw_cd.get_WmnI_diag(gw, orbs, Lpq, freqs)[source]#

Compute W_mn(iw) on imarginary axis grids Return:

Wmn: (Nmo, Norbs, Nw)

pyscf.gw.gw_cd.get_rho_response(omega, mo_energy, Lpq)[source]#

Compute density response function in auxiliary basis at freq iw

pyscf.gw.gw_cd.get_rho_response_R(gw, omega, Lpq)[source]#

Compute density response function in auxiliary basis at poles

pyscf.gw.gw_cd.get_sigmaI_diag(gw, omega, Wmn, sign, freqs, wts)[source]#

Compute self-energy by integrating on imaginary axis

pyscf.gw.gw_cd.get_sigmaR_diag(gw, omega, orbp, ef, Lpq)[source]#

Compute self-energy for poles inside contour (more and more expensive away from Fermi surface)

pyscf.gw.gw_cd.get_sigma_diag(gw, ep, p, Lpq, Wmn, freqs, wts)[source]#

Compute self-energy on real axis using contour deformation

pyscf.gw.gw_cd.kernel(gw, mo_energy, mo_coeff, Lpq=None, orbs=None, nw=None, vhf_df=False, verbose=3)[source]#

GW-corrected quasiparticle orbital energies

Returns:

A list : converged, mo_energy, mo_coeff

pyscf.gw.gw_exact module#

Spin-restricted G0W0 approximation with exact frequency integration

class pyscf.gw.gw_exact.GWExact(mf, frozen=None, tdmf=None)[source]#

Bases: StreamObject

non-relativistic restricted GW

Saved results

mo_energy :

Orbital energies

mo_coeff

Orbital coefficients

ao2mo(mo_coeff=None)[source]#
dump_flags(verbose=None)[source]#
eta = 1e-08#
get_frozen_mask()#

Get boolean mask for the restricted reference orbitals.

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

get_g(omega, eta=None)[source]#
get_g0(omega, eta=None)[source]#
get_nmo()#
get_nocc()#
kernel(mo_energy=None, mo_coeff=None, td_e=None, td_xy=None, eris=None, orbs=None)[source]#

Kernel function is the main driver of a method. Every method should define the kernel function as the entry of the calculation. Note the return value of kernel function is not strictly defined. It can be anything related to the method (such as the energy, the wave-function, the DFT mesh grids etc.).

linearized = False#
property nmo#
property nocc#
reset(mol=None)[source]#

Clean up intermediates

pyscf.gw.gw_exact.get_g(omega, mo_energy, mo_occ, eta)[source]#
pyscf.gw.gw_exact.get_sigma_deriv_element(gw, omega, tdm_p, tdm_q, td_e, eta=None, vir_sgn=1)[source]#
pyscf.gw.gw_exact.get_sigma_element(gw, omega, tdm_p, tdm_q, td_e, eta=None, vir_sgn=1)[source]#
pyscf.gw.gw_exact.kernel(gw, mo_energy, mo_coeff, td_e, td_xy, eris=None, orbs=None, verbose=3)[source]#

GW-corrected quasiparticle orbital energies

Returns:

A list : converged, mo_energy, mo_coeff

pyscf.gw.gw_slow module#

This module implements the G0W0 approximation on top of pyscf.tdscf.rhf_slow and pyscf.tdscf.proxy TD implementations. Unlike gw.py, all integrals are stored in memory. Several variants of GW are available:

  • (this module) pyscf.gw_slow: the molecular implementation;

  • pyscf.pbc.gw.gw_slow: single-kpoint PBC (periodic boundary condition) implementation;

  • pyscf.pbc.gw.kgw_slow_supercell: a supercell approach to PBC implementation with multiple k-points. Runs the molecular code for a model with several k-points for the cost of discarding momentum conservation and using dense instead of sparse matrixes;

  • pyscf.pbc.gw.kgw_slow: a PBC implementation with multiple k-points;

class pyscf.gw.gw_slow.AbstractIMDS(td, eri=None)[source]#

Bases: object

entire_space()[source]#

The entire orbital space. Returns:

An iterable of the entire orbital space.

get_rhs(p)[source]#

The right-hand side of the quasiparticle equation. Args:

p (int, tuple): the orbital;

Returns:

Right-hand sides of the quasiparticle equation

get_sigma_element(omega, p, **kwargs)[source]#

The diagonal matrix element of the self-energy matrix. Args:

omega (float): the energy value; p (int, tuple): the orbital;

Returns:

The diagonal matrix element.

initial_guess(p)[source]#

Retrieves the initial guess for the quasiparticle energy for orbital p. Args:

p (int, tuple): the orbital;

Returns:

The value of initial guess (float).

orb_dims = 1#
quasiparticle_eq(p, **kwargs)[source]#

The quasiparticle equation f(omega) = 0. Args:

p (int, tuple): the orbital; **kwargs: keyword arguments to get_sigma_element;

Returns:

A callable function of one parameter.

class pyscf.gw.gw_slow.GW(td, eri=None)[source]#

Bases: object

base_imds#

alias of IMDS

kernel()[source]#

Calculates GW roots.

Returns:

GW roots.

class pyscf.gw.gw_slow.IMDS(td, eri=None)[source]#

Bases: AbstractIMDS

construct_tdm()[source]#
property entire_space#

The entire orbital space. Returns:

An iterable of the entire orbital space.

get_rhs(p)[source]#

The right-hand side of the quasiparticle equation. Args:

p (int, tuple): the orbital;

Returns:

Right-hand sides of the quasiparticle equation

get_sigma_element(omega, p, eta, vir_sgn=1)[source]#

The diagonal matrix element of the self-energy matrix. Args:

omega (float): the energy value; p (int, tuple): the orbital;

Returns:

The diagonal matrix element.

initial_guess(p)[source]#

Retrieves the initial guess for the quasiparticle energy for orbital p. Args:

p (int, tuple): the orbital;

Returns:

The value of initial guess (float).

class pyscf.gw.gw_slow.LoggingFunction(m)[source]#

Bases: object

plot_call_history(title='')[source]#

Plots calls to this function. Args:

title (str): plot title;

property x#
property y#
pyscf.gw.gw_slow.corrected_moe(eri, p)[source]#

Calculates the corrected orbital energy. Args:

eri (PhysERI): a container with electron repulsion integrals; p (int): orbital;

Returns:

The corrected orbital energy.

pyscf.gw.gw_slow.kernel(imds, orbs=None, linearized=False, eta=0.001, tol=1e-09, method='fallback')[source]#

Calculates GW energies. Args:

imds (AbstractIMDS): GW intermediates; orbs (Iterable): indexes of MO orbitals to correct; linearized (bool): whether to apply a single-step linearized correction to energies instead of iterative procedure; eta (float): imaginary energy for the Green’s function; tol (float): tolerance for the search of zero; method (str): ‘bisect’ finds roots no matter what but, potentially, wrong ones, ‘newton’ finding roots close to the correct one but, potentially, failing during iterations, or ‘fallback’ using ‘newton’ and proceeding to ‘bisect’ in case of failure;

Returns:

Corrected orbital energies.

pyscf.gw.rpa module#

Spin-restricted 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)

pyscf.gw.rpa.DirectRPA#

alias of RPA

class pyscf.gw.rpa.RPA(mf, frozen=None, mo_coeff=None, mo_occ=None, mo_energy=None)[source]#

Bases: DFRMP2

dump_flags(verbose=None)[source]#
get_e_hf()[source]#
kernel(eris=None, nw=40, x0=0.5)[source]#

The kernel function for direct RPA

make_dielectric_matrix(omega, e_ov=None, f_ov=None, eris=None, max_memory=None, blksize=None)[source]#
Args:

omega : float, frequency e_ov : 1D array (nocc * nvir), orbital energy differences mo_coeff : (nao, nmo), mean-field mo coefficient cderi_ov : (naux, nocc, nvir), Cholesky decomposed ERI in OV subspace.

Returns:

diel : 2D array (naux, naux), dielectric matrix

make_e_ov()[source]#

Compute orbital energy differences

make_f_ov()[source]#

Compute orbital occupation number differences

pyscf.gw.rpa.dRPA#

alias of RPA

pyscf.gw.rpa.kernel(rpa, eris=None, nw=40, x0=0.5, verbose=None)[source]#

RPA correlation and total energy

Args:
cderi_ov:

Array-like object, Cholesky decomposed ERI in OV subspace.

nw:

number of frequency point on imaginary axis.

x0:

scaling factor for frequency grid.

Returns:
e_tot:

RPA total energy

e_hf:

EXX energy

e_corr:

RPA correlation energy

pyscf.gw.rpa.make_dielectric_matrix(omega, e_ov, f_ov, eris, blksize=None)[source]#

Compute dielectric matrix at a given frequency omega

Args:

omega : float, frequency e_ov : 1D array (nocc * nvir), orbital energy differences eris : DF ERI object

Returns:

diel : 2D array (naux, naux), dielectric matrix

pyscf.gw.ugw_ac module#

Spin-unrestricted G0W0 method based on the analytic continuation scheme. This implementation has N^4 scaling, and is faster than GW-CD (N^4~N^5) and fully analytic GW (N^6) methods. GW-AC is recommended for valence states only, and is inaccurate for core states.

References:

T. Zhu and G.K.-L. Chan, J. Chem. Theory. Comput. 17, 727-741 (2021) New J. Phys. 14 053020 (2012)

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

Bases: GWAC

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

pyscf.gw.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

pyscf.gw.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

pyscf.gw.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

pyscf.gw.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

pyscf.gw.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

pyscf.gw.ugw_ac.kernel(gw)[source]#
pyscf.gw.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

pyscf.gw.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 pyscf.gw.urpa.URPA(mf, frozen=None, mo_coeff=None, mo_occ=None, mo_energy=None)[source]#

Bases: DFUMP2

get_e_hf()#
kernel(eris=None, nw=40, x0=0.5)#

The kernel function for direct RPA

make_dielectric_matrix(omega, e_ov=None, f_ov=None, eris=None, max_memory=None, blksize=None)[source]#
Args:

omega : float, frequency e_ov : 1D array (nocc * nvir), orbital energy differences mo_coeff : (nao, nmo), mean-field mo coefficient cderi_ov : (naux, nocc, nvir), Cholesky decomposed ERI in OV subspace.

Returns:

diel : 2D array (naux, naux), dielectric matrix

make_e_ov()[source]#

Compute orbital energy differences

make_f_ov()[source]#

Compute orbital occupation number differences

pyscf.gw.urpa.make_dielectric_matrix(omega, e_ov, f_ov, eris, blksize=None)[source]#

Compute dielectric matrix at a given frequency omega

Args:

omega : float, frequency e_ov : 1D array (nocc * nvir), orbital energy differences eris : DF ERI object

Returns:

diel : 2D array (naux, naux), dielectric matrix

Module contents#

G0W0 approximation

pyscf.gw.GW(mf, freq_int='ac', frozen=None, tdmf=None)[source]#