toqito.matrices.gen_pauli ========================= .. py:module:: toqito.matrices.gen_pauli .. autoapi-nested-parse:: Produces the generalized Pauli operator matrices. Module Contents --------------- .. py:function:: gen_pauli(k_1, k_2, dim) Produce generalized Pauli operator [@WikiPauliGen]. Generates a `dim`-by-`dim` unitary operator. More specifically, it is the operator \(X^k_1 Z^k_2\), where \(X\) and \(Z\) are the "gen_pauli_x" and "gen_pauli_z" operators that naturally generalize the Pauli X and Z operators. These matrices span the entire space of `dim`-by-`dim` matrices as `k_1` and `k_2` range from 0 to `dim-1`, inclusive. Note that the generalized Pauli operators are also known by the name of "discrete Weyl operators". (Lecture 6: Further Remarks On Measurements And Channels from [@Watrous_2011_Lecture_Notes]) .. rubric:: Examples The generalized Pauli operator for `k_1 = 1`, `k_2 = 0`, and `dim = 2` is given as the standard Pauli-X matrix \[ G_{1, 0, 2} = \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix}. \] This can be obtained in `|toqito⟩` as follows. ```python exec="1" source="above" from toqito.matrices import gen_pauli print(gen_pauli(k_1=1, k_2=0, dim=2)) ``` The generalized Pauli matrix `k_1 = 1`, `k_2 = 1`, and `dim = 2` is given as the standard Pauli-Y matrix \[ G_{1, 1, 2} = \begin{pmatrix} 0 & -1 \\ 1 & 0 \end{pmatrix}. \] This can be obtained in `|toqito⟩` as follows. ```python exec="1" source="above" from toqito.matrices import gen_pauli print(gen_pauli(k_1=1, k_2=1, dim=2)) ``` :param k_1: (a non-negative integer from 0 to `dim-1` inclusive). :param k_2: (a non-negative integer from 0 to `dim-1` inclusive). :param dim: (a positive integer indicating the dimension). :returns: A generalized Pauli operator.