Lecture 7 - System Dynamics, Simulation, and Polynomial Functions
Chapter map
- 1. Quantum Finite-State Automaton: system dynamics, DFA → PFA → QFA, Szegedy's algorithm (quantum walk), quantum lattice, PennyLane code, Exercise 7.1
- 2. Quantum System (Hamiltonian matrix): simulation, Hamiltonian , Pauli decomposition (Final Q6), commutator, BCH, Trotter–Suzuki, qubitization, Exercises 7.2–7.4
- 3. Polynomial Functions: QSP, GQSP, QSVT, Exercise 7.5 (skipped in class)
- 4. HHL Algorithm: linear equation systems, Hermitian embedding / block encoding, HHL, Exercise 7.6 (skipped in class)
- 5. Conclusion + Target Learning Outcomes
- Final exam from this chapter: Q6 [Hamiltonian Matrix]: slides 19–23. Manually compute the Hamiltonian matrix of a single-qubit operator. This is one of only two computation questions on the final.
- In class he said he would only cover the first two topics (QFA + Hamiltonian). Qubitization, polynomial functions and HHL are not in the final (Nov 10).
- See also Final - Instructor Hints
Related
- Builds on: Lecture 1 - Complex Algebra, Lecture 1 - Complex Algebra, Lecture 1 - Complex Algebra, Trick for checking Hermitian Matrix
- Why we need the Hamiltonian: QPE needs → Lecture 6 - Searching and Cryptography
- Next: Lecture 8 - Quantum Artificial Intelligence (the "configurable sausage machine" idea returns as VQA)
Quantum Computing: Chapter 07: System Dynamics, Simulation, and Polynomial Functions
- Prachya Boonkwan (P' Arm), SIIT, Thammasat University
- Version: January 15, 2026 · License: CC-BY-NC 4.0
Who? Me?
- Nickname: Arm (P'/N' Arm, etc.)
- Born: Aug 1981
- Work
- Researcher at NECTEC 2005–2024
- Lecturer at SIIT, Thammasat University 2025–now
- Education
- B.Eng & M.Eng in Computer Engineering, Kasetsart University, Thailand
- Ministry of Science and Technology Scholarship of Thailand (early 2008)
- PhD in Informatics (AI & Computational Linguistics), University of Edinburgh, UK (2008–2013)
Table of Contents
- Quantum Finite-State Automaton
- Quantum System
- Polynomial Functions
- HHL Algorithm
- Conclusion
📝 Instructor's annotation: next to "2. Quantum System" he wrote ": Hamiltonian matrix" and underlined it in red. This is the part that matters for the final.
🎙️ In class (Nov 10, 12:10): "For this class we will study only the first two topics. That will be more than enough. The rest is for non-linear simulation, we don't care about it." He also said the Hamiltonian matrix "can be computed by hand, and it's quite easy too."
1. Quantum Finite-State Automaton
System Dynamics

- A complex system is a system made of multiple elements that interact with one another
- System dynamics is a mathematical model that represents the non-linear behavior of a complex system over time, in terms of state transitions
- There are two types of system dynamics:
- deterministic
- probabilistic
- Simulating system dynamics helps us understand how the system behaves in the long run
- Figure 1: Vending machine (six states: Start, Idle, Wait for coins, Dispense item, Dispense change, Stop)
- The start state is marked with a triangle; each final state has double circles
- A state transition happens when there is an input stimulus at a particular state
- E.g. the machine moves from Idle to Wait for coins when the customer selects an item
- Transitions: Start →(Power on)→ Idle →(Select item)→ Wait for coins (loops on "Deposit coin or Reselect item") →(Coin ≥ item cost)→ Dispense item →(Pick up item)→ Dispense change →(Pick up change)→ Idle; Wait for coins →(Cancel)→ Dispense change; Idle →(Power off)→ Stop
📝 Instructor's annotation: the input arrows (Power on, Select item) are labeled "interaction with the environment". The states (Wait for coins, Dispense item) are labeled "action to the environment".
🎙️ In class (Nov 10, 14:39): a state machine where each state also performs an action on the environment is called a Moore machine, which is a finite-state automaton plus state actions. The vending machine downstairs works exactly like this.
💡 Analogy: a 7-Eleven coffee machine. Pressing buttons and inserting coins are inputs from you. Pouring and giving change are actions back to you. The "state" is what screen it's showing.
Deterministic Finite-State Automaton

- A finite-state automaton (FSA) describes system dynamics over a finite set of possible internal configurations
- A Deterministic FSA (DFA) is a quintuple :
- = finite set of states
- = alphabet (set of input symbols)
- = the start state
- = the set of final states
- = transition function: takes the current state and an input symbol and returns the next state
- Derivation (one step):
- Time evolution of an input sequence is a derivation
- where and
- Acceptance: and
- Figure 2: a 4-state DFA () over ; the start state has a triangle, the final state () has double circles
📝 Instructor's annotation: is labeled "the start state" and is labeled "a final state".
🎙️ In class (Nov 10, 17:41 / 21:23): "Determinism means you have all cases of the if-clause covered. You consume one symbol and you know exactly where to go, no hesitation." is a function, so it gives exactly one output. Recall: a function allows one-to-one and many-to-one mappings. A relation also allows one-to-many and many-to-many.
🎙️ In class (Nov 10, 25:46): "In TOC we didn't use this term. We call it time evolution": state derivation one symbol at a time. We call it that because we are now running a simulation. Deterministic → one input string gives exactly one path.
💡 Analogy: a BTS route with no transfers. If you know the station and the direction you take, the next station is fixed.
Probabilistic Finite-State Automaton

- A Probabilistic FSA (PFA) is a quintuple :
- are the same as in the DFA
- is a conditional probability over the next states, given a current state and an input symbol:
- Probability of time evolution:
- where and
- Example: transition from state with input symbols 0 and 1:
- , (highlighted yellow)
- , (highlighted red)
- Each (state, symbol) row sums to 1
- Figure 3: the PFA with every edge labeled by symbol (probability)
📝 Instructor's annotation: he highlighted the edges on the diagram, "0 (0.6)" and "0 (0.4)" in yellow and "1 (0.3)" and "1 (0.7)" in red, to match the four values.
🎙️ In class (Nov 10, 30:32): read as "P of B if A". is the premise (condition) and is the consequence: . For three steps: .
❓ Why do we need a PFA? Nature is not deterministic. The same input string can follow many paths (e.g. weather cycles). The only change from a DFA is that the transition function becomes a conditional probability (Nov 10, 28:12).
💡 Analogy: a Bangkok taxi driver. Same destination (input), but which road he takes is "60% expressway, 40% Rama 4". You only know the odds.
Quantum Finite-State Automaton
- A Quantum FSA (QFA) is a quintuple :
- = a Hilbert space of dimensions
- = alphabet
- = a start quantum state
- = a projector matrix of final states
- = a function giving one quantum operator per input symbol, used for probabilistic state transition
- Derivation: is a probability distribution over the next states:
- Time evolution:
- where is the quantum equivalent of the start state :
- Acceptance:
📝 Instructor's annotation: next to he wrote "Each is a quantum operator". Under he wrote "start state".
🎙️ In class (Nov 10, 47:13–49:31): the initial state has two parts: the start state, and a uniform superposition (average) of all possible next states, which is . For acceptance you need a projector (X, Y or Z). "In most cases we choose to be Z", because you just want the expectation over all possible final states.
❓ Why does the state carry a "next state" register too? Every quantum operator must be unitary, so it can't simply overwrite the current state the way a classical machine does. Storing the pair (current, next) gives the walk operator room to stay reversible.
Related
- Expectation with a projector: Lecture 4 - Computation, Measurement, and Dynamic Circuits (Final Q1)
Szegedy's Algorithm

- Conversion from PFA to QFA: for every input symbol , convert each state into its quantum equivalent:
- Compute the diffusion matrix for each input symbol :
- Then compute the reflection matrix:
- The quantum walk operator is
- Figure 4: a quantum walk is a sequence of reflections about the axis plus axis rotation via swapping. Together they imitate the state transition from to by symbol
📝 Instructor's annotation:
- On the title: "In practice, and may be multi-qubit. E.g. "
- Over : "a superposition of all state transitions from with "
- = current state, = next state, and the square root is
🎙️ In class (Nov 10, 55:15): "This is a square root of the conditional probability. You need the square root." It's an amplitude, so squaring it on measurement gives the probability back.
🎙️ In class (Nov 10, 56:20): geometric picture: "You are at state . If the input symbol is , use as a mirror and compute the reflection of across it. That's the next state . The more input symbols, you do the mirror over and over again." is a Householder reflection (Chapter 3). Then swap bra and ket () to finish.
❓ Why the square root? Quantum states store amplitudes, and . If you take , then measuring gives back exactly .
❓ Why can't we use the Markov matrix directly as ? (Exercise 7.1 Q4.) A Markov matrix has columns that sum to 1 (L1-norm). A quantum operator must be unitary (, so the L2-norm is preserved). In general is not unitary. Szegedy builds a reflection , which is always unitary and Hermitian, because is a projector.
❓ Why a reflection? A reflection is the simplest unitary that "pulls" a state toward the subspace spanned by the allowed transitions . The diffusion matrix defines the mirror (the subspace of legal transitions for symbol ). is the mirror. SWAP turns "where I came from" into "where I am now".
💡 Analogy: a kaleidoscope. Each input symbol is a mirror, and every time light (your state) bounces off a mirror it ends up somewhere new. Feed in the symbols "a, a, b" and you get three bounces in a row.
Related
- Reflection / Householder: Lecture 1 - Complex Algebra
Szegedy's Algorithm (cont'd): Example

Example: Convert the PFA in Fig 5 to QFA
- Markov matrices for each input symbol (column = current state, row = next state; each column sums to 1):
-
Figure 5 (Simple PFA): : a (9/25), b (16/25). : a (16/25), b (9/25). : a (3/4), b (1/4). : a (1/4), b (3/4)
-
Let's construct the unitary operators.
-
Step 1: convert each state to its quantum equivalent (state , ):
-
As printed on the slide (and as he did it in class: "take the first row of , square-root it"):
- ⚠️ Careful: using rows gives states that are not normalized, e.g. . The formula with "each column sums to 1" gives normalized states: , . He said Szegedy will not be computed in the exam, so just know the idea: square-root the transition probabilities and put them on .
- Steps 2–4 below copy the slide's numbers (which follow the row version).
📝 Instructor's annotation: under each ket he labeled the pair, e.g. , , , . He rewrote the formula as with the note "twice the size of ".
🎙️ In class (Nov 10 pt 2, 1:00–4:33): "For each column they sum to one." "You're at : the first half of the ket is fixed to 0. From with you have two choices: back to or to . Take the probability and square-root it, and put it right there. Take each one, square-root, put it there. That's easy."
Step 2: Diffusion matrices
📝 Instructor's annotation:
🎙️ In class (Nov 10 pt 2, 4:41–5:30): "Compute the ket, compute the bra, and then sum them. Keep it that way. You don't have to expand the term."
Step 3: Reflection matrices
📝 Instructor's annotation:
Step 4: Transition (walk) operators
- : every becomes
📝 Instructor's annotation:
🎙️ In class (Nov 10 pt 2, 5:48 and 8:26), exam hint: "Are you going to make me compute that by hand? No. I'm asking why questions instead, like: why do we need a reflection? What does it mean to do a state transition by reflection? You just have to understand the concept." And: "I'm not going to make you compute . No actual computation at this point."
From Paths to Quantum Lattice

- In each quantum walk, all next states are explored in parallel. This gradually produces a quantum lattice that enumerates all possible paths in its structure
- Because of quantum nature, we cannot assign a definite probability to unobserved paths
- A path gets a probability only when it is observed with measurement
- We run a simulation to observe the state in each quantum walk
- Figure 6 (Quantum lattice): start , then layers fully connected between states
- Figure 7 (QFA circuit): registers , ( qubits each), then registers . After each , a CNOT copies the state into the -th register, which is measured as
📝 Instructor's annotation: the lattice start is , with a green arrow showing time direction. Under the circuit he wrote the measured outputs as (expectation on Z for each step).
🎙️ In class (Nov 10 pt 2, 6:48–8:15): "As you apply each quantum operator, you also mirror it with the CNOT, and you can measure the expectation for each step. That's how you get the most probable state sequence." This is the quantum Viterbi algorithm: classical Viterbi for an HMM is , and the quantum version is .
❓ Why does a quantum walk create a lattice? (Exercise 7.1 Q6.) Each maps a state to a superposition of every possible next state. Applying of them spreads amplitude over every path at once, like a lattice (grid) of all routes. Nothing is "chosen" until you measure.
💡 Analogy: pouring water into a pachinko board. The water goes down every channel at once, and you only see "which hole" when you look at the bottom.
Quantum Finite-State Automaton in PennyLane
no_states = 2
markov = { 'a': [ (0, 0, 9/25), (0, 1, 16/25), (1, 1, 3/4), (1, 0, 1/4) ],
'b': [ (0, 0, 16/25), (0, 1, 9/25), (1, 1, 1/4), (1, 0, 3/4) ] }
input_seq = ['a', 'a', 'b', 'a', 'b', 'b']
no_qubits_per_state = int(np.ceil(np.log2(no_states)))
state_qubits = list(range(0, no_qubits_per_state))
trans_qubits = list(range(no_qubits_per_state,
no_qubits_per_state * (len(input_seq) + 1)))
dev = qml.device('default.qubit', wires = state_qubits + trans_qubits)
def markov_to_unitary(markov, no_states):
unitary_tbl = {}
for symbol in markov:
mat = np.zeros((no_states, no_states), dtype=np.complex128)
for (i, j, prob) in markov[symbol]:
mat[j, i] = prob
unitary_tbl[symbol] = 2 * mat - np.eye(no_states)
return unitary_tblQuantum Finite-State Automaton in PennyLane (cont'd)
@qml.qnode(dev, shots=1000)
def evolution_circuit():
unitary_tbl = markov_to_unitary(markov, 2)
for i, symbol in enumerate(input_seq):
qml.QubitUnitary(unitary_tbl[symbol], wires=state_qubits)
for j in range(no_qubits_per_state):
qml.CNOT(wires=[j, (i + 1) * no_qubits_per_state + j])
return qml.counts(wires=trans_qubits)
evolution_circuit()
# Expected result:
# State transitions : Counts
# { '001010' : 150,
# '001101' : 425,
# '010010' : 150,
# '010101' : 12.5,
# '101010' : 12.5,
# '101101' : 50,
# '110010' : 150,
# '110101' : 50 }- Each output bit-string is one state path ; the count shows how likely that path is
- The
2 * mat - np.eye(...)line is the "" reflection idea
Exercise 7.1: Quantum Finite-State Automaton

- Convert this PFA (Figure 8: 4 states , each edge labeled with 0 (p) and 1 (p)) to Markov matrices and an equivalent QFA via Szegedy's Algorithm
- Discuss the differences between deterministic FSA and probabilistic FSA
- What are the key differences between probabilistic FSA and quantum FSA?
- Explain why we cannot directly use the Markov matrices of PFA as a quantum operator of QFA
- In Szegedy's Algorithm, what are the roles of the diffusion matrix and the reflection matrix ?
- Explain why quantum walks create a quantum lattice
- Short answer guide (the "why" questions are the exam style):
- Q2: DFA uses a transition function (one next state, one path per input). PFA uses a conditional probability (many next states, many paths, each with a probability)
- Q3: PFA keeps probabilities (real, non-negative, sum to 1) and follows one path at a time when simulated. QFA keeps amplitudes (complex, squared magnitudes sum to 1), evolves all paths in superposition with unitary operators, paths can interfere, and probabilities appear only on measurement
- Q4: is column-stochastic, not unitary (does not preserve the L2-norm and is generally not reversible)
- Q5: = projector onto the subspace of legal transitions for symbol (it defines the mirror). = reflection about that subspace, a unitary that performs the move
- Q6: see the "Why" box above
2. Quantum System {Exam Q6}
Final Q6 — Hamiltonian Matrix (slides 19–23)
- "Manually compute the Hamiltonian matrix of a single-qubit quantum operator."
- You will be given a 2×2 matrix (maybe not Hermitian) and asked to convert it into its Hamiltonian, exactly like the slide 22–23 example.
- One of only two computation questions on the final. Use the step-by-step recipe below.
- "My heart isn't made of wood. You would have one qubit", so no 4×4 (Nov 10).
- See Final - Instructor Hints
Simulation of System Dynamics {Exam Q6}

- Simulation = a representation of a system's trajectory (path of actions) by means of a model
- In deterministic simulation, the trajectory is dictated by a deterministic model, so there is only one next state given the current state and input stimulus
- In stochastic simulation, each state transition is dictated by a probability distribution given the current state and input stimulus
- In quantum simulation, each state transition is dictated by a quantum operator, resulting in a state lattice
- Challenge: quantum simulation is computationally expensive due to iterative matrix multiplications
- Solution: we can reduce the quantum walk operator into a special form called the Hamiltonian , so that matrix multiplication becomes simple addition
- Figure 9 (Trotter–Suzuki decomposition): the product becomes a sum of the two Hamiltonians
🎙️ In class (Nov 10 pt 2, 9:37–12:09): "What if you want to apply this quantum operator 10,000 times? In the simulator you'd do matrix multiplication 10,000 times. That's time-consuming. Can we speed it up?" Recall QPE needs ("rotate the electric fan many times"). "Can we convert it to some form, multiply by 10,000, and convert it back? Yes. This step is called the Hamiltonian matrix."
🎙️ In class (Nov 3, 29:41–31:40): "We can transform any quantum algorithm into its energy form. H is called the Hamiltonian of U. We can do that by hand as well, which means I'm going to make you do it." For you just multiply into the Hamiltonian: .
❓ Why does the Hamiltonian turn multiplication into addition? Same reason as for numbers. If , then . One scalar multiplication replaces matrix multiplications. For two different operators it works only approximately, because matrices don't commute (that is what Trotter–Suzuki fixes).
💡 Analogy: logarithm tables before calculators. To multiply big numbers, convert them to logs, add, then convert back. The Hamiltonian is the "log" of a quantum operator.
Quantum System and Hamiltonian {Exam Q6}
- A quantum system is a QFA that describes the system dynamics via time evolution on the Hilbert space (complex vectors)
- Time evolution:
- For a QFA with a large set of states, each becomes very large, which makes sequential multiplication intractable
- Imitating , we can rewrite
- We call the Hamiltonian of
- Time evolution can then be rewritten as
- Recall that matrix multiplication is non-commutative:
- Therefore, if , then
- because
- Later, we can still estimate the product from the Hamiltonians
📝 Instructor's annotation:
- Under "We call the Hamiltonian of " he added: "where is Hermitian ()"
- On the "Therefore" line he added "If then"
🎙️ In class (Nov 10 pt 2, 17:08–17:56): "We can convert only some quantum operators to this form, not all. The condition is that the operator must be Hermitian, . What if it's not Hermitian? We can still do it, but it's going to be an approximation."
🎙️ In class (Nov 10 pt 2, 18:25–19:38): "You're so tempted to add them, but can we? Matrix multiplication is non-commutative. If are not the same, you can't just add them. You have to make sure each is actually the same one."
❓ Why can we add the exponents only when the operators are the same (or commute)? holds only if . A matrix always commutes with itself, so is exact. For different operators the error is governed by the commutator (slides 25–26).
❓ Why ""? A single wave with angular frequency evolves as . A quantum operator is "many waves at once": each eigenvector rotates with its own frequency. is the matrix of those frequencies (energies). That's why he calls it the "energy form".
Conversion to Hamiltonian by Pauli Decomposition {Exam Q6}
- Step 1: if a quantum operator is Hermitian, let . Otherwise, we have to approximate its Hermitian:
- Step 2: enumerate all possible Pauli axes from , where is the number of qubits. E.g. a two-qubit operator has Pauli axes:
- Tip:
- Step 3: compute the coefficient for each Pauli axis :
- Step 4: the Hamiltonian of is an LCU (linear combination of unitaries):
- These steps can be computed by
qml.pauli_decompose(mat, wire_order=...), where the wire order specifies the input wires
📝 Instructor's annotation: he corrected the slide typo "Hermition" → Hermitian, and circled "appproximate" (typo, should be approximate).
🎙️ In class (Nov 10 pt 2, 22:46–24:52): "First you need to check whether A is Hermitian. Do you still remember how? The diagonal is real; across the diagonal is conjugate." If not, "just add and and average. We can guarantee the output will be Hermitian."
🎙️ In class (Nov 10 pt 2, 23:12), exam hint: "Why do I mention that? Because I'm going to make you do it in the exam. You'll be given a matrix like this and then convert it into its Hamiltonian. I'm telling you what's going to show up in the final."
🎙️ In class (Nov 10 pt 2, 28:58): count qubits from the size: → 1 qubit, → 2 qubits, → 3 qubits ().
🎙️ In class (Nov 10 pt 2, 32:02): "If you look at the source code of PennyLane, you'll see the same method."
❓ Why make it Hermitian first? The Pauli matrices are all Hermitian, and any real combination of them is Hermitian. So a real Pauli LCU can only represent a Hermitian matrix. is the closest Hermitian matrix to (it keeps the "Hermitian half" and throws away the anti-Hermitian half ). That's why it's only an approximation when isn't Hermitian.
❓ Why does the trace give the coefficient? The Pauli matrices are orthogonal under the trace inner product: if , else . So multiplying by and taking the trace filters out every component except the one, the same way picks the -th coordinate of a vector.
❓ Why a "linear combination of unitaries"? Each Pauli string is a unitary that is easy to run on hardware. Writing as a sum of them lets us later simulate piece by piece (trotterization) or block-encode it (qubitization).
💡 Analogy: a sound equalizer. Any sound (your matrix) can be split into 4 "bands" (I, X, Y, Z). The trace is the meter that reads how loud each band is. The Hamiltonian is the list of slider positions.
Related
- Checking Hermitian: Trick for checking Hermitian Matrix, Lecture 1 - Complex Algebra
- Tensor product (for multi-qubit Pauli axes): Lecture 2 - Quantum Logic Gates
- Pauli X/Y/Z matrices: Lecture 3 - Quantum Algorithm and State Preparation
Conversion to Hamiltonian by Pauli Decomposition (cont'd) {Exam Q6}

Example: Compute the Hamiltonian of (slides 22–23)
- Step 1: convert into its Hermitian matrix
- Check: diagonal is real ✓. Off-diagonal vs are not conjugates ✗, so not Hermitian
- (transpose, then conjugate)
- Step 2: enumerate all Pauli axes ( → axes)
- Step 3: compute each coefficient (you only need the diagonal of : row 1 · column 1 + row 2 · column 2)
- : row 1 · col 1 , and row 2 · col 2
- ⚠️ The slide prints "". That is a sign slip: , not . Verified with numpy: . Don't copy the 0
- Step 4: the Hamiltonian of
- As printed on slide 23 (with ):
- Corrected (with ):
- Sanity check: the result is Hermitian (real diagonal, conjugate off-diagonal) ✓, and it equals exactly (see the normalization note below) ✓
📝 Instructor's annotation (slide 22): his "trick" is colour highlighting. For each he highlighted row 1 of with column 1 of (yellow) and row 2 of with column 2 of (green). Then he wrote the two dot products as yellow + green: , , , .
🎙️ In class (Nov 10 pt 2, 29:40–31:14), the trick: "Instead of doing the actual multiplication, let me show you my trick. You don't have to compute the full matrix multiplication. Look at the row and the column and dot them. First row first column, second row second column. That's how you extract the trace."
🎙️ In class (Nov 10 pt 2, 43:43): "Your Hamiltonian: look at that, each element may be larger than one, and it's okay, because it's the argument of cis. These are phases."
🎙️ In class (Nov 10 pt 2, 44:17): "Once you have extracted the Hamiltonian, that's all for the final."
Step-by-step recipe for Final Q6 (single qubit) — Method A (the slide method)
- Step 0: Read the size. → qubit → 4 Pauli axes
- Step 1: Hermitian check (write it out, it earns marks)
- Diagonal entries real?
- Mirror entries conjugate ()?
- If both are yes: , and write "U is Hermitian, so the Hamiltonian is exact"
- If not: (swap off-diagonals, then flip every sign), and . Write "U is not Hermitian, so this is an approximation"
- Shortcut for :
- Step 2: list the Pauli axes (copy I, X, Y, Z from above)
- Step 3: coefficients via the diagonal-only trick. Let ( real):
- Where these come from: , ,
- Check: all four must be real. If you get an left over, you made an arithmetic slip (most often in )
- Extra shortcut (verified): , so you can use the original and keep the real part
- Step 4: assemble. , then write it as a matrix:
- Step 5: verify. must be Hermitian (real diagonal, conjugate off-diagonal). With the slide formula it must equal for one qubit. If it doesn't, recheck
Normalization: what the slide formula gives vs what PennyLane gives
- Pauli axes satisfy . So the textbook decomposition is , and then exactly. This is what
qml.pauli_decomposereturns. - The slide formula (no ) gives , i.e. for one qubit.
- Example A, normalized:
- For the exam: follow the slide formula (it's what he demonstrated and grades from). Optionally add one line: "with PennyLane's normalization, ."
Deeper: the "true" Hamiltonian (Method B: eigen-decomposition)
- The definition literally means . Slide 28 writes exactly this: "If …"
- The Pauli-decomposition recipe above gives the Pauli LCU of the Hermitian part of . It is what the slides call "the Hamiltonian" and what Q6 asks for. In general . For example, Pauli decomposition of gives (or normalized), but
- If a question explicitly asks for such that (the physics meaning), use this method. It also works as a cross-check and helps you answer "why" questions
- Recipe (single qubit, unitary):
- B1. Check unitary: . A true Hamiltonian exists only for unitary , and then the eigenvalues satisfy
- B2. Eigen-decompose: solve , find orthonormal eigenvectors, and write
- B3. Logarithm of each eigenvalue: , so
- B4. Branch choice: is only defined up to . Use the principal branch unless told otherwise. Any gives another valid Hamiltonian (Hamiltonians are not unique)
- B5. Time : if for evolution time (units with ; the slides use ), then
- B6. Check Hermitian: the eigenvalues are real and the eigenvectors are orthonormal, so ✓. Then check by plugging eigenvalues back in
- B7. (Optional) Pauli-decompose this (normalized ) to write it as an LCU
Worked example (Method B): ,
- Unitary ✓ (also Hermitian)
- Eigen-pairs: with , with
- Logs: , (principal branch)
- Check: ✓ (verified with scipy
expm) - Other branch (): , which also gives ✓. The two differ only by a global phase term ( shift) in the coefficient
- General rule (verified for X, Y, Z, Hadamard): any Hermitian unitary (eigenvalues ) has
Worked example (Method B): phase gate
- Already diagonal: (), ()
- (verified)
- Same pattern for : (verified)
Worked example (Method B): rotation with time, produced by evolving for
- ; eigenvalues on , so
- (verified)
- Units: is "phase per unit time" (an angular frequency / energy with ). Doubling halves
- Link to simulation: , e.g. ✓ (verified)
❓ Why can the Hamiltonian have entries bigger than 1? is unitary, so its entries are at most 1 in size. holds angles/frequencies (arguments of cis), which can be any real number. That's why is fine (Nov 10, 43:43).
❓ Why must be Hermitian? Hermitian means real eigenvalues (real energies/phases). Then has eigenvalues on the unit circle, so it is unitary (probability-preserving). A non-Hermitian would make amplitudes grow or shrink.
❓ Why is the Hamiltonian not unique? , so each eigenvalue's logarithm has infinitely many branches. Every branch choice gives a valid . The principal branch is the usual convention.
Exercise 7.2: Hamiltonian Matrix

- Convert the following matrices to Hamiltonians. Note that some of them are not Hermitian.
- for any
📝 Instructor's annotation: he wrote "End" with a big slash on this slide. In class he stopped the computational material here: "that's all for the final" (Nov 10, 44:17).
- Worked solutions (slide formula ; normalized in brackets; all checked with numpy):
- : Hermitian ✓. , others 0 → []
- : Hermitian ✓. → []
- : Hermitian ✓. → []
- : Hermitian ✓. → []
- : diagonal real ✓, but vs are not conjugates ✗
- ,
- []
- (2 qubits, 16 axes): only → []
- CNOT: Hermitian ✓. , so , → []
- : Hermitian ✓. → []
- (, axes, only one nonzero): → []
- : not Hermitian (unless )
- , →
- ⚠️ The Hermitian approximation threw away all the rotation information (the part sits in the anti-Hermitian half). The true Hamiltonian (Method B) is (principal branch, ; verified). This is a good "why is non-Hermitian only an approximation" example
- Patterns to remember:
- For any Pauli string on qubits, the slide formula gives , because and
- A tensor product of Paulis is itself one Pauli axis, so only one coefficient is nonzero (use the Tip )
🎙️ In class (Nov 10 pt 2, 34:58–42:29), multi-qubit: enumerate the Pauli axes as tensor products, of them (2 qubits → 16, 3 qubits → 64). , , … , . Tensor product recap: . "It's exponential, . My heart isn't made of wood. You would have one qubit. Not 20. , you don't have enough time even for your lifetime."
Commutator
- The commutator of two matrices and is their positional discrepancy:
- and are commutative if and only if (no discrepancy)
- Repetitive commutator: apply pairs of and then pairs of on matrix :
- Example: both operands are non-commutative
- Their positional discrepancy:
- If , then
💡 Analogy: putting on socks then shoes ≠ shoes then socks. The commutator measures "how different the result is when you swap the order".
Baker–Campbell–Hausdorff Expansion
- Swapping the order of applying and also gives different results
- Denote one combination of applying and by
- where represents one combination of applying times of and times of , with each
- Baker–Campbell–Hausdorff expansion: the commutator is the foundation for approximating
- where is the set of all possible tuples with each
- In practice we set a limit for the granularity . The more granularity, the closer the approximation
- Leading terms (standard result, for intuition):
🎙️ In class (Nov 10 pt 2, 44:28): "Let's forget this math. If you're interested you can take a look, but that's deep math. We're not looking at that." (Skipped.)
❓ Why does BCH matter? It says exactly how wrong "just add the Hamiltonians" is. The error starts with , so if the operators commute, the error is zero.
Exercise 7.3: Commutator
- Show that is an additive inverse of
- Show that if is Hermitian, then
- ⇒
- Let and be non-Hermitian matrices. Discuss why reflects positional discrepancy between and
- Suppose two non-Hermitian matrices and are converted to their Hamiltonians and . Explain why
- Let and be non-Hermitian matrices with approximate Hamiltonians and . Show that
- where is an error-term matrix
Trotter–Suzuki Decomposition
- If and , then
- where is the error term in the Baker–Campbell–Hausdorff expansion
- Trotter–Suzuki decomposition (a.k.a. trotterization): we can approximate
- Note that the error term depends on the chosen number
- Proof:
- Since for small , we obtain the analogy
- because the Hamiltonians are divided by a very large number
🎙️ In class (Nov 10 pt 2, 15:12): "This is called Trotter–Suzuki decomposition. That's a big word. In the textbook we usually call it trotterization. Not terrorization. Trotterization." (A good line for the video.)
🎙️ In class (Nov 10 pt 2, 49:05): the error is of the reciprocal of . "Reciprocal is a noun, the verb is reciprocate. For example, you take good care of your girlfriend, but she never reciprocates. That hurts, right? I learned this word the hard way."
Trotter–Suzuki Decomposition (cont'd)
- Expand the right-hand side:
- Generalization: if there is only one unitary operator in the time evolution of timesteps, , we can generalize Trotter–Suzuki into
- This formula is useful when the length of the time evolution is predefined, because we can precompute in advance
🎙️ In class (Nov 10 pt 2, 20:48–22:19): he jumped to this slide first: "This is the point of the Hamiltonian. If you've got where is very large, you don't need the actual matrix multiplication. Multiply into the Hamiltonian, divide by , then take the power . Instead of computing , multiply 10,000 into the Hamiltonian."
🎙️ In class (Nov 10 pt 2, 51:01–53:48): small is the degree of granularity (same idea as in QPE). " is supposed to be small, like 2 or 4, because the thing inside cis is a matrix, and you have to multiply it times. Use small to minimize the number of matrix multiplications." Trade-off: "If is too large it takes ages. If it's too small, the approximation may not be accurate." Trotterization is used in QPE, which makes QPE "almost practical", and when QPE becomes practical "you can crack RSA".
❓ Why does the error shrink like ? Slicing into small steps makes each step's cross term tiny. Over steps these add up to . More slices means more accuracy, but also more multiplications.
❓ Why does accuracy get worse for large ? (Exercise 7.4 Q1.) The argument is no longer "small" when , so the approximation breaks. That's the motivation for qubitization.
💡 Analogy: walking diagonally across Siam Paragon's grid of shops. You can't walk "east and north at the same time", but if you alternate tiny east steps and tiny north steps, it looks like a straight diagonal. Smaller steps make a straighter line, but take more steps.
Trotter–Suzuki Decomposition in PennyLane
mat = np.zeros((4, 4), dtype=np.complex128) # Markov matrix
mat[0,0] = -7/25; mat[1,0] = 6 * np.sqrt(3) / 10
mat[2,1] = 6 * np.sqrt(3) / 10; mat[1,1] = 2/4
mat[2,2] = 7/25; mat[3,2] = 8/10
mat[2,3] = 8/10; mat[1,3] = -2/4
dev = qml.device('default.qubit', wires=[0,1])
def make_hamiltonian(opr):
hermitian = 0.5 * (opr + opr.T.conj()) # Enforce Hermitian matrix
hamiltonian = qml.pauli_decompose(hermitian, wire_order=[0,1])
return hamiltonian
@qml.qnode(dev, shots=1000)
def evolution_circuit():
hmlt = make_hamiltonian(mat)
qml.TrotterProduct(hmlt, time=10.0, n=20) # Run for 10 steps with
# granularity degree n = 100
return qml.counts(wires=[0,1])
evolution_circuit()
# Expect result: {'00': 600, '01': 125, '10': 250, '11': 25}
# These are probable final states after 10 steps of time evolutionmake_hamiltonianis exactly Steps 1–4:0.5 * (opr + opr.T.conj())is , andqml.pauli_decomposedoes Steps 2–4 (with the normalization)time=10.0is (timesteps) andn=20is the granularity (the code comment says 100, but the code uses 20)
Qubitization Algorithm
- Limitation: Trotter–Suzuki can approximate , but the accuracy drops for a large number of timesteps
- Qubitization: any non-unitary Hermitian matrix can be converted to a unitary one via block encoding:
- We can estimate by rotating many times with QPE and measuring the distribution of destination states
- Step 1: since is Hermitian, perform Pauli decomposition on it to obtain the LCU , where each is the -th Pauli axis
- Step 2: construct the preparation operator that maps
- where the normalizing constant is
🎙️ In class (Nov 10 pt 2, 54:47): "This is an extension of trotterization. We call it qubitization: a better approximation of with better accuracy, but it's a little more complicated. I'm not going to include it in the final. If you're interested, read the book (PDF on Google Classroom)."
Qubitization Algorithm (cont'd)
- Step 3: construct the selection operator that maps
- Step 4: construct the block encoder
- and apply it to with phase kickback:
- where is perpendicular to
- Step 5: apply QPE to measure the distribution of destination states:
- Step 6: deduce the phase of the Hamiltonian by , where
- Step 7: approximate , and the eigenvalue of is
Qubitization Algorithm (cont'd): Circuit

- Figure 10: qubitization algorithm. Registers: control qubits and an -qubit
- → (controlled for control patterns 00, 01, 10, 11) → → QPE → measure
- PREP + SEL + PREP* together form the block encoder . Each is the -th Pauli axis of
Proof via Jacobi–Anger Expansion
- The Jacobi–Anger expansion explains why we can deduce the eigenvalue from the estimated phase :
- Jacobi–Anger expansion:
- where is the Bessel function of order applied to :
- Because , we can expand it with Jacobi–Anger for matrices:
- Suppose has an eigen-pair and has phase :
- where is the normalizing constant
Qubitization Algorithm in PennyLane
import pennylane as qml
from pennylane import numpy as np
# A unitary matrix
mat = np.zeros((4, 4), dtype=np.complex128)
mat[0,0] = -7/25; mat[1,0] = 6 * np.sqrt(3) / 10
mat[2,1] = 6 * np.sqrt(3) / 10; mat[1,1] = 2/4
mat[2,2] = 7/25; mat[3,2] = 8/10
mat[2,3] = 8/10; mat[1,3] = -2/4
target_wires = ['t0','t1'] # N = input qubits
control_wires = ['c1','c2','c3','c4'] # 2^N wires
estimation_wires = ['e1','e2','e3','e4','e5','e6'] # Granularity
dev = qml.device('default.qubit', wires=target_wires + control_wires + estimation_wires)
def make_hamiltonian(opr):
hermitian = 0.5 * (opr + opr.T.conj())
hamiltonian = qml.pauli_decompose(hermitian, wire_order=target_wires)
return hamiltonianQubitization Algorithm in PennyLane (cont'd)
hmlt = make_hamiltonian(mat) # Convert a unitary matrix to a Hamiltonian
normconst = sum([abs(coeff) for coeff in hmlt.terms()[0]]) # Normalizing constant
print(qml.matrix(hmlt).real) # This is how we print a Hamiltonian out in the matrix form
@qml.qnode(dev)
def evolution_circuit():
qml.QuantumPhaseEstimation(
qml.Qubitization(hmlt, control_wires),
estimation_wires=estimation_wires
)
return qml.probs(wires=estimation_wires)
probs = evolution_circuit()
r = np.argmax(probs)
phase = 2 * np.pi * r / 2 ** len(estimation_wires)
eigval = np.cos(phase) * normconst
print(f'phase = {phase}')
print(f'eigenvalue = {eigval}')
# Expected result:
# phase = 1.7671
# eigenvalue = -0.4096Exercise 7.4: Trotter–Suzuki Decomposition and Qubitization Algorithm
- Consider the general case of trotterization . Explain why the accuracy deteriorates when the number of timesteps becomes large. [Hint: consider for small .]
- Consider the trotterization of . Discuss why the accuracy deteriorates when both matrices are non-Hermitian
- What is the role of block encoding in the qubitization algorithm?
- Explain how the qubitization algorithm addresses simulation over large timesteps by opting for the global phase rotation of the block encoder
- Discuss why we have to choose the right number of estimation wires for the QPE module. What happens when is large? What happens when is small?
- Compare the pros and cons of trotterization and qubitization in terms of speed, space, and programming complexity
- Hints:
- Q1: is small only when . For large the dropped terms are big
- Q2: non-Hermitian → we only use the approximate Hamiltonian (Hermitian part), so there are two error sources: the Hermitian approximation plus the BCH/commutator error
3. Polynomial Functions
🎙️ In class (Nov 10 pt 2, 55:53): he flipped through this section saying "passed… passed". Not covered, not in the final. The sausage-machine idea returns in Lecture 8 (VQA).
Polynomial Functions

- A polynomial function is a mathematical expression consisting of coefficients and exponentiated variables, e.g.
- The coefficients are
- The degree of a polynomial function is the greatest exponent:
- Polynomial functions are fundamental for modeling the non-linear behavior of a complex system, where each variable represents a stimulus
- Figure 11: a polynomial function is sometimes seen as a configurable sausage machine: (stimulus/input) goes in, (observation/output) comes out. The parameters (adjustable settings = the coefficients) are tuned to change the type of sausage it produces
💡 Analogy: a Thai street noodle stall. The broth recipe settings (coefficients) decide what bowl (output) you get from the same noodles (input).
Quantum Signal Processing (QSP)
- Quantum signal processing (QSP) is a technique for computing a polynomial function from an input qubit
- Define the Z-rotation operator
- and a signal rotation operator
- where is a phase parameter and is a diagonal parameter
- We can decompose a time series into a QSP operator made of several components:
- where is the degree, is a set of phase parameters, and is a diagonal parameter
- If we adjust parameters and , we can estimate the original time series
- In function fitting, we optimize and to minimize the prediction loss, e.g. mean squared error (MSE)
QSP as Polynomial Function
- Let . Then
- The degree-2 polynomial is
- Observe that the crossing elements are the conjugate of each other
- Generalization: QSP of degree has a polynomial form once we expand the multiplications:
- where and
- and are polynomial functions with these constraints:
- and
- has parity , and has parity
- (the slide prints )
Polynomial Function of Unitary Operators

- Generalized QSP (GQSP): treat the input signal as a control qubit. The result is a block encoding of :
- PennyLane:
qml.GQSP(opr=U, angles=..., control=...) - Convert the polynomial coefficients into angles with
qml.poly_to_angles(coeffs, 'GQSP') - Figure 12: control qubit with . Between them, a controlled on and a controlled on act on
Quantum Signal Processing in PennyLane
control_wires = ['c']
target_wires = ['t1', 't2', 't3']
dev = qml.device('default.qubit', wires=target_wires + control_wires)
@qml.prod # Make this function an operator argument
def my_opr(wires):
qml.Hadamard(wires=wires[0])
qml.X(wires=wires[2])
qml.CNOT(wires=[wires[0], wires[1]])
qml.CNOT(wires=[wires[0], wires[2]])
@qml.qnode(dev, shots=1000)
def circuit():
coeffs = np.array([0.1, 0.2j, 0.3]) # 0.1 + 0.2j x + 0.3 x^2
phases = qml.poly_to_angles(coeffs, routine='GQSP') # Convert the coefficients to phases
qml.GQSP(my_opr(target_wires), phases, control=control_wires)
return qml.counts(wires=target_wires)
circuit()
# Expected result:
# {'000': 268, '001': 23, '011': 243, '100': 202, '110': 21, '111': 243}Quantum Singular Value Transformation (QSVT)
- Quantum singular value transformation (QSVT) computes a polynomial function of a Hamiltonian
- Suppose , where
- and each is an eigen-pair of
- QSVT transforms , where is a polynomial function, e.g.
- Imitating QSP, we convert to a unitary operator
- Now apply the block encoding to :
- Note: this slide is the "eigen-decomposition" view of a Hamiltonian (), the same idea as Method B in Section 2
Backbone of QSVT
- Observe that
- and has the same form (the slide prints the identical matrix)
- Therefore
- We compose a polynomial function by alternately multiplying and until arriving at :
- where the polynomial of has the coefficient set
Implementation of QSVT

- Figure 13: QSVT circuits. Case 1: even: . Case 2: odd: the last pair is . In both cases the sit on the control qubit
- PennyLane:
qml.QSVT(opr, projectors) - The operator
opris constructed byqml.BlockEncode(U, wires=...) - The projectors are made by converting each phase into a projector-controlled phase gate
qml.PCPhase(θ_k, dim, wires=...)that maps - Note that the projectors can now be generalized beyond RZ
Quantum Singular Value Transformation in PennyLane
target_wires = ['t1','t2']
dev = qml.device('default.qubit', wires=target_wires)
mat = np.array([ [0.7, 0.5],
[0.5, 0.4] ], dtype=np.complex128)
@qml.qnode(dev, shots=1000)
def circuit():
coeffs = np.array([0.1, 0.2, 0.3]) # 0.1 + 0.2j x + 0.3 x^2
block_encoding = qml.BlockEncode(mat, target_wires)
projectors = [ qml.PCPhase(phase, dim=2, wires=target_wires)
for phase in coeffs ]
qml.QSVT(block_encoding, projectors)
return qml.counts(wires=target_wires)
circuit()
# Expected result:
# '00': 957, '01': 19, '10': 20, '11': 4}Exercise 7.5: Polynomial Functions
- What are the differences between quantum signal processing (QSP) and quantum singular value transformation (QSVT)?
- In quantum signal processing, explain why we need both the Z-rotation operator and the signal rotation operator . What do they contribute to the polynomial function?
- Derive . The result should be a degree-3 polynomial function
- Discuss how we can apply QSVT in trotterization
- Show that we can eigen-decompose into eigen-pairs . Show that if , then
- (This is the eigen-decomposition route of Method B in Section 2. Strictly, the eigenvalues of are of the eigenvalues of , while the eigenvectors are shared.)
4. HHL Algorithm
🎙️ Not covered in class (Nov 10) and not in the final. Kept here for completeness.
Linear Equation Systems
- A linear equation system (LES) is a collection of two or more equations involving the same set of variables:
- where each is a coefficient
- An LES can be rewritten in matrix form: , where is the coefficient matrix and we want to solve for
- Three ways to solve an LES:
- Matrix inverse: , but not all matrices are invertible
- Gaussian elimination: solve by hand in time
- Eigen-decomposition: find the dominant eigenvalue of , so that , ,
Solving LES with Quantum Computing
- For speed-up via quantum computing, we want to convert to a Hermitian matrix and to a quantum state
- Hermitian embedding: build a Hermitian matrix (i.e. ) by putting in a Hermitian block:
- Block encoding: we can also construct a polynomial block out of :
- and encode as an amplitude vector
- The LES becomes
- Block encoding is numerically more stable than Hermitian embedding
📝 Instructor's annotation: he underlined "more stable" in green.
Harrow–Hassidim–Lloyd Algorithm (HHL)
- The HHL algorithm solves an LES of equations and variables using QPE
- A Hermitian matrix can be rewritten with eigen-pairs :
- Rewrite and in terms of the eigenvectors:
- Since may not be unitary, convert it with block encoding:
- Step 1: initialize:
- Step 2: extract the eigenvalues:
HHL Algorithm (cont'd)
- Step 3: compute the filter flag of by a conditional rotation on the last qubit, controlled by each qubit of :
- where is the filter flag of and is a normalizing constant:
- Step 4: disentangle the eigenvalues from the input with inverse QPE:
- Step 5: we want . Measure the last qubit, , and post-select only . If , go back to Step 1 and resample
Related
- Post-selection: Lecture 4 - Computation, Measurement, and Dynamic Circuits
HHL Algorithm (cont'd): Result

- Step 6: after some iterations we obtain
- Step 7: for the solution of the LES, measure its first qubits:
- Time complexity of HHL: , where is the number of variables and is the condition number of
- Figure 14: → QPE(U) → (CY rotations onto the flag qubit , controlled by ) → QPE*(U) → post-select flag → read
Implementation of HHL Algorithm in PennyLane
# Linear equation system:
# 2a + 3b - 4c + 5d = 70
# -3a + b + 2c + 0d = 50
# a + 2b + 3c + d = 60
# 2a + 2b + 2c + 3d = 40
mat = np.array([ [ 2, 3, -4, 5],
[-3, 1, 2, 0],
[ 1, 2, 3, 1],
[ 2, 2, 2, 3] ], dtype=np.complex128)
bvec = np.array([70, 50, 60, 40], dtype=np.complex128)
extra_wires = ['x']
target_wires = ['t0','t1']
estimation_wires = ['e1','e2','e3','e4','e5']
check_wires = ['f']
dev = qml.device('default.qubit',
wires=extra_wires + target_wires + estimation_wires + check_wires)
def normalize_les(mat, bvec):
norm_a = np.max(np.linalg.svd(mat)[1])
norm_b = np.linalg.norm(bvec)
return mat / norm_a, bvec / norm_bImplementation of HHL Algorithm in PennyLane (cont'd)
@qml.qnode(dev, shots=1000)
def hhl_circuit(mat, bvec):
mat, bvec = normalize_les(mat, bvec) # Normalize A and b
qml.AmplitudeEmbedding(bvec, wires=target_wires) # Initialize the circuit with b
qml.QuantumPhaseEstimation( # Extract eigenvalues with block encoding
qml.BlockEncode(mat, wires=extra_wires + target_wires),
estimation_wires=estimation_wires # We need an extra qubit for block encoding
)
qml.ControlledSequence( # Compute the filter flag and the
qml.Y(wires=check_wires), # inverse of eigenvalues
control=estimation_wires
)
qml.adjoint(qml.QuantumPhaseEstimation)( # Clean up the qubitization
qml.BlockEncode(mat, wires=extra_wires + target_wires),
estimation_wires=estimation_wires
)
m = qml.measure(wires=check_wires, postselect=1) # Redo if the check flag is 0
return qml.probs(wires=target_wires)
hhl_circuit(mat, bvec)
# Solution is a unit vector for each variable
# Result: [0.0, 0.40, 0.25, 0.35 ] -> a = 0, b = 0.4, c = 0.25, d = 0.35Exercise 7.6: HHL Algorithm
- We learned that one extra qubit is needed for the block encoding. Compare the pros and cons of this against Hermitian embedding
- Suppose we have an LES , and is eigen-decomposed to . Explain why we use QPE in the HHL algorithm and why we can extract the eigenvalues with it
- Discuss why we have to disentangle the eigenvalues from the input using the inverse QPE. What will happen if we don't?
- Consider the filter flag in Step 3, , where is a normalizing constant. Explain why we post-select and ignore
5. Conclusion
Conclusion
- System dynamics is a math model for representing the non-linear behavior of a complex system
- A quantum finite-state automaton represents such non-linear behavior, and its state transition is given by the quantum walk operator
- Quantum simulation of system dynamics yields a path lattice, and we can observe its paths by measurement
- However, quantum simulation is expensive. For short simulation, we trotterize the walk operator to estimate the final results
- For a long simulation, trotterization is inaccurate, so we qubitize the walk operator instead
- One application of simulation is solving a linear equation system (LES), which reduces the time complexity from classical to quantum
📝 Instructor's annotation: "trotterize" and "qubitize" are underlined.
Questions?
Target Learning Outcomes/1
- Quantum Finite-State Automaton (QFA)
- Contrast deterministic, probabilistic, and quantum finite-state automata in terms of their state transitions and mathematical definitions
- Apply Szegedy's Algorithm to convert a Probabilistic Finite-State Automaton (PFA) into its quantum equivalent (QFA) by constructing the necessary diffusion and reflection matrices
- Implement a QFA circuit using PennyLane to simulate state transitions for a given input sequence
- Quantum System Dynamics and Simulation
- Define the Hamiltonian of a quantum walk operator and explain how it simplifies complex matrix multiplications into additions
- Execute the conversion of a quantum operator into a Hamiltonian using the Pauli decomposition method (Linear Combination of Unitaries) ← Final Q6
- Evaluate the trade-offs between Trotter–Suzuki Decomposition for short-term simulations and the Qubitization Algorithm for high-accuracy, long-term simulations
Target Learning Outcomes/2
- Polynomial Functions and Signal Processing
- Explain the role of Quantum Signal Processing (QSP) in computing polynomial functions through signal and rotation operators
- Analyze Quantum Singular Value Transformation (QSVT) as a method to transform a Hamiltonian via a polynomial function
- Construct quantum circuits that implement Generalized QSP (GQSP) and QSVT using block encoding and projector-controlled phase gates
- HHL Algorithm for Linear Systems
- Formulate a Linear Equation System (LES) in a format suitable for quantum computation using Hermitian embedding or block encoding
- Illustrate the step-by-step mechanics of the Harrow–Hassidim–Lloyd (HHL) algorithm, including eigenvalue extraction via QPE, conditional rotation, and post-selection
- Compare the time complexity of classical Gaussian elimination against the quantum HHL algorithm