From 9c199d5ed52ec5d4cb3306fd0ab38da724588d3a Mon Sep 17 00:00:00 2001 From: Boris De Vos Date: Thu, 27 Nov 2025 16:43:56 +0100 Subject: [PATCH 1/4] add docstring for `fusiontensor` --- src/irreps/irreps.jl | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/irreps/irreps.jl b/src/irreps/irreps.jl index 56e3dbd..83b43dd 100644 --- a/src/irreps/irreps.jl +++ b/src/irreps/irreps.jl @@ -59,6 +59,14 @@ Asymbol(a::I, b::I, c::I) where {I <: AbelianIrrep} = Int(Nsymbol(a, b, c)) Bsymbol(a::I, b::I, c::I) where {I <: AbelianIrrep} = Int(Nsymbol(a, b, c)) Rsymbol(a::I, b::I, c::I) where {I <: AbelianIrrep} = Int(Nsymbol(a, b, c)) +""" + fusiontensor(a::I, b::I, c::I) where {I <: AbstractIrrep} -> Array{T, 4} + +Return the fusion tensor for the fusion `a ⊗ b -> c`, where `a`, `b`, and `c` are irreps of +a group. The dimensions of the returned array are `(dim(a), dim(b), dim(c), Nsymbol(a, b, c))`. +The components of the fusion tensor are simply the Clebsch-Gordan coefficients of the group, +describing the unitary basis change from the tensor product of irreps `a` and `b` to the coupled irrep `c`. +""" function fusiontensor(a::I, b::I, c::I) where {I <: AbelianIrrep} return fill(Int(Nsymbol(a, b, c)), (1, 1, 1, 1)) end From 8ae459364f83a019e6858f8883c38ab9f2b4a2f6 Mon Sep 17 00:00:00 2001 From: Boris De Vos Date: Fri, 5 Dec 2025 15:40:30 +0100 Subject: [PATCH 2/4] move docstring and make generic --- src/irreps/irreps.jl | 8 -------- src/sectors.jl | 10 ++++++++++ 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/irreps/irreps.jl b/src/irreps/irreps.jl index 83b43dd..56e3dbd 100644 --- a/src/irreps/irreps.jl +++ b/src/irreps/irreps.jl @@ -59,14 +59,6 @@ Asymbol(a::I, b::I, c::I) where {I <: AbelianIrrep} = Int(Nsymbol(a, b, c)) Bsymbol(a::I, b::I, c::I) where {I <: AbelianIrrep} = Int(Nsymbol(a, b, c)) Rsymbol(a::I, b::I, c::I) where {I <: AbelianIrrep} = Int(Nsymbol(a, b, c)) -""" - fusiontensor(a::I, b::I, c::I) where {I <: AbstractIrrep} -> Array{T, 4} - -Return the fusion tensor for the fusion `a ⊗ b -> c`, where `a`, `b`, and `c` are irreps of -a group. The dimensions of the returned array are `(dim(a), dim(b), dim(c), Nsymbol(a, b, c))`. -The components of the fusion tensor are simply the Clebsch-Gordan coefficients of the group, -describing the unitary basis change from the tensor product of irreps `a` and `b` to the coupled irrep `c`. -""" function fusiontensor(a::I, b::I, c::I) where {I <: AbelianIrrep} return fill(Int(Nsymbol(a, b, c)), (1, 1, 1, 1)) end diff --git a/src/sectors.jl b/src/sectors.jl index 814336e..aa619f9 100644 --- a/src/sectors.jl +++ b/src/sectors.jl @@ -349,6 +349,16 @@ Base.:&(f₁::UnitStyle, f₂::UnitStyle) = f₂ & f₁ Base.:&(::GenericUnit, ::SimpleUnit) = GenericUnit() +""" + fusiontensor(a::I, b::I, c::I) where {I <: Sector} -> Array{T, 4} + +Return the fusion tensor for the fusion `a ⊗ b -> c`, where `a`, `b`, and `c` are irreps of +a group. The dimensions of the returned array are `(dim(a), dim(b), dim(c), Nsymbol(a, b, c))`. +The components of the fusion tensor are simply the Clebsch-Gordan coefficients of the group, +describing the unitary basis change from the tensor product of irreps `a` and `b` to the coupled irrep `c`. +""" +function fusiontensor end + """ Fsymbol(a::I, b::I, c::I, d::I, e::I, f::I) where {I <: Sector} From c82909e61b911d14a13e472c31b8dfd7afb97f77 Mon Sep 17 00:00:00 2001 From: Boris De Vos Date: Mon, 8 Dec 2025 09:44:28 +0100 Subject: [PATCH 3/4] code suggestions --- src/sectors.jl | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/sectors.jl b/src/sectors.jl index aa619f9..8cc3349 100644 --- a/src/sectors.jl +++ b/src/sectors.jl @@ -350,11 +350,10 @@ Base.:&(f₁::UnitStyle, f₂::UnitStyle) = f₂ & f₁ Base.:&(::GenericUnit, ::SimpleUnit) = GenericUnit() """ - fusiontensor(a::I, b::I, c::I) where {I <: Sector} -> Array{T, 4} + fusiontensor(a::I, b::I, c::I) where {I <: Sector} -> AbstractArray{T, 4} -Return the fusion tensor for the fusion `a ⊗ b -> c`, where `a`, `b`, and `c` are irreps of -a group. The dimensions of the returned array are `(dim(a), dim(b), dim(c), Nsymbol(a, b, c))`. -The components of the fusion tensor are simply the Clebsch-Gordan coefficients of the group, +Return the fusion tensor for the fusion `a ⊗ b -> c`. The dimensions of the returned array are `(dim(a), dim(b), dim(c), Nsymbol(a, b, c))`. +The components of the fusion tensor are simply the Clebsch-Gordan coefficients, describing the unitary basis change from the tensor product of irreps `a` and `b` to the coupled irrep `c`. """ function fusiontensor end From 1ecef3139414b064b23127d52a889c7f4023fb76 Mon Sep 17 00:00:00 2001 From: Lukas Devos Date: Mon, 8 Dec 2025 10:18:46 -0500 Subject: [PATCH 4/4] Restrict docstring to `Sector` --- src/sectors.jl | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/sectors.jl b/src/sectors.jl index 8cc3349..cfef692 100644 --- a/src/sectors.jl +++ b/src/sectors.jl @@ -349,14 +349,14 @@ Base.:&(f₁::UnitStyle, f₂::UnitStyle) = f₂ & f₁ Base.:&(::GenericUnit, ::SimpleUnit) = GenericUnit() -""" +@doc """ fusiontensor(a::I, b::I, c::I) where {I <: Sector} -> AbstractArray{T, 4} -Return the fusion tensor for the fusion `a ⊗ b -> c`. The dimensions of the returned array are `(dim(a), dim(b), dim(c), Nsymbol(a, b, c))`. -The components of the fusion tensor are simply the Clebsch-Gordan coefficients, -describing the unitary basis change from the tensor product of irreps `a` and `b` to the coupled irrep `c`. -""" -function fusiontensor end +Return the fusion tensor for the fusion `a ⊗ b -> c`. The dimensions of the returned array +are `(dim(a), dim(b), dim(c), Nsymbol(a, b, c))`. The components of the fusion tensor are +simply the Clebsch-Gordan coefficients, describing the unitary basis change from the tensor +product of irreps `a` and `b` to the coupled irrep `c`. +""" fusiontensor(::I, ::I, ::I) where {I <: Sector} """ Fsymbol(a::I, b::I, c::I, d::I, e::I, f::I) where {I <: Sector}