dq.ry
ry(theta: ArrayLike) -> QArray
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
(array-like of shape (...))
–
Rotation angle \(\theta\) in radians.
Returns
(qarray of shape (2, 2)) \(R_y(\theta)\) gate.
Examples
>>> dq.ry(jnp.pi)
QArray: shape=(2, 2), dims=(2,), dtype=complex64, layout=dense
[[-0.+0.j -1.+0.j]
[ 1.+0.j -0.+0.j]]
>>> dq.ry([0, jnp.pi/4, jnp.pi/3, jnp.pi/2, jnp.pi]).shape
(5, 2, 2)