Y gate

The Y gate: matrix, effect on |0⟩ and |1⟩, the y() call in Python and JS, and its IonQ native-gate form.

The Y gate flips a qubit and adds a phase: 0\vert 0 \rangle becomes i1i\vert 1 \rangle and 1\vert 1 \rangle becomes i0-i\vert 0 \rangle. It acts on one qubit and takes no parameters. The Circuit panel draws it as Y. Measured straight after it, a qubit that started as 0 reads 1, the same as after an X; the phase shows only once the qubit meets other gates.

Kets such as 0\vert 0 \rangle name the basis states and rotations are described on the Bloch sphere; the qubits lesson introduces both.

Call

WhereCall
Pythonqc.y(qubit)
JScircuit.y(qubit)
Qiskit classYGate
Controlled formcy(control, target)

Matrix

Y=(0ii0)Y = \begin{pmatrix} 0 & -i \\ i & 0 \end{pmatrix}

On the Bloch sphere this is a half-turn about the Y axis. It is the same operation as ry(π) up to a global phase.

Effect on basis states

InputOutput
0\vert 0 \ranglei1i\vert 1 \rangle
1\vert 1 \ranglei0-i\vert 0 \rangle
+\vert + \ranglei-i\vert - \rangle
\vert - \ranglei+i\vert + \rangle

Measured straight away, a basis state flips exactly as it does under X; the phases only matter once the qubit meets other gates.

Inverse

Y is its own inverse. Two Y gates in a row on the same qubit cancel.

Usage

from qiskit import QuantumCircuit

qc = QuantumCircuit(1, 1)
qc.y(0)
qc.measure(0, 0)
import { QuantumCircuit } from 'qiskit';

const circuit = QuantumCircuit(1, 1);
circuit.y(0);
circuit.measure(0, 0);

Every shot reads 1.

On IonQ hardware

Y is exactly GPi(0.25), a native gate with its phase a quarter turn from X, so it costs one physical pulse. See How your circuit is compiled.

Stay in the loop.

Get the latest tutorials, demos, and project showcases straight to your inbox. No noise, just the good stuff.