Functions

GroupFunctions.group_functionFunction
group_function(λ::Irrep, tu::YoungTableau, tv::YoungTableau)

Returns the symbolic group function corresponding to irrep λ and Young tableaux tu and tv.

Example:

julia> t = YoungTableau([2,1]); fill!(t, [1,2,3]);
julia> group_function([2,1,0], t, t)
group_function(λ::Irrep, tab_u::YTableau, tab_v::YTableau; verbose::Bool = false) -> Basic

Compute group theoretical function based on Young tableaux and irreducible representations.

Arguments:

  • λ::Irrep: Irreducible representation
  • tab_u::YTableau: First Young tableau
  • tab_v::YTableau: Second Young tableau
  • verbose::Bool: Flag for detailed output (default: false)

Returns:

  • Complex: Group function evaluated

Notes:

  • Uses SymEngine for symbolic computation
  • Involves matrix operations and coset calculations
source
group_function(λ::Irrep, tu::GTPattern, tv::GTPattern)

Returns the symbolic group function corresponding to irrep λ and GT patterns tu and tv.

Example:

julia> t = GTPattern([[2,1,0],[2,1],[2]],[2]);
julia> group_function([2,1,0], t, t)
group_function(λ::Irrep, pat_u::GTPattern, pat_v::GTPattern; verbose::Bool = false) -> Basic

Compute group theoretical function based on Gelfand-Tsetlin patterns and irreducible representations.

Arguments:

  • λ::Irrep: Irreducible representation
  • pat_u::GTPattern: First Gelfand-Tsetlin pattern
  • pat_v::GTPattern: Second Gelfand-Tsetlin pattern
  • verbose::Bool: Flag for detailed output (default: false)

Returns:

  • Basic: Computed polynomial expression in SymEngine format

Notes:

  • Converts GT patterns to Young tableaux for calculations
  • Uses SymEngine for symbolic computation
source
group_function(λ::Irrep, tu::GTPattern, tv::GTPattern, mat::Array{Complex{Float64},2})

Returns the numeric group function, for an SU(n) member mat, corresponding to irrep λ and a pair of GT patterns tu and tv.

julia> using RandomMatrices
julia> mat = rand(Haar(2),3)
julia> t = GTPattern([[2,1,0],[2,1],[2]],[2]);
julia> group_function([2,1,0], t, t, mat)
source
group_function(λ::Irrep, pat_u::GTPattern, pat_v::GTPattern, mat::AbstractMatrix{<:Basic}; verbose::Bool = false) -> Basic

Evaluate a symbolic matrix element of the irrep λ using the same symbolic matrix path as group_function_sym, but through the main group_function API.

source
group_function(λ::Irrep, tu::GTPattern, tv::GTPattern, mat::Array{Complex{Float64},2})

Returns the numeric group function, for an SU(n) member mat, corresponding to irrep λ and STYT tu and tv.

Example:

julia> using RandomMatrices
julia> mat = rand(Haar(2),3)
julia> t = YoungTableau([2,1]); fill!(t, [1,2,3]);
julia> group_function([2,1,0], t, t, mat)
source
group_function(λ::Irrep; verbose::Bool = false) -> Tuple{Matrix{Basic}, Vector{GTPattern}}

Compute all symbolic group functions associated with the partition λ. The routine builds every valid GT pattern for λ and evaluates the group function for each pair.

Arguments:

  • λ::Irrep: Partition describing the irrep
  • verbose::Bool: Forwarded to the underlying pairwise group_function

Returns:

  • Tuple: (values, patterns) where values[i,j] corresponds to group_function(λ, patterns[i], patterns[j]) and patterns is the basis returned by basis_states(λ)
source
group_function(λ::Irrep, mat::AbstractMatrix{<:Basic}; verbose::Bool = false) -> Tuple{Matrix{Basic}, Vector{GTPattern}}

Compute the full symbolic irrep matrix for λ from a symbolic SU(n) matrix. This is the symbolic-matrix analog of the numeric group_function(λ, mat) overload.

source
group_function(λ::Irrep, mat::Array{Complex{Float64}, 2}; verbose::Bool = false) -> Tuple{Matrix{ComplexF64}, Vector{GTPattern}}

Compute all numeric group functions associated with the partition λ and a matrix mat. Generates the GT patterns for λ and evaluates every pair using the provided matrix.

Arguments:

  • λ::Irrep: Partition describing the irrep
  • mat::Array{Complex{Float64}, 2}: Matrix representing the SU(n) element
  • verbose::Bool: Forwarded to the underlying pairwise group_function

Returns:

  • Tuple: (values, patterns) where values[i,j] corresponds to group_function(λ, patterns[i], patterns[j], mat) and patterns is the basis returned by basis_states(λ)
source

Gelfand-Tsetlin patterns

GT patterns are used to denote the basis states.

GroupFunctions.GTPatternType

GTPattern(arrayofarrays) Stucture to hold Gelfand-Tsetlin patterns. Data fields:

  • rows
  • last_row, copied from rows during initialization (for internal algorithm purposes, mathematically irrelevant)

TODO: either make it immutable, or somehow auto-change last_row upon change in rows (and vice versa).

Example:

julia> gt=GTPattern([[2,1,0],[2,1],[2]])
│ 2   1   0 ╲
│   2   1    〉
│     2     ╱


julia> gt.rows
3-element Vector{Vector{Int64}}:
 [2, 1, 0]
 [2, 1]
 [2]

julia> gt.last_row
1-element Vector{Int64}:
 2
source

Construction of matrices

SU(2) blocks are used to construct unitary matrices.

GroupFunctions.su2_blockFunction
su2_block(size::Int, position::Int, angles::NTuple{3,Float64})
su2_block(size::Int, indices::NTuple{2,Int}, angles::NTuple{3,Float64})

Embed a 2×2 SU(2) rotation defined by Euler angles (α, β, γ) into a size × size identity matrix.

Method 1: Adjacent indices

su2_block(size, position, angles) acts on rows/cols position and position+1.

Method 2: Arbitrary indices

su2_block(size, (i, j), angles) acts on rows/cols i and j where 1 ≤ i < j ≤ size. This allows creating SU(2) blocks at non-adjacent positions.

Examples

# Adjacent indices (traditional usage)
mat = su2_block(4, 2, (0.1, 0.2, 0.3))  # acts on rows/cols (2, 3)

# Non-adjacent indices
mat = su2_block(5, (1, 4), (0.1, 0.2, 0.3))  # acts on rows/cols (1, 4)
source

Young Tableaux Operations

Young tableaux are fundamental combinatorial objects used in representation theory. These functions provide tools for constructing and manipulating Young tableaux.

GroupFunctions.axialdistanceFunction
axialdistance(Y::YoungTableau, i, j)

Return the hook-length of an element in Y at position (i,j), i.e the number of cells in the i-th row to the right of (i,j)-th box, plus the number of cells in the j-th column below the (i,j)-th box, plus 1.

Return 0 for (i,j) not in the tableau Y.

Examples

julia> y = YoungTableau([4,3,1])
┌───┬───┬───┬───┐
│ 1 │ 2 │ 3 │ 4 │
├───┼───┼───┼───┘
│ 5 │ 6 │ 7 │
├───┼───┴───┘
│ 8 │
└───┘

julia> axialdistance(y, 1,1)
6

julia> axialdistance(y, 1,3)
3

julia> axialdistance(y, 2,4)
0
source
GroupFunctions.determine_positionFunction
matrix_repr(Y::YoungTableau)

Construct sparse integer matrix representing the tableau.

Examples:

julia> y = YoungTableau([4,3,1]);


julia> matrix_repr(y)
3×4 SparseArrays.SparseMatrixCSC{Int64,Int64} with 8 stored entries:
  [1, 1]  =  1
  [2, 1]  =  5
  [3, 1]  =  8
  [1, 2]  =  2
  [2, 2]  =  6
  [1, 3]  =  3
  [2, 3]  =  7
  [1, 4]  =  4
source
GroupFunctions.first_young_tableau_lexicographicFunction
first_young_tableau_lexicographic(YoungTableau) -> YoungTableau
Computes the first ---in lexicographic order---
Standard Tableaux.

Examples:

julia> pat = YoungTableau([2,1]);

julia> first_young_tableau_lexicographic(pat)
┌───┬───┐
│ 1 │ 3 │
├───┼───┘
│ 2 │
└───┘
source
GroupFunctions.StandardYoungTableauxFunction
StandardYoungTableaux(part::Array{Int64,1}) -> list of YoungTableaux

Return a list of Standard YoungTableaux.

Examples:

julia> StandardYoungTableaux([2,1])
2-element Vector{AbstractAlgebra.Generic.YoungTableau{Int64}}:
 [1 3; 2 0]
 [1 2; 3 0]
source
GroupFunctions.index_of_semistandard_tableauFunction
index_of_semistandard_tableau(p::YoungTableau)
was: indice_tablon_semistandard

Returns the index of the standard YoungTableau such that the function mapping the filling of the semistandard to the standard Tableau is non decreasing

TODO add examples

source

GT Pattern Generation

Functions for generating and iterating through Gelfand-Tsetlin patterns, which form a basis for irreducible representations.

GroupFunctions.determine_next_patternFunction
determine_next_pattern(x::GTPattern)

was: siguientepatron Determine next GT pattern by decreasing one entry (if possible) and propagating the change to rows below. Note: With incomplete patterns e.g. GTPattern([[2,1,0],[2,0]]) outputs of determinenextpattern and determinenextpattern! differ.

source
GroupFunctions.determine_next_pattern!Function
determine_next_pattern!(x::GTPattern)

was: siguientepatron! Determine next GT pattern by decreasing one entry (if possible) and propagating the change to rows below.

source

Weight Functions

Weight functions extract different types of weights from Gelfand-Tsetlin patterns, useful for quantum optics and physical applications.

GroupFunctions.zweightFunction

Computes zweight of a GTPattern. This array, if applied to each state of the irrep, is commonly known as the weight diagram of an SU(n) irrep.

zweight(x::GTPattern)

Examples:

julia> t = GTPattern([[2,1,0],[2,1],[2]],[2])
julia> zweight(t)
>[0.5,0.5]
source
GroupFunctions.pweightFunction
pweight(x::GTPattern)

Compute the pweight of a GTPattern.

This array is related to the occupation number.

Examples

julia> using GroupFunctions

julia> t = GTPattern([[2, 1, 0], [2, 1], [2]]);

julia> pweight(t)
3-element Vector{Int64}:
 0
 1
 2
source

Content and Matrix Generation

Functions for computing content vectors, coefficients, and matrix representations of irreducible representations.

GroupFunctions.contentFunction
content(p::YoungTableau, λ::Irrep)

Return the size of the vector which represents the partition. WARNING calling content without an irrep λ assumes you are working with SU(d) with d the length of the partition p.

Examples:

julia> ss = YoungTableau(GTPattern([[2,1,0,0],[2,1,0],[2,1],[2]]));

julia> content(ss, [2,1,0,0])
4-element Vector{Int64}:
 2
 2
 0
 0

julia> ss = YoungTableau(GTPattern([[2,1,0,0],[2,1,0],[2,1],[2]]));

julia> content(ss, [2,1,0])
3-element Vector{Int64}:
 2
 1
 0
source
content(p::YoungTableau) -> Vector{Int}

Return the content vector of the tableau fill (counts of each label). In simple terms: it counts how many times each label (1, 2, 3, ...) appears in the tableau.

Examples:

julia> t = YoungTableau([2,1]); fill!(t, [1,2,2]);
julia> content(t)
2-element Vector{Int64}:
 1
 2
source
GroupFunctions.generate_matrixFunction
generate_matrix(Y::Array{YoungTableau}, p::Perm, λ::Array{Int64,1}) -> SparseMatrixCSC

Return non-zero entries of the orthogonal irrep given by the permutation 'p' The information of the irrep is introduced via 'Y' which is a list of Standard Young tableaux

Examples

julia> guilty = StandardYoungTableaux([3,2])
julia> generate_matrix(guilty, Perm([2,1,3,4,5]), [3,2])
[1, 1]  =  -1.0
[2, 2]  =  1.0
[3, 3]  =  -1.0
[4, 4]  =  1.0
[5, 5]  =  1.0

julia> generate_matrix(guilty, Perm([1,3,2,4,5]), [3,2])
[1, 1]  =  0.5
[2, 1]  =  0.866025
[1, 2]  =  0.866025
[2, 2]  =  -0.5
[3, 3]  =  0.5
[4, 3]  =  0.866025
[3, 4]  =  0.866025
[4, 4]  =  -0.5
[5, 5]  =  1.0
source

SU(n) Matrix Construction

Advanced functions for constructing special unitary matrices using various factorization methods and Euler angle parametrizations.

GroupFunctions.su2_factorizationFunction
su2_factorization(size::Int; skip_tail::Int = 0)

Build a random size × size unitary (SU(d)) as a product of SU(2) blocks; setting skip_tail skips the last skip_tail layers of factors.

source
GroupFunctions.sud_from_anglesFunction
sud_from_angles(angles::Vector{Float64}, size::Int; quotient::Bool = false)

Construct an SU(d) matrix from a supplied list of Euler angles, optionally zeroing the earliest layers when quotient is true.

source
GroupFunctions.su2_block_symbolicFunction
su2_block_symbolic(size::Int, position::Int; prefix::String = "v")
su2_block_symbolic(size::Int, indices::NTuple{2,Int}; prefix::String = "v")

Create a symbolic size × size matrix with a generic 2×2 block represented by symbolic variables. The rest of the matrix is an identity.

This is the symbolic analog of su2_block, where instead of numeric angles, the 2×2 block elements are symbolic variables. This is useful for symbolic computations similar to how group_function creates symbolic expressions in terms of matrix elements u_i_j.

Method 1: Adjacent indices

su2_block_symbolic(size, position; prefix) creates a 2×2 block at position and position+1.

Method 2: Arbitrary indices

su2_block_symbolic(size, (i, j); prefix) creates a 2×2 block at rows/cols i and j where 1 ≤ i < j ≤ size. This allows creating symbolic blocks at non-adjacent positions.

Arguments

  • size::Int: Dimension of the square matrix
  • position::Int: Starting row/column for the 2×2 block (must satisfy 0 < position < size)
  • indices::NTuple{2,Int}: Tuple (i, j) specifying arbitrary row/column indices
  • prefix::String: Prefix for symbolic variable names (default: "v")

Returns

  • Matrix{Basic}: A symbolic matrix with identity everywhere except a 2×2 symbolic block

Examples

julia> using GroupFunctions, SymEngine

# Adjacent indices (traditional usage)
julia> mat = su2_block_symbolic(3, 1)
3×3 Matrix{Basic}:
 v_1_1  v_1_2  0
 v_2_1  v_2_2  0
     0      0  1

# Non-adjacent indices
julia> mat = su2_block_symbolic(5, (1, 4))
5×5 Matrix{Basic}:
 v_1_1  0  0  v_1_4  0
     0  1  0      0  0
     0  0  1      0  0
 v_4_1  0  0  v_4_4  0
     0  0  0      0  1

julia> mat = su2_block_symbolic(4, 2, prefix="w")
4×4 Matrix{Basic}:
 1      0      0      0
 0  w_2_2  w_2_3      0
 0  w_3_2  w_3_3      0
 0      0      0      1

Notes

  • The symbolic variables are named \$(prefix)_i_j where i,j are the row and column indices
  • Unlike su2_block, this does not enforce SU(2) constraints (unitarity, determinant = 1)
  • The resulting matrix can be used in symbolic group function computations
source

Utility Functions

Conversion utilities for interfacing with other symbolic computation systems.

GroupFunctions.julia_to_mmaFunction
julia_to_mma(expr::SymEngine.Basic)

Convert a SymEngine expression using u_i_j symbols into a Mathematica-style string using u[i,j], adding light operator spacing for readability.

source
GroupFunctions.mma_to_juliaFunction
mma_to_julia(s::String)

Convert a Mathematica-style string using x[i,j] into a SymEngine expression with u_i_j symbols.

Example:

julia> mma_to_julia("x[1, 1]")
u_1_1
source