momentGW.bse

Spin-restricted Bethe-Salpeter equation (BSE) via self-energy moment constraints for molecular systems.

Module Contents

momentGW.bse.kernel(bse, nmom_max, moments=None, integrals=None)

Bethe-Salpeter equation.

Parameters:
  • gw (BaseGW) – GW object.

  • nmom_max (int) – Maximum moment number to calculate.

  • moments (numpy.ndarray, optional) – Moments of the dynamic polarizability, if passed then they will be used instead of calculating them. Default value is None.

  • integrals (BaseIntegrals, optional) – Integrals object. If None, generate from scratch. Default value is None.

Returns:

gf – Green’s function object.

Return type:

dyson.Lehmann

class momentGW.bse.BSE(gw, **kwargs)

Bases: momentGW.base.Base

Bethe-Salpeter equation.

Parameters:
  • gw (BaseGW) – GW object.

  • polarizability (str) – Type of polarizability to use, can be one of `(“drpa”, “drpa-exact”, “dtda”, “thc-dtda”). Default value is the same as the underling GW object.

  • excitation (str) – Type of excitation, can be one of (“singlet”, “triplet”). Default value is “singlet”.

property name

Get the method name.

property mol

Get the molecule object.

property with_df

Get the density fitting object.

property nao

Get the number of atomic orbitals.

property nmo

Get the number of molecular orbitals.

property nocc

Get the number of occupied molecular orbitals.

property active

Get the mask to remove frozen orbitals.

property mo_energy

Get the molecular orbital energies.

property mo_energy_with_frozen

Get the molecular orbital energies with frozen orbitals.

property mo_coeff

Get the molecular orbital coefficients.

property mo_coeff_with_frozen

Get the molecular orbital coefficients with frozen orbitals.

property mo_occ

Get the molecular orbital occupation numbers.

property mo_occ_with_frozen

Get the molecular orbital occupation numbers with frozen orbitals.

ao2mo(transform=True)

Get the integrals object.

Parameters:

transform (bool, optional) – Whether to transform the integrals object.

Returns:

integrals – Integrals object.

Return type:

BaseIntegrals

build_dd_moment_inv(integrals, **kwargs)

Build the first inverse moment of the density-density response.

Parameters:
  • integrals (BaseIntegrals) – Integrals object.

  • **kwargs (dict, optional) – Additional keyword arguments to pass to the RPA or TDA solver. See momentGW.tda and momentGW.rpa for options.

Returns:

moment – First inverse (n=-1) moment of the density-density response.

Return type:

numpy.ndarray

build_matvec(integrals, moment=None)

Build the matrix-vector product required for the Bethe-Salpeter equation.

Parameters:
  • integrals (BaseIntegrals) – Integrals object.

  • moment (numpy.ndarray, optional) – First inverse (n=-1) moment of the density-density response. If not provided, calculate from scratch. Default value is None.

Returns:

matvec – Function that takes a vector x and returns the matrix- vector product xA.

Return type:

callable

build_dp_moments(nmom_max, integrals, matvec=None)

Build the moments of the dynamic polarizability.

Parameters:
  • nmom_max (int) – Maximum moment number to calculate.

  • integrals (BaseIntegrals) – Integrals object.

  • matvec (callable, optional) – Function that computes the matrix-vector product between the Bethe-Salpeter Hamiltonian and a vector. If not provided, calculate using build_matvec. Default value is None.

Returns:

  • moments_dp (numpy.ndarray) – Moments of the dynamic polarizability.

  • orth (numpy.ndarray) – Orthogonalization matrix. For compatibility with the Chebyshev solver, and is None in this case.

solve_bse(moments)

Solve the Bethe-Salpeter equation.

Parameters:

moments (numpy.ndarray) – Moments of the dynamic polarizability.

Returns:

gf – Green’s function object.

Return type:

dyson.Lehmann

kernel(nmom_max, moments=None, integrals=None)

Driver for the method.

Parameters:
  • nmom_max (int) – Maximum moment number to calculate.

  • moments (tuple of numpy.ndarray, optional) – Chebyshev moments of the dynamic polarizability, if passed then they will be used instead of calculating them. Default value is None.

  • integrals (BaseIntegrals, optional) – Integrals object. If None, generate from scratch. Default value is None.

Returns:

gf – Green’s function object.

Return type:

dyson.Lehmann

run(*args, **kwargs)

Alias for kernel, instead returning self.

Parameters:
  • *args (tuple) – Positional arguments to pass to kernel.

  • **kwargs (dict) – Keyword arguments to pass to kernel.

Returns:

self – The solver object.

Return type:

BaseGW

class momentGW.bse.cpBSE(gw, **kwargs)

Bases: BSE

Chebyshev-polynomial Bethe-Salpeter equation.

Parameters:
  • mf (pyscf.scf.SCF) – PySCF mean-field class.

  • scale (tuple of int) –

    Scaling parameters used to scale the spectrum to [-1, 1], given as (a, b) where

    \[\begin{split}a = \\frac{\omega_{\max} - \omega_{\min}}{2 - \epsilon}, b = \\frac{\omega_{\max} + \omega_{\min}}{2}.\end{split}\]

    where \(\omega_{\max}\) and \(\omega_{\min}\) are the maximum and minimum energies in the spectrum, respectively, and \(\epsilon\) is a small number shifting the spectrum values away from the boundaries.

  • grid (numpy.ndarray) – Grid to plot spectral function on.

  • eta (float, optional) – Regularisation parameter. Default value is 0.1.

  • polarizability (str, optional) – Type of polarizability to use, can be one of (“drpa”, “drpa-exact”, “dtda”, “thc-dtda”). Default value is `”drpa”.

  • excitation (str, optional) – Type of excitation, can be one of (“singlet”, “triplet”). Default value is “singlet”.

property name

Get the method name.

property mol

Get the molecule object.

property with_df

Get the density fitting object.

property nao

Get the number of atomic orbitals.

property nmo

Get the number of molecular orbitals.

property nocc

Get the number of occupied molecular orbitals.

property active

Get the mask to remove frozen orbitals.

property mo_energy

Get the molecular orbital energies.

property mo_energy_with_frozen

Get the molecular orbital energies with frozen orbitals.

property mo_coeff

Get the molecular orbital coefficients.

property mo_coeff_with_frozen

Get the molecular orbital coefficients with frozen orbitals.

property mo_occ

Get the molecular orbital occupation numbers.

property mo_occ_with_frozen

Get the molecular orbital occupation numbers with frozen orbitals.

build_dp_moments(nmom_max, integrals, matvec=None)

Build the moments of the dynamic polarizability.

Parameters:
  • nmom_max (int) – Maximum moment number to calculate.

  • integrals (BaseIntegrals) – Integrals object.

  • matvec (callable, optional) – Function that computes the matrix-vector product between the Bethe-Salpeter Hamiltonian and a vector. If not provided, calculate using build_matvec. Default value is None.

Returns:

moments_dp – Chebyshev moments of the dynamic polarizability.

Return type:

numpy.ndarray

solve_bse(moments)

Solve the Bethe-Salpeter equation.

Parameters:

moments (numpy.ndarray) – Chebyshev moments of the dynamic polarizability.

Returns:

gf – Green’s function object.

Return type:

numpy.ndarray

ao2mo(transform=True)

Get the integrals object.

Parameters:

transform (bool, optional) – Whether to transform the integrals object.

Returns:

integrals – Integrals object.

Return type:

BaseIntegrals

build_dd_moment_inv(integrals, **kwargs)

Build the first inverse moment of the density-density response.

Parameters:
  • integrals (BaseIntegrals) – Integrals object.

  • **kwargs (dict, optional) – Additional keyword arguments to pass to the RPA or TDA solver. See momentGW.tda and momentGW.rpa for options.

Returns:

moment – First inverse (n=-1) moment of the density-density response.

Return type:

numpy.ndarray

build_matvec(integrals, moment=None)

Build the matrix-vector product required for the Bethe-Salpeter equation.

Parameters:
  • integrals (BaseIntegrals) – Integrals object.

  • moment (numpy.ndarray, optional) – First inverse (n=-1) moment of the density-density response. If not provided, calculate from scratch. Default value is None.

Returns:

matvec – Function that takes a vector x and returns the matrix- vector product xA.

Return type:

callable

kernel(nmom_max, moments=None, integrals=None)

Driver for the method.

Parameters:
  • nmom_max (int) – Maximum moment number to calculate.

  • moments (tuple of numpy.ndarray, optional) – Chebyshev moments of the dynamic polarizability, if passed then they will be used instead of calculating them. Default value is None.

  • integrals (BaseIntegrals, optional) – Integrals object. If None, generate from scratch. Default value is None.

Returns:

gf – Green’s function object.

Return type:

dyson.Lehmann

run(*args, **kwargs)

Alias for kernel, instead returning self.

Parameters:
  • *args (tuple) – Positional arguments to pass to kernel.

  • **kwargs (dict) – Keyword arguments to pass to kernel.

Returns:

self – The solver object.

Return type:

BaseGW