toqito.matrices.gell_mann

toqito.matrices.gell_mann(ind, is_sparse=False)[source]

Produce a Gell-Mann operator [WikGM].

Generates the 3-by-3 Gell-Mann matrix indicated by the value of ind. When ind = 0 gives the identity matrix, while values 1 through 8 each indicate one of the other 8 Gell-Mann matrices.

The 9 Gell-Mann matrices are defined as follows:

\[\begin{split}\begin{equation} \begin{aligned} \lambda_0 = \begin{pmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{pmatrix}, \quad \lambda_1 = \begin{pmatrix} 0 & 1 & 0 \\ 1 & 0 & 0 \\ 0 & 0 & 0 \end{pmatrix}, \quad & \lambda_2 = \begin{pmatrix} 0 & -i & 0 \\ i & 0 & 0 \\ 0 & 0 & 0 \end{pmatrix}, \\ \lambda_3 = \begin{pmatrix} 1 & 0 & 0 \\ 0 & -1 & 0 \\ 0 & 0 & 0 \end{pmatrix}, \quad \lambda_4 = \begin{pmatrix} 0 & 0 & 1 \\ 0 & 0 & 0 \\ 1 & 0 & 0 \end{pmatrix}, \quad & \lambda_5 = \begin{pmatrix} 0 & 0 & -i \\ 0 & 0 & 0 \\ i & 0 & 0 \end{pmatrix}, \\ \lambda_6 = \begin{pmatrix} 0 & 0 & 0 \\ 0 & 0 & 1 \\ 0 & 1 & 0 \end{pmatrix}, \quad \lambda_7 = \begin{pmatrix} 0 & 0 & 0 \\ 0 & 0 & -i \\ 0 & i & 0 \end{pmatrix}, \quad & \lambda_8 = \frac{1}{\sqrt{3}} \begin{pmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & -2 \end{pmatrix}. \end{aligned} \end{equation}\end{split}\]

Examples

The Gell-Mann matrix generated from idx = 2 yields the following matrix:

\[\begin{split}\lambda_2 = \begin{pmatrix} 0 & -i & 0 \\ i & 0 & 0 \\ 0 & 0 & 0 \end{pmatrix}\end{split}\]
>>> from toqito.matrices import gell_mann
>>> gell_mann(2)
[[ 0.+0.j, -0.-1.j,  0.+0.j],
 [ 0.+1.j,  0.+0.j,  0.+0.j],
 [ 0.+0.j,  0.+0.j,  0.+0.j]]

References

[WikGM]

Wikipedia: Gell-Mann matrices, https://en.wikipedia.org/wiki/Gell-Mann_matrices

Raises:

ValueError – Indices must be integers between 0 and 8.

Parameters:
  • ind – An integer between 0 and 8 (inclusive).

  • is_sparse – Boolean to determine whether matrix is sparse.