A Julia package to compute the generalized GellMann matrices in d
dimensions.
The generalized GellMann matrices provide a traceless basis for the space of Hermitian matrices, with elements that are orthogonal under the Frobenius inner product.
Notable special cases include the Pauli matrices σᵢ (d = 2
) and the standard GellMann matrices Λᵢ (d = 3
).
GellMannMatrices.jl exports a single function gellmann(d)
which returns the d^2  1
generalized GellMann matrices in d
dimensions.
The signature gellmann(T, d)
allows specifying the matrix type T
(which must be a mutable AbstractMatrix
with complex element type).
As examples, we can compute the Pauli matrices and the standard GellMann matrices:
julia> gellmann(2) # Pauli matrices
[0.0 + 0.0im 1.0 + 0.0im; 1.0 + 0.0im 0.0 + 0.0im]
[0.0 + 0.0im 0.0  1.0im; 0.0 + 1.0im 0.0 + 0.0im]
[1.0 + 0.0im 0.0 + 0.0im; 0.0 + 0.0im 1.0 + 0.0im]
julia> gellmann(3) # Standard GellMann matrices
[0.0 + 0.0im 1.0 + 0.0im 0.0 + 0.0im; 1.0 + 0.0im 0.0 + 0.0im 0.0 + 0.0im; 0.0 + 0.0im 0.0 + 0.0im 0.0 + 0.0im]
[0.0 + 0.0im 0.0  1.0im 0.0 + 0.0im; 0.0 + 1.0im 0.0 + 0.0im 0.0 + 0.0im; 0.0 + 0.0im 0.0 + 0.0im 0.0 + 0.0im]
[...]
Keyword arguments:

skip_identity
(default,true
): toggle tofalse
to include the identity matrix. 
normalize
(default,false
): toggle totrue
to guarantee a fixed (Frobenius) normalization prefactor of 2, in the sense$\mathrm{Tr}(M_i^\dagger M_j) = 2\delta_{ij}$ . Iffalse
, matrix elements are chosen to be small integers, leaving the normalization prefactor matrixdependent.