RXX gate

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

The RXX gate rotates a pair of qubits together about the XXX \otimes X axis by an angle θ\theta. It acts on two qubits and takes one parameter, θ\theta in radians. The two qubits are interchangeable. The Circuit panel draws an Xx(θ) box on each wire, with the angle shown as a multiple of π. At θ=π/2\theta = \pi/2 on two fresh qubits, the pair reads 00 or 11 with equal probability and never 01 or 10.

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

Matrix

The matrix uses the basis order 00,01,10,11\vert 00 \rangle, \vert 01 \rangle, \vert 10 \rangle, \vert 11 \rangle, with c=cosθ2c = \cos\frac{\theta}{2} and s=sinθ2s = \sin\frac{\theta}{2}.

RXX(θ)=(c00is0cis00isc0is00c)RXX(\theta) = \begin{pmatrix} c & 0 & 0 & -is \\ 0 & c & -is & 0 \\ 0 & -is & c & 0 \\ -is & 0 & 0 & c \end{pmatrix}

That is eiθ2XXe^{-i\frac{\theta}{2} X \otimes X}. It is an RZZ gate of the same angle with an H gate on both qubits before and after.

Effect on basis states

InputOutput
00\vert 00 \ranglec00is11c\vert 00 \rangle - is\vert 11 \rangle
01\vert 01 \ranglec01is10c\vert 01 \rangle - is\vert 10 \rangle
10\vert 10 \ranglec10is01c\vert 10 \rangle - is\vert 01 \rangle
11\vert 11 \ranglec11is00c\vert 11 \rangle - is\vert 00 \rangle

At θ=π/2\theta = \pi/2 the gate is fully entangling: from 00\vert 00 \rangle it produces an equal superposition of 00\vert 00 \rangle and 11\vert 11 \rangle, a Bell state up to a phase.

Inverse

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

Usage

from math import pi
from qiskit import QuantumCircuit

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

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

On a noiseless simulator every shot reads 00 or 11, in close to equal numbers.

On IonQ hardware

RXX is the abstract form of Aria's native entangler: for θ from 0 to π/2, rxx(θ) is exactly MS(0, 0, θ/2π), one native gate with no single-qubit pulses, partially entangling between 0 and π/2. IonQ's MS angle runs from 0 to a quarter turn; above π/2 the compiler rewrites the gate and does not publish the result. On Forte, where the entangler is ZZ, it is one ZZ 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.