Last version

This commit is contained in:
Alberto Ramos 2021-09-04 14:16:22 +02:00
parent c378648508
commit 76d0b66b4b
9 changed files with 515 additions and 322 deletions

View file

@ -68,6 +68,14 @@ Base.:*(a::SU2alg,b::Number) = SU2alg(a.t1*b,a.t2*b,a.t3*b)
Base.:*(b::Number,a::SU2alg) = SU2alg(a.t1*b,a.t2*b,a.t3*b)
Base.:/(a::SU2alg,b::Number) = SU2alg(a.t1/b,a.t2/b,a.t3/b)
function isgroup(a::SU2)
tol = 1.0E-10
if (abs2(a.t1) + abs2(a.t2) - 1.0 < 1.0E-10)
return true
else
return false
end
end
"""
function Base.exp(a::SU2alg, t::Number=1)
@ -155,3 +163,5 @@ function expm(g::SU2, a::SU2alg, t::Float64)
return SU2(t1,t2)
end
export SU2, SU2alg, inverse, dag, tr, projalg, expm, exp, norm, norm2, isgroup

View file

@ -79,8 +79,21 @@ function Base.:\(a::SU3,b::SU3)
end
function isgroup(a::SU3)
tol = 1.0E-10
g = a/a
if ( (abs(g.u11 - 1.0) < tol) &&
(abs(g.u12) < tol) &&
(abs(g.u13) < tol) &&
(abs(g.u21) < tol) &&
(abs(g.u22 - 1.0) < tol) &&
(abs(g.u23) < tol) )
return true
else
return false
end
end
struct SU3alg <: Algebra
t1::Float64
@ -122,7 +135,7 @@ Base.:/(a::SU3alg,b::Number) = SU3alg(a.t1/b,a.t2/b,a.t3/b,a.t4/b,a.t5/b,a.t6/b,
export SU3, SU3alg, inverse, dag, tr, projalg, expm, exp, norm, norm2
export SU3, SU3alg, inverse, dag, tr, projalg, expm, exp, norm, norm2, isgroup
struct M3x3
u11::ComplexF64

View file

@ -23,7 +23,7 @@ export SU2, SU2alg
include("GroupSU3.jl")
export SU3, SU3alg
export dot, expm, exp, dag, normalize, inverse, tr, projalg, norm, norm2
export dot, expm, exp, dag, normalize, inverse, tr, projalg, norm, norm2, isgroup
end # module