Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions src/SUNRepresentations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export SUNIrrep, basis, weight, Zweight, creation, annihilation, highest_weight,
export directproduct, CGC
export SU, SU₃, SU₄, SU₅, SU3Irrep, SU4Irrep, SU5Irrep
export dynkin_label, congruency
export casimir

"""
struct SUNIrrep{N} <: AbstractIrrep{SU{N}}
Expand Down Expand Up @@ -101,6 +102,34 @@ end

include("gtpatterns.jl")

"""
casimir(k::Int, irrep::SUNIrrep)

Return the eigenvalue of the `k`-th order Casimir operator in the representation `irrep`.

The formula is:
```math
C_k(\\lambda) = \\frac{1}{2} \\left[ \\sum_{i=1}^{N} L_i^k - \\sum_{i=1}^{N} \\rho_i^k \\right]
```
where ``\\rho_i = (N+1-2i)/2`` are the Weyl vector components and
``L_i = (\\lambda_i - \\bar\\lambda) + \\rho_i`` are the shifted traceless weights
(``\\bar\\lambda = \\sum_j \\lambda_j / N``).

The independent primitive Casimir operators have orders ``k = 2, 3, \\ldots, N``.
Other values of `k` are valid but give dependent (or zero) results.
"""
function casimir(k::Int, irrep::SUNIrrep{N}) where {N}
λ = weight(irrep)
λ̄ = sum(λ) // N
c = zero(Rational{Int})
for i in 1:N
ρᵢ = (N + 1 - 2i) // 2
Lᵢ = (λ[i] - λ̄) + ρᵢ
c += Lᵢ^k - ρᵢ^k
end
Comment thread
lkdvos marked this conversation as resolved.
return c / 2
end

basis(s::SUNIrrep) = GTPatternIterator(s)

# direct product: return dictionary with new irreps as keys, outer multiplicities as value
Expand Down
29 changes: 29 additions & 0 deletions test/casimir.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
@testset "casimir" begin
# --- SU(2): C₂(m) = m(m+2)/4, all odd C_k = 0 ---
for m in 0:10
@test casimir(2, SUNIrrep{2}([m])) == m * (m + 2) // 4
@test casimir(3, SUNIrrep{2}([m])) == 0
end

# --- SU(3): C₂(p,q) = (p²+q²+pq+3p+3q)/3, C₃(p,q) = (p-q)(2p+q+3)(p+2q+3)/18 ---
for p in 0:10, q in 0:10
irrep = SUNIrrep{3}([p, q])
@test casimir(2, irrep) == (p^2 + q^2 + p * q + 3p + 3q) // 3
@test casimir(3, irrep) == (p - q) * (2p + q + 3) * (p + 2q + 3) // 18
end

# --- k > 3: structural properties only ---
# Singlet always 0
for k in 2:5, N in 2:5
@test casimir(k, one(SUNIrrep{N})) == 0 // 1
end

# Conjugation: C_k(dual(λ)) = (-1)^k * C_k(λ)
for N in 2:5
for irrep in Iterators.take(values(SUNIrrep{N}), 20)
for k in 2:5
@test casimir(k, dual(irrep)) == (-1)^k * casimir(k, irrep)
end
end
end
end
1 change: 1 addition & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ module GenericTests
end

include("caching.jl")
include("casimir.jl")
sectorlist = (SUNIrrep{3}, SUNIrrep{4}, SUNIrrep{5}, SUNIrrep{3} ⊠ SUNIrrep{3})
include("sectors.jl")
sectorlist = (SUNIrrep{3}, SUNIrrep{4}, SUNIrrep{5})
Expand Down
Loading