Utility Functions
MetaQCD.Utils.cdot
— Methodcdot(a, b)
Return the complex dot product of a
and b
MetaQCD.Utils.cinv
— Methodcinv(M)
Calculate the inverse of the complex matrix M
.
MetaQCD.Utils.ckron
— Methodckron(a, b)
ckron(A, B)
Return the complex Kronecker(outer) product of vectors a
and b
, i.e. a ⊗ b†
, or of two matrices A
and B
, i.e. A ⊗ B
.
MetaQCD.Utils.cmvmul
— Methodcmvmul(A, x)
Return the matrix-vector product of A
and x
MetaQCD.Utils.cmvmul_block
— Methodcmvmul_block(P::PauliMatrix, x::SVector)
Return the matrix-vector product of the block diagonal matrix containing A₊
and A₋
and the vector x
MetaQCD.Utils.cmvmul_color
— Methodcmvmul_color(A, x)
Return the matrix-vector product of A
and x
, where A
only acts on the color structure of x
.
MetaQCD.Utils.cmvmul_d
— Methodcmvmul_d(A, x)
Return the matrix-vector product of the adjoint of A
and x
MetaQCD.Utils.cmvmul_d_color
— Methodcmvmul_d_color(A, x)
Return the matrix-vector product of A†
and x
, where A†
only acts on the colo structure of x
.
MetaQCD.Utils.cmvmul_spin_proj
— Methodcmvmul_spin_proj(A, x, ::Val{ρ}, ::Val{is_adjoint}=Val(false))
Return A * (1 ± γᵨ) * x
where γᵨ
is the ρ-th Euclidean gamma matrix in the Chiral basis. x
is assumed to be a 4xN component complex vector. The third argument is ρ wrapped in a Val
and must be within the range [-4,4]. Its sign determines the sign in front of the γᵨ matrix. If is_adjoint
is true
, A†
is used instead of A
.
MetaQCD.Utils.cnorm2
— Methodcnorm2(A::SMatrix{N,N,Complex{T},N²}) where {N,N²,T}
Calculate the 2-norm of the complex NxN matrix M
MetaQCD.Utils.cvmmul
— Methodcvmmul(x, A)
Return the vector-matrix product of x†
and A
.
MetaQCD.Utils.cvmmul_color
— Methodcvmmul_color(x, A)
Return the matrix-vector product of x†
and A
, where A
only acts on the color structure of x†
.
MetaQCD.Utils.cvmmul_d
— Methodcvmmul_d(x, A)
Return the vector-matrix product of x
and the adjoint of A
. x
is implicitly assumed to be a column vector and therefore the adjoint of x
is used
MetaQCD.Utils.cvmmul_d_color
— Methodcvmmul_d_color(x, A)
Return the matrix-vector product of x†
and A†
, where A†
only acts on the color structure of x†
.
MetaQCD.Utils.exp_iQ
— Methodexp_iQ(Q::SU{3,9,T}) where {T}
exp_iQ(e::exp_iQ_su3{T}) where {T}
Compute the exponential of a traceless Hermitian 3x3 matrix Q
or return the exp_iQ
field of the exp_iQ_su3{T}
-object e
.
From Morningstar & Peardon (2008) arXiv:hep-lat/0311018v1
MetaQCD.Utils.exp_iQ_coeffs
— Methodexp_iQ_coeffs(Q::SU{3,9,T}) where {T}
Return a exp_iQ_su3
object that contains the exponential of Q
and all parameters obtained in the Cayley-Hamilton algorithm that are needed for Stout force recursion.
MetaQCD.Utils.gaussian_TA_mat
— MethodgaussianTAmat(::Type{T}) where {T}
Generate a normally distributed traceless anti-Hermitian 3x3 matrix with precision T
.
MetaQCD.Utils.gen_SU2_matrix
— MethodgenSU2matrix(ϵ, ::Type{T}) where {T}
Generate a Matrix X ∈ SU(2) with precision T
near the identity with spread ϵ
.
From Gattringer C. & Lang C.B. (Springer, Berlin Heidelberg 2010)
MetaQCD.Utils.gen_SU3_matrix
— MethodgenSU3matrix(ϵ, ::Type{T}) where {T}
Generate a Matrix X ∈ SU(3) with precision T
near the identity with spread ϵ
.
From Gattringer C. & Lang C.B. (Springer, Berlin Heidelberg 2010)
MetaQCD.Utils.kenney_laub
— Methodkenney_laub(M::SMatrix{3,3,Complex{T},9}) where {T}
Compute the SU(3) matrix closest to M
using the Kenney-Laub algorithm.
MetaQCD.Utils.move
— Methodmove(s::SiteCoords, μ, steps, lim)
Move a site s
in the direction μ
by steps
steps with periodic boundary conditions. The maximum extent of the lattice in the direction μ
is lim
.
MetaQCD.Utils.mpi_init
— Methodmpi_init()
Check whether MPI has been initialized and if not, initialize it.
MetaQCD.Utils.multr
— Methodmultr(A::SMatrix{N,N,Complex{T},N²}, B::SMatrix{N,N,Complex{T},N²}) where {N,N²,T}
Calculate the trace of the product of two complex NxN matrices A
and B
of precision T
.
MetaQCD.Utils.rand_SU3
— Methodrand_SU3(::Type{T}) where {T}
Generate a random Matrix X ∈ SU(3) with precision T
.
MetaQCD.Utils.spin_proj
— Methodspin_proj(x, ::Val{ρ})
Return (1 ± γᵨ) * x
where γᵨ
is the ρ-th Euclidean gamma matrix in the Chiral basis. and x
is a 4xN component complex vector. The second argument is ρ wrapped in a Val
and must be within the range [-4,4]. Its sign determines the sign in front of the γᵨ matrix.
MetaQCD.Utils.spintrace
— Methodspintrace(a, b)
Return the complex Kronecker(outer) product of vectors a
and b
, summing over dirac indices, i.e. ∑ ᵨ aᵨ ⊗ bᵨ†
MetaQCD.Utils.spintrace_pauli
— Methodspintrace_pauli(P::PauliMatrix, ::Val{μ}, ::Val{ν})
MetaQCD.Utils.switch_sides
— Methodswitch_sides(site::CartesianIndex, NX, NY, NZ, NT, NV)
Return the cartesian index equivalent to site
but with opposite parity. E.g., switch_sides((1, 1, 1, 1), 4, 4, 4, 4, 256) = (1, 1, 1, 3)
and reverse
MetaQCD.Utils.update_halo!
— Methodupdate_halo!(U)
Update the halos or buffers of an MPI-parallelized field.
MetaQCD.Utils.σμν_spin_mul
— Methodσμν_spin_mul(x, ::Val{μ}, ::Val{ν})
Return σμν * x
where σμν = i/2 * [γμ, γν]
with the gamma matrices in the Chiral basis and x
is a 4xN component complex vector. The latter two arguments are μ and ν wrapped in a Val
and must be within the range [1,4]
with μ < ν