dgamore.greens_function#
Single-particle Green’s function. GreensFunction builds the momentum-dependent interacting Green’s
function \(G_{ab}(k, \nu) = [(\imath\nu + \mu)\delta_{ab} - \varepsilon_{ab}(k) - \Sigma_{ab}(k, \nu)]^{-1}\)
from a SelfEnergy, the band dispersion \(\varepsilon(k)\) and the chemical potential \(\mu\),
and derives the filling, occupation, kinetic and (Galitskii-Migdal) potential energies. The module-level helpers
adjust \(\mu\) to a target filling via a Newton root search. Moment-corrected asymptotic sums are used so the
finite Matsubara box does not bias the energies/filling.
Functions
|
Returns the total filling calculated from the self-energy, \(\mu\), kinetic Hamiltonian and more. |
|
Residual function used to find a new chemical potential \(\mu\) via Newton's method: the difference between the current filling and the target filling. |
|
Updates the chemical potential to match the target filling by using Newton's method to find the optimal \(\mu\). |
- class dgamore.greens_function.GreensFunction(mat: ndarray, sigma: SelfEnergy = None, ek: ndarray = None, full_niv_range: bool = True, calc_filling: bool = True, has_compressed_q_dimension: bool = False, nk: tuple = (1, 1, 1), beta: float = None, mu: float = None)[source]#
Bases:
TwoPointThe single-particle Green’s function \(G_{ab}(k, \nu) = [(\imath\nu + \mu)\delta_{ab} - \varepsilon_{ab}(k) - \Sigma_{ab}(k, \nu)]^{-1}\). Built from a
SelfEnergy, the band dispersion \(\varepsilon(k)\) and the chemical potential \(\mu\); on top of the two-point orbital bookkeeping inherited fromLocalTwoPointit adds the Dyson construction (local and momentum-resolved) and the derived quantities — filling, occupation matrices, kinetic and (Galitskii-Migdal) potential energy — all using moment-corrected asymptotic Matsubara sums so the finite frequency box does not bias the result.- Parameters:
- static create_g_loc(siw: SelfEnergy, ek: ndarray, beta: float, mu: float, calc_filling: bool = True) GreensFunction[source]#
Builds a local (k-summed) Green’s function from a self-energy and band dispersion.
- Parameters:
siw (SelfEnergy) – The
SelfEnergy\(\Sigma\).ek (ndarray) – Band dispersion \(\varepsilon(k)\).
beta (float) – Inverse temperature \(\beta\).
mu (float) – Chemical potential \(\mu\).
calc_filling (bool) – If True, compute the filling/occupation (exposed via the
n/occ/occ_kproperties).
- Returns:
The local
GreensFunction.- Return type:
- property ek: ndarray#
The band dispersion stored on this object.
- Returns:
The band dispersion \(\varepsilon(k)\) as a numpy array.
- get_ekin() float[source]#
Returns the kinetic energy from the band dispersion and the k-resolved occupation, \(E_{kin} = \sum_{\sigma \vec{k} ab} \varepsilon(\vec{k})_{ab}\, n(\vec{k})_{ba}\).
- Returns:
The kinetic energy per site.
- Return type:
- get_epot(niv_asympt: int = 50000) float[source]#
Computes the moment-corrected Galitskii-Migdal potential energy,
\[E_{pot} = \sum_k \mathrm{Tr}[\Sigma_\infty \rho_k] + \frac{1}{\beta} \sum_{k,\nu} \mathrm{Tr}[(\Sigma - \Sigma_\infty) G] + \frac{1}{\beta} \big[\textstyle\sum_{\mathrm{big}} - \sum_{\mathrm{box}}\big]\, \mathrm{Tr}[(\Sigma_{\mathrm{mod}} - \Sigma_\infty) G_{\mathrm{mod}}],\]i.e. the exact Hartree term, the in-box correlation part, and the analytic \(1/\nu^2\) tail. Here \(\Sigma_{\mathrm{mod}} - \Sigma_\infty = -\Sigma_1/(\imath\nu)\) and \(G_{\mathrm{mod}} = [\imath\nu + \mu - \varepsilon_k - \Sigma_\infty]^{-1}\). The model subtraction cancels the \(1/\nu^2\) tail of the correlation sum (remainder \(\sim 1/\nu^4\)), while the large sum supplies the part beyond the stored box.
- get_fill_nonlocal() tuple[float, ndarray, ndarray][source]#
Computes the filling and occupation from the momentum-resolved Green’s function, using the analytic density-matrix of the model (moment) Green’s function plus the box correction to accelerate convergence.
- static get_g_full(siw: SelfEnergy, mu: float, ek: ndarray, beta: float)[source]#
Builds the full momentum-dependent Green’s function \(G(k, \nu) = [(\imath\nu + \mu) - \varepsilon(k) - \Sigma(k, \nu)]^{-1}\).
- Parameters:
siw (SelfEnergy) – The
SelfEnergy\(\Sigma\).mu (float) – Chemical potential \(\mu\).
ek (ndarray) – Band dispersion \(\varepsilon(k)\).
beta (float) – Inverse temperature \(\beta\).
- Returns:
The momentum-dependent
GreensFunction(filling not recomputed).
- get_g_wv(wn: ndarray, niv_cut: int) ndarray[source]#
Returns the frequency-shifted Green’s function \(G_{ab}^{\nu - \omega}\) on a fermionic window of half width
niv_cut, for the bosonic frequencies inwn.
- property n: float#
The total filling computed for this Green’s function.
- Returns:
The total filling \(n\), or None if the filling has not been computed.
- dgamore.greens_function.get_total_fill(mu: float, ek: ndarray, sigma_mat: ndarray, beta: float, smom0: ndarray) float[source]#
Returns the total filling calculated from the self-energy, \(\mu\), kinetic Hamiltonian and more. Helper method for the root finding of \(\mu\) via a Newton method. A local model Green’s function built from the self-energy moment is subtracted to accelerate the Matsubara sum convergence. This is the cheap, purely local (k-summed) scalar variant used inside the \(\mu\) root search;
GreensFunction.get_fill_nonlocal()is the k-resolved counterpart that additionally returns the occupation matrices. Both share the Fermi-Dirac density matrix via_fermi_dirac_density().- Parameters:
mu (float) – Chemical potential \(\mu\).
ek (ndarray) – Band dispersion \(\varepsilon(k)\), shape
[kx, ky, kz, o1, o2].sigma_mat (ndarray) – Self-energy array, shape
[k, o1, o2, v].beta (float) – Inverse temperature \(\beta\).
smom0 (ndarray) – Zeroth moment \(\Sigma_\infty\) of the self-energy, shape
[o1, o2].
- Returns:
The total filling (electron number) \(n\).
- Return type:
- dgamore.greens_function.root_fun(mu: float, target_filling: float, ek: ndarray, sigma_mat: ndarray, beta: float, smom0: ndarray) float[source]#
Residual function used to find a new chemical potential \(\mu\) via Newton’s method: the difference between the current filling and the target filling.
- Parameters:
mu (float) – Chemical potential \(\mu\).
target_filling (float) – Desired total filling.
ek (ndarray) – Band dispersion \(\varepsilon(k)\).
sigma_mat (ndarray) – Self-energy array, shape
[k, o1, o2, v].beta (float) – Inverse temperature \(\beta\).
smom0 (ndarray) – Zeroth moment \(\Sigma_\infty\) of the self-energy.
- Returns:
The signed filling residual
filling(mu) - target_filling.- Return type:
- dgamore.greens_function.update_mu(mu0: float, target_filling: float, ek: ndarray, sigma_mat: ndarray, beta: float, smom0: ndarray, logger=None) float[source]#
Updates the chemical potential to match the target filling by using Newton’s method to find the optimal \(\mu\). On failure to converge the starting value is returned unchanged.
- Parameters:
mu0 (float) – Initial guess for the chemical potential.
target_filling (float) – Desired total filling.
ek (ndarray) – Band dispersion \(\varepsilon(k)\).
sigma_mat (ndarray) – Self-energy array, shape
[k, o1, o2, v].beta (float) – Inverse temperature \(\beta\).
smom0 (ndarray) – Zeroth moment \(\Sigma_\infty\) of the self-energy.
logger – Optional logger; if given, a failed root search is logged at debug level.
- Returns:
The updated (real) chemical potential, or
mu0if the root search did not converge.- Raises:
ValueError – If the converged chemical potential has a non-negligible imaginary part.
- Return type: