Computing Library › Quantum Logic Gates
Quantum Logic Gates

Controlled-RY Gate (CRY)

Applies a real-valued Y-axis rotation to a target qubit conditioned on the control being in state one.

Definition

CRY(θ) rotates the target about the Y axis by angle θ when the control is |1⟩, and does nothing when the control is |0⟩. Because RY has purely real matrix entries, CRY is convenient for encoding real amplitudes — for example, loading a probability distribution into an amplitude register.

Matrix

Kronos motion — control room
CRY(θ)
1000010000cos(θ/2)-sin(θ/2)00sin(θ/2)cos(θ/2)

The lower-right block is RY(θ) = exp(-i θ Y / 2). Unlike CRX and CRZ, every entry is real, so CRY maps real state vectors to real state vectors.

Amplitude encoding

A cascade of CRY gates with classically precomputed angles builds an arbitrary real amplitude vector on n qubits. The angle at each node of the binary tree is derived from the ratio of the summed probabilities of its two subtrees, so the circuit realizes a controlled rotation for each conditional split.

python
import numpy as np
def cry(theta):
    c, s = np.cos(theta/2), np.sin(theta/2)
    m = np.eye(4, dtype=complex)
    m[2,2]=c; m[3,3]=c; m[2,3]=-s; m[3,2]=s
    return m

Decomposition

CRY(θ) = CNOT·(I⊗RY(-θ/2))·CNOT·(I⊗RY(θ/2)). The two RY halves cancel when the control is |0⟩ and add when it is |1⟩, because the intervening CNOT flips the sign of the Y-rotation axis. This uses two entangling gates and two single-qubit rotations.

In variational quantum algorithms, layers of CRY paired with single-qubit rotations form expressive ansätze whose parameters are optimized against a cost function.