toqito.matrices.gen_gell_mann
- toqito.matrices.gen_gell_mann(ind_1, ind_2, dim, is_sparse=False)[source]
Produce a generalized Gell-Mann operator [WikGM2].
Construct a
dim-by-dimHermitian operator. These matrices span the entire space ofdim-by-dimmatrices asind_1andind_2range from 0 todim-1, inclusive, and they generalize the Pauli operators whendim = 2and the Gell-Mann operators whendim = 3.Examples
The generalized Gell-Mann matrix for
ind_1 = 0,ind_2 = 1anddim = 2is given as\[\begin{split}G_{0, 1, 2} = \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix}.\end{split}\]This can be obtained in
toqitoas follows.>>> from toqito.matrices import gen_gell_mann >>> gen_gell_mann(0, 1, 2) [[0., 1.], [1., 0.]])
The generalized Gell-Mann matrix
ind_1 = 2,ind_2 = 3, anddim = 4is given as\[\begin{split}G_{2, 3, 4} = \begin{pmatrix} 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 1 \\ 0 & 0 & 1 & 0 \end{pmatrix}.\end{split}\]This can be obtained in
toqitoas follows.>>> from toqito.matrices import gen_gell_mann >>> gen_gell_mann(2, 3, 4) [[0., 0., 0., 0.], [0., 0., 0., 0.], [0., 0., 0., 1.], [0., 0., 1., 0.]])
References
[WikGM2]Wikipedia: Gell-Mann matrices, https://en.wikipedia.org/wiki/Gell-Mann_matrices
- Parameters:
ind_1 – A non-negative integer from 0 to
dim-1(inclusive).ind_2 – A non-negative integer from 0 to
dim-1(inclusive).dim – The dimension of the Gell-Mann operator.
is_sparse – If set to
True, the returned Gell-Mann operator is a sparse lil_matrix and if set toFalse, the returned Gell-Mann operator is a densenumpyarray.
- Returns:
The generalized Gell-Mann operator.