Skip to content

dq.ry

ry(theta: float) -> Array

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

It is defined by $$ R_y(\theta) = \begin{pmatrix} \cos(\theta/2) & -\sin(\theta/2) \\ \sin(\theta/2) & \cos(\theta/2) \end{pmatrix} $$

Parameters

  • theta –

    Rotation angle \(\theta\) in radians.

Returns

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

Examples

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