quant_met.routines.

self_consistency_loop#

quant_met.routines.self_consistency_loop(hamiltonian, kgrid, beta, hubbard_int_orbital_basis, epsilon, max_iter=1000, delta_init=None, q=None)#

Self-consistently solves the gap equation for a given Hamiltonian.

This function performs a self-consistency loop to solve the gap equation for a Hamiltonian h. The gaps in the orbital basis are iteratively updated until the change is within a specified tolerance epsilon.

Parameters:
q
kgrid
hubbard_int_orbital_basis
beta
hamiltoniansisl.Hamiltonian

The Hamiltonian object.

epsilonfloat

The convergence criterion. The loop will terminate when the change in the delta orbital basis is less than this value.

delta_initnumpy.ndarray

Initial gaps in orbital basis.

max_iterint

Maximal number of iterations, default 300.

Returns:
quant_met.mean_field.BaseHamiltonian

The updated Hamiltonian object with the new gaps.

Notes

The function initializes the gaps with random complex numbers before entering the self-consistency loop. The mixing parameter is set to 0.2, which controls how much of the new gaps is taken relative to the previous value in each iteration.