Sdg gate

The Sdg gate, the inverse of S: matrix, effect on the basis states, the sdg() call in Python and JS, and why it costs nothing on IonQ hardware.

The Sdg gate, S dagger or SS^\dagger, undoes the S gate: it multiplies the 1\vert 1 \rangle amplitude by i-i and leaves 0\vert 0 \rangle alone. It acts on one qubit and takes no parameters. The Circuit panel draws it as Sdg. On its own it changes nothing a measurement can see.

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.sdg(qubit)
JScircuit.sdg(qubit)
Qiskit classSdgGate

Matrix

S=(100i)S^\dagger = \begin{pmatrix} 1 & 0 \\ 0 & -i \end{pmatrix}

On the Bloch sphere this is a quarter-turn about the Z axis in the opposite direction to S. It is the special case p(-π/2) of the P gate.

Effect on basis states

InputOutput
0\vert 0 \rangle0\vert 0 \rangle
1\vert 1 \ranglei1-i\vert 1 \rangle
+\vert + \rangle12(0i1)\tfrac{1}{\sqrt{2}}(\vert 0 \rangle - i\vert 1 \rangle)

A measurement straight after Sdg shows no change on 0\vert 0 \rangle or 1\vert 1 \rangle.

Inverse

The inverse of Sdg is S. An S followed by an Sdg on the same qubit is the identity.

Usage

from qiskit import QuantumCircuit

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

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

Every shot reads 0: the pair cancels.

On IonQ hardware

Sdg is a virtual Z. The compiler folds the quarter-turn into the phase of the next pulse, so it costs no gate and no time on the machine. 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.