Introduction to quantum gates
Small operations on amplitudes become the building blocks of a circuit.
- Trace the order of operations in a circuit.
- Distinguish a gate’s effect on amplitudes from its effect on measurement probabilities.
An operation, not an assignment
Section titled “An operation, not an assignment”An ideal quantum gate applies a unitary matrix to a state. X exchanges amplitudes. Z changes the sign of the 1 component. H mixes components so they can reinforce or cancel.
If H is applied first and Z second, the resulting state is . The rightmost matrix acts first. Circuit diagrams here read left to right, so follow the physical order when translating to algebra.
A small gate dictionary
Section titled “A small gate dictionary”| Gate | Action on a one-qubit state |
|---|---|
| X | |
| Z | |
| H | |
| S | |
| T |
Predict, then build
Section titled “Predict, then build”Apply H to q0 and CX from q0 to q1. Predict which two basis outcomes survive. Use Undo to check the circuit one step at a time.
Quantum gate playground
Gates act on amplitudes. Build a small circuit one operation at a time and compare its exact predictions with repeated measurements.
Make a prediction first
Apply H to q0, then CX from q0 to q1. Which two outcomes should disappear?
Exact ideal-model predictions · run a measurement experiment to compare.
Take it further
Create the Bell state, then undo the gates in reverse order. Where did the randomness go?
Prediction: Apply H to q0, then CX from q0 to q1. Which two outcomes should disappear? Challenge: Create the Bell state, then undo the gates in reverse order. Where did the randomness go?
Order can matter
Section titled “Order can matter”On , H followed by Z gives . Z followed by H gives . Their Z probabilities match, so add a final H to reveal the difference.
Do not infer that two circuits are equivalent merely because they give the same counts for one input in one basis. A gate is a transformation with a contract over its allowed inputs.
Challenge: find two gates in the table that square to I. Then explain why S is not one of them.
Reference: IBM Quantum — Bits, gates, and circuits.
Ready for the next step?
Your progress stays in this browser.