MeshGrids
GreenFunc.MeshGrids.DLRFreq — Type
function DLRFreq(β, isFermi::Bool=false;
dtype=Float64,
rtol=1e-12,
Euv=1000 / β,
sym=:none,
rebuild=false,
dlr::Union{DLRGrid,Nothing}=nothing
)Create a DLRFreq struct from parameters.
Arguments
β: inverse temperature.isFermi: the statistics for particles is fermionic or not. False by default.dtype: type ofβandEuv.rtol: tolerance absolute error. By default,rtol= 1e-12.Euv: the UV energy scale of the spectral density. By default,Euv = 1000 / β.symmetry::phfor particle-hole symmetric,:phafor particle-hole symmetry, and:nonefor no symmetry. By default,sym = :none.rebuild: if no dlr is input, set false to load DLRGrid from the file; set true to recalculate the DLRGrid on the fly. By default,rebuild = false.
GreenFunc.MeshGrids.DLRFreq — Type
struct DLRFreq{T<:Real} <: TemporalGrid{Int}Discrete-Lehmann-representation grid for Green's functions.
Parameters
T: type of thegridpoint,βandEuv.
Members
dlr: built-in DLR grid.grid: 1D grid of time axis, with locate, volume, and AbstractArray interface implemented. It should be grid of Int for ImFreq, and DLRGrid for DLRFreq.β: inverse temperature.Euv: the UV energy scale of the spectral density.rtol: tolerance absolute error.symmetry::phfor particle-hole symmetric,:phafor particle-hole symmetry, and:nonefor no symmetry. By default,sym = :none.isFermi: the statistics for particles.
GreenFunc.MeshGrids.DLRFreq — Method
GreenFunc.MeshGrids.ImFreq — Type
function ImFreq(β, isFermi::Bool=false;
dtype=Float64,
Euv=1000 / β,
rtol=1e-12,
symmetry=:none,
grid::Union{AbstractGrid,AbstractVector,Nothing}=nothing
)Create a ImFreq struct from parameters.
Arguments
β: inverse temperature.isFermi: the statistics for particles is fermionic or not. False by default.dtype: type ofβandEuv. By default,dtype = Float64.Euv: the UV energy scale of the spectral density. By default,Euv = 1000 / β.symmetry::phfor particle-hole symmetric,:phafor particle-hole symmetry, and:nonefor no symmetry. By default,sym = :none.grid: 1D Matsubara-frequency integer-valued grid as a AbstractVector or CompositeGrids.AbstractGrid. By default, a optimized grid built in DLR is used.
GreenFunc.MeshGrids.ImFreq — Type
struct ImFreq{T, G, R} <: TemporalGrid{Int}Imaginary-frequency grid for Green's functions.
Parameters
T<:Real: type of thegridpoint,βandEuv.G<:AbstractGrid{T}: type of 1D grid withTas the grid point type.R: type of the representation.REV: access the grid in reverse order or not.
Members
grid: 1D grid of time axis, with locate, volume, and AbstractArray interface implemented. Always in ascend order It should be grid of Int for ImFreq, and DLRGrid for DLRFreq.β: inverse temperature.Euv: the UV energy scale of the spectral density.isFermi: the statistics for particles is fermionic or not.symmetry::phfor particle-hole symmetric,:phafor particle-hole symmetry, and:nonefor no symmetry. By default,sym = :none.rtol: relative tolerancerepresentation: the representation of the Green's function.
GreenFunc.MeshGrids.ImFreq — Method
function ImFreq(dlr::DLRGrid;
dtype=Float64,
grid::Union{AbstractGrid,AbstractVector}=SimpleG.Arbitrary{Int}(dlr.n)
)Construct ImFreq from a DLRGrid, with a given grid. By default, grid is the Matsubara-frequency points from DLRGrid.
GreenFunc.MeshGrids.ImTime — Type
function ImTime(β, isFermi::Bool=false;
dtype=Float64,
rtol=1e-12,
Euv=1000 / β,
symmetry=:none,
grid::Union{AbstractGrid,AbstractVector,Nothing}=nothing
)Create a ImTime struct.
Arguments
β: inverse temperature.isFermi: the statistics for particles is fermionic or not. False by default.dtype: type of thegridpoint. By default,dtype = Float64.Euv: the UV energy scale of the spectral density. By default,Euv = 1000 / β.symmetry::phfor particle-hole symmetric,:phafor particle-hole symmetry, and:nonefor no symmetry. By default,sym = :none.grid: 1D time grid as a AbstractVector or CompositeGrids.AbstractGrid. By default, a optimized grid built in DLR is used.
GreenFunc.MeshGrids.ImTime — Type
struct ImTime{T, G, R} <: TemporalGrid{T}Time grid for Green's functions.
Parameters
T<:Real: type of thegridpoint,βandEuv.G<:AbstractGrid{T}: type of 1D grid withTas the grid point type.R: type of the representation.- REV: access the grid in reverse order or not.
Members
grid: 1D grid of time axis, with locate, volume, and AbstractArray interface implemented. Always in ascend order. It should be grid of Int for ImFreq, and DLRGrid for DLRFreq.β: inverse temperature.Euv: the UV energy scale of the spectral density.isFermi: the statistics for particles is fermionic or not.symmetry::phfor particle-hole symmetric,:phafor particle-hole symmetry, and:nonefor no symmetry. By default,sym = :none.rtol: relative tolerancerepresentation: the representation of the Green's function.
GreenFunc.MeshGrids.ImTime — Method
function ImTime(dlr::DLRGrid;
dtype=Float64,
grid::Union{AbstractGrid,AbstractVector}=SimpleG.Arbitrary{dtype}(dlr.τ))Construct ImTime from a DLRGrid, with a given grid. By default, grid is the imaginary-time grid points from DLRGrid.
GreenFunc.MeshGrids.MeshProduct — Type
MeshProduct{MT,N}
MeshProduct(vargs...)The Cartesian Mesh product:
Parameters:
MT: Type of meshesN: Number of meshes
Members:
meshes: The list of Meshes in the MeshProductdims: A tuple of the length of the mesh factors
Base.floor — Method
Base.floor(tg::TemporalGrid{T,false}, pos) where {T} = floor(tg.grid, pos) #TODO: how to implement?
Base.floor(tg::TemporalGrid{T,true}, pos) where {T} = length(tg) - floor(tg.grid, pos) #TODO: how to implement?If the grid is in ascend order, then floor returns the largest index that the grid point is smaller than pos. If the grid is in descend order, then floor returns the largest index that the grid point is larger than pos.
In both cases, the returned index is in the range [1, length(tg)-1]
Base.getindex — Method
getindex(g::ImFreq{T, G, R, REV}, I::Int)Equivalent to g[I], get the real-valued Matsubara frequency of the Ith point in the grid. For fermion, return (2g[I]+1)π/β, for boson, return 2g[I]*π/β.
If REV = true, then index in the reversed order, namely I will be replaced with length(g) - I + 1.
If you need the integer-valued frequency, use g.grid[I] instead.
Base.length — Method
GreenFunc.MeshGrids.index_to_linear — Method
function index_to_linear(obj::MeshProduct, index...)Convert a tuple of the indexes of each mesh to a single linear index of the MeshProduct.
Argument:
obj: The MeshProduct objectindex...: N indexes of the mesh factor, where N is the number of mesh factor
GreenFunc.MeshGrids.linear_to_index — Method
function linear_to_index(obj::MeshProduct, I::Int)Convert the single linear index of the MeshProduct to a tuple of indexes of each mesh.
Argument:
obj: The MeshProduct objectI: The linear index of the MeshProduct
GreenFunc.MeshGrids.locate — Method
locate(tg::ImFreq, n::Int)
locate(tg::ImFreq, ωn)Find the location in tg.grid for the Matsubara frequency ωn or the integer n.