Why does applying the same quantum operation again sometimes undo it and sometimes make things worse?
Why replaying a gate does not always undo it
Source research checked . Teaching calculations are ideal models.
Compare the phase gate S=diag(1,i) with its inverse S†=diag(1,-i). Start with a plus state so the phase change can later become visible in an X measurement. The example deliberately avoids a gate such as X that happens to equal its own inverse.
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.
Figure and table scope: Start from plus. Compare S then S with S then S†, followed by H and Z-basis readout in both cases.
Derivation step 1: One S operation changes plus into (|0>+i|1>)/√2. Its Z histogram is still balanced.
Derivation step 2: Applying S again gives (|0>-|1>)/√2, the minus state. Algebraically S²=Z, not the identity.
Derivation step 3: Applying S† after S cancels their phases and recovers plus. The product S†S is the identity.
Derivation step 4: After a final Hadamard, the repeated-S branch gives one while the inverse branch gives zero, under the stated ideal preparation and measurement conventions.
Separate challenge: For U=HS, with S applied first, write U† and verify that U†U is identity. What goes wrong if the order is not reversed?
Worked challenge answer: The inverse is S†H because H†=H and (HS)†=S†H. Then S†HHS=S†S=I. The unreversed product HS†HS is generally not identity. The exercise tests ordering rather than hardware noise.
Start with the assumptions
- Ideal gates and a declared temporal convention. Any echo claim involving real noise needs a model for noise timing, correlations and control errors.
S²=Z; S†S=I; H|−>=|1>; H|+>=|0>.

Compare the input regimes
Each case uses invented inputs. The results follow from this model and do not describe measured hardware.
Reference example with separately scoped figure
Complete inputs
- reference scenario
- Start with plus. Apply a phase gate S that adds 90 degrees to the one amplitude. Compare applying S again with applying S-dagger.
- separate figure scope
- Start from plus. Compare S then S with S then S†, followed by H and Z-basis readout in both cases.
- S = diag(1,i). S^2 = Z. S-dagger S = I. (BA)-dagger = A-dagger B-dagger.
| Reference | Prediction |
|---|---|
| Original declared example | Two S gates turn plus into minus, which differs in a subsequent X-basis measurement. S followed by S-dagger returns plus in the ideal model. |
| Operation sequence | Final zero probability | Final one probability |
|---|---|---|
| S then S | 0 | 1 |
| S then S† | 1 | 0 |
The declared reference example predicts: Two S gates turn plus into minus, which differs in a subsequent X-basis measurement. S followed by S-dagger returns plus in the ideal model.
Try the reasoning: For U=HS, with S applied first, write U† and verify that U†U is identity. What goes wrong if the order is not reversed?
Sources and model boundaries
- IBM Quantum Learning: limitations on quantum information ↗
Primary scientific context for an original ideal teaching example. Source research checked 19 October 2026; site integration inspected 20 October 2026. These are different checks.