Skip to content

dq.rz

rz(theta: float) -> Array

Returns the \(R_z(\theta)\) rotation gate.

It is defined by $$ R_z(\theta) = \begin{pmatrix} e^{-i\theta/2} & 0 \\ 0 & e^{i\theta/2} \end{pmatrix} $$

Parameters

  • theta –

    Rotation angle \(\theta\) in radians.

Returns

(array of shape (2, 2)) \(R_z(\theta)\) gate.

Examples

>>> dq.rz(jnp.pi)
Array([[-0.-1.j,  0.+0.j],
       [ 0.+0.j, -0.+1.j]], dtype=complex64)