toqito.matrices.gell_mann

Generates the Gell-Mann operator matrices.

Module Contents

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

Produce a Gell-Mann operator [@WikiGellMann].

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{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}

]

Examples

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

[
lambda_2 = begin{pmatrix}

0 & -i & 0 \ i & 0 & 0 \ 0 & 0 & 0

end{pmatrix}

] ```python exec=”1” source=”above” from toqito.matrices import gell_mann

print(gell_mann(ind=2)) ```

Raises:

ValueError – Indices must be integers between 0 and 8.

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

  • is_sparse (bool) – Boolean to determine whether array is sparse. Default value is False.

Return type:

numpy.ndarray | scipy.sparse.csr_array