matrices.shift

Shift matrix.

Module Contents

Functions

shift(dim)

Produce a dim-by-dim shift matrix [1].

matrices.shift.shift(dim)

Produce a dim-by-dim shift matrix [1].

Returns the shift matrix of dimension dim described in [1]. The shift matrix generates the following dim-by-dim matrix:

\[\begin{split}\Sigma_{1, d} = \begin{pmatrix} 0 & 0 & 0 & \ldots & 0 & 1 \\ 1 & 0 & 0 & \ldots & 0 & 0 \\ 0 & 1 & 0 & \ldots & 0 & 0 \\ 0 & 0 & 1 & \ldots & 0 & 0 \\ \vdots & \vdots & \vdots & \ddots & \vdots & \vdots \\ 0 & 0 & 0 & \ldots & 1 & 0 \end{pmatrix}\end{split}\]

The shift matrix is primarily used in the construction of the generalized Pauli operators.

Examples

The shift matrix generated from \(d = 3\) yields the following matrix:

\[\begin{split}\Sigma_{1, 3} = \begin{pmatrix} 0 & 0 & 1 \\ 1 & 0 & 0 \\ 0 & 1 & 0 \end{pmatrix}\end{split}\]
>>> from toqito.matrices import shift
>>> shift(3)
[[0., 0., 1.],
 [1., 0., 0.],
 [0., 1., 0.]]

References

[1] (1,2,3)

Wikipedia. Generalizations of Pauli matrices. https://en.wikipedia.org/wiki/Generalizations_of_Pauli_matrices.

Parameters:

dim (int) – Dimension of the matrix.

Returns:

dim-by-dim shift matrix.

Return type:

numpy.ndarray