MeshGrids
GreenFunc.MeshGrids.DLRFreq
— Typefunction 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
::ph
for particle-hole symmetric,:pha
for particle-hole symmetry, and:none
for 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
— Typestruct DLRFreq{T<:Real} <: TemporalGrid{Int}
Discrete-Lehmann-representation grid for Green's functions.
Parameters
T
: type of thegrid
point,β
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
::ph
for particle-hole symmetric,:pha
for particle-hole symmetry, and:none
for no symmetry. By default,sym = :none
.isFermi
: the statistics for particles.
GreenFunc.MeshGrids.DLRFreq
— Methodfunction DLRFreq(dlr::DLRGrid)
Create a DLRFreq
struct from DLRGrid
.
Arguments
dlr
: 1D DLR grid.
GreenFunc.MeshGrids.ImFreq
— Typefunction 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
::ph
for particle-hole symmetric,:pha
for particle-hole symmetry, and:none
for 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
— Typestruct ImFreq{T, G, R} <: TemporalGrid{Int}
Imaginary-frequency grid for Green's functions.
Parameters
T<:Real
: type of thegrid
point,β
andEuv
.G<:AbstractGrid{T}
: type of 1D grid withT
as 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
::ph
for particle-hole symmetric,:pha
for particle-hole symmetry, and:none
for no symmetry. By default,sym = :none
.rtol
: relative tolerancerepresentation
: the representation of the Green's function.
GreenFunc.MeshGrids.ImFreq
— Methodfunction 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
— Typefunction 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 thegrid
point. By default,dtype = Float64
.Euv
: the UV energy scale of the spectral density. By default,Euv = 1000 / β
.symmetry
::ph
for particle-hole symmetric,:pha
for particle-hole symmetry, and:none
for 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
— Typestruct ImTime{T, G, R} <: TemporalGrid{T}
Time grid for Green's functions.
Parameters
T<:Real
: type of thegrid
point,β
andEuv
.G<:AbstractGrid{T}
: type of 1D grid withT
as 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
::ph
for particle-hole symmetric,:pha
for particle-hole symmetry, and:none
for no symmetry. By default,sym = :none
.rtol
: relative tolerancerepresentation
: the representation of the Green's function.
GreenFunc.MeshGrids.ImTime
— Methodfunction 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
— TypeThe cartesian Mesh product:
#Parameters:
- 'MT': Type of meshes
- 'N' : Number of meshes
#Members:
- 'meshes' : The list of Meshes in the MeshProduct
- 'dims' : A tuple of the length of the mesh factors
Base.floor
— MethodBase.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
— Methodgetindex(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
— Methodfunction Base.length(obj::MeshProduct)
Return the number of grids of the MeshProduct.
Base.show
— Methodshow(io::IO, tg::DLRFreq)
Write a text representation of the DLR grid tg
to the output stream io
.
Base.show
— Methodshow(io::IO, tg::ImFreq)
Write a text representation of the Imaginary-frequency grid tg
to the output stream io
.
Base.show
— Methodshow(io::IO, tg::ImTime)
Write a text representation of the Imaginary-time grid tg
to the output stream io
.
Base.show
— Methodfunction Base.show(io::IO, obj::MeshProduct)
Print the MeshProduct.
Base.size
— Methodfunction Base.size(obj::MeshProduct, I::Int)
Return the length of the specifict Ith mesh factor of the MeshProduct.
Base.size
— Methodfunction Base.size(obj::MeshProduct, I::Int)
Return the length of the specifict Ith mesh factor of the MeshProduct.
GreenFunc.MeshGrids.index_to_linear
— Methodfunction 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 object
- 'index...': N indexes of the mesh factor, where N is the number of mesh factor
GreenFunc.MeshGrids.linear_to_index
— Methodfunction 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 object
- 'I': The linear index of the MeshProduct
GreenFunc.MeshGrids.locate
— Methodlocate(tg::ImFreq, n::Int)
locate(tg::ImFreq, ωn)
Find the location in tg.grid
for the Matsubara frequency ωn
or the integer n
.