RZZ gate

The RZZ gate, a two-qubit rotation about Z⊗Z: matrix, effect on the basis states, the rzz() call in Python and JS, and its IonQ native-gate form.

The RZZ gate rotates a pair of qubits together about the ZZZ \otimes Z axis by an angle θ\theta: it adds a phase that depends on whether the two qubits agree. It acts on two qubits and takes one parameter, θ\theta in radians. The two qubits are interchangeable. The Circuit panel draws a Zz(θ) box on each wire, with the angle shown as a multiple of π. On its own it changes nothing a measurement can see, whatever the angle; the phases show once the qubits are in superposition.

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.rzz(θ, qubit1, qubit2)
JScircuit.rzz(θ, qubit1, qubit2)
Qiskit classRZZGate

Matrix

The matrix uses the basis order 00,01,10,11\vert 00 \rangle, \vert 01 \rangle, \vert 10 \rangle, \vert 11 \rangle.

RZZ(θ)=(eiθ/20000eiθ/20000eiθ/20000eiθ/2)RZZ(\theta) = \begin{pmatrix} e^{-i\theta/2} & 0 & 0 & 0 \\ 0 & e^{i\theta/2} & 0 & 0 \\ 0 & 0 & e^{i\theta/2} & 0 \\ 0 & 0 & 0 & e^{-i\theta/2} \end{pmatrix}

That is eiθ2ZZe^{-i\frac{\theta}{2} Z \otimes Z}. It is the same as a CX, an RZ of θ on the target, and a second CX, and the CP gate is an RZZ with single-qubit phases added.

Effect on basis states

InputOutput
00\vert 00 \rangleeiθ/200e^{-i\theta/2}\vert 00 \rangle
01\vert 01 \rangleeiθ/201e^{i\theta/2}\vert 01 \rangle
10\vert 10 \rangleeiθ/210e^{i\theta/2}\vert 10 \rangle
11\vert 11 \rangleeiθ/211e^{-i\theta/2}\vert 11 \rangle

A measurement straight after RZZ shows no change on any basis state, whatever the angle. The phases show once the qubits are in superposition: this gate is the building block of Ising-model and QAOA circuits.

Inverse

The inverse of rzz(θ) is rzz(-θ).

Usage

from math import pi
from qiskit import QuantumCircuit

qc = QuantumCircuit(2, 2)
qc.h(0)
qc.h(1)
qc.rzz(pi, 0, 1)
qc.h(0)
qc.h(1)
qc.measure([0, 1], [0, 1])
import { QuantumCircuit } from 'qiskit';

const circuit = QuantumCircuit(2, 2);
circuit.h(0);
circuit.h(1);
circuit.rzz(Math.PI, 0, 1);
circuit.h(0);
circuit.h(1);
circuit.measure([0, 1], [0, 1]);

On a noiseless simulator every shot reads 11: between the H gates, rzz(π) flips the sign of both qubits' 1\vert 1 \rangle components together.

On IonQ hardware

RZZ is the abstract form of Forte's native entangler: rzz(θ) is exactly ZZ(θ/2π), one native gate with no single-qubit pulses at all, and Forte is the hardware behind Qollab's QPU backends. On Aria it is one MS gate with single-qubit pulses around it. 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.