LadderDGA.jl Documentation
Index
LadderDGA.EnvironmentVarsLadderDGA.LambdaCorrection.λ_resultLadderDGA.LambdaCorrection.λ_resultLadderDGA.ModelParametersLadderDGA.RPAHelperLadderDGA.SimulationParametersLadderDGA.lDΓAHelperLadderDGA.γTLadderDGA.χTLadderDGA.χ₀RPA_TLadderDGA.χ₀TBase.showBase.showLadderDGA.EPot1LadderDGA.EPot_p1LadderDGA.EPot_p2LadderDGA.F_from_χLadderDGA.F_from_χ_genLadderDGA.F_from_χ_star_genLadderDGA.G_fftLadderDGA.G_from_ΣLadderDGA.G_from_ΣLadderDGA.G_from_ΣladderLadderDGA.G_rfft!LadderDGA.LambdaCorrection.EPot_diffLadderDGA.LambdaCorrection.PP_diffLadderDGA.LambdaCorrection.bisectLadderDGA.LambdaCorrection.calc_G_ΣLadderDGA.LambdaCorrection.convergedLadderDGA.LambdaCorrection.correct_marginsLadderDGA.LambdaCorrection.dχ_λLadderDGA.LambdaCorrection.gen_νω_indicesLadderDGA.LambdaCorrection.get_λ_minLadderDGA.LambdaCorrection.linear_approxLadderDGA.LambdaCorrection.n_diffLadderDGA.LambdaCorrection.newtonLadderDGA.LambdaCorrection.newton_rightLadderDGA.LambdaCorrection.newton_secularLadderDGA.LambdaCorrection.newton_secular_traceLadderDGA.LambdaCorrection.reset!LadderDGA.LambdaCorrection.sample_fLadderDGA.LambdaCorrection.sc_convergedLadderDGA.LambdaCorrection.validateLadderDGA.LambdaCorrection.validate_EPotLadderDGA.LambdaCorrection.validate_PPLadderDGA.LambdaCorrection.validate_sumsLadderDGA.LambdaCorrection.λ_correctionLadderDGA.LambdaCorrection.λdm_correctionLadderDGA.LambdaCorrection.λdm_correction_valLadderDGA.LambdaCorrection.λdm_sc_correction_cleanLadderDGA.LambdaCorrection.λdm_tsc_correction_cleanLadderDGA.LambdaCorrection.λm_correctionLadderDGA.LambdaCorrection.λm_correction_valLadderDGA.LambdaCorrection.λm_rhsLadderDGA.LambdaCorrection.λm_sc_correctionLadderDGA.LambdaCorrection.λm_tsc_correctionLadderDGA.LambdaCorrection.χ_λLadderDGA.LambdaCorrection.χ_λ!LadderDGA.OneToIndex_to_FreqLadderDGA.OneToIndex_to_FreqLadderDGA.PP_p1LadderDGA.PP_p2LadderDGA._update_tail!LadderDGA.attach_ΣlocLadderDGA.bse_invLadderDGA.build_GGLadderDGA.build_q_access_GLadderDGA.calc_ELadderDGA.calc_E_EDLadderDGA.calc_bubbleLadderDGA.calc_bubble_parLadderDGA.calc_gen_χLadderDGA.calc_Γs_udLadderDGA.calc_ΣLadderDGA.calc_Σ_eom_parLadderDGA.calc_Σ_parLadderDGA.calc_Σ_partsLadderDGA.calc_λ0LadderDGA.calc_λ0LadderDGA.calc_λmax_linEliashbergLadderDGA.calc_λmax_linEliashberg_MatrixFreeLadderDGA.calc_χγLadderDGA.calc_χγLadderDGA.calc_χγ_parLadderDGA.clear_wcache!LadderDGA.collect_Σ!LadderDGA.collect_γLadderDGA.collect_χLadderDGA.collect_χ₀LadderDGA.conv_tmp_add_rpa!LadderDGA.coreLadderDGA.core_sum_bosonicLadderDGA.core_sum_fermionicLadderDGA.correction_termLadderDGA.eom_ν_cutoffLadderDGA.estimate_connected_efLadderDGA.estimate_efLadderDGA.expand_ωLadderDGA.fermi_surface_connectedLadderDGA.fillingLadderDGA.filling_posLadderDGA.filter_KZLadderDGA.filter_MALadderDGA.find_usable_χ_intervalLadderDGA.gen_ν_partLadderDGA.gen_ν_part_slicesLadderDGA.gen_νω_partLadderDGA.gen_ω_partLadderDGA.initialize_EoMLadderDGA.initialize_EoM_cache!LadderDGA.is_okayLadderDGA.iν_arrayLadderDGA.iω_arrayLadderDGA.log_q0_χ_checkLadderDGA.par_partitionLadderDGA.printr_sLadderDGA.q0_indexLadderDGA.readConfigLadderDGA.readConfig_RPALadderDGA.readFortranχDMFTLadderDGA.read_χ₀_RPALadderDGA.reduce_rangeLadderDGA.setupConfig_RPALadderDGA.setup_LDGALadderDGA.setup_LDGAaLadderDGA.shell_sum_fermionicLadderDGA.subtract_tailLadderDGA.subtract_tail!LadderDGA.sum_kωLadderDGA.sum_ωLadderDGA.sum_ωkLadderDGA.tail_correction_termLadderDGA.tail_factorLadderDGA.update_tail!LadderDGA.update_tail!LadderDGA.update_wcache!LadderDGA.usable_ωindicesLadderDGA.ΔLadderDGA.Σ_DysonLadderDGA.Σ_hartreeLadderDGA.λ_from_γLadderDGA.ν0Index_of_ωIndexLadderDGA.νi_healthLadderDGA.νi_νngrid_posLadderDGA.νnGridLadderDGA.χ₀AsymLadderDGA.χ₀Asym_coeffsLadderDGA.ω0_indexLadderDGA.ω2_tailLadderDGA.ω_tailLadderDGA.ωn_grid
List of Functions
LadderDGA
LadderDGA.EnvironmentVars — TypeEnvironmentVars <: ConfigStructContains various settings, controlling the I/O behaviour of this module. This is typically generated from a config.toml file using the readConfig function.
Fields
inputDir:String, Directory of input filesinputVars:String, File name of .jld2 file containing input.loglevel:String, Options: disabled, error, warn, info, debuglogfile:String, Options: STDOUT, STDERR, filename
LadderDGA.ModelParameters — TypeModelParameters <: ConfigStructContains model parameters for the Hubbard model. This is typically generated from a config.toml file using the readConfig function.
Fields
U:Float64, Hubbard Uμ:Float64, chemical potentialβ:Float64, inverse temperaturen:Float64, fillingEpot_1Pt:Float64, DMFT potential energyEkin_1Pt:Float64, DMFT kinetic energy
LadderDGA.RPAHelper — TypeRPAHelper <: RunHelperStruct with data needed to run ladder RPA calculations.
Constructor
setup_RPA(kGridStr::Tuple{String,Int}, mP::ModelParameters, sP::SimulationParameters, env::EnvironmentVars [; silent=false])See setup_RPA
Fields
TODO: documentationLadderDGA.SimulationParameters — TypeSimulationParameters <: ConfigStructContains simulation parameters for the ladder DGA computations. This is typically generated from a config.toml file using the readConfig function.
Fields
n_iω:Int, Number of positive bosonic frequencies (full number will be2*n_iω+1n_iν:Int, Number of positive fermionic frequencies (full number will be2*n_iνn_iν_shell:Int, Number of fermionic frequencies used for asymptotic sum improvement (χ_asym_rarrays with at least these many entries need to be provided)shift:Bool, Flag specifying if-n_iν:n_iν-1is shifted by-ωₙ/2at eachωₙslice (centering the main features)χ_helper:struct, helper struct for asymptotic sum improvements involving the generalized susceptibility (nothingifn_iν_shell == 0), see alsoBSE_SC.jl.sVk:Float64, ∑_k Vₖ^2fft_range:Int, Frequencies used for computations of typef(νₙ + ωₙ).usable_prct_reduction:Float64, percent reduction of usable bosonic frequenciesdbg_full_eom_omega:Bool, if true overrides usable ω ranges ton_iω.
LadderDGA.lDΓAHelper — TypelDΓAHelper <: RunHelperStruct with data needed to run ladder DΓA calculations.
Constructor
setup_LDGA(kGridStr::Tuple{String,Int}, mP::ModelParameters, sP::SimulationParameters, env::EnvironmentVars)See setup_LDGA
Fields
TODO: documentation for fields
LadderDGA.γT — TypeγT <: MatsubaraFunctionStruct for the non-local triangular vertex.
Fields
data:Array{ComplexF64,3}, dataaxis_types:Dict{Symbol,Int}, Dictionary mapping:q, :ν, :ωto the axis indices.
LadderDGA.χT — TypeχT <: MatsubaraFunctionStruct for the non-local susceptibilities.
Constructor
χT(data::Array{T, 2}; full_range=true, reduce_range_prct=0.1): if full_range is set to false, the usable range is determined via find_usable_χ_interval.
Fields
data:Array{ComplexF64,3}, dataaxis_types:Dict{Symbol,Int}, Dictionary mapping:q, :ωto the axis indices.indices_ω:Vector{Int},tail_c:Vector{Float64}, tail coefficients of $1/\omega^i$ tails. Index1corresponds toi=0.λ:Float64, λ correction parameter.β:Float64, inverse temperature.usable_ω:AbstractArray{Int}, usable indices for which data is assumed to be correct. See alsofind_usable_χ_interval
LadderDGA.χ₀RPA_T — Typeχ₀RPA_T <: MatsubaraFunctionStruct for the RPA bubble term.
TODO: this does not use the χ₀Asym function and mixes thermodynamic quantities (kinetic energy) with tail coefficients (they are the same, but should not be stored this way here).
Constructor
χ₀RPAT(data::Array{eltype,2}, ωnGrid::AbstractVector{Int}, νnGrid::UnitRange{Int64}, β::Float64)
This constructor does not perform any checks for the entered data array in the currently implemented version. Make sure that the axes match the axis_types field!
Fields
data:Array{ComplexF64,3}, data.axis_types:Dict{Symbol,Int}, Dictionary mapping:q, :ωto the axis indices.indices_ω:Vector{Int},mindices m of bosonic $\omega_m$ Matsubara frequencies.β:Float64, inverse temperature.e_kin:Float64, kinetic energy.Nq:Int, Number of points per dimension that are used to sample the reciprocal spaceNgl:Int, Number of gauß-legendre sample points per dimension that where used to calculate each element
LadderDGA.χ₀T — Typeχ₀T <: MatsubaraFunctionStruct for the bubble term. The q, ω dependent asymptotic behavior is computed from the t1 and t2 input. See χ₀Asym_coeffs implementation for details.
Constructor
χ₀T(type::Symbol, data::Array{_eltype,3}, kG::KGrid, ωnGrid::AbstractVector{Int}, n_iν::Int, shift::Bool, mP::ModelParameters)Set local_tail=true in case of the local bubble constructed fro mthe impurity Green's function. This is necessary in order to construct the correct asymptotics.
Fields
type:Symbol, can beDMFT,local,RPA,RPA_exact. TODO: documentationdata:Array{ComplexF64,3}, dataasym:Array{ComplexF64,2},[q, ω]dependent asymptotic behavior.axis_types:Dict{Symbol,Int}, Dictionary mapping:q, :ν, :ωto the axis indices.indices_νω:Matrix{Tuple{Int,Int}}, (n,m) indices of fermionic $\nu_n$ and bosonic $\omega_m$ Matsubara frequencies.β:Float64, inverse temperature.
Base.show — MethodBase.show(io::IO, m::ModelParameters)Custom output for ModelParameters
Base.show — MethodBase.show(io::IO, m::SimulationParameters)Custom output for SimulationParameters
LadderDGA.EPot1 — MethodSpecialized function for DGA potential energy. Better performance than calc_E.
LadderDGA.EPot_p1 — MethodEPot_p1(χm::χT, χd::χT, λm::Float64, λd::Float64, n::Float64, U::Float64)::Float64Pauli-Principle on 2-particle level: $\sum_{k,\nu} G^{\lambda,\nu}_{k} \Sigma^{\lambda,\nu}_{k}$.
LadderDGA.EPot_p2 — MethodEPot_p2(χm::χT, χd::χT, λm::Float64, λd::Float64, n::Float64, U::Float64)::Float64Pauli-Principle on 2-particle level: $U(\sum_{k,\omega} \chi^{\lambda,\omega}_{m,k} - \sum_{k,\omega} \chi^{\lambda,\omega}_{d,k})/2 + U n^2/4$.
LadderDGA.F_from_χ — MethodF_from_χ(type::Symbol, h::lDΓAHelper; diag_term=true)
F_from_χ(χ::AbstractArray{ComplexF64,3}, G::AbstractArray{ComplexF64,1}, sP::SimulationParameters, β::Float64; diag_term=true)TODO: documentation
LadderDGA.F_from_χ_gen — MethodF_from_χ_gen(χ₀::χ₀T, χr::Array{ComplexF64,4})::Array{ComplexF64,4}Calculates the full vertex from the generalized susceptibility $\chi^{\nu\nu'\omega}_r$ and the bubble term $\chi_0$ via $F^{\nu\nu'\omega}_{r,\mathbf{q}} = \beta^2 \left( \chi^{\nu\nu'\omega}_{0,\mathbf{q}} \right)^{-1} - \left( \chi^{\nu\omega}_{0,\mathbf{q}} \right)^{-1} \chi^{\nu\nu'\omega}_{r,\mathbf{q}} \left( \chi^{\nu'\omega}_{0,\mathbf{q}} \right)^{-1}$
For a version using the physical susceptibilities see F_from_χ_gen.
LadderDGA.F_from_χ_star_gen — MethodF_from_χ_star_gen(χ₀::χ₀T, χstar_r::Array{ComplexF64,4}, χr::χT, γr::γT, Ur::Float64)Calculates the full vertex from the generalized susceptibility $\chi^{\nu\nu'\omega}_r$, the physical susceptibility $\chi^{\omega}_r$ and the triangular vertex $\gamma^{\nu\omega}_r$. This is usefull to calculate a $\lambda$-corrected full vertex.
$F^{\nu\nu'\omega}_{r,\mathbf{q}} = \beta^2 \left( \chi^{\nu\nu'\omega}_{0,\mathbf{q}} \right)^{-1} - \beta^2 (\chi^{\nu\omega}_{0,\mathbf{q}})^{-1} \chi^{*,\nu\nu'\omega}_{r,\mathbf{q}} (\chi^{\nu'\omega}_{0,\mathbf{q}})^{-1} + U_r (1 - U_r \chi^{\omega}_{r,\mathbf{q}}) \gamma^{\nu\omega}_{r,\mathbf{q}} \gamma^{\nu'\omega}_{r,\mathbf{q}}$ For a version using the physical susceptibilities see F_from_χ_gen.
LadderDGA.G_fft — MethodG_fft(G::GνqT, kG::KGrid, mP::ModelParameters, sP::SimulationParameters)Calculates fast Fourier transformed lattice Green's functions used for calc_bubble.
LadderDGA.G_from_Σ — MethodG_from_Σ(ind::Int64, β::Float64, μ::Float64, ϵₖ::Float64, Σ::ComplexF64)
G_from_Σ(mf::ComplexF64, μ::Float64, ϵₖ::Float64, Σ::ComplexF64)Computes Green's function according to $[\frac{(2 n + 1)\pi i}{\beta} + \mu - \epsilon_k - \Sigma(k,i\nu_n)]^{-1}$, where $\epsilon_k$ and $\Sigma(k,i\nu_n)$ are given as single values. Convenience wrappers for full grids are provided below.
Arguments:
ind: Matsubara frequency indexmf: Matsubara frequencyβ: Inverse temperature (only needs to be set, if index instead of frequency is given)μ: Chemical potentialϵₖ: Dispersion relation at fixedk, see below for convenience wrappers.Σ: Self energy at fixed frequency (and potentially fixedk), see below for convenience wrappers.
LadderDGA.G_from_Σ — MethodG_from_Σ(Σ::OffsetVector{ComplexF64}, ϵkGrid::Vector{Float64}, range::UnitRange{Int}, mP::ModelParameters;
μ = mP.μ, Σloc::OffsetVector{ComplexF64} = OffsetVector(ComplexF64[], 0:-1),
)
G_from_Σ!(res::OffsetMatrix{ComplexF64}, Σ::OffsetVector{ComplexF64}, ϵkGrid::Vector{Float64}, range::UnitRange{Int},
mP::ModelParameters; μ = mP.μ, Σloc::OffsetVector{ComplexF64} = OffsetVector(ComplexF64[], 0:-1),
)::Nothing
mP::ModelParameters; μ = mP.μ, Σloc::OffsetVector{ComplexF64} = OffsetVector(ComplexF64[], 0:-1),
G_from_Σ(Σ::AbstractVector{ComplexF64}, ϵkGrid::Vector{Float64}, range::AbstractVector{Int}, mP::ModelParameters; μ = mP.μ, Σloc::AbstractArray = nothing)
G_from_Σ!(res::Matrix{ComplexF64}, Σ::AbstractVector{ComplexF64}, ϵkGrid::Vector{Float64}, range::AbstractVector{Int}, mP::ModelParameters; μ = mP.μ, Σloc::AbstractVector = nothing)#TODO: unify API, redo documentation
Computes Green's function from self energy Σ and dispersion ϵkGrid over given frequency indices range. Optionally, a different chemical potential μ can be provided. When the non-local self energy is used, one typically wants to extend the usefull range of frequencies by attaching the tail of the local self energy in the high frequency regime. This is done by providing a range larger than the array size of Σ and in addition setting Σloc (the size of Σloc must be as large or larger than range). The inplace version stores the result in res.
LadderDGA.G_from_Σladder — MethodG_from_Σladder(Σ_ladder::AbstractMatrix{ComplexF64}, Σloc::Vector{ComplexF64}, kG::KGrid, mP::ModelParameters, sP::SimulationParameters;
fix_n::Bool=false, μ=mP.μ, improved_sum_filling::Bool=true, νRange = sP.fft_range, n = mP.n, νFitRange=0:last(axes(Σ_ladder, 2)) )
G_from_Σladder!(G_new::OffsetMatrix{ComplexF64}, Σ_ladder::OffsetMatrix{ComplexF64}, Σloc::AbstractVector{ComplexF64}, kG::KGrid, mP::ModelParameters;
fix_n::Bool=false, μ=mP.μ, improved_sum_filling::Bool=true, n = mP.n, νFitRange=0:last(axes(Σ_ladder, 2)) )Computes Green's function from lDΓA self-energy. This is the Greensfunction used in eq. (8) of Stobbe, J., & Rohringer, G. (2022). Consistency of potential energy in the dynamical vertex approximation. Physical Review B, 106(20), 205101.
The resulting frequency range is given by default as νRange = sP.fft_range, if less frequencies are available from Σ_ladder, Σloc is used instead. TODO: documentation for arguments TODO: fit function computes loads of unnecessary frequencies
LadderDGA.G_rfft! — MethodG_rfft!(G_rfft::GνqT, G::GνqT, kG::KGrid, fft_range::UnitRange)::NothingCalculates fast Fourier transformed lattice Green's functions used for calc_bubble. Inplace version of G_fft.
LadderDGA.OneToIndex_to_Freq — MethodOneToIndex_to_Freq(ωi::Int, νpi::Int, νi::Int, sP::SimulationParameters)
Freq_to_OneToIndex(ωn::Int, νn::Int, νpn::Int, shift::Int, nBose::Int, nFermi::Int)Converts Matsubara frequency index to array indices, starting at 1. This is the inverse function of OneToIndex_to_Freq.
LadderDGA.OneToIndex_to_Freq — MethodOneToIndex_to_Freq(ωi::Int, νi::Int, sP::SimulationParameters)
OneToIndex_to_Freq(ωi::Int, νi::Int, shift::Int, nBose::Int, nFermi::Int)Converts (1:N,1:N) index tuple for bosonic (ωi) and fermionic (νi) frequency to Matsubara frequency number. If the array has a ν shell (for example for tail improvements) this will also be taken into account by providing Nν_shell. This is the inverse function of Freq_to_OneToIndex.
LadderDGA.PP_p1 — MethodPP_p1(χm::χT, χd::χT, λm::Float64, λd::Float64, n::Float64, U::Float64)::Float64Pauli-Principle on 1-particle level: $n/2 (1-n/2)$.
LadderDGA.PP_p2 — MethodPP_p2(χm::χT, χd::χT, λm::Float64, λd::Float64, n::Float64, U::Float64)::Float64Pauli-Principle on 2-particle level: $(\sum_{k,\omega} \chi^{\lambda,\omega}_{m,k} + \sum_{k,\omega} \chi^{\lambda,\omega}_{d,k})/2$.
LadderDGA._update_tail! — Method_update_tail!(coeffs::Vector{Float64})Updates the Ekin/ω^2 tail of physical susceptibilities on worker. Used by update_tail!.
LadderDGA.attach_Σloc — Methodattach_Σloc(Σ_ladder::OffsetMatrix, Σ_loc::OffsetVector;
ν_first::Int=last(axis(Σ_ladder,2))+1, ν_last::Int=last(axes(Σloc,1)))Attach the local self energy tail, starting at ν_first up to ν_last to the ladder self energy. #TODO: attach this smoothely by also considering derivatives
LadderDGA.bse_inv — Methodbse_inv(type::Symbol, Γr::Array{ComplexF64,3})Kernel for calculation of susceptibility and triangular vertex. Used by calc_χγ_par.
LadderDGA.build_GG — Methodbuild_GG(GF::OffsetMatrix, νnGrid::AbstractVector{Int}, kVecs::AbstractVector{NTuple})::Matrix{ComplexF64}Builds helper array A, defined as: $A^{\nu}_{k} = G^\nu_{k} G^{-\nu}_{-k}$. Used, for example, by build_Γs.
LadderDGA.build_q_access_G — Methodbuild_q_access(kG::KGrid, k_vecs::AbstractVector{NTuple})::Array{Int,2}Builds helper array A, defined as: $A^{\nu}_{k} = G^\nu_{k} G^{-\nu}_{-k}$. Used, for example, by build_Γs.
LadderDGA.calc_E — MethodcalcE(χsp::χT, γsp::γT, χch::χT, γch::γT, λ₀, Σloc, gLocrfft, kG::KGrid, mP::ModelParameters, sP::SimulationParameters; νmax::Int = eomνcutoff(sP), tc::Bool=true) calcE([G::Array{ComplexF64,2},] Σ::AbstractArray{ComplexF64,2}, kG::KGrid, mP::ModelParameters; trace::Bool=false)
Returns kinetic and potential energies from given * self-energy Σ or * the ingredients of the equation of motion: the physical susceptibilies as well as the triangular vertices in spin and charge channel, the correction term and the greensfunction to be used.
LadderDGA.calc_E_ED — Methodcalc_E_ED(ϵₖ::Vector{Float64}, Vₖ::Vector{Float64}, GImp::Vector{ComplexF64}, U, n, μ, β)
calc_E_ED(ϵₖ::Vector{Float64}, Vₖ::Vector{Float64}, GImp::Vector{ComplexF64}, mP::ModelParameters)
calc_E_ED(fname::String)Computes kinetic and potential energies from Anderson parameters.
Returns:
(EKin, EPot): Tuple{Float64,Float64}, kinetic and potential energy.
Arguments:
fname:jld2-file containing the fields:[gImp, β, ϵₖ, Vₖ, U, nden, μ](see below)ϵₖ: bath levelsVₖ: hoppend amplitudesGImp: impurity Green's function. WARNING: the arguments are assumed to by fermionic Matsuabra indices 0:length(GImp)-1!U: Coulomb interaction strengthn: number densityμ: chemical potentialβ: inverse temperaturemP: Alternative call with model parameters asFloat64. See alsoModelParameters.
LadderDGA.calc_bubble — Methodcalc_bubble(type::Symbol, h <: RunHelper; mode=:ph)
calc_bubble(type::Symbol, Gνω::GνqT, Gνω_r::GνqT, kG::KGrid, mP::ModelParameters, sP::SimulationParameters; mode=:ph)Calculates bubble term.
$\chi^{\omega}_{0,\mathbf{q}} = -\Sigma_{\mathbf{k}} \Sigma_{\nu} G^{\nu}_{\mathbf{k}} \cdot G^{\nu+\omega}_{\mathbf{k}+\mathbf{q}}$
where $\nu$ : Fermionic Matsubara frequencies $\omega$ : Bosonic Matsubara frequencies $\mathbf{k}, \mathbf{q}$: Element of the first Brillouin zone
This is a real-valued quantity.Returns
Bubble, χ₀::χ₀T
Arguments
type:Symbol, can beDMFT,local,RPA,RPA_exact. TODO: documentationRPAHelper: Helper struct generated bysetup_RPA.β:Float64, Inverse temperature in natural unitskG:KGrid, The k-grid on which to perform the calculationsP:SimulationParameters, (to construct a frequency range)mode: selects particle-hole (:ph, default) or particle-particle (:pp) notation
LadderDGA.calc_bubble_par — Methodcalc_bubble_par(h::lDΓAHelper; collect_data=true)
calc_bubble_par(kG::KGrid, mP::ModelParameters, sP::SimulationParameters; collect_data=true)Calculates the bubble, based on two fourier-transformed Greens functions where the second one has to be reversed.
LadderDGA.calc_gen_χ — Methodcalc_gen_χ(Γr::ΓT, χ₀::χ₀T, kG::KGrid)Calculates generalized susceptibility from Γr by solving the Bethe Salpeter Equation. See calc_χγ for direct (and more efficient) calculation of physical susceptibility and triangular vertex.
Returns: $\chi^{\nu\nu'\omega}_q$ as 4-dim array with axis: νi, νpi, qi, ωi.
LadderDGA.calc_Γs_ud — Methodcalc_Γs_ud(Fm, Fd, Phi_ud, h::lDΓAHelper)Calculates the Γs in particle-particle notation from the ladder vertices.
LadderDGA.calc_Σ — Methodcalc_Σ(χm::χT, γm::γT, χd::χT, γd::γT, λ₀::λ₀T, h::lDΓAHelper;
νmax=eom_ν_cutoff(h), λm::Float64=0.0, λd::Float64=0.0, tc::Bool=true)
calc_Σ(χm::χT, γm::γT, χd::χT, γd::γT, λ₀::λ₀T, gLoc_rfft, h;
νmax::Int=eom_ν_cutoff(h), λm::Float64 = 0.0, λd::Float64 = 0.0, tc::Bool = true)
calc_Σ(χm::χT, γm::γT, χd::χT, γd::γT, χ_m_sum::Union{Float64,ComplexF64}, λ₀::λ₀T,
Gνω::GνqT, kG::KGrid, mP::ModelParameters, sP::SimulationParameters;
νmax=eom_ν_cutoff(sP), λm::Float64=0.0, λd::Float64=0.0, tc::Bool=true)Calculates the self-energy from ladder quantities.
This is the single core variant, see calc_Σ_par for the parallel version.
LadderDGA.calc_Σ_eom_par — Methodcalc_Σ_eom_par(νmax::Int)Equation of motion for self energy. See calc_Σ_par.
LadderDGA.calc_Σ_par — Methodcalc_Σ_par(; λm::Float64=0.0, λd::Float64=0.0, collect_data=true, tc::Bool=true)Calculates self-energy on worker pool. Workers must first be initialized using initialize_EoM. #TODO: νrange must be equal to the one used during initialization. remove one.
LadderDGA.calc_Σ_parts — Methodcalc_Σ_parts(χm::χT,γm::γT,χd::χT,γd::γT,h::lDΓAHelper,λ₀::AbstractArray{ComplexF64,3};λm::Float64=0.0, λd::Float64=0.0)
calc_Σ_parts(χm::χT,γm::γT, χd::χT, γd::γT, χ_m_sum::Union{Float64,ComplexF64}, λ₀::λ₀T,
Gνω::GνqT, kG::KGrid,mP::ModelParameters, sP::SimulationParameters;
λm::Float64=0.0, λd::Float64=0.0)Calculates the $lD\GammaA$ self-energy (see also calc_Σ), but split into 7 contributions from: χm, γm, χd, γd, U, Fm + Σ_hartree, tail_correction.
LadderDGA.calc_λ0 — Methodcalcλ0(χ₀::χ₀RPAT, helper::RPAHelper) calcλ0(χ₀::χ₀RPAT, sP::SimulationParameters, mP::ModelParameters)
This function corresponds to the following mapping
λ0: BZ × π(2N + 1)/β × 2πN/β → C, (q, ν, ω)↦ -U χ₀(q,ω)
where ...
... U is the Hubbard on-site interaction parameter
... χ₀ is the RPA bubble termTODO: λ0 is constant in the fermionic matsubara frequency. This should be refactured.
LadderDGA.calc_λ0 — Methodcalc_λ0(χ₀::χ₀T, h::lDΓAHelper)
calc_λ0(χ₀::χ₀T, Fr::FT, h::lDΓAHelper)
calc_λ0(χ₀::χ₀T, Fr::FT, χ::χT, γ::γT, mP::ModelParameters, sP::SimulationParameters)Correction term, TODO: documentation
LadderDGA.calc_λmax_linEliashberg — Methodcalc_λmax_linEliashberg(bubble::χ₀T, χm::χT, χd::χT, γm::γT, γd::γT, h::lDΓAHelper, env;
GF=h.gLoc, max_Nk::Int=h.kG.Ns, χm_star_gen=nothing, χd_star_gen=nothing)Calculates largest and smallest (real) eigen value of $\Gamma_{\mathrm{s},\uparrow\downarrow}$.
TODO: TeX/DOCU...
LadderDGA.calc_λmax_linEliashberg_MatrixFree — Methodcalc_λmax_linEliashberg_MatrixFree(bubble::χ₀T, χm::χT, χd::χT, γm::γT, γd::γT, h::lDΓAHelper)This is a slower, but memory efficient versuion of calc_λmax_linEliashberg.
TODO: TeX/DOCU...
LadderDGA.calc_χγ — Methodcalc_χγ(type::Symbol, h::lDΓAHelper, χ₀::χ₀T)
calc_χγ(type::Symbol, Γr::ΓT, χ₀::χ₀T, kG::KGrid, mP::ModelParameters, sP::SimulationParameters)Calculates susceptibility and triangular vertex in type channel. See calc_χγ_par for parallel calculation.
This method solves the following equation: `` \chir = \chi0 - \frac{1}{\beta^2} \chi0 \Gammar \chir \ \Leftrightarrow (1 + \frac{1}{\beta^2} \chi0 \Gammar) = \chi0 \ \Leftrightarrow (\chi^{-1}r - \chi^{-1}0) = \frac{1}{\beta^2} \Gamma_r ``
LadderDGA.calc_χγ — Methodcalc_χγ(type::Symbol, χ₀::χ₀RPA_T, kG::KGrid, mP::ModelParameters)
This function corresponds to the following mappings
χ: BZ × 2πN/β → R, (q, ω)↦ χ₀(q,ω) / ( 1 + U_r⋅χ₀(q,ω) )
γ: BZ × π(2N + 1)/β × 2πN/β → C, (q, ν, ω)↦ 1
where ...
... U_r is the Hubbard on-site interaction parameter multiplied by +1 if type = d and -1 if type = m.
... χ₀ is the RPA bubble term
... ν is a fermionic matsubara frequency
... ω is a bosonic matsubara frequency
... N is the set of natural numbers
... β is the inverse temperature
... q is a point in reciprocal spaceLadderDGA.calc_χγ_par — Methodcalc_χγ_par(type::Symbol, h::lDΓAHelper)
calc_χγ_par(type::Symbol, Γr::ΓT, kG::KGrid, mP::ModelParameters, sP::SimulationParameters; collect_data=true)Calculate susceptibility and triangular vertex parallel on workerpool.
Set collect_data to return both quantities, or call collect_χ and collect_γ at a later point. calc_χγ can be used for single core computations.
LadderDGA.clear_wcache! — Methodclear_wcache!()Clears cache on all workers. Must be used when recalculating susceptibilities after EoM initialization.
LadderDGA.collect_Σ! — Methodcollect_Σ!(Σ_ladder::OffsetMatrix{ComplexF64, Matrix{ComplexF64}}, mP::ModelParameters; λm=0.0)Collects self-energy from workers.
LadderDGA.collect_γ — Methodcollect_γ(type::Symbol, [kG::KGrid, mP::ModelParameters, sP::SimulationParameters] OR [h::lDΓAHelper])Collects triangular vertex from workers, after parallel computation (see calc_χγ_par).
LadderDGA.collect_χ — Methodcollect_χ(type::Symbol, [kG::KGrid, mP::ModelParameters, sP::SimulationParameters] OR [h::lDΓAHelper])Collects susceptibility from workers, after parallel computation (see calc_χγ_par).
LadderDGA.collect_χ₀ — Methodcollect_χ₀(kG::KGrid, mP::ModelParameters, sP::SimulationParameters)Collect non-local bubble $\chi_0^{\omega}(q)$ from workers. Values first need to be calculated using calc_bubble_par.
LadderDGA.conv_tmp_add_rpa! — Methodconv_tmp_add_rpa!(res::AbstractVector{ComplexF64}, kG::KGrid, arr1::Vector{ComplexF64}, GView::AbstractArray{ComplexF64,N})::Nothing where NExpect both input arrays already in fouriertransformed.
LadderDGA.core — Methodcore(χ₀::χ₀T)Select core region (without asymptotic shell) from bubble term.
LadderDGA.core_sum_bosonic — Methodcore_sum_bosonic(N::Int, β::Float64, power::Int)Fast evaluation of $\sum_{n=1}^N \frac{1}{(\pi i (2n) / \beta)^l}$
LadderDGA.core_sum_fermionic — Methodcore_sum_fermionic(N::Int, β::Float64, power::Int)Fast evaluation of $\sum_{n=0}^N \frac{1}{(\pi i (2n+1) / \beta)^l}$
LadderDGA.correction_term — Methodcorrection_term(mP::ModelParameters, kG::KGrid, χm::χT, χ_m_sum::Union{Float64,ComplexF64}, grid::AbstractArray{Int64,1})Calculates the so called tail correcion term of the ladder self energy. The purpose of this term is to enforce the limit
\lim_{n\rightarrow\infty}i\nu_n\Sigma_{\mathbf{q}}^{\nu_n}=U^2\frac{n}{2}\left(1-\frac{n}{2} \right ).
This can be archived by adding the term * RPA: -\frac{U^2}{i\nu}\sum_{\omega,\mathbf{q}}\left( \chi_{m,\mathbf{q}}^{\omega}-\chi_{0,\mathbf{q}}^{\omega}\right ) * ladder-DGA: -\frac{U^2}{i\nu}\left(\sum_{\omega,\mathbf{q}}\chi_{m,\mathbf{q}}^{\omega}-\chi_{m,loc} \right ) from the ladder self energy.
Arguments
mP: ModelParameterskG: KGridχm: χTχ_m_sum: Union{Float64,ComplexF64}. RPA:\sum_{\omega,\mathbf{q}}\chi_{0,\mathbf{q}}^{\omega}, lDGA: 'χmsum'.grid: AbstractArray{Int64,1}
LadderDGA.eom_ν_cutoff — Methodeom_ν_cutoff(Niν::Int, grid_shifted::Bool)::Int
eom_ν_cutoff(sP::SimulationParameters)
eom_ν_cutoff(h::lDΓAHelper)Returns number of positive fermionic frequencies to be used in self-energy after calculation of EoM (as a function of available positive frequency from DMFT Niν).
This is especially necessary for shifted grids, since there fewer bosonic frequencies available for large ν, leading to an error in the high frequency tail of the self energy.
LadderDGA.estimate_connected_ef — Methodestimate_connected_ef(Σ_ladder::OffsetMatrix, kG::KGrid, μ::Float64, β::Float64; ν0_estimator::Function=lin_fit)Estimates connected fermi surface. See also estimate_ef and fermi_surface_connected. Returns fermi surface indices and relax_zero_condition (values substantially larger than 1 indicate appearance of fermi arcs).
LadderDGA.estimate_ef — Methodestimate_ef(Σ_ladder::OffsetMatrix, kG::KGrid, μ::Float64, β::Float64; ν0_estimator::Function=lin_fit, relax_zero_condition::Float64=10.0)Estimate fermi surface of Σ_ladder, using extrapolation to $\nu = 0$ with the function ν0_estimator and the condition $\lim_{\nu \to 0} \Sigma (\nu, k_f) = \mu - \epsilon_{k_f}$.
LadderDGA.expand_ω — Methodexpand_ω(χ₀qω)
Helper function for reading RPA input. It holds χ₀(q,ω)=χ₀(q,-ω). Take an array for χ₀(q,ω) with ω-integers {0, 1, ..., m} and map onto array with ω-integers {-m, -(m-1), ..., -1, 0, 1, ..., m-1, m}.LadderDGA.fermi_surface_connected — Methodfermi_surface_connected(ef_ind::BitVector, kG::KGrid, D::Int)Checks for connected fermi surface of kG dimensions, given a BitVector of points on the fermi surface. Returns < 0 if fermi surface is not connected, == 0 if it is exactly a line, > 0 if the line is multiple points thick.
LadderDGA.filling — Methodfilling(G::Vector{ComplexF64}, [kG::KGrid, ] β::Float64)
filling(G::Vector, U::Float64, μ::Float64, β::Float64, [shell::Float64])Computes filling of (non-) local Green's function.
If U, μ and β are provided, asymptotic corrections are used. The shell sum can be precomputed using shell_sum_fermionic If G is defined only over positive Matsubara frequencies filling_pos can be used.
LadderDGA.filling_pos — Methodfilling_pos(G::Vector, U::Float64, μ::Float64, β::Float64[, shell::Float64, improved_sum::Bool=true])::Float64
filling_pos(G::AbstractMatrix{ComplexF64},kG::KGrid,U::Float64,μ::Float64,β::Float64; improved_sum::Bool = true)::Float64
filling_pos(G::AbstractMatrix{ComplexF64},kG::KGrid,)::Float64Returns filling from G only defined over positive Matsubara frequencies. See filling for further documentation.
LadderDGA.filter_KZ — Methodfilter_KZ(m::Int, k::Int, X::AbstractArray{T,1}) where T <: NumberIterated moving average noise filter for inut data. See also filter_MA.
LadderDGA.filter_MA — Methodfilter_MA(m::Int, X::AbstractArray{T,1}) where T <: Number
filter_MA!(res::AbstractArray{T,1}, m::Int, X::AbstractArray{T,1}) where T <: NumberIterated moving average noise filter for inut data. See also filter_KZ.
LadderDGA.find_usable_χ_interval — Methodfind_usable_χ_interval(χ_ω::Array{Float64,1/2}; sum_type::Union{Symbol,Tuple{Int,Int}}=:common, reduce_range_prct::Float64 = 0.1)Determines usable range for physical susceptibilities $\chi^\omega$ or $\chi^\omega$ and additionally cut away reduce_range_prct % of the range. The unusable region is given whenever the susceptibility becomes negative, or the first derivative changes sign.
Returns:
range::AbstractVector{Float64} : Usable $\omega$ range for $\chi$
Arguments:
χ_ω: $\chi^\omega$sum_type: Optional, default:common. Can be set to:fullto enforce full range, or a::Tuple{Int,Int}to enforce a specific interval size.reduce_range_prct: Optional, default0.1. After finding the usable interval it is reduced by an additional percentage given by this value.
LadderDGA.gen_ν_part — Methodgenνpart(νGrid::AbstractVector{Int}, sP::SimulationParameters, N::Int)
Returns partition of fermionic frequencies grid, according to the number of workers N. The partition is given as a list (of length N) of lists with 4-Tuples (ωi, ωn, νi, νn). νi and ωi are the indices for the Matsubara frequencies νn and ωn.
LadderDGA.gen_ν_part_slices — Methodgen_ν_part_slices(data::Array{ComplexF64,3}, index_list::Vector{NTuple{4,Int}})Rearragnes data over q, ν and ω axes, for EoM (see calc_Σ_par) given index_list, which is one element of the list of lists obtained from gen_ν_part.
Returns three arrays: - datares: Rearranged data, only containes values for ν, given in `indexlist, ω values not contained indataare set to 0. - νn_list: Has lengthsize(datares,3)`. Contained fermionic Matsubara frequency for each index. - ωnranges: Has length size(data_res,3). Containes bosonic Matsubara frequencies for each ν value.
LadderDGA.gen_νω_part — Methodgen_νω_part(sP::SimulationParameters, N::Int)Returns partition of frequency grid, according to the number of workers N.
LadderDGA.gen_ω_part — Methodgen_ω_part(sP::SimulationParameters, N::Int)Returns partition of bosonic frequencies grid, according to the number of workers N.
LadderDGA.initialize_EoM — Methodfunction initialize_EoM([G_fft_reverse, λ₀::Array{ComplexF64,3}, νGrid::AbstractVector{Int},
kG::KGrid, mP::ModelParameters, sP::SimulationParameters];
OR [h::lDΓAHelper, λ₀, νGrid];
force_reinit = false,
χm::χT = collect_χ(:sp, kG, mP, sP),
γm::γT = collect_γ(:sp, kG, mP, sP),
χd::χT = collect_χ(:ch, kG, mP, sP),
γd::γT = collect_γ(:ch, kG, mP, sP))Worker cache initialization. Must be called before calc_Σ_par.
LadderDGA.initialize_EoM_cache! — Methodinitialize_EoM_cache!()Initializes cache to correct size. kG and sP must be set first.
LadderDGA.is_okay — Methodis_okay(χ₀qω)
check whether the given χ₀qω Array satisfies a set of expected conditions.
LadderDGA.iν_array — Methodiν_array(β::Real, grid::AbstractArray{Int64,1})::Vector{ComplexF64}
iν_array(β::Real, size::Int)::Vector{ComplexF64}Computes list of fermionic Matsubara frequencies. If length size is given, the grid will have indices 0:size-1. Bosonic arrays can be generated with iω_array.
Returns:
Vector of fermionic Matsubara frequencies, given either a list of indices or a length.
LadderDGA.iω_array — Methodiω_array(β::Real, grid::AbstractArray{Int64,1})::Vector{ComplexF64}
iω_array(β::Real, size::Int)::Vector{ComplexF64}Computes list of bosonic Matsubara frequencies. If length size is given, the grid will have indices 0:size-1. Fermionic arrays can be generated with iν_array.
Returns:
Vector of bosonic Matsubara frequencies, given either a list of indices or a length.
LadderDGA.log_q0_χ_check — Methodlog_q0_χ_check(kG::KGrid, sP::SimulationParameters, χ::AbstractArray{_eltype,2}, type::Symbol)TODO: documentation
LadderDGA.par_partition — Methodpar_partition(set::AbstractVector, N::Int)Returns list of indices for partition of set into N (almost) equally large segements.
LadderDGA.printr_s — Methodprintr_s(x::ComplexF64)
printr_s(x::Float64)prints 4 digits of (the real part of) x
LadderDGA.q0_index — Methodq0_index(kG::KGrid)Index of zero k-vector.
LadderDGA.readConfig — MethodreadConfig(cfg_in::String)Reads a config.toml file either as string or from a file and returns - workerpool - ModelParameters - SimulationParameters - EnvironmentVars - kGrid (see Dispersions.jl)
LadderDGA.readConfig_RPA — MethodreadConfig_RPA(cfg_in::String)Reads a config.toml file either as string or from a file and returns - workerpool - ModelParameter, "../test/test_data/rpa_chi0_1.h5") # χ₀ = read_χ₀_RPA(inputfile)s - SimulationParameters - EnvironmentVars - kGrid (see Dispersions.jl)
LadderDGA.readFortranχDMFT — MethodReturns χ_DMFT[ω, ν, ν']LadderDGA.read_χ₀_RPA — Methodread_χ₀_RPA(file::String)
Nω :: Int, Number of positive bosonic frequencies to be used. Make sure that the given χ₀-file has at least this many bosonic frequencies!LadderDGA.reduce_range — Methodreduce_range(range::AbstractArray, red_prct::Float64)Returns indices for 1D array slice, reduced by red_prct % (compared to initial range). Range is symmetrically reduced fro mstart and end.
LadderDGA.setupConfig_RPA — MethodsetupConfig_RPA(KGridStr, Nk::Int)Sets up RPA calculation directly. Usually one should use readConfig_RPA as entry point.
LadderDGA.setup_LDGA — Methodsetup_LDGA(kGridStr::Tuple{String,Int}, mP::ModelParameters, sP::SimulationParameters, env::EnvironmentVars [;silent=false])Computes all needed objects for DΓA calculations.
Returns: lDΓAHelper
LadderDGA.setup_LDGAa — Methodsetup_LDGAa(kGridStr::Tuple{String,Int}, mP::ModelParameters, sP::SimulationParameters, env::EnvironmentVars [;silent=false])Computes all needed objects for DΓA-asymptotic calculations.
Returns: lDΓAaHelper
LadderDGA.shell_sum_fermionic — Methodshell_sum_fermionic(N::Int, β::Float64, power::Int)::Float64Calculate $\frac{1}{\beta} \sum_{n \in \Omega_\mathrm{shell}} \frac{1}{(i \nu_n)^power}$ N-1 is the largest frequency index (i.e. $\sum_{n=-N}^(N-1) u_n$ is in the core region)
LadderDGA.subtract_tail! — Methodsubtract_tail!(outp::AbstractArray{T,1}, inp::AbstractArray{T,1}, c::Float64, iω::Array{ComplexF64,1}, power::Int) where T <: Numbersubtract the c/(iω)^power high frequency tail from inp and store in outp. See also subtract_tail
LadderDGA.subtract_tail — Methodsubtract_tail(inp::AbstractArray{T,1}, c::Float64, iω::Array{ComplexF64,1}, power::Int) where T <: Numbersubtract the $\frac{c}{(i\omega)^\text{power}}$ high frequency tail from input array inp.
LadderDGA.sum_kω — Methodsum_kω(kG::kGrid, χ::χT; ωn_arr=ωn_grid(χ), force_full_range=false, [transform::Function])
sum_kω(kG::kGrid, χ::χT; ωn_arr=ωn_grid(χ), force_full_range=false, [λ::Float64])
sum_kω(kG::KGrid, χ::AbstractMatrix{Float64}, β::Float64, ωn2_tail::Vector{Float64}; transform=nothing)::Float64Returns $\int_\mathrm{BZ} dk \sum_\omega \chi^\omega_k$. The bosonic Matsubara grid can be precomputed and given with ωn_arr to increase performance.
TODO: for now this is only implemented for tail correction in the $1 / \omega^2_n$ term! Sums first over k, then over ω (see also sum_ω), see sum_kω for the reverse order (results can differ, due to inaccuracies in the asymptotic tail treatment). The transform function needs to have the signature f(in::Float64)::Float64 and will be applied before summation. Alternatively, λ can be given directly as Float64, if the usual λ-correction should be applied.
LadderDGA.sum_ω — Methodsum_ω(χ::χT)
sum_ω!(res::Vector{ComplexF64}, ωn_arr::Vector{ComplexF64}, χ::χT; force_full_range=false)::Nothing
sum_ω!(ωn_arr::Vector{T}, χ::AbstractVector{T}, tail_c::Vector{Float64}, β::Float64; force_full_range=false)::T where T <: Union{Float64,ComplexF64}
Sums the physical susceptibility over all usable (if `force_full_range` is not set to `true`) bosonic frequencies, including improvd tail summation, if `χ.tail_c` is set.
WARNING: This function might be buggy!LadderDGA.sum_ωk — Methodsum_ωk(kG::KGrid, χ::χT; force_full_range=false)::Float64WARNING: This function is a non optimized debugging function! See sum_kω, which should return the same result if the asymptotics are captured correctly. Optional function f transforms χ before summation.
WARNING: This function might be buggy!
LadderDGA.tail_correction_term — Methodtail_correction_term(χm_nl::Float64, χm_loc::Float64, tail_factor::Vector{ComplexF64})
tail_correction_term(U::Float64, β::Float64, n::Float64, χm_nl::Float64, χm_loc::Float64,
Σ_loc::OffsetVector{ComplexF64}, iν::Vector{ComplexF64};
δ::Real=10.0*length(iν))Calculates correction term for high frequency behavior of self energy.
$w_\nu = e^{(-\Delta^2_{\nu}/\delta)}$ with $\Delta_{\nu} = \nu \cdot \Sigma^\nu_\mathrm{DMFT} - U^2 \frac{n}{2} (1 - \frac{n}{2})$. See also tail_factor.
LadderDGA.tail_factor — Methodtail_factor(U::Float64, β::Float64, n::Float64, Σ_loc::OffsetVector{ComplexF64}, iν::Vector{ComplexF64};
δ::Real=min(0.01, 1 ./ length(iν)))Calculates the tail factor for tail_correction_term.
LadderDGA.update_tail! — Methodupdate_tail!(coeffs::Vector{Float64})Updates the Ekin/ω^2 tail of physical susceptibilities on all workers.
LadderDGA.update_tail! — Methodupdate_tail!(χ::χT, new_tail_c::Array{Float64}, ωnGrid::Array{ComplexF64})Updates the $\frac{c_i}{\omega_n^i}$ tail for all coefficients given in new_tail_c (index 1 corresponds to $i=0$). #TODO: ONLY UPDATES 1/w^2 AT THE MOMENT!!!
LadderDGA.update_wcache! — Methodupdate_wcache!(name::Symbol, val; override=true)Updates worker cache with given name and value. Typically used through remotecall() on specific worker.
LadderDGA.usable_ωindices — Methodusable_ωindices(sP::SimulationParameters, χ_sp::χT, χ_ch::χT)Helper function, returning the indices n for $\omega_n$ ranges of multiple channels. If dbg_full_eom_omega is set to true in the config, the full range will be returned, otherwise an intersection of the usable ranges obtained from find_usable_χ_interval.
LadderDGA.Δ — MethodΔ(ϵₖ::Vector{Float64}, Vₖ::Vector{Float64}, νₙ::Vector{ComplexF64})::Vector{ComplexF64}Computes hybridization function $\Delta(i\nu_n) = \sum_k \frac{|V_k|^2}{\nu_n - \epsilon_k}$ from Anderson parameters (for example obtained through exact diagonalization).
Returns:
Hybridization function over list of given fermionic Matsubara frequencies.
Arguments:
ϵₖ: list of bath levelsVₖ: list of hopping amplitudesνₙ: Vector of fermionic Matsubara frequencies, see also:iν_array.
LadderDGA.Σ_Dyson — MethodΣ_Dyson(GBath::Vector{ComplexF64}, GImp::Vector{ComplexF64})::Vector{ComplexF64}
Σ_Dyson!(Σ::Vector{ComplexF64}, GBath::Vector{ComplexF64}, GImp::Vector{ComplexF64})::Vector{ComplexF64}Calculates $\Sigma = 1 / G_\text{bath} - 1 / G_\text{imp}$.
LadderDGA.Σ_hartree — MethodΣ_hartree(mP::ModelParameters)Calculates the hartree term of the self energy
\Sigma_{hartree}=\frac{U\cdot n}{2}.
Arguments
mP: ModelParameters
Returns
Float64 : Hartree term
LadderDGA.λ_from_γ — Methodλ_from_γ(type::Symbol, γ::γT, χ::χT, U::Float64)TODO: documentation
LadderDGA.ν0Index_of_ωIndex — Methodν0Index_of_ωIndex(ωi::Int[, sP])::IntCalculates index of zero fermionic Matsubara frequency (which may depend on the bosonic frequency). ωi is the index (i.e. starting with 1) of the bosonic Matsubara frequency.
LadderDGA.νi_health — Methodνi_health(νGrid::AbstractArray{Int}, sP::SimulationParameters)Returns a list of available bosonic frequencies for each fermionic frequency, given in νGrid. This can be used to estimate the maximum number of usefull frequencies for the equation of motion.
LadderDGA.νi_νngrid_pos — Methodνi_νngrid_pos(ωi::Int, νmax::Int, sP::SimulationParameters)Indices for positive fermionic Matsubara frequencies, depinding on ωi, the index of the bosonic Matsubara frequency.
LadderDGA.νnGrid — MethodνnGrid(ωn::Int, sP::SimulationParameters)Calculates grid of fermionic Matsubara frequencies for given bosonic frequency ωn (including shift, if set through sP).
LadderDGA.χ₀Asym — Methodχ₀Asym(c1::Float64, c2::Vector{Float64}, c3::Float64, ωnGrid::AbstractVector{Int}, n_iν::Int, shift::Int, β::Float64)Builds asymtotic helper array. See calc_bubble implementation for details.
c1, c2 and c3 are the coefficients for the asymtotic tail expansion and can be obtained through χ₀Asym_coeffs. n_iν is the number of positive fermionic Matsubara frequencies, shift is either 1 or 0, depending on the type of frequency grid.
LadderDGA.χ₀Asym_coeffs — Methodχ₀Asym_coeffs(type::Symbol, kG::KGrid, mP::ModelParameters; sVk=NaN)Builds tail coefficients for the χ₀ asymptotic helper, obtained through χ₀Asym.
TODO: full documentation
LadderDGA.ω0_index — Methodω0_index(sP::SimulationParameters)
ω0_index(χ::[χT or AbstractMatrix])Index of ω₀ frequency.
LadderDGA.ω2_tail — Methodω2_tail(χ, h)Computes bosonic frequency tail for χ: $\mathrm{tail}(n) = \frac{1}{(2 i \pi n / \beta)^2}$. Sets $\mathrm{tail}(n) = 0$.
LadderDGA.ω_tail — Methodω_tail(ωindices::AbstractVector{Int}, coeffs::AbstractVector{Float64}, sP::SimulationParameters)
ω_tail(χ_sp::χT, χ_ch::χT, coeffs::AbstractVector{Float64}, β::Float64, sP::SimulationParameters)LadderDGA.ωn_grid — Methodωn_grid(χ::χT)Computes bosonic frequencies for χ: $2 i \pi n / \beta$.
LambdaCorrection
This sub-module contains function related to the $\lambda$-correction.
LadderDGA.LambdaCorrection.λ_result — Typeλ_resultContaines result and auxilliary information of λ correction, is returned by λ_correction, should not be constructed explicitly!
Fields
λm:Float64, Magnetic channel correction parameter.λd:Float64, Density channel correction parameter.type:CorrectionMethod, Type of λ correction::m, only magnetic channel:dm, magnetic and density channel:m_sc, only magnetic channel, partial self-consistency in EoM:dm_sc, magnetic and density channel, partial self-consistency in EoM:m_tsc, only magnetic channel, partial self-consistency in EoM, updated kinetic energy term in susceptibility tail:dm_tsc, magnetic and density channel, partial self-consistency in EoM, updated kinetic energy term in susceptibility tail
sc_converged:Bool, convergence parameter for self-consistency methods. AlwaysTruefor non self-consist methods. See alsosc_convergedeps_abs:Float64, Threshold for convergence. Convergence is assumed when the potential energies and Pauli principle values (depending on method both or one) are equal up to this value.sc_eps_abs:Float64, Threshold for sc convergence. Convergence is assumed when the potential energies and Pauli principle values (for 1- and 2-particle quantities) individually change by less thansc_eps_abs.EKin:Float64, 2-Particle kinetic energyEPot_p1:Float64, 1-Particle potential energy, $G^\mathbf{\lambda}_\mathrm{ladder} \Sigma^\mathbf{\lambda}_\mathrm{ladder}$, seecalc_EEPot_p2:Float64, 2-Particle potential energy, $\frac{U}{2} \sum_{\omega,q} (\chi^{\lambda_\mathrm{d},\omega}_{\mathrm{d},q} - \chi^{\lambda_\mathrm{m},\omega}_{\mathrm{m},q} + U\frac{n^2}{2}$PP_p1:Float64, 1-Particle Pauli principle, $\frac{n}{2} (1 - \frac{n}{2})$PP_p2:Float64, 2-Particle Pauli principle, $\frac{1}{2} \sum_{\omega,q} (\chi^{\lambda_\mathrm{d},\omega}_{\mathrm{d},q} + \chi^{\lambda_\mathrm{m},\omega}_{\mathrm{m},q}$trace:DataFrame/Nothing, intermediate values ofλ_result(Σ_ladderandG_ladderare only stored as checksums) for each self-consistency iteration.G_ladder:Nothing/OffsetMatrix, Green's function after covnergence of λ-correctionΣ_ladder:Nothing/OffsetMatrix, self-energy after λ-correctionμ:Float64, chemical potential after λ-correctionn:Float64, electron density. This is used as check, μ should have been internally adjustet to keep this value fixed (i.e.n ≈ n_dmft)n_dmft:Float64, input electron density
LadderDGA.LambdaCorrection.λ_result — Methodλ_result(χm::χT,γm::γT,χd::χT, γd::γT, λ₀::Array{ComplexF64,3}, λm, λd, h;
validation_threshold::Float64 = 1e-8, max_steps_m::Int = 2000)
λ_result(χm::χT,γm::γT,χd::χT, γd::γT, λ₀::Array{ComplexF64,3}, μ_new, G_ladder, Σ_ladder, λm, λd, h;
validation_threshold::Float64 = 1e-8, max_steps_m::Int = 2000)Constructs λ_result object, runs all checks and stores them.
LadderDGA.LambdaCorrection.EPot_diff — MethodEPot_diff(result::λ_result)Difference between potential energies on one- and two particle level (may be negative if EPot_p2 > EPot_p1).
LadderDGA.LambdaCorrection.PP_diff — MethodPP_diff(result::λ_result)Difference between Pauli principle on one- and two particle level (may be negative if PP_p2 > PP_p1).
LadderDGA.LambdaCorrection.bisect — Methodbisect(λl::T, λm::T, λr::T, Fm::T)::Tuple{T,T} where T <: Union{Float64, Vector{Float64}}WARNING: Not properly tested! Bisection root finding algorithm. This is a very crude adaption of the 1D case. The root may therefore lie outside the given region and the search space has to be corrected using correct_margins.
Returns:
(Vector of) new interval borders, according to Fm.
Arguments:
λl: (Vector of) left border(s) of bisection areaλm: (Vector of) central border(s) of bisection areaλr: (Vector of) right border(s) of bisection areaFm: (Vector of) Poincare-Miranda condition (s)
LadderDGA.LambdaCorrection.calc_G_Σ — Methodcalc_G_Σ(χm::χT, γm::γT, χd::χT, γd::γT, λ₀::AbstractArray{ComplexF64,3},
λm::Float64, λd::Float64,
h::RunHelper, sP::SimulationParameters, mP::ModelParameters;
tc::Bool = true, fix_n::Bool = true)
Returns μ_new, G_ladder, Σ_ladder with λ correction according to function parameters.
LadderDGA.LambdaCorrection.converged — Methodconverged(r::λ_result, eps_abs::Float64=1e-6)Checks convergences for appropriate parameters of method.
LadderDGA.LambdaCorrection.correct_margins — Methodcorrect_margins(λl::T, λm::T, λr::T, Fm::T, Fr::T)::Tuple{T,T} where T <: Union{Float64, Vector{Float64}}Helper method for bisect.
LadderDGA.LambdaCorrection.dχ_λ — Methoddχ_λ(χ::[Float64,ComplexF64,AbstractArray], λ::Float64)First derivative of χ_λ.
LadderDGA.LambdaCorrection.gen_νω_indices — Methodgen_νω_indices(χ_m::χT, χ_d::χT, sP::SimulationParameters)Internal helper to generate usable bosonic and fermionic ranges. Also returns the $c_1/x^2$ tail.
LadderDGA.LambdaCorrection.get_λ_min — Methodget_λ_min(χr::AbstractArray{Float64,2})::Float64Computes the smallest possible $\lambda$-correction parameter (i.e. first divergence of $\chi(q)$), given as $\lambda_\text{min} = - \min_{q}(1 / \chi^{\omega_0}_q)$.
LadderDGA.LambdaCorrection.linear_approx — Methodlinear_approx(f1::T2, f2::T2, x1::T1, x2::T1, xm::T1) where {T1, T2}Linear approximation of function sampled at f1 = f(x1) and f2 = f(x2) at point xm, x1 <= xm <= x2.
LadderDGA.LambdaCorrection.n_diff — Methodn_diff(result::λ_result)Difference between density before and after λ-correction (this should always be close to 0!)
LadderDGA.LambdaCorrection.newton — Methodnewton(f::Function, df::Function, xi::Float64; nsteps::Int = 500, atol::Float64 = 1e-10)::Float64Normal Newton method, used for example by newton_transformed and newton_secular.
xi is the initial guess, for functions with multiple roots, the result will depend on this guess.
LadderDGA.LambdaCorrection.newton_right — Methodnewton_right(f::Function, [df::Function,] start::[Float64,Vector{Float64},MVector{Float64}], min::[Float64,Vector{Float64},MVector{Float64}]; nsteps=5000, atol=1e-11)Computes root of function f but under the condition that each compontent of the root is larger than the corresponding component of the start vector. This algorithm also assumes, that f is stricly monotonically decreasing in each component. nsteps sets the maximum number of newton-steps, atol sets the convergence tolerance. df can be omitted. In this case it is approximated using finite differences.
This is a legacy method. For better convergence performance and reliability please consider using newton_secular.
LadderDGA.LambdaCorrection.newton_secular — Methodnewton_secularEq(f::Function, [df::Function,], pole::Float64)Computes largest root of function f, assuming it corresponds to a secular equaiton $f(x) = 1 + \sum_j \frac{b_j}{d_j - x}$. Adapted from Example 2, https://doi.org/10.48550/arXiv.2204.02326 Given the largest pole $x_p$ we transform the input according to $w(x_i) = \frac{1}{x} + x_p$ and then procede with the modified Newton algorithm (using the chain rule): $x_{(n+1)} = x_{(n)} + f(w(x_i)) \cdot (f'(w(x_i)))^{-1} (w'(x_i))^{-1}$
For debugging purposes, there are also newton_secular_trace and trace_f available.
Arguments:
f: function, with structure as given above.df: derivative function, will be constructed by finite differences, if not provided.xp: largest pole, it is guaranteed, that there is exactly one root larger than this, which will be returned by the algorithm.nsteps: maximum number of stepsatol: convergence criterion, i.e. $|f(x_0)| <$atolwill return rootx0.
LadderDGA.LambdaCorrection.newton_secular_trace — Methodnewton_secular_trace(f::Function, df::Function, xp::Float64; nsteps::Int = 500, atol::Float64 = 1e-10)::Float64This is the same as newton_secular, but also returns a trace of the intermediate values (xi,xi_tf,fi,dfii).
LadderDGA.LambdaCorrection.reset! — Methodreset!(χ::χT)Resets the λ-correction of the χ struct.
LadderDGA.LambdaCorrection.sample_f — Methodsample_f(f::Function, xmin::T, xmax::T; feps_abs::Float64=1e-8, xeps_abs::Float64=1e-8, maxit::Int=1000) where TSample a function $f: \mathbb{R} \to \mathbb{R}$ over the interval $[xmin, xmax]$ by repeatedly bisecting intervals, that cannot be approximated linearly.
$x$ values will be sampled with a distance of at least ϵ. $\delta$ is the bisection criterion. i.e. if $|f(x_i) L_f(x_i)| | <$ feps_abs for a proposed bisection point, the interval is supposed to be converged. Algorithm will stop bisection after maxit samples
LadderDGA.LambdaCorrection.sc_converged — Methodsc_converged(r::λ_result)Checks for self-consistency convergence. Returns true if method does not invlove a self-consistency loop.
LadderDGA.LambdaCorrection.validate — Methodvalidation(r::λ_result)Returns Tuple with check for (density, Pauli-principle, potential energy), both checked between one- and two-particle level against λ_result.eps_abs.
LadderDGA.LambdaCorrection.validate_EPot — Methodvalidate_EPot(χm::χT, χd::χT, λm::Float64, n::Float64)Returns .
LadderDGA.LambdaCorrection.validate_PP — Methodvalidate_PP(χm::χT, χd::χT, λm::Float64, λd::Float64, n::Float64)Returns .
LadderDGA.LambdaCorrection.validate_sums — Methodvalidate_sums(kG::KGrid, χr::χT[, λr::Float64])Returns $\sum_k \sum_\omega \chi^{\lambda_r,\omega}_{r,q} - \sum_\omega \sum_k \chi^{\lambda_r,\omega}_{r,q}$.
LadderDGA.LambdaCorrection.λ_correction — Methodλ_correction(type::Symbol, χm::χT, γm::γT, χd::χT, γd::γT, λ₀, h::lDΓAHelper;
λm_rhs_type::Symbol=:native, fit_μ::Bool=true,
νmax::Int=eom_ν_cutoff(h), λ_min_δ::Float64 = 0.0001,
maxit::Int=100, mixing::Float64=0.2, conv_abs::Float64=1e-8, trace::Bool=false,
λ_val_only::Bool=false, verbose::Bool=false, validation_threshold::Float64=1e-8, tc::Bool=true)Executes λ-correction. TODO: finish docu
Arguments
type:Symbol, options are:m,:dm,:m_sc,:dm_sc,:m_tscand:dm_tscχm:γm:χd:γd:
LadderDGA.LambdaCorrection.λdm_correction — Methodλdm_correction(χm::χT,γm::γT,χd::χT, γd::γT,λ₀::Array{ComplexF64,3}, h;
validation_threshold::Float64 = 1e-8, max_steps_m::Int = 2000, max_steps_dm::Int = 2000, log_io = devnull
)Computes the λm and λd parameters for the consistency of Pauli principle and potential energie on one- and two-particle level. Returns a λ_result object.
LadderDGA.LambdaCorrection.λdm_correction_val — Methodλdm_correction_val(χm::χT,γm::γT,χd::χT, γd::γT,λ₀::Array{ComplexF64,3}, h;
validation_threshold::Float64 = 1e-8, max_steps_m::Int = 2000, max_steps_dm::Int = 2000, log_io = devnull
)Computes the λm and λd parameters for the consistency of Pauli principle and potential energie on one- and two-particle level. Returns the bare λ-values, usually one should run λdm_correction, which returns a λ_result object that stores additional consistency checks.
LadderDGA.LambdaCorrection.λdm_sc_correction_clean — Methodλdm_sc_correction(χm::χT,γm::γT,χd::χT, γd::γT,λ₀::λ₀T, h;
validation_threshold::Float64 = 1e-8,
max_steps_m::Int = 2000, max_steps_dm::Int = 2000, max_steps_sc::Int = 2000,
log_io = devnull, tc = true)Runs partial self-consistency loop (update of propagators in equation of motion) within λdm correction
LadderDGA.LambdaCorrection.λdm_tsc_correction_clean — Methodλdm_tsc_correction(χm::χT, γm::γT, χd::χT, γd::γT, λ₀::Array{ComplexF64,3}, h, sP, mP;
validation_threshold::Float64 = 1e-8, log_io = devnull
)LadderDGA.LambdaCorrection.λm_correction — Methodλm_correction(χm::χT,γm::γT,χd::χT,γd::γT,λ₀::Array{ComplexF64,3},h::lDΓAHelper;
νmax::Int = eom_ν_cutoff(h), fit_μ::Bool = true, tc = true,
validation_threshold::Float64 = 1e-8, log_io = devnullLadderDGA.LambdaCorrection.λm_correction_val — Methodλm_correction_val(χm::χT, rhs::Float64, h::lDΓAHelper)
λm_correction_val(χm::χT, rhs::Float64, kG::KGrid, ωn2_tail)Used internally for performance reasons (because the $\lambda_\mathrm{d}$ correction needs this calculation repeatedly), see λm_correction for the user-sided version. Calculates $\lambda_\mathrm{m}$ value, by fixing $\sum_{q,\omega} \chi^{\lambda,\omega}_{\uparrow\uparrow}(q,i\omega) = \frac{n}{2}(1-\frac{n}{2})$. This is only calculates the value and validation numbers and does not return a full λ_result object.
TODO: finish docu
Arguments
χm:rhs:h:ωn2_tail:verbose:ωn2_tail:
LadderDGA.LambdaCorrection.λm_rhs — Methodλm_rhs(χm::χT, χd::χT, h::RunHelper; λd::Float64=NaN, λ_rhs = :native, verbose=false)
λm_rhs(imp_density::Float64, χm::χT, χd::χT, λd::Float64, kG::KGrid, mP::ModelParameters, sP::SimulationParameters, λ_rhs = :native)Helper function for the right hand side of the Pauli principle conditions (λm correction). imp_density can be set to NaN, if the rhs ($\frac{n}{2}(1-\frac{n}{2})$) should not be error-corrected (not ncessary or usefull when asymptotic improvement are active). TODO: write down formula, explain imp_density as compensation to DMFT.
LadderDGA.LambdaCorrection.λm_sc_correction — Methodλm_sc_correction(χm::χT,γm::γT,χd::χT, γd::γT,λ₀::λ₀T, h;
validation_threshold::Float64 = 1e-8,
max_steps_m::Int = 2000, max_steps_dm::Int = 2000, max_steps_sc::Int = 2000,
log_io = devnull, tc = true)Runs partial self-consistency loop (update of propagators in equation of motion) within λdm correction
LadderDGA.LambdaCorrection.λm_tsc_correction — Methodλm_tsc_correction(χm::χT, γm::γT, χd::χT, γd::γT, λ₀::Array{ComplexF64,3}, h, sP, mP;
validation_threshold::Float64 = 1e-8, log_io = devnull
)LadderDGA.LambdaCorrection.χ_λ! — Methodχ_λ!(χ_destination::[AbstractArray,χT], [χ::[AbstractArray,χT], ] λ::Float64)Inplace version of χ_λ. If the second argument is omitted, results are stored in the input χ.
LadderDGA.LambdaCorrection.χ_λ — Methodχ_λ(χ::[Float64,ComplexF64,AbstractArray,χT], λ::Float64)Computes the λ-corrected susceptibility: $\chi^{\lambda,\omega}_q = \frac{1}{1 / \chi^{\lambda,\omega}_q + \lambda}$. The susceptibility $\chi$ can be either given element wise, or as χT See also χT in LadderDGA.jl.