Implementation of Gauge and Spinor fields
We create a 4-dimensional SU(3) gauge field by specifying the backend, floating point precision, gauge action, dimensions and coupling parameter beta:
backend = CPU
prec = Float64
action = WilsonGaugeAction
Ns = Nt = 12
beta = 6.0
U = Gaugefield{backend,prec,action}(Ns, Ns, Ns, Nt, beta) # all links are set to 0
and set the initial conditions with identity_gauges!(U)
(cold) or random_gauges!(U)
(hot).
Gaugefield
s, Colorfield
s and Expfield
s are structs that contain a main Array U
, which is a 5-dimensional array of statically sized 3x3 complex matrices, i.e., SMatrix
objects from StaticArrays.jl
(where arrays are stored as Tuples under the hood). Colorfield
s are really just Gaugefield
s without the added information of the gauge action and Expfield
s don't just store 3x3 complex matrices but all the information required for the "Q" matrices of the Stout algorithm and Stout recursion.
The fact that the elements are statically sized immutable arrays means that, for one, there are no allocations when performing linear algebra operations with them and secondly that we always just override the matrices in the arrays instead of mutating them.
The different backends are handled by Kernelabstractions.jl
.
We might use more memory efficient storage schemes for SU(3) or su(3) elements in the future.
Fermion fields or spinors or whatever you want to call them are stored in 4-dimensional arrays of n_color * n_dirac
complex valued SVector
s. The reason for chosing 4 instead of 5 dimensions is that this enabled us to write routines that take care of all dirac components at the same time, which should be more efficient.
When using even-odd preconditioned dirac operators, the fermion fields get wrapped in a struct called EvenOdd
such that we can overload all functions on that type. Our convention is to define the fields on the even sites. We map all even sites to the first half of the array to have contiguous memory accesses. The function eo_site
does exactly this mapping.
Spinorfield
s are created in the same way as Gaugefield
s with the gauge action type parameter being replaced by the number of Dirac indices. For Spinorfield
s we have the ones!
and gaussian_pseudofermions!
methods to init them.
MetaQCD.Fields.Gaugefield
— TypeGaugefield{Backend,FloatType,IsDistributed,ArrayType,GaugeAction} <:
AbstractField{Backend,FloatType,IsDistributed,ArrayType}
5-dimensional dense array of statically sized 3x3 matrices contatining associated meta-data.
Gaugefield{Backend,FloatType,GaugeAction}(NX, NY, NZ, NT, β)
Gaugefield{Backend,FloatType,GaugeAction}(NX, NY, NZ, NT, β, numprocs_cart, halo_width)
Gaugefield(U::Gaugefield)
Gaugefield(parameters::ParameterSet)
Creates a Gaugefield on Backend
, i.e. an array of link-variables (SU3 matrices with FloatType
precision) of size 4 × NX × NY × NZ × NT
with coupling parameter β
and gauge action GaugeAction
or a zero-initialized copy of U
Supported backends
CPU
CUDABackend
ROCBackend
Supported gauge actions
WilsonGaugeAction
SymanzikTreeGaugeAction
(Lüscher-Weisz) IwasakiGaugeAction
DBW2GaugeAction
MetaQCD.Fields.Colorfield
— TypeColorfield{Backend,FloatType,IsDistributed,ArrayType} <:
AbstractField{Backend,FloatType,IsDistributed,ArrayType}
5-dimensional dense array of statically sized 3x3 matrices contatining associated meta-data.
Colorfield{Backend,FloatType}(NX, NY, NZ, NT)
Colorfield{Backend,FloatType}(NX, NY, NZ, NT, numprocs_cart, halo_width)
Colorfield(u::AbstractField)
Creates a Colorfield on Backend
, i.e. an array of 3-by-3 FloatType
-precision matrices of size 4 × NX × NY × NZ × NT
or a zero-initialized Colorfield of the same size as u
Supported backends
CPU
CUDABackend
ROCBackend
MetaQCD.Fields.Expfield
— TypeExpfield{Backend,FloatType,IsDistributed,ArrayType} <:
AbstractField{Backend,FloatType,IsDistributed,ArrayType}
5-dimensional dense array of exp_iQ_su3
objects contatining associated meta-data. The objects hold the Q
-matrices and all the exponential parameters needed for stout-force recursion.
Expfield{Backend,FloatType}(NX, NY, NZ, NT)
Expfield{Backend,FloatType}(NX, NY, NZ, NT, numprocs_cart, halo_width)
Expfield(u::AbstractField)
Creates a Expfield on Backend
, i.e. an array of FloatType
-precison exp_iQ_su3
objects of size 4 × NX × NY × NZ × NT
or of the same size as u
.
Supported backends
CPU
CUDABackend
ROCBackend
MetaQCD.Fields.Spinorfield
— TypeSpinorfield{Backend,FloatType,NumDirac}(NX, NY, NZ, NT)
Spinorfield(ψ::Spinorfield)
Spinorfield(f::AbstractField; staggered=false)
Creates a Spinorfield on Backend
, i.e. an array of link-variables (numcolors×NumDirac complex vectors with FloatType
precision) of size NX × NY × NZ × NT
or a zero-initialized copy of ψ
. If staggered=true
, the number of Dirac degrees of freedom (NumDirac) is reduced to 1 instead of 4.
Supported backends
CPU
CUDABackend
ROCBackend