dyson.solvers.static.chempot#

Chemical potential optimising solvers.

Functions

search_aufbau_bisect(greens_function, nelec)

Search for a chemical potential in a Green's function using Aufbau principle and bisection.

search_aufbau_direct(greens_function, nelec)

Search for a chemical potential in a Green's function using the Aufbau principle.

search_aufbau_global(greens_function, nelec)

Search for a chemical potential in a Green's function using a global minimisation.

Classes

AufbauPrinciple(*args, **kwargs)

Solve a self-energy and assign a chemical potential based on the Aufbau principle.

AuxiliaryShift(*args, **kwargs)

Shift the self-energy auxiliaries to best assign a chemical potential.

ChemicalPotentialSolver(*args, **kwargs)

Base class for a solver for a self-energy that optimises the chemical potential.

dyson.solvers.static.chempot.search_aufbau_global(greens_function: Lehmann, nelec: int, occupancy: float = 2.0) tuple[float, float][source]#

Search for a chemical potential in a Green’s function using a global minimisation.

Parameters:
  • greens_function – Green’s function.

  • nelec – Target number of electrons.

  • occupancy – Occupancy of each state, typically 2 for a restricted reference and 1 otherwise.

Returns:

The chemical potential and the error in the number of electrons.

dyson.solvers.static.chempot.search_aufbau_direct(greens_function: Lehmann, nelec: int, occupancy: float = 2.0) tuple[float, float][source]#

Search for a chemical potential in a Green’s function using the Aufbau principle.

Parameters:
  • greens_function – Green’s function.

  • nelec – Target number of electrons.

  • occupancy – Occupancy of each state, typically 2 for a restricted reference and 1 otherwise.

Returns:

The chemical potential and the error in the number of electrons.

dyson.solvers.static.chempot.search_aufbau_bisect(greens_function: Lehmann, nelec: int, occupancy: float = 2.0, max_cycle: int = 1000) tuple[float, float][source]#

Search for a chemical potential in a Green’s function using Aufbau principle and bisection.

Parameters:
  • greens_function – Green’s function.

  • nelec – Target number of electrons.

  • occupancy – Occupancy of each state, typically 2 for a restricted reference and 1 otherwise.

  • max_cycle – Maximum number of iterations.

Returns:

The chemical potential and the error in the number of electrons.

class dyson.solvers.static.chempot.ChemicalPotentialSolver(*args: Any, **kwargs: Any)[source]#

Bases: StaticSolver

Base class for a solver for a self-energy that optimises the chemical potential.

Parameters:
  • static – Static part of the self-energy.

  • self_energy – Self-energy.

  • nelec – Target number of electrons.

error: float | None = None#
chempot: float | None = None#
converged: bool | None = None#
property static: Array#

Get the static part of the self-energy.

property self_energy: Lehmann#

Get the self-energy.

property nelec: int#

Get the target number of electrons.

property overlap: Array | None#

Get the overlap matrix, if available.

property nphys: int#

Get the number of physical degrees of freedom.

kernel(*args: Any, **kwargs: Any) Any#

Run the solver.

class dyson.solvers.static.chempot.AufbauPrinciple(*args: Any, **kwargs: Any)[source]#

Bases: ChemicalPotentialSolver

Solve a self-energy and assign a chemical potential based on the Aufbau principle.

Parameters:
  • static – Static part of the self-energy.

  • self_energy – Self-energy.

  • nelec – Target number of electrons.

occupancy: float = 2.0#
solver#

alias of Exact

method: Literal['direct', 'bisect', 'global'] = 'global'#
classmethod from_self_energy(static: Array, self_energy: Lehmann, overlap: Array | None = None, **kwargs: Any) AufbauPrinciple[source]#

Create a solver from a self-energy.

Parameters:
  • static – Static part of the self-energy.

  • self_energy – Self-energy.

  • overlap – Overlap matrix for the physical space.

  • kwargs – Additional keyword arguments for the solver.

Returns:

Solver instance.

Notes

To initialise this solver from a self-energy, the nelec keyword argument must be provided.

classmethod from_expression(expression: BaseExpression, **kwargs: Any) AufbauPrinciple[source]#

Create a solver from an expression.

Parameters:
  • expression – Expression to be solved.

  • kwargs – Additional keyword arguments for the solver.

Returns:

Solver instance.

kernel(*args: Any, **kwargs: Any) Any#

Run the solver.

class dyson.solvers.static.chempot.AuxiliaryShift(*args: Any, **kwargs: Any)[source]#

Bases: ChemicalPotentialSolver

Shift the self-energy auxiliaries to best assign a chemical potential.

Parameters:
  • static – Static part of the self-energy.

  • self_energy – Self-energy.

  • nelec – Target number of electrons.

Notes

Convergence is met when either of the thresholds conv_tol or conv_tol_grad are met, rather than both, due to constraints of the scipy.optimize.minimize() method.

occupancy: float = 2.0#
solver#

alias of AufbauPrinciple

max_cycle: int = 200#
conv_tol: float = 1e-08#
conv_tol_grad: float = 0.0#
guess: float = 0.0#
shift: float | None = None#
classmethod from_self_energy(static: Array, self_energy: Lehmann, overlap: Array | None = None, **kwargs: Any) AuxiliaryShift[source]#

Create a solver from a self-energy.

Parameters:
  • static – Static part of the self-energy.

  • self_energy – Self-energy.

  • overlap – Overlap matrix for the physical space.

  • kwargs – Additional keyword arguments for the solver.

Returns:

Solver instance.

Notes

To initialise this solver from a self-energy, the nelec keyword argument must be provided.

classmethod from_expression(expression: BaseExpression, **kwargs: Any) AuxiliaryShift[source]#

Create a solver from an expression.

Parameters:
  • expression – Expression to be solved.

  • kwargs – Additional keyword arguments for the solver.

Returns:

Solver instance.

objective(shift: float) float[source]#

Objective function for the chemical potential search.

Parameters:

shift – Shift to apply to the self-energy.

Returns:

The error in the number of electrons.

gradient(shift: float) tuple[float, Array][source]#

Gradient of the objective function.

Parameters:

shift – Shift to apply to the self-energy.

Returns:

The error in the number of electrons, and the gradient of the error.

kernel(*args: Any, **kwargs: Any) Any#

Run the solver.