StabilizerTable.to_matrix¶
- StabilizerTable.to_matrix(sparse=False, array=False)[source]¶
Convert to a list or array of Stabilizer matrices.
For large StabilizerTables converting using the
array=True
kwarg will be more efficient since it allocates memory for the full rank-3 Numpy array of matrices in advance.Table 14 Stabilizer Representations¶ Label
Phase
Symplectic
Matrix
Pauli
"+I"
0
\([0, 0]\)
\(\begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix}\)
\(I\)
"-I"
1
\([0, 0]\)
\(\begin{bmatrix} -1 & 0 \\ 0 & -1 \end{bmatrix}\)
\(-I\)
"X"
0
\([1, 0]\)
\(\begin{bmatrix} 0 & 1 \\ 1 & 0 \end{bmatrix}\)
\(X\)
"-X"
1
\([1, 0]\)
\(\begin{bmatrix} 0 & -1 \\ -1 & 0 \end{bmatrix}\)
\(-X\)
"Y"
0
\([1, 1]\)
\(\begin{bmatrix} 0 & 1 \\ -1 & 0 \end{bmatrix}\)
\(iY\)
"-Y"
1
\([1, 1]\)
\(\begin{bmatrix} 0 & -1 \\ 1 & 0 \end{bmatrix}\)
\(-iY\)
"Z"
0
\([0, 1]\)
\(\begin{bmatrix} 1 & 0 \\ 0 & -1 \end{bmatrix}\)
\(Z\)
"-Z"
1
\([0, 1]\)
\(\begin{bmatrix} -1 & 0 \\ 0 & 1 \end{bmatrix}\)
\(-Z\)
- Parameters
sparse (bool) – if True return sparse CSR matrices, otherwise return dense Numpy arrays (Default: False).
array (bool) – return as rank-3 numpy array if True, otherwise return a list of Numpy arrays (Default: False).
- Returns
A list of dense Pauli matrices if array=False and sparse=False. list: A list of sparse Pauli matrices if array=False and sparse=True. array: A dense rank-3 array of Pauli matrices if array=True.
- Return type
list