√X gate
The √X gate, half of an X: matrix, effect on the basis states, the sx() call in Python and JS, and its IonQ native-gate form.
The √X gate, SX, is half of an X gate: two of them in a row make one X. It acts on one qubit and takes no parameters. The Circuit panel draws it as √X. Measured straight after it, a qubit that started as 0 reads 0 or 1 with equal probability.
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.sx(qubit) |
| JS | circuit.sx(qubit) |
| Qiskit class | SXGate |
| Controlled form | csx(control, target) |
Matrix
On the Bloch sphere this is a quarter-turn about the X axis. It is the same operation as rx(π/2) up to a global phase.
Effect on basis states
| Input | Output |
|---|---|
Measured straight after √X, a qubit that started in or reads 0 or 1 with equal probability, the same split as after an H gate but with different phases.
Inverse
The inverse of √X is √X†, sxdg(qubit). √X is not its own inverse: two of them make an X.
Usage
from qiskit import QuantumCircuit
qc = QuantumCircuit(1, 1)
qc.sx(0)
qc.sx(0)
qc.measure(0, 0)
import { QuantumCircuit } from 'qiskit';
const circuit = QuantumCircuit(1, 1);
circuit.sx(0);
circuit.sx(0);
circuit.measure(0, 0);
Every shot reads 1: the two half-flips make one full flip.
On IonQ hardware
√X is GPi2(0) up to a global phase, a native gate, so it costs one physical pulse. 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