SESAME · Day 3 · Module 08
Hybrid optimization
with QAOA
How can a short quantum circuit help us search for good solutions?
Run a circuit.
Return measured bits.
Assess the results.
Choose the next settings.
The hybrid approach / QAOA / Learning from results
We can search for good solutions by combining short quantum circuits with classical feedback.
01Classical feedback lets us search using circuits of limited depth.
02QAOA turns a scoring problem into an adjustable quantum circuit.
03Measured scores guide the search for better circuit settings.
01 / The hybrid approach · 1.1
Hardware imperfections limit reliable circuit depth.
A gate can introduce an error. A longer sequence exposes the state to more operations and more elapsed time.
Depth counts successive stages of operations in one circuit.
Gates on different qubits can share a stage. The usable depth depends on the device and the circuit.
01 / The hybrid approach · 1.2
A fixed circuit pattern can have adjustable settings.
Setting A
a = 0.00 b = 0.125
Setting B
a = 0.50 b = 0.125
One circuit pattern
Prepare qubits
Measure
Different settings can change the output probabilities.
We change the circuit settings so that good candidate solutions occur more often when we measure.
a and b are settings we choose. The measured bit string describes a candidate solution.
01 / The hybrid approach · 1.3
Classical feedback chooses the next circuit settings.
The quantum device supplies samples. Classical computation guides further runs.
We search the settings to improve the sampled candidates. Each shot starts with a fresh preparation.
02 / QAOA for optimization · 2.1
MaxCut asks us to split vertices into two groups.
This graph is small enough that we can check every answer. We use it to follow the method.
One graph throughout
Each vertex belongs to group 0 or group 1.
We earn one point for each edge joining different groups.
We want the largest score.
02 / QAOA for optimization · 2.1
The score counts edges whose endpoint bits differ.
Candidate 000
Score 0
Candidate 001
Score 1
Candidate 010
Score 2
010 cuts both edges. Its score is 2, the best possible for this graph.
101 describes the same partition with the group labels exchanged.
02 / QAOA for optimization · 2.1
Uniform sampling gives each of the eight strings probability ⅛.
| Score | Candidate strings x₀x₁x₂ | Probability of this score |
|---|---|---|
| 0 | 000, 111 | 2/8 = 25% |
| 1 | 001, 011, 100, 110 | 4/8 = 50% |
| 2 | 010, 101 | 2/8 = 25% |
Uniform sampling finds a score-2 candidate on one quarter of the runs, on average.
This gives us a starting distribution to compare with other circuit settings.
02 / QAOA for optimization · 2.2
QAOA alternates problem phases and mixing.
Quantum Approximate Optimization Algorithm · One qubit per vertex.
Problem-dependent phase
a sets the phase change per score point.
Mixing
b controls how amplitudes combine afterward.
H on every qubit prepares equal amplitudes. Each block contains gates; this example uses one layer.
02 / QAOA for optimization · 2.2 / Prediction
Does the phase block change the immediate probabilities?
At setting B, a = 0.50 adds a phase of \( -\pi/2 \) per score point.
| Score | Phase added | Amplitude factor |
|---|---|---|
| 0 | \(0\) | \(1\) |
| 1 | \(-\pi/2\) | \(-i\) |
| 2 | \(-\pi\) | \(-1\) |
Measure before mixing
H preparation gives each candidate probability ⅛.
What is it after these phase changes?
Still ⅛. All three phase factors have magnitude 1.
Mixing then allows the phases to affect the final probabilities.
02 / QAOA for optimization · 2.3
Changing the settings changes the sampled scores.
b controls mixing. At b = 0 there is no mixing; here both choices use b = 0.125.
Setting A · Uniform baseline · a = 0.00
Setting B · a = 0.50
At B, mixing turns the score-dependent phases into more score-2 outcomes.
Ideal probabilities · The score influences interference; the settings determine whether the result is useful.
03 / Learning from results · 3.1
One shot returns one candidate bit string.
Prepare
Three qubits
in zero.
Run
QAOA circuit
at setting B.
Measure
For example:
010
Score classically
Two crossing
edges: 2
Illustrative records from fresh shots
010001101000…We keep the settings fixed while collecting a batch of samples.
Strings use the labelled vertex order x₀x₁x₂. These are separate circuit executions.
03 / Learning from results · 3.1
Repeated shots give counts for each score.
| Candidate score | Number of results |
|---|---|
| 0 | 10 |
| 1 | 20 |
| 2 | 50 |
10 + 20 + 50 = 80 shots.
One batch at setting B
a = 0.50
b = 0.125
80 fresh runs
Every returned string is scored with the same graph.
The counts tell us how often each score occurred in this batch.
Illustrative counts, chosen to match the ideal proportions. Actual finite samples can differ.
03 / Learning from results · 3.1
The average score is total score divided by shots.
| Score | Count | Contribution to the total score |
|---|---|---|
| 0 | 10 | 0 × 10 = 0 |
| 1 | 20 | 1 × 20 = 20 |
| 2 | 50 | 2 × 50 = 100 |
This estimates the expected score at setting B.
The average evaluates a circuit setting across many samples.
03 / Learning from results · 3.2 / Prediction
Which tested setting has the highest average score?
| Setting | Score 0 count | Score 1 count | Score 2 count | Average score |
|---|---|---|---|---|
| A | 20 | 40 | 20 | 1.00 |
| B | 10 | 20 | 50 | 1.50 |
| C | 50 | 20 | 10 | 0.50 |
B has the highest observed average.
C performs worse than A. A change of settings need not improve the result.
80 fresh shots per setting · Illustrative counts.
C uses a = 0.50, b = 0.375; the graph and one-layer circuit pattern stay fixed.
03 / Learning from results · 3.2
The classical search uses scores to propose further settings.
We retain the best observed setting while exploring further choices.
One option is a coarse grid of settings, followed by a closer search around the best observed pair.
03 / Learning from results · 3.3
The output is a candidate, with its own score.
Used to compare settings
Observed average at B
1.50
One number summarizing a batch of samples.
A possible result after tuning
010Candidate score: 2
We sample with the chosen settings, score the candidates and keep a good result.
The average guides tuning. The bit string describes the solution.
03 / Learning from results · 3.3 / Prediction
Does the better setting always give an optimal cut?
Setting B · Ideal probabilities
No. A score of 0 or 1 still has total probability 37.5%.
Every returned candidate can be scored classically.
For this tiny graph we can verify the optimum by inspection. In general, a good candidate does not certify global optimality.
03 / Learning from results · 3.4
Short circuits can still require many executions.
Setting A
80
fresh circuit runs
Setting B
80
fresh circuit runs
Setting C
80
fresh circuit runs
Depth describes one run. Shots and trials determine how often we run it.
More layers add settings and circuit depth. Noise limits how many layers we can use reliably.
03 / Learning from results · 3.4
A useful comparison includes solution quality and total work.
Our graph is easy to solve directly
Assign alternating groups.
Both edges cross: score 2.
For the same problem
How good are the solutions?
How much quantum and classical work produces them?
How does that compare with a suitable classical method?
This example demonstrates the workflow. It does not establish a speedup.
The hybrid approach / QAOA / Learning from results
We can search for good solutions by combining short quantum circuits with classical feedback.
01Classical feedback lets us search using circuits of limited depth.
02QAOA turns a scoring problem into an adjustable quantum circuit.
03Measured scores guide the search for better circuit settings.
Practice / The same graph and scoring rule
Which setting would we retain from these results?
| Setting | Score 0 count | Score 1 count | Score 2 count |
|---|---|---|---|
| D | 20 | 20 | 40 |
| E | 40 | 20 | 20 |
01What is the average score for each setting?
02Which setting has the better observed average?
03Would one more shot necessarily return a score-2 candidate?
80 fresh shots per setting · Supplied illustrative sample data.
Average score = total score / number of shots.