GenGellMann

GenGellMann is a function that produces generalized Gell-Mann matrices. That is, it produces Hermitian matrices that form a traceless orthogonal basis for the space of $d \times d$ complex matrices.

Syntax

 * G = GenGellMann(IND1,IND2,DIM)
 * G = GenGellMann(IND1,IND2,DIM,SP)

Argument descriptions

 * IND1 and IND2: Integers between 0 and DIM-1, inclusive. If IND1 == IND2 then G</tt> will be diagonal. If IND1 < IND2</tt> then G</tt> will be real and have exactly 2 nonzero entries. If IND1 > IND2</tt> then G</tt> will be imaginary and have exactly 2 nonzero entries.
 * DIM</tt>: The size of the output matrix.
 * SP</tt> (optional, default 0): A flag (either 1 or 0) indicating that the generalized Gell-Mann matrix produced should or should not be sparse.

In Higher Dimensions
Generalized Gell-Mann matrices can be generated in arbitrary dimensions. It is recommended that you set SP = 1</tt> if DIM</tt> is large in order to save memory.