Skip to content

dq.sigmaz

sigmaz(*, layout: Layout | None = None) -> QArray

Returns the Pauli \(\sigma_z\) operator.

It is defined by \(\sigma_z = \begin{pmatrix} 1 & 0 \\ 0 & -1 \end{pmatrix}\).

Parameters

  • layout –

    Matrix layout (dq.dense, dq.dia or None).

Returns

(qarray of shape (2, 2)) Pauli \(\sigma_z\) operator.

Examples

>>> dq.sigmaz()
QArray: shape=(2, 2), dims=(2,), dtype=complex64, layout=dia, ndiags=1
[[ 1.+0.j    â‹…   ]
 [   â‹…    -1.+0.j]]