matrices.shift
Shift matrix.
Module Contents
Functions
|
Produce a |
- 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 followingdim
-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
- Parameters:
dim (int) – Dimension of the matrix.
- Returns:
dim
-by-dim
shift matrix.- Return type:
numpy.ndarray