dyson.expressions

Contents

dyson.expressions#

Expressions for constructing Green’s functions and self-energies.

Subclasses of BaseExpression expose various methods which provide different representations of the self-energy or Green’s function for the given level of theory. The Green’s function is related to the resolvent

\[\left[ \omega - \mathbf{H} \right]^{-1},\]

where \(\mathbf{H}\) is the Hamiltonian, and in the presence of correlation, takes the form of a self-energy supermatrix

\[\begin{split}\mathbf{H} = \begin{bmatrix} \boldsymbol{\Sigma}(\omega) & \mathbf{v} \\ \mathbf{v}^\dagger & \mathbf{K} + \mathbf{C} \end{bmatrix},\end{split}\]

which possesses its own Lehmann representation. For more details on these representations, see the representations module.

The BaseExpression interface provides a from_mf() constructor to create an expression of that level of theory from a mean-field object

>>> from dyson import util, quiet, FCI
>>> quiet()  # Suppress output
>>> mf = util.get_mean_field("H 0 0 0; H 0 0 1", "6-31g")
>>> fci = FCI.h.from_mf(mf)

The BaseExpression interface provides methods to compute the matrix-vector operations and diagonal of the self-energy supermatrix

>>> import numpy as np
>>> ham = fci.build_matrix()
>>> np.allclose(np.diag(ham), fci.diagonal())
True
>>> vec = np.random.random(fci.shape[0])
>>> np.allclose(fci.apply_hamiltonian(vec), ham @ vec)
True

More precisely, the Green’s function requires also the excitation operators to connect to the ground state

\[\mathbf{G}(\omega) = \left\langle \boldsymbol{\Psi}_0 \right| \hat{a}_p \left[ \omega - \mathbf{H} \right]^{-1} \hat{a}_q^\dagger \left| \boldsymbol{\Psi}_0 \right\rangle,\]

which may be a simple projection when the ground state is mean-field, or otherwise in the case of correlated ground states. The interface can provide these vectors

>>> bra = fci.get_excitation_bras()
>>> ket = fci.get_excitation_kets()

which are vectors with shape (nphys, nconfig) where nphys is the number of physical states.

These methods can be used to construct the moments of the Green’s function

\[\mathbf{G}_n = \left\langle \boldsymbol{\Psi}_0 \right| \hat{a}_p \mathbf{H}^n \hat{a}_q^\dagger \left| \boldsymbol{\Psi}_0 \right\rangle,\]

which are important for some of the novel approaches implemented in dyson. In the case of some levels of theory, analytic expressions for the moments of the self-energy are also available. These moments can be calculated using

>>> gf_moments = fci.build_gf_moments(nmom=6)

A list of available expressions is provided in the documentation of dyson. Each expression is an instance of ExpressionCollection, which provides the subclasses of BaseExpression for various sectors such as the hole and particle.

Submodules#

expression

Base class for expressions.

hf

Hartree--Fock (HF) expressions [1]_.

ccsd

Coupled cluster singles and doubles (CCSD) expressions [1]_ [2]_.

fci

Full configuration interaction (FCI) expressions [1]_.

adc

Algebraic diagrammatic construction theory (ADC) expressions [1]_ [2]_.

gw

GW approximation expressions [1]_ [2]_ [3]_.

hamiltonian

Hamiltonian-driven expressions.