Tdg gate
The Tdg gate, the inverse of T: matrix, effect on the basis states, the tdg() call in Python and JS, and why it costs nothing on IonQ hardware.
The Tdg gate, T dagger or , undoes the T gate: it multiplies the amplitude by and leaves alone. It acts on one qubit and takes no parameters. The Circuit panel draws it as Tdg. On its own it changes nothing a measurement can see.
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.tdg(qubit) |
| JS | circuit.tdg(qubit) |
| Qiskit class | TdgGate |
Matrix
On the Bloch sphere this is an eighth-turn about the Z axis in the opposite direction to T. It is the special case p(-π/4) of the P gate.
Effect on basis states
| Input | Output |
|---|---|
A measurement straight after Tdg shows no change on or .
Inverse
The inverse of Tdg is T. A T followed by a Tdg on the same qubit is the identity.
Usage
from qiskit import QuantumCircuit
qc = QuantumCircuit(1, 1)
qc.t(0)
qc.tdg(0)
qc.measure(0, 0)
import { QuantumCircuit } from 'qiskit';
const circuit = QuantumCircuit(1, 1);
circuit.t(0);
circuit.tdg(0);
circuit.measure(0, 0);
Every shot reads 0: the pair cancels.
On IonQ hardware
Tdg is a virtual Z. The compiler folds the eighth-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.
Related
Stay in the loop.
Get the latest tutorials, demos, and project showcases straight to your inbox. No noise, just the good stuff.
Gates