RY gate
The RY gate, a rotation about Y by any angle: matrix, effect on the basis states, the ry() call in Python and JS, and its IonQ native-gate form.
The RY gate rotates a qubit about the Y axis of the Bloch sphere by an angle . It acts on one qubit and takes one parameter, in radians. The Circuit panel draws it as Ry(θ) with the angle shown as a multiple of π. Measured straight after it, a qubit that started as 0 reads 1 with probability : never at , half the time at , always at .
Kets such as name the basis states and rotations are described on the Bloch sphere; the qubits lesson introduces both.
Call
| Where | Call |
|---|---|
| Python | qc.ry(θ, qubit) |
| JS | circuit.ry(θ, qubit) |
| Qiskit class | RYGate |
| Controlled form | cry(θ, control, target) |
Matrix
The matrix is real, so RY never introduces complex phases. ry(π) is a Y gate up to a global phase, and ry(π/2) takes to , the same state an H gate produces from .
Effect on basis states
| Input | Output |
|---|---|
Measured straight after ry(θ), a qubit that started in reads 1 with probability : 0 at , one half at , certainty at .
Inverse
The inverse of ry(θ) is ry(-θ).
Usage
from math import pi
from qiskit import QuantumCircuit
qc = QuantumCircuit(1, 1)
qc.ry(pi / 3, 0)
qc.measure(0, 0)
import { QuantumCircuit } from 'qiskit';
const circuit = QuantumCircuit(1, 1);
circuit.ry(Math.PI / 3, 0);
circuit.measure(0, 0);
Over many shots about a quarter of them read 1: .
On IonQ hardware
RY is not a native gate for a general angle. An arbitrary ry(θ) compiles to two GPi2 pulses with a virtual Z of angle θ between them. The special angles are cheaper: ry(π/2) is exactly GPi2(0.25), a single pulse, and ry(π) is a single GPi. See How your circuit is compiled.
Related
Stay in the loop.
Get the latest tutorials, demos, and project showcases straight to your inbox. No noise, just the good stuff.
Gates