From 23930e14cf7be38e2578e6c00741dda9a069e1cd Mon Sep 17 00:00:00 2001 From: Alberto Ramos Date: Wed, 3 Nov 2021 14:15:03 +0100 Subject: [PATCH] Added project to algebra with multiplication for SU(2) --- src/Groups/AlgebraSU2.jl | 1 + src/Groups/AlgebraSU3.jl | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Groups/AlgebraSU2.jl b/src/Groups/AlgebraSU2.jl index ec6a853..0eb57db 100644 --- a/src/Groups/AlgebraSU2.jl +++ b/src/Groups/AlgebraSU2.jl @@ -12,6 +12,7 @@ SU2alg(x::T) where T <: AbstractFloat = SU2alg{T}(x,0.0,0.0) SU2alg(v::Vector{T}) where T <: AbstractFloat = SU2alg{T}(v[1],v[2],v[3]) projalg(g::SU2{T}) where T <: AbstractFloat = SU2alg{T}(imag(g.t2), real(g.t2), imag(g.t1)) +projalg(z::Complex{T}, g::SU2{T}) where T <: AbstractFloat = SU2alg{T}(imag(z*g.t2), real(z*g.t2), imag(z*g.t1)) dot(a::SU2alg{T}, b::SU2alg{T}) where T <: AbstractFloat = a.t1*b.t1 + a.t2*b.t2 + a.t3*b.t3 norm(a::SU2alg{T}) where T <: AbstractFloat = sqrt(a.t1^2 + a.t2^2 + a.t3^2) norm2(a::SU2alg{T}) where T <: AbstractFloat = a.t1^2 + a.t2^2 + a.t3^2 diff --git a/src/Groups/AlgebraSU3.jl b/src/Groups/AlgebraSU3.jl index 52e8005..c0bc33b 100644 --- a/src/Groups/AlgebraSU3.jl +++ b/src/Groups/AlgebraSU3.jl @@ -46,8 +46,6 @@ function projalg(z::Complex{T}, a::SU3{T}) where T <: AbstractFloat sr3ov2*(ditr)) end -projalg(z::Int, a::SU3{T}) where T <: AbstractFloat = projalg(a::SU3{T}) - dot(a::SU3alg{T},b::SU3alg{T}) where T <: AbstractFloat = a.t1*b.t1 + a.t2*b.t2 + a.t3*b.t3 + a.t4*b.t4 + a.t5*b.t5 + a.t6*b.t6 + a.t7*b.t7 + a.t8*b.t8 norm2(a::SU3alg{T}) where T <: AbstractFloat = a.t1^2 + a.t2^2 + a.t3^2 + a.t4^2 + a.t5^2 + a.t6^2 + a.t7^2 + a.t8^2 norm(a::SU3alg{T}) where T <: AbstractFloat = sqrt(a.t1^2 + a.t2^2 + a.t3^2 + a.t4^2 + a.t5^2 + a.t6^2 + a.t7^2 + a.t8^2)