Meshes on real axis.
The spectral functions are always defined on real axis. The ACFlow toolkit supports various uniform and non-uniform meshes. In order to build these meshes, we need some additional control parameters, including $f_1$ and cut. They should be setup by using the parameter pmesh.
ACFlow.AbstractMeshACFlow.DynamicMeshACFlow.DynamicMeshACFlow.HalfLorentzMeshACFlow.HalfLorentzMeshACFlow.LinearMeshACFlow.LinearMeshACFlow.LorentzMeshACFlow.LorentzMeshACFlow.TangentMeshACFlow.TangentMeshACFlow.nearestBase.eachindexBase.firstindexBase.getindexBase.getindexBase.iterateBase.iterateBase.lastindexBase.length
Types
ACFlow.AbstractMesh — TypeAbstractMeshAn abstract type representing the real axis. It is used to build the internal type system.
ACFlow.LinearMesh — TypeLinearMeshMutable struct. A linear and uniform mesh.
Members
- nmesh -> Number of mesh points.
- wmax -> Right boundary (maximum value).
- wmin -> Left boundary (minimum value).
- mesh -> Mesh itself.
- weight -> Precomputed integration weights (composite trapezoidal rule).
See also: TangentMesh.
ACFlow.TangentMesh — TypeTangentMeshMutable struct. A non-linear and non-uniform mesh. Note that it should be defined on both negative and positive half-axis.
Members
- nmesh -> Number of mesh points.
- wmax -> Right boundary (maximum value).
- wmin -> Left boundary (minimum value).
- mesh -> Mesh itself.
- weight -> Precomputed integration weights (composite trapezoidal rule).
See also: LinearMesh.
ACFlow.LorentzMesh — TypeLorentzMeshMutable struct. A non-linear and non-uniform mesh. Note that it should be defined on both negative and positive half-axis.
Members
- nmesh -> Number of mesh points.
- wmax -> Right boundary (maximum value).
- wmin -> Left boundary (minimum value).
- mesh -> Mesh itself.
- weight -> Precomputed integration weights (composite trapezoidal rule).
See also: HalfLorentzMesh.
ACFlow.HalfLorentzMesh — TypeHalfLorentzMeshMutable struct. A non-linear and non-uniform mesh. Note that it should be defined on positive half-axis only.
Members
- nmesh -> Number of mesh points.
- wmax -> Right boundary (maximum value).
- wmin -> Left boundary (minimum value). It must be 0.0.
- mesh -> Mesh itself.
- weight -> Precomputed integration weights (composite trapezoidal rule).
See also: LorentzMesh.
ACFlow.DynamicMesh — TypeDynamicMeshMutable struct. A mesh used internally in stochastic methods. It supports both uniform and non-uniform meshes. The mesh is usually generated by util/gmesh.jl, saved in fmesh.inp, and loaded dynamically during the initialization step. This mesh should not be used as a regular mesh for describing the spectral functions.
Note that only the StochAC and StochPX solvers support DynamicMesh. This is because δ-like peaks in the StochAC solver and poles in the StochPX solvers can distribute in a non-uniform mesh. While in the StochSK solver, the δ-like peaks must be distributed in an uniform mesh, so it doesn't support DynamicMesh. See sac.jl/calcfmesh() and spx.jl/calcfmesh() for more details.
Members
- nmesh -> Number of mesh points.
- wmax -> Right boundary (maximum value).
- wmin -> Left boundary (minimum value).
- mesh -> Mesh itself.
- weight -> Precomputed integration weights (composite trapezoidal rule).
See also: LinearMesh.
Constructors
ACFlow.LinearMesh — MethodLinearMesh(nmesh::I64, wmin::T, wmax::T) where {T}A constructor for the LinearMesh struct, which is announced in src/types.jl.
Arguments
- nmesh -> Number of mesh points.
- wmin -> Left boundary of the mesh.
- wmax -> Right boundary of the mesh.
Returns
- lm -> A LinearMesh struct.
See also: LinearMesh.
ACFlow.TangentMesh — TypeTangentMesh(nmesh::I64, wmin::T, wmax::T, 𝑝::T = 2.1) where {T}A constructor for the TangentMesh struct, which is announced in src/types.jl.
Arguments
- nmesh -> Number of mesh points.
- wmin -> Left boundary of the mesh.
- wmax -> Right boundary of the mesh.
- 𝑝 -> A customized parameter.
Returns
- tm -> A TangentMesh struct.
See also: TangentMesh.
ACFlow.LorentzMesh — TypeLorentzMesh(nmesh::I64, wmin::T, wmax::T, 𝑝::T = 0.01) where {T}A constructor for the LorentzMesh struct, which is announced in src/types.jl. The algorithm for generating a lorentzian mesh is taken from:
- https://github.com/CQMP/Maxent.
Arguments
- nmesh -> Number of mesh points.
- wmin -> Left boundary of the mesh.
- wmax -> Right boundary of the mesh.
- 𝑝 -> A customized parameter.
Returns
- lm -> A LorentzMesh struct.
See also: LorentzMesh.
ACFlow.HalfLorentzMesh — TypeHalfLorentzMesh(nmesh::I64, wmax::T, 𝑝::T = 0.01) where {T}A constructor for the HalfLorentzMesh struct, which is announced in src/types.jl. The algorithm for generating a half-lorentzian mesh is taken from:
- https://github.com/CQMP/Maxent.
Arguments
- nmesh -> Number of mesh points.
- wmax -> Right boundary of the mesh (wmin ≡ 0.0).
- 𝑝 -> A customized parameter.
Returns
- hm -> A HalfLorentzMesh struct.
See also: HalfLorentzMesh.
ACFlow.DynamicMesh — MethodDynamicMesh(mesh::Vector{T}) where {T}A constructor for the DynamicMesh struct, which is announced in src/types.jl. The δ peaks in stochastic analytic continuation methods or poles in stochastic pole expansion method could be placed in this mesh. This mesh should not be used to define the spectrum.
Arguments
- mesh -> Usually a mesh from file
fmesh.inp. See util/gmesh.jl.
Returns
- dm -> A DynamicMesh struct.
See also: DynamicMesh.
Base.* Functions
Base.length — MethodBase.length(am::AbstractMesh)Return number of mesh points in a Mesh-like struct.
Base.iterate — MethodBase.iterate(am::AbstractMesh)Advance the iterator of a Mesh-like struct to obtain the next mesh point.
Base.iterate — MethodBase.iterate(am::AbstractMesh, i::I64)This is the key method that allows a Mesh-like struct to be iterated, yielding a sequences of mesh points.
Base.eachindex — MethodBase.eachindex(am::AbstractMesh)Create an iterable object for visiting each index of a Mesh-like struct.
Base.firstindex — MethodBase.firstindex(am::AbstractMesh)Return the first index of a Mesh-like struct.
Base.lastindex — MethodBase.lastindex(am::AbstractMesh)Return the last index of a Mesh-like struct.
Base.getindex — MethodBase.getindex(am::AbstractMesh, ind::I64)Retrieve the value(s) stored at the given key or index within a Mesh-like struct.
Base.getindex — MethodBase.getindex(am::AbstractMesh, I::UnitRange{I64})Return a subset of a Mesh-like struct as specified by I.
Utilities
ACFlow.nearest — Functionnearest(am::AbstractMesh, r::F64)Given a position r (0.0 ≤ r ≤ 1.0), and return the index of the nearest point in the mesh am.
Arguments
See above explanations.
Returns
See above explanations.
Examples
am = LinearMesh(1001, -10.0, 10.0)
pos = nearest(am, 0.2) # pos = 201
println(am[pos]) # -6.0See also: AbstractMesh.