Immanants

Kostant's theorem (background page) writes an immanant as a sum of diagonal group functions over the zero-zweight states of an irrep. The irrep λ = [2,1,0] has two zero-weight states, so the $(2,1)$ immanant of a $3\times3$ matrix is the sum of their two group functions. We pick the states out by their vanishing zweight, evaluate the immanant from its definition, and compare:

Kostant's zero-weight diagonal sum for the (2,1) immanant

julia> using GroupFunctions
julia> imm21(A) = 2*A[1,1]*A[2,2]*A[3,3] - A[1,2]*A[2,3]*A[3,1] - A[1,3]*A[2,1]*A[3,2];
julia> λ = [2, 1, 0];
julia> zero = filter(gt -> all(iszero, zweight(gt)), basis_states(λ));
julia> M1 = su2_block(3,1,(0.5,0.9,0.2)) * su2_block(3,2,(0.4,0.2,0.6)) * su2_block(3,1,(0.5,0.7,0.3)); #certified to be random, picked by me
julia> total = sum(group_function(λ, t, t, M1) for t in zero)0.9956384412225798 + 1.1037178115902435e-16im
julia> total ≈ imm21(M1)true

Permanent as special case

The permanent is the immanant of the fully symmetric irrep, $\mathrm{Per}=\mathrm{Imm}^{(n)}$, and there the zero-weight sum collapses to a single term. For three photons in four modes (λ = [3,0,0,0]) the group function reproduces the permanent of the relevant submatrix (with a $\sqrt{2}$ normalization factor – see the background page):

Repeated input occupations select repeated submatrix indices in the permanent

julia> using GroupFunctions
julia> permanent3(A) = A[1,1]*A[2,2]*A[3,3] + A[1,1]*A[2,3]*A[3,2] + A[1,2]*A[2,1]*A[3,3] + A[1,2]*A[2,3]*A[3,1] + A[1,3]*A[2,1]*A[3,2] + A[1,3]*A[2,2]*A[3,1];
julia> U = su2_block(4, 1, (0.3, 0.7, 0.2)) * su2_block(4, 2, (0.5, 0.9, 0.5)) * su2_block(4, 1, (0.4, 0.8, 0.1)) * su2_block(4, 3, (0.6, 0.2, 0.6)) * su2_block(4, 2, (0.1, 0.3, 0.1)) * su2_block(4, 1, (0.9, 0.4, 0.7));
julia> basis = basis_states([3,0,0,0]);
julia> state_x = filter(s -> occupation_number(s) == [1,1,1,0], basis)[1]; #modes 1,2,3
julia> state_y = filter(s -> occupation_number(s) == [0,2,0,1], basis)[1];#modes 2 (twice), 4
julia> M2 = U[[1,2,3], [2,2,4]]; #the modes from above form the indices to extract matrix elements
julia> group_function([3,0,0,0], state_x, state_y, U) ≈ permanent3(M2) / sqrt(2)true