Instructor Guide › 7 Sessions › Teacher notes
Teacher notes — Session 6: Near-term methods: Hamiltonians and variational circuits
For instructorsFlipped format
The session in one sentence. Variational algorithms tune circuit angles with a classical loop to minimize a measured average.
The student page for Session 6 is written for self-study: students can read, work the example, run both experiments, and check their own answers without you. These notes are for the class time you do have.
Before class (students, on their own)
- Read Chapter 8 and Chapter 9 and Chapter 10.
- Do the worked example and the first experiment on the student page.
- Bring one written prediction and one question.
If you have 20 minutes
| Minutes | What to do |
|---|---|
| 0–3 | Ask the exit question below cold, and take a show of hands. Do not give the answer yet. |
| 3–10 | Board: the worked example from the student page, with students supplying each step. |
| 10–16 | Live demo: run the second experiment. Collect predictions first, then run it. |
| 16–20 | Return to the exit question, settle it, and assign the project. |
If you have a full 75-minute class
| Minutes | Activity |
|---|---|
| 0–10 | Motivating question and show of hands. |
| 10–30 | The three points below, with the mathematics on the board. |
| 30–45 | Worked example at the board, students supplying steps. |
| 45–55 | Misconceptions: put each “common mistake” to the class as a true/false statement. |
| 55–65 | Live demo of both experiments, predictions first. |
| 65–75 | Project briefing and exit question. |
Three points to make
- Expectation value from counts: P(0) − P(1) on the board.
- The hybrid loop: quantum estimates, classical decides.
- Always state the classical baseline next to the quantum result.
Board example
From counts to an expectation value. The state Ry(θ)|0⟩ is cos(θ/2)|0⟩ + sin(θ/2)|1⟩.
- P(0) = cos²(θ/2) and P(1) = sin²(θ/2).
- Z gives +1 for outcome 0 and −1 for outcome 1, so ⟨Z⟩ = P(0) − P(1) = cos²(θ/2) − sin²(θ/2) = cos θ.
- Suppose 1,000 shots give 250 zeros and 750 ones. Then ⟨Z⟩ ≈ 0.25 − 0.75 = −0.5.
- cos θ = −0.5 means θ = 2π/3, or 120°.
This is how an energy is estimated on real hardware: from counts, not from the state itself.
Misconceptions to raise
- Treating a variational result as exact. It is an estimate with sampling error, and the optimizer may stop in a local minimum.
- Skipping the classical baseline. At teaching sizes the exact answer is always available, so compare against it.
- Calling a small successful demonstration “quantum advantage”.
Discussion prompts
- What would count as honest evidence that a variational method is useful?
- Why might an optimizer fail on hardware even when the circuit is correct?
Exit question
Ask: 1,000 shots give 250 zeros and 750 ones. What is ⟨Z⟩?
Looking for: 0.25 − 0.75 = −0.5.
Assign
One project from this session, following the predict → baseline → one extension → analyze routine. Project solutions are deliberately not published on this site.