From 97e46a538c78fa9cbf236ced5241df784cf4ed14 Mon Sep 17 00:00:00 2001 From: Alberto Ramos Date: Wed, 6 Oct 2021 09:54:54 +0200 Subject: [PATCH] Added file with operations in the fundamental of SU(2) --- src/Groups/FundamentalSU2.jl | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 src/Groups/FundamentalSU2.jl diff --git a/src/Groups/FundamentalSU2.jl b/src/Groups/FundamentalSU2.jl new file mode 100644 index 0000000..e3fb8b8 --- /dev/null +++ b/src/Groups/FundamentalSU2.jl @@ -0,0 +1,29 @@ +### +### "THE BEER-WARE LICENSE": +### Alberto Ramos wrote this file. As long as you retain this +### notice you can do whatever you want with this stuff. If we meet some +### day, and you think this stuff is worth it, you can buy me a beer in +### return. +### +### file: FundamentalSU2.jl +### created: Tue Oct 5 10:31:09 2021 +### + +SU2fund(a::T, b::T) where T <: AbstractFloat = SU2fund{T}(complex(a), complex(b)) +dag(a::SU2fund{T}) where T <: AbstractFloat = SU2fund{T}(conj(b.t1), -b.t2) +norm(a::SU2fund{T}) where T <: AbstractFloat = sqrt((abs2(a.t1) + abs2(a.t2))/2) +norm2(a::SU2fund{T}) where T <: AbstractFloat = (abs2(a.t1) + abs2(a.t2))/2 +tr(g::SU2fund{T}) where T <: AbstractFloat = complex(real(g.t1), 0.0) +dot(g1::SU2fund{T},g2::SU2fund{T}) where T <: AbstractFloat = real(conj(g1.t1)*g2.t1+g1.t2*conj(g2.t2)) + +Base.:*(a::SU2{T},b::SU2fund{T}) where T <: AbstractFloat = SU2fund{T}(a.t1*b.t1-a.t2*conj(b.t2),a.t1*b.t2+a.t2*conj(b.t1)) +Base.:/(a::SU2fund{T},b::SU2{T}) where T <: AbstractFloat = SU2fund{T}(a.t1*conj(b.t1)+a.t2*conj(b.t2),-a.t1*b.t2+a.t2*b.t1) +Base.:\(a::SU2{T},b::SU2fund{T}) where T <: AbstractFloat = SU2fund{T}(conj(a.t1)*b.t1+a.t2*conj(b.t2),conj(a.t1)*b.t2-a.t2*conj(b.t1)) + +""" + \(phi::SU2fund{T},u::SU2{T}) + +This operation has to be understood as (phi^+ u) +""" +Base.:\(a::SU2fund{T},b::SU2{T}) where T <: AbstractFloat = SU2fund{T}(conj(a.t1)*b.t1+a.t2*conj(b.t2),conj(a.t1)*b.t2-a.t2*conj(b.t1)) +