Group functions
A group function is a matrix element of an irrep: given an initial and a final basis state and a unitary U, it returns the amplitude between them. We reuse the states from the previous page — the symmetric irrep [2, 0, 0], two photons in three modes. For the theory (permanents, determinants, the general formula) see the background page.
julia> using GroupFunctionsjulia> λ = [2, 0, 0];julia> basis = basis_states(λ);julia> initial = basis[findfirst(gt -> occupation_number(gt) == [2, 0, 0], basis)]│ 2 0 0 ╲ │ 2 0 〉 │ 2 ╱julia> final = basis[findfirst(gt -> occupation_number(gt) == [1, 1, 0], basis)]│ 2 0 0 ╲ │ 2 0 〉 │ 1 ╱
One numeric entry
A single matrix element is one call. Here U is a 50:50 beam splitter on modes 1–2 (an SU(2) block embedded in three modes), and we ask for the amplitude $\langle 1,1,0 \mid U \mid 2,0,0\rangle$:
julia> U = su2_block(3, 1, (0.0, pi/2, 0.0));julia> amp = group_function(λ, final, initial, U)0.7071067811865476 + 0.0im
The result is a complex amplitude; its squared modulus is the transition probability:
julia> abs2(amp)0.5000000000000001
The whole representation at once
Passing only λ and U — no states — returns every matrix element at once, together with the patterns indexing its rows and columns. To keep the printed matrix small we drop here to the two-mode irrep [2, 0], whose representation is $3\times3$:
julia> using GroupFunctionsjulia> BS = su2_block(2, 1, (0.0, pi/2, 0.0));julia> values, patterns = group_function([2, 0], BS);julia> size(values)(3, 3)julia> round.(values, digits=4)3×3 Matrix{ComplexF64}: 0.5+0.0im 0.7071+0.0im 0.5+0.0im -0.7071+0.0im 0.0+0.0im 0.7071+0.0im 0.5+0.0im -0.7071+0.0im 0.5+0.0im
One-dimensional irreps
The one-dimensional irreps of U(d) correspond to the constant partitions: betweenness forces every entry of the pattern to equal the (constant) top row, so there is exactly one basis vector. The zero partition ([0,0], [0,0,0]) is the trivial irrep, where every group element acts as 1; the all-ones partition ([1,1,1]) is the determinant rep, acting as $\det U$. The all-entries call returns that single scalar as its first result:
julia> using GroupFunctionsjulia> using LinearAlgebra: qr, detjulia> U = Matrix(qr(rand(ComplexF64, 3, 3)).Q);julia> # trivial irrep: scalar 1, and a single basis state group_function([0, 0, 0],U)[1]1.0 + 0.0imjulia> length(group_function([0, 0,0],U)[2])1julia> # determinant irrep: returns det(U) group_function([1, 1, 1], U)[1]1×1 Matrix{ComplexF64}: 0.5093604124904489 + 0.8605532930548573imjulia> det(U)0.5093604124904487 + 0.8605532930548574im
A symbolic entry
Omit U altogether and group_function returns the matrix element symbolically, as a function of $U$ with matrix elements u_i_j rather than a number. The ability to compute group functions purely symbolically is this library most distinctive capability. The same machinery that gives permanents and determinants for the symmetric and antisymmetric irreps produces, in general, the immanants of the relevant submatrix.
julia> group_function(λ, final, initial)sqrt(2)*u_2_1*u_1_1