SESAME · Day 1 · Module 02
Gates and
interference
Quantum gate
A reversible operation on one or more qubits that transforms their state.
Quantum circuit
Specifies the operations, the qubits they act on and their order. Usually drawn as a diagram.
We use sequences of gates to carry out a quantum computation.
Opening / From a state difference to a recorded result
Can the same gate make these inputs distinguishable?
Plus
Minus
Direct computational-basis readout: \(P(0)=P(1)=1/2\) for both inputs.
Yes. After the same gate, plus can give 0 with certainty and minus can give 1 with certainty.
Gates / Circuits / Interference
A circuit’s measurement probabilities depend on how its gates change and combine amplitudes.
01 Ideal gates transform a qubit’s amplitudes reversibly.
02 A circuit fixes which operations act on each qubit and in what order.
03 Interference turns relative phase into different measurement probabilities.
01 / Gates · 1.1
A gate applies a linear transformation to the qubit’s state.
For example: X
\(X|0\rangle=|1\rangle\), \(X|1\rangle=|0\rangle\)
Swap the amplitudes
The same rule applies to every input.
The gate acts without reading \(\alpha\) and \(\beta\) from the qubit.
01 / Gates · 1.2
Unitary gates preserve normalization and have inverses.
\(U^\dagger\): transpose and complex conjugate.
Apply \(U\), then \(U^\dagger\): recover the input.
For example: Z
Change the second amplitude’s sign.
Change the sign twice
\(Z^2=I\)
The total probability stays 1. Individual probabilities can change.
01 / Gates · 1.2 / Geometric connection
Ideal single-qubit gates rotate the state point.
Two examples
Gates can also have adjustable rotation angles.
An inverse gate reverses the ideal transformation.
01 / Gates · 1.3
The Hadamard gate combines the two input amplitudes.
Starting from 0, H gives us a way to prepare a superposition.
First row: add. Second row: subtract. Scale both by \(1/\sqrt2\).
From zero, H prepares the plus state on every run.
02 / Circuits · 2.1
Each quantum wire follows one qubit through a sequence of operations.
Wire: the same qubit.
Box: an operation.
Time: left to right →
The output of one gate is the input to the next.
The intermediate states are written for our calculation. There is no measurement between these gates.
02 / Circuits · 2.2
The input and measurement specify the calculation we need.
q₀: the qubit remains available.
c0: the classical record, 0 or 1.
The state afterwards matches the record: \(|0\rangle\) or \(|1\rangle\).
Our examples start in zero and request a final computational-basis readout.
02 / Circuits · 2.3
Changing gate order can change the state we obtain.
A / H, then Z
B / Z, then H
Different states. The same direct readout probabilities: \(P(0)=P(1)=1/2\).
Keep the relative sign. A later operation can use it.
02 / Circuits · 2.3 / Prediction
Which gate acts first?
H acts first. It is next to the input vector.
Z acts on the state H produces.
Next: make the phase difference affect the result we read.
03 / Interference · 3.1
Contributions to the same outcome can reinforce or cancel.
Each output amplitude receives contributions from both input amplitudes.
Apply the second H to both terms of plus.
03 / Interference · 3.1 / H, then H
Add the contributions before calculating probabilities.
From the first input term
From the second input term
| Outcome | Add contributions to its amplitude | Then take the squared magnitude |
|---|---|---|
| \(0\) | \(\frac12+\frac12=1\) | \(P(0)=|1|^2=1\) |
| \(1\) | \(\frac12-\frac12=0\) | \(P(1)=|0|^2=0\) |
Final state: \(|0\rangle\). The measurement records 0 with certainty.
03 / Interference · 3.2 / H, Z, H
Z changes the relative sign before the last H.
Before Z
\(P(0)=P(1)=1/2\)
After Z
\(P(0)=P(1)=1/2\)
These are predicted readout probabilities. No measurement is inserted here.
03 / Interference · 3.2 / The last H
A relative sign changes which contributions cancel.
From the first input term
From the second input term
| Outcome | Add contributions to its amplitude | Then take the squared magnitude |
|---|---|---|
| \(0\) | \(\frac12-\frac12=0\) | \(P(0)=|0|^2=0\) |
| \(1\) | \(\frac12+\frac12=1\) | \(P(1)=|1|^2=1\) |
Final state: \(|1\rangle\). The measurement records 1 with certainty.
03 / Interference · 3.2 / The opening question
The same H gate makes plus and minus distinguishable.
Plus input
Record 0 with certainty.
Minus input
Record 1 with certainty.
Relative phase can change the result we read.
H followed by this readout gives the plus/minus measurement probabilities.
In an algorithm, we arrange gates so that useful results become likely.
03 / Interference · 3.3 / Checking a circuit
What happens if we measure between the two H gates?
Without the middle measurement
Final result: 0 with certainty.
With the middle measurement
What state enters the last H?
The middle measurement leaves \(|0\rangle\) or \(|1\rangle\), each with probability \(1/2\).
03 / Interference · 3.3 / After the middle measurement
The last H now receives one reference state or the other.
Middle record 0 / Probability ½
Middle record 1 / Probability ½
Ignoring the middle record does not undo the state change.
No later gate depends on the middle record.
03 / Interference · 3.3 / Superposition and random preparation
Equal direct readout probabilities can hide different preparations.
Prepare a fresh input for each run.
| Preparation | Direct readout: \(P(1)\) | H, then readout: \(P(1)\) |
|---|---|---|
| Prepare \(|+\rangle\) | \(1/2\) | \(0\) |
| Prepare \(|-\rangle\) | \(1/2\) | \(1\) |
| Randomly prepare \(|0\rangle\) or \(|1\rangle\), equally often | \(1/2\) | \(1/2\) |
Amplitudes combine within a superposition.
Probabilities combine across randomly selected preparations.
Gates / Circuits / Interference
A circuit’s measurement probabilities depend on how its gates change and combine amplitudes.
01 Ideal gates transform a qubit’s amplitudes reversibly.
02 A circuit fixes which operations act on each qubit and in what order.
03 Interference turns relative phase into different measurement probabilities.
Exercise / Worked circuit
What is the probability of measuring 1?
Start in \(|0\rangle\). Use a final computational-basis measurement.
Exercise / Your turn
Find the final probability of measuring 1 in each circuit.
Start in \(|0\rangle\). Follow the state after each gate. Submit a decimal.