Skip to content
Current section
The Quantum Computing Enthusiast’s Hub
Saved
All sections

All sections

Saved
Skip Learn navigation
Encyclopedia
Explainer

The undo button on a quantum gate has a direction

A circuit is an ordered product of operations. Undoing a whole circuit requires both inversion of every operation and reversal of their order. Merely reading the original gate list backward works only if every gate is self-inverse. This is a practical distinction for uncomputation, test circuits and any story about reversing a quantum process.

Edition released Coverage: Overview · Technical · Research
On this page

Explanation

A quantum circuit is often described as reversible, but reversible does not mean that every gate is its own undo button. A rotation must usually be reversed by a rotation in the opposite direction. Some especially familiar gates happen to undo themselves, which can make an introductory circuit misleading. The distinction becomes important when readers encounter echo sequences, mirror circuits and attempts to check a calculation by running it backwards. A return to the starting measurement outcome can be useful evidence, but only after the intended inverse and the complete measurement task have been defined.

Take an ideal phase rotation that changes the one component of a qubit by a relative angle. Applying that operation twice adds the angles. Applying its adjoint subtracts the angle and recovers the starting state. Hadamard is a special example whose ideal inverse is itself. A general sequence also reverses order when it is inverted: if the forward process applies A then B, the undo process applies the inverse of B and then the inverse of A. This is a relationship between complete operations, not a promise that the same noisy hardware retraces every microscopic interaction with its environment. An ideal circuit inverse and an experimentally implemented recovery sequence should therefore remain distinct in the description.

Consider two rotations about different axes. Undoing their sequence requires reversing the order and replacing each operation by its inverse, as expressed by the adjoint rule. The operation performed last must be undone first. This matters when a paper uses a round-trip experiment as a diagnostic: some errors may cancel, others may add, and a chosen measurement may be insensitive to a remaining difference. Identifying which case applies turns the familiar rewind metaphor into a precise way to read an experiment.

Suppose a programmer wants to check a short quantum circuit by appending an inverse. The inverse must reverse the order of the gates and invert each gate. A visual replay of the original list in reverse order works only when the individual operations have the required self-inverse property. The S gate is a useful test case because repeating it gives Z, not the identity.

Start with a known input, apply the proposed operation and then its actual adjoint. Verify the complete returned state, allowing for an irrelevant global phase. A single convenient basis input may hide a mistake, so include an input that is sensitive to the relative phase being changed. The same logic establishes a boundary for an engineering claim: reversing ideal unitary evolution does not mean that arbitrary discarded measurement records or uncontrolled environmental interactions have also been reversed. State which mathematical map is being inverted and which real processes remain outside it.

Declared model

The inverse cancels the phase; repetition doubles it

Inputs and assumptions

Start from plus. Compare S then S with S then S†, followed by H and Z-basis readout in both cases.

Mathematical expression

S²=Z; S†S=I; H|−>=|1>; H|+>=|0>.

Worked interpretation

Preserved calculated values — synthetic model
Operation sequenceFinal zero probabilityFinal one probability
S then S01
S then S†10

Model boundaries

Ideal gates and a declared temporal convention. Any echo claim involving real noise needs a model for noise timing, correlations and control errors.

Original ideal teaching calculation. Not measured hardware data.

Misconception and correction

Misconception: Applying a quantum gate a second time always undoes its first application.

Correction: An inverse is defined by the operation’s algebra, not by a visual arrow pointing backward. Irreversible measurement records require separate treatment.

Worked derivation

One S operation changes plus into (|0>+i|1>)/√2. Its Z histogram is still balanced.

Applying S again gives (|0>-|1>)/√2, the minus state. Algebraically S²=Z, not the identity.

Applying S† after S cancels their phases and recovers plus. The product S†S is the identity.

After a final Hadamard, the repeated-S branch gives one while the inverse branch gives zero, under the stated ideal preparation and measurement conventions.

Additional scientific distinctions

Operator order reverses when an inverse or adjoint is taken. With column state vectors and U=HS, the S gate acts first. Its inverse is U†=S†H because H†=H. Multiplication gives U†U=S†HHS=S†S=I. Retaining the original order would instead form HS†HS, which generally differs from identity. The cancellation follows from both the inverse of each factor and the reversal of composition order.

Hadamard is a special self-inverse gate, not evidence that repeating any quantum operation undoes it. A forward-and-reverse circuit can diagnose a specified experiment, but some coherent errors can compensate and some imperfections may be invisible to its chosen output measurement. Measurement with an acquired outcome, dissipation and discarded environmental information are different transformations from an isolated unitary. Replaying the gate list does not supply a universal reversal of these processes.

Sources