Meshes

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.

Contents

Index

Types

ACFlow.AbstractMeshType
AbstractMesh

An abstract type representing the real axis. It is used to build the internal type system.

ACFlow.LinearMeshType
LinearMesh

Mutable 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.TangentMeshType
TangentMesh

Mutable 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.LorentzMeshType
LorentzMesh

Mutable 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.HalfLorentzMeshType
HalfLorentzMesh

Mutable 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.DynamicMeshType
DynamicMesh

Mutable 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.LinearMeshMethod
LinearMesh(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.TangentMeshType
TangentMesh(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.LorentzMeshType
LorentzMesh(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.HalfLorentzMeshType
HalfLorentzMesh(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.DynamicMeshMethod
DynamicMesh(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.lengthMethod
Base.length(am::AbstractMesh)

Return number of mesh points in a Mesh-like struct.

Base.iterateMethod
Base.iterate(am::AbstractMesh)

Advance the iterator of a Mesh-like struct to obtain the next mesh point.

Base.iterateMethod
Base.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.eachindexMethod
Base.eachindex(am::AbstractMesh)

Create an iterable object for visiting each index of a Mesh-like struct.

Base.firstindexMethod
Base.firstindex(am::AbstractMesh)

Return the first index of a Mesh-like struct.

Base.lastindexMethod
Base.lastindex(am::AbstractMesh)

Return the last index of a Mesh-like struct.

Base.getindexMethod
Base.getindex(am::AbstractMesh, ind::I64)

Retrieve the value(s) stored at the given key or index within a Mesh-like struct.

Base.getindexMethod
Base.getindex(am::AbstractMesh, I::UnitRange{I64})

Return a subset of a Mesh-like struct as specified by I.

Utilities

ACFlow.nearestFunction
nearest(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.0

See also: AbstractMesh.