dyson.solvers#
Solvers for solving the Dyson equation.
Solvers generally provide some method to solving the Dyson equation
which can also be written recursively as
and can be expressed as an eigenvalue problem as
For more details on the equivalence of these representations, see the representations
module.
The BaseSolver interface provides the constructors
from_expression() and
from_self_energy() to create a solver of that type from
either an instance of a subclass of BaseExpression or a
self-energy in the form of an instance of Lehmann object,
respectively
>>> from dyson import util, quiet, CCSD, Exact
>>> quiet() # Suppress output
>>> mf = util.get_mean_field("H 0 0 0; H 0 0 1", "6-31g")
>>> ccsd = CCSD.h.from_mf(mf)
>>> solver = Exact.from_expression(ccsd)
Solvers can be run by calling the kernel() method, which
in the case of static solvers sets the attribute and returns result,
an instance of Spectral
>>> result = solver.kernel()
>>> type(result)
<class 'dyson.representations.spectral.Spectral'>
The result can then be used to construct Lehmann representations of the Green’s function and
self-energy, details of which can be found in the representations module. On the other
hand, solvers in dynamic return an instance of
Dynamic, which contains the dynamic Green’s function in the
format requested by the solver arguments.
A list of available solvers is provided in the documentation of dyson, along with their
expected inputs.