fcdmft.gw.mol.bse module#

class fcdmft.gw.mol.bse.BSE(gw=None, nocc=None, mo_energy=None, Lpq=None, verbose=5, TDA=False, nroot=10, max_vec=200, max_iter=100, max_expand=None, init_ntri=None, residue_thresh=1e-08)[source]#

Bases: StreamObject

Methods

__call__(*args, **kwargs)

Update the attributes of the current object.

analyze([thresh, oscillator, s2])

Analyze excitations.

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_memory()

Check memory needed for the BSE calculation.

check_sanity()

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

copy()

Returns a shallow copy

get_oscillator_strength()

Get transition dipoles and oscillator strengths.

kernel(multi[, e_min, delta])

Kernel function is the main driver of a method.

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

full_diagonalization

analyze(thresh=0.1, oscillator=True, s2=True)[source]#

Analyze excitations.

Args:

thresh (float, optional): threshold to print dominant component. Defaults to 0.1.

check_memory()[source]#

Check memory needed for the BSE calculation.

dump_flags()[source]#
full_diagonalization(multi)[source]#
get_oscillator_strength()[source]#

Get transition dipoles and oscillator strengths.

Returns:

dipole (double ndarray): transition dipoles. oscillator_strength (double array): oscillator strengths.

kernel(multi, e_min=0.0, delta=0.0)[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.).

fcdmft.gw.mol.bse.bse_davidson(bse, multi, e_min=0.0, delta=0.0)[source]#

Davidson algorithm for BSE. The Davidson algorithm follows doi.org/10.1063/1.477483. BSE equation is defined as equation 1 in doi.org/10.1002/jcc.24688. Spin-adapted formalism can be found in chapter 18.3.2 in “Concepts and methods in modern theoretical chemistry. Electronic structure (2013, CRC) Ghosh S.K., Chattaraj P.K. (eds.)”

Args:

bse (fcdmft.gw.mol.bse.BSE): BSE object. multi (str): multiplicity, ‘s’=singlet, ‘t’=triplet, ‘u’=unrestricted. e_min (float, optional): minimum desired excitation energy. Defaults to 0.0. delta (float, optional): energy shift for trial vector generation, typically <=0.0.

Returns:

exci (double array): excitation energy. X_vec (double ndarray): X block of eigenvector (excitation). Y_vec (double ndarray): Y block of eigenvector (de-excitation).

fcdmft.gw.mol.bse.bse_full_diagonalization(bse, multi)[source]#

Full diagonalization of BSE equation. BSE equation is defined as equation 1 in doi.org/10.1002/jcc.24688. Spin-adapted formalism can be found in chapter 18.3.2 in “Concepts and methods in modern theoretical chemistry. Electronic structure (2013, CRC) Ghosh S.K., Chattaraj P.K. (eds.)” The working equation is rewritten as equation 15 in doi.org/10.1063/1.477483.

Args:

bse (fcdmft.gw.mol.bse.BSE): BSE object. multi (str): multiplicity, ‘s’=singlet, ‘t’=triplet, ‘u’=unrestricted.

Returns:

exci (double array): excitation energy. X_vec (double ndarray): X block of eigenvector (excitation). Y_vec (double ndarray): Y block of eigenvector (de-excitation).

fcdmft.gw.mol.bse.bse_lanczos(bse, multi, u1=None, nsteps=100)[source]#

Lanczos algorithm for BSE. Follows 10.1137/16M1102641.

Args:

bse (fcdmft.gw.mol.bse.BSE): BSE object. multi (str): multiplicity, ‘s’=singlet, ‘t’=triplet, ‘u’=unrestricted. u1 (double ndarray, optional): initial state for Lanczos algorithm. Defaults to None. nsteps (int, optional): the number of Lanczos steps. Defaults to 100.

Returns:

exci (double array): excitation energy. X_vec (double ndarray): X block of eigenvector (excitation). Y_vec (double ndarray): Y block of eigenvector (de-excitation).

fcdmft.gw.mol.bse.get_davidson_trial_vector(ntri, nocc, mo_energy, e_min=0.0, delta=0.0)[source]#

Generate initial trial vectors for particle-hole excitations. The order is determined by the occ-vir pair orbital energy difference. The initial trial vectors are diagonal. They are generated by taking occ-vir pairs with an energy difference of >= e_min + delta.

Args:

ntri (int): the number of desired initial trial vectors. nocc (int array): the number of occupied orbitals. mo_energy (double ndarray): orbital energy. e_min (float, optional): minimum desired excitation energy. Defaults to 0.0. delta (float, optional): energy shift for trial vector generation, typically <=0.0.

Returns:

ntri, int: the number of actual trial vectors generated tri_vec, double ndarray: initial trial vectors

fcdmft.gw.mol.bse.get_excitation_from_eigenvector(multi, nocc, mo_energy, Lpq, X_vec, Y_vec, TDA=False, Lpq_bar=None)[source]#

Get excitation energies from corresponding eigenvectors. exci = (X+Y)^T (A+B) (X+Y) Equation.18 in doi.org/10.1063/1.477483

Args:

multi (str): multiplicity, ‘s’=singlet, ‘t’=triplet, ‘u’=unrestricted. nocc (int array): the number of occupied orbitals. mo_energy (double ndarray): orbital energy. Lpq (double ndarray): 3-center density-fitting matrix. X_vec (list of double ndarray): X block of eigenvector (excitation). Y_vec (list of double ndarray): Y block of eigenvector (de-excitation). TDA (bool, optional): use TDA approximation. Defaults to False. Lpq_bar (double ndarray, optional): auxiliary 3-center matrix as equation 21 in doi.org/10.1002/jcc.24688. Defaults to None.

Returns:

exci (double array): excitation energies.

fcdmft.gw.mol.bse.lanczos_estimate_spectrum(alphas, betas, e_range, eta, nw, TDA=False)[source]#

Estimate the excitation spectrum density from the results of the Lanczos algorithm.

Parameters:
alphas (double array): coefficients from the Lanczos algorithm.

diagonal elements of the tridiagonal matrix.

betas (double array): coefficients from the Lanczos algorithm.

off-diagonal elements of the tridiagonal matrix.

e_range (tuple): energy range (e_min, e_max).
eta (float): broadening factor.
nw (int): number of frequency points.
TDA (bool, optional): Lanczos used TDA approximation. Defaults to False.
Returns:
freqs (double array): frequency points at which to compute density estimate.
density (double array): excitation spectrum density estimate.