gem.solvers.gem_solver.gemSolver

class gem.solvers.gem_solver.gemSolver(solver_params=None, solver_type=None)[source]

Base class of every GEM impurity solver.

Fragment checks that the solver it receives is a gemSolver, so any new solver must inherit from this class. SolverTemplate is a commented skeleton to copy, SimpleED a working implementation.

A subclass is expected to:

  • call super().__init__(solver_params=..., solver_type=...), which sets self.type and self.solver_params;

  • override every method listed in mandatory_methods.

Solver-specific parameters are not passed by Fragment: they are read from self.solver_params and fixed once when the solver is built, e.g. num_eig = self.solver_params.get('num_eig', default). In principle they can be changed from fragment.solver.solver_params.

The whole surface the rest of GEM touches is:

  • build_Hemb(D, eloc, Lambdac, V2E), called positionally, and solve_Hemb(verbose=, T=), called with these two keywords only;

  • calc_density_matrix() and compute_E2loc(), without arguments; all four from Fragment.solve_impurity;

  • the attributes gs_ene (ground-state energy of the embedding Hamiltonian) and Zpart (partition function divided by exp(-gs_ene/T), hence 1 at zero temperature), set by solve_Hemb and read by Lattice.compute_functional;

  • self.type, only used in the printouts;

  • optionally compute_E1loc(nimp), used by Fragment.compute_energy, and calc_double_occ(i), used by Gdmft.run.

Everything else is up to the solver. In particular the constructor arguments (dimensions, symmetry sectors, whether the calculation is thermal, …) are decided when the solver is built: the Fragment only ever sees the object and never sets them.

Methods

calc_double_occ(i)

Double occupancy of the impurity level i.

compute_E1loc(nimp)

One-body local energy of the impurity block.

missing_methods()

Names of the mandatory methods that are still the gemSolver stubs, i.e. that this solver has not implemented.

build_Hemb

calc_density_matrix

compute_E2loc

solve_Hemb

Methods

__init__([solver_params, solver_type])

build_Hemb(D, eloc, Lambdac, V2E)

calc_density_matrix()

calc_double_occ(i)

Double occupancy of the impurity level i.

compute_E1loc(nimp)

One-body local energy of the impurity block.

compute_E2loc()

missing_methods()

Names of the mandatory methods that are still the gemSolver stubs, i.e. that this solver has not implemented.

solve_Hemb([verbose, T])

Attributes

mandatory_methods