OQCL   HomeStart Here7 SessionsTextbookProjectsQUEST LabSubmitUse CasesInstructor GuideReferences

Instructor Guide › 7 Sessions › Teacher notes

1234567

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)

If you have 20 minutes

MinutesWhat to do
0–3Ask the exit question below cold, and take a show of hands. Do not give the answer yet.
3–10Board: the worked example from the student page, with students supplying each step.
10–16Live demo: run the second experiment. Collect predictions first, then run it.
16–20Return to the exit question, settle it, and assign the project.

If you have a full 75-minute class

MinutesActivity
0–10Motivating question and show of hands.
10–30The three points below, with the mathematics on the board.
30–45Worked example at the board, students supplying steps.
45–55Misconceptions: put each “common mistake” to the class as a true/false statement.
55–65Live demo of both experiments, predictions first.
65–75Project briefing and exit question.

Three points to make

  1. Expectation value from counts: P(0) − P(1) on the board.
  2. The hybrid loop: quantum estimates, classical decides.
  3. 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⟩.

  1. P(0) = cos²(θ/2) and P(1) = sin²(θ/2).
  2. Z gives +1 for outcome 0 and −1 for outcome 1, so ⟨Z⟩ = P(0) − P(1) = cos²(θ/2) − sin²(θ/2) = cos θ.
  3. Suppose 1,000 shots give 250 zeros and 750 ones. Then ⟨Z⟩ ≈ 0.25 − 0.75 = −0.5.
  4. 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

Discussion prompts

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.

← Notes for Session 5Student pageNotes for Session 7 →