From 7766517358a9c0f5cabb06329307fa77a434ca87 Mon Sep 17 00:00:00 2001 From: Alberto Ramos Date: Thu, 18 Nov 2021 13:59:06 +0100 Subject: [PATCH] Several bugs corrected --- src/Groups/FundamentalSU3.jl | 8 ++++---- src/Groups/Groups.jl | 2 +- src/Groups/SU3Types.jl | 3 +++ src/LatticeGPU.jl | 4 ++-- src/Spinors/Spinors.jl | 14 ++++++++++---- 5 files changed, 20 insertions(+), 11 deletions(-) diff --git a/src/Groups/FundamentalSU3.jl b/src/Groups/FundamentalSU3.jl index 3c5076c..8a9270f 100644 --- a/src/Groups/FundamentalSU3.jl +++ b/src/Groups/FundamentalSU3.jl @@ -52,13 +52,13 @@ Base.:*(g::SU3{T},b::SU3fund{T}) where T <: AbstractFloat = SU3fund{T}(g.u11 conj(g.u11*g.u22 - g.u12*g.u21)*b.t3) """ - \(g::SU3{T},b::SU3fund{T}) + \\(g::SU3{T},b::SU3fund{T}) Returns g^dag b """ -Base.:\(a::SU3{T},b::SU3fund{T}) where T <: AbstractFloat = SU3fund{T}(conj(g.u11)*b.t1 + conj(g.u21)*b.t2 + (a.u12*a.u23 - a.u13*a.u22)*b.t3, - conj(g.u12)*b.t1 + conj(g.u22)*b.t2 + (a.u13*a.u21 - a.u11*a.u23)*b.t3, - conj(g.u13)*b.t1 + conj(g.u23)*b.t2 + (a.u11*a.u22 - a.u12*a.u21)*b.t3) +Base.:\(g::SU3{T},b::SU3fund{T}) where T <: AbstractFloat = SU3fund{T}(conj(g.u11)*b.t1 + conj(g.u21)*b.t2 + (g.u12*g.u23 - g.u13*g.u22)*b.t3, + conj(g.u12)*b.t1 + conj(g.u22)*b.t2 + (g.u13*g.u21 - g.u11*g.u23)*b.t3, + conj(g.u13)*b.t1 + conj(g.u23)*b.t2 + (g.u11*g.u22 - g.u12*g.u21)*b.t3) Base.:+(a::SU3fund{T},b::SU3fund{T}) where T <: AbstractFloat = SU3fund{T}(a.t1+b.t1,a.t2+b.t2,a.t3+b.t3) Base.:-(a::SU3fund{T},b::SU3fund{T}) where T <: AbstractFloat = SU3fund{T}(a.t1-b.t1,a.t2-b.t2,a.t3-b.t3) diff --git a/src/Groups/Groups.jl b/src/Groups/Groups.jl index 281d203..a0d9525 100644 --- a/src/Groups/Groups.jl +++ b/src/Groups/Groups.jl @@ -36,7 +36,7 @@ include("AlgebraSU2.jl") # SU(3) and 3x3 matrix operations ## include("SU3Types.jl") -export SU3, SU3alg, M3x3 +export SU3, SU3alg, M3x3, SU3fund include("GroupSU3.jl") include("M3x3.jl") diff --git a/src/Groups/SU3Types.jl b/src/Groups/SU3Types.jl index 7a23043..8d3c4ff 100644 --- a/src/Groups/SU3Types.jl +++ b/src/Groups/SU3Types.jl @@ -63,4 +63,7 @@ struct SU3fund{T} t3::Complex{T} end Base.zero(::Type{SU3fund{T}}) where T <: AbstractFloat = SU3fund{T}(zero(T),zero(T),zero(T)) +Random.rand(rng::AbstractRNG, ::Random.SamplerType{SU3fund{T}}) where T <: AbstractFloat = SU3fund{T}(complex(randn(rng,T),randn(rng,T)), + complex(randn(rng,T),randn(rng,T)), + complex(randn(rng,T),randn(rng,T))) diff --git a/src/LatticeGPU.jl b/src/LatticeGPU.jl index dc9fa74..7ea3e60 100644 --- a/src/LatticeGPU.jl +++ b/src/LatticeGPU.jl @@ -47,10 +47,10 @@ export flw, flw_adapt export sfcoupling, bndfield, setbndfield export import_lex64, import_cern64 -include("Spinors/Spinor.jl") +include("Spinors/Spinors.jl") using .Spinors -export Pgamma +export Spinor, Pgamma export norm, norm2, dot, imm, mimm export pmul, gpmul, gdagpmul diff --git a/src/Spinors/Spinors.jl b/src/Spinors/Spinors.jl index f2644f4..c60e956 100644 --- a/src/Spinors/Spinors.jl +++ b/src/Spinors/Spinors.jl @@ -64,7 +64,7 @@ Returns ga Base.:*(g::S,b::Spinor{NS,G}) where {S <: Group,NS,G} = Spinor{NS,G}(ntuple(i->g*b.s[i], NS)) """ - \(g::SU3{T},b::Spinor{NS,G}) + \\(g::SU3{T},b::Spinor{NS,G}) Returns g^+ a """ @@ -97,7 +97,7 @@ end """ pmul(Pgamma{N,S}, a::Spinor) -Returns (1+s\gamma_N)a. +Returns ``(1+s\\gamma_N)a``. """ function pmul(::Type{Pgamma{4,1}}, a::Spinor{4,G}) where {NS,G} @@ -155,7 +155,7 @@ end """ gpmul(pgamma{N,S}, g::G, a::Spinor) G <: Group -Returns g(1+s\gamma_N)a +Returns ``g(1+s\\gamma_N)a`` """ function gpmul(::Type{Pgamma{4,1}}, g, a::Spinor{4,G}) where {NS,G} @@ -212,7 +212,7 @@ end """ gdagpmul(pgamma{N,S}, g::G, a::Spinor) G <: Group -Returns g^+ (1+s\gamma_N)a +Returns ``g^+ (1+s\\gamma_N)a`` """ function gdagpmul(::Type{Pgamma{4,1}}, g, a::Spinor{4,G}) where {NS,G} @@ -265,3 +265,9 @@ function gdagpmul(::Type{Pgamma{3,-1}}, g, a::Spinor{4,G}) where {NS,G} r2 = g\(a.s[2]+imm(a.s[4])) return Spinor{4,G}((r1,r2,imm(r1),mimm(r2))) end + +export Spinor, Pgamma +export norm, norm2, dot, imm, mimm +export pmul, gpmul, gdagpmul + +end