GroupFunctions.GTPatternAbstractAlgebra.YoungTableauGroupFunctions.StandardYoungTableauxGroupFunctions.axialdistanceGroupFunctions.basis_statesGroupFunctions.character_weylGroupFunctions.contentGroupFunctions.determine_next_patternGroupFunctions.determine_next_pattern!GroupFunctions.determine_positionGroupFunctions.first_young_tableau_lexicographicGroupFunctions.generate_matrixGroupFunctions.group_functionGroupFunctions.index_of_semistandard_tableauGroupFunctions.julia_to_mmaGroupFunctions.mma_to_juliaGroupFunctions.pweightGroupFunctions.su2_blockGroupFunctions.su2_block_symbolicGroupFunctions.su2_factorizationGroupFunctions.sud_from_anglesGroupFunctions.zweightGroupFunctions.Θ
Functions
GroupFunctions.group_function — Function
group_function(λ::Irrep, tu::YoungTableau, tv::YoungTableau)Returns the symbolic group function corresponding to irrep
λand Young tableauxtuandtv.
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) -> BasicCompute group theoretical function based on Young tableaux and irreducible representations.
Arguments:
λ::Irrep: Irreducible representationtab_u::YTableau: First Young tableautab_v::YTableau: Second Young tableauverbose::Bool: Flag for detailed output (default: false)
Returns:
Complex: Group function evaluated
Notes:
- Uses SymEngine for symbolic computation
- Involves matrix operations and coset calculations
group_function(λ::Irrep, tu::GTPattern, tv::GTPattern)Returns the symbolic group function corresponding to irrep
λand GT patternstuandtv.
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) -> BasicCompute group theoretical function based on Gelfand-Tsetlin patterns and irreducible representations.
Arguments:
λ::Irrep: Irreducible representationpat_u::GTPattern: First Gelfand-Tsetlin patternpat_v::GTPattern: Second Gelfand-Tsetlin patternverbose::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
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 patternstuandtv.
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)group_function(λ::Irrep, pat_u::GTPattern, pat_v::GTPattern, mat::AbstractMatrix{<:Basic}; verbose::Bool = false) -> BasicEvaluate a symbolic matrix element of the irrep λ using the same symbolic matrix path as group_function_sym, but through the main group_function API.
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 STYTtuandtv.
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)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 irrepverbose::Bool: Forwarded to the underlying pairwisegroup_function
Returns:
Tuple:(values, patterns)wherevalues[i,j]corresponds togroup_function(λ, patterns[i], patterns[j])andpatternsis the basis returned bybasis_states(λ)
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.
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 irrepmat::Array{Complex{Float64}, 2}: Matrix representing the SU(n) elementverbose::Bool: Forwarded to the underlying pairwisegroup_function
Returns:
Tuple:(values, patterns)wherevalues[i,j]corresponds togroup_function(λ, patterns[i], patterns[j], mat)andpatternsis the basis returned bybasis_states(λ)
Gelfand-Tsetlin patterns
GT patterns are used to denote the basis states.
GroupFunctions.GTPattern — Type
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}:
2Construction of matrices
SU(2) blocks are used to construct unitary matrices.
GroupFunctions.su2_block — Function
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)Young Tableaux Operations
Young tableaux are fundamental combinatorial objects used in representation theory. These functions provide tools for constructing and manipulating Young tableaux.
AbstractAlgebra.YoungTableau — Function
Construct Young tableau from a given GTPattern.
GroupFunctions.axialdistance — Function
axialdistance(Y::YoungTableau, i, j)Return the hook-length of an element in
Yat position(i,j), i.e the number of cells in thei-th row to the right of(i,j)-th box, plus the number of cells in thej-th column below the(i,j)-th box, plus1.Return
0for(i,j)not in the tableauY.
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)
0GroupFunctions.determine_position — Function
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] = 4GroupFunctions.first_young_tableau_lexicographic — Function
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 │
└───┘GroupFunctions.StandardYoungTableaux — Function
StandardYoungTableaux(part::Array{Int64,1}) -> list of YoungTableauxReturn 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]GroupFunctions.index_of_semistandard_tableau — Function
index_of_semistandard_tableau(p::YoungTableau)
was: indice_tablon_semistandardReturns 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
GT Pattern Generation
Functions for generating and iterating through Gelfand-Tsetlin patterns, which form a basis for irreducible representations.
GroupFunctions.basis_states — Function
basis_states(weight::Row)
Generate basis states (GTPatterns) of a given representation.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. Note: With incomplete patterns e.g. GTPattern([[2,1,0],[2,0]]) outputs of determinenextpattern and determinenextpattern! differ.
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.
Weight Functions
Weight functions extract different types of weights from Gelfand-Tsetlin patterns, useful for quantum optics and physical applications.
GroupFunctions.zweight — Function
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]
GroupFunctions.pweight — Function
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
2Content and Matrix Generation
Functions for computing content vectors, coefficients, and matrix representations of irreducible representations.
GroupFunctions.content — Function
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
0content(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
2GroupFunctions.Θ — Function
Θ(patron_semi::YoungTableau)Computes coefficient Θ. Returns a Float64
GroupFunctions.generate_matrix — Function
generate_matrix(Y::Array{YoungTableau}, p::Perm, λ::Array{Int64,1}) -> SparseMatrixCSCReturn 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.0SU(n) Matrix Construction
Advanced functions for constructing special unitary matrices using various factorization methods and Euler angle parametrizations.
GroupFunctions.su2_factorization — Function
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.
GroupFunctions.sud_from_angles — Function
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.
GroupFunctions.su2_block_symbolic — Function
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 matrixposition::Int: Starting row/column for the 2×2 block (must satisfy0 < position < size)indices::NTuple{2,Int}: Tuple(i, j)specifying arbitrary row/column indicesprefix::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 1Notes
- The symbolic variables are named
\$(prefix)_i_jwhere 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
Utility Functions
Conversion utilities for interfacing with other symbolic computation systems.
GroupFunctions.julia_to_mma — Function
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.
GroupFunctions.mma_to_julia — Function
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