View on GitHub
Open this notebook in GitHub to run it yourself
Simulating physical and chemical systems was among the original motivations for quantum computing, as first envisioned by Richard Feynman in 1982, and remains one of its most impactful applications. Time-independent Hamiltonian simulation refers to the task of approximately implementing the unitary evolution operator for a Hermitian matrix . When access to the Hamiltonian is provided via block-encoding, this can be realized by applying an appropriate polynomial transformation within a desired precision . Qubitization [1] achieves Hamiltonian simulation by combining the Jacobi–Anger expansion with the Linear Combination of Unitaries (LCU) technique, exploiting the fact that powers of the walk operator directly implement Chebyshev polynomial block-encodings. This approach is entirely constructive- it requires no classical preprocessing for rotation angles, but uses more ancilla qubits (, where is the polynomial degree) than GQSP or QSVT.A block-encoded Hamiltonian refers to its embedding within a larger unitary matrix. Definition: A -encoding of a matrix refers to completing it into a unitary matrix : with functional error . Here is a scaling factor that ensures the overall operator is unitary, is the number of auxiliary (block) qubits, and is the encoding error. This notebook assumes basic knowledge of Linear Combination of Unitaries (LCU) and the PREPARE–SELECT implementation; see the LCU tutorial for background. Given an exact -encoding of the Hamiltonian (denoting ), we define the Szegedy quantum walk operator [2] where reflects about the state of the block variable. The Chebyshev LCU approach presented here relies on the fact that the -th power of walk operator directly implements a Chebyshev polynomial block-encoding of : This means we can implement the Hamiltonian simulation as an LCU over the walk operator powers, using the Jacobi-Anger expansion coefficients (Eqs. (3)–(4)) as the LCU weights: The resulting block-encoding has scaling factor and block size :Complexity: calls to the block-encoding, using auxiliary qubits. No classical angle preprocessing required.
- Input: A Hermitian operator given through a block-encoding unitary with scaling factor , evolution time , and target error .
- Output: A unitary approximating , with .
Keywords: Hamiltonian Simulation, Block Encoding, Qubitization, Chebyshev Polynomials, Walk Operator, LCU, Oracle/Query complexity.
This notebook demonstrates Hamiltonian simulation using the Qubitization (Chebyshev LCU) method.For the other approaches, see the companion notebooks on GQSP and QSVT.For a side-by-side comparison of all three methods, see the table at the end of this notebook.
Preliminaries
Setting a Specific Hamiltonian to Evolve
We set some specific hyperparameters for our problem. We use a simple Hamiltonian given as a sum of Pauli strings, and thelcu_pauli function to block-encode it via the Linear Combination of Unitaries (LCU) technique:
To treat different problems with the same algorithm, simply change theses hyperparameters.
Output:
Output:
Setting Up a Statevector Simulator
Working with block-encoding typically requires post-selection of the block register being at state . The success of this process can be amplified via Oblivious Amplitude Amplification. In this notebook, instead, we use a statevector simulator and project the result. We import two utility functions fromhamiltonian_simulation_utils:
get_projected_state_vector: extracts the post-selected statevector from the execution results.compare_quantum_classical_states: aligns the global phase and computes the overlap with the classically computed reference.
The Jacobi–Anger Expansion
The LCU coefficients for the Chebyshev polynomials come directly from the Jacobi–Anger expansion (Eqs. (3)-(4)). We compute the cosine and sine Chebyshev coefficients and combine them into complex coefficients for .Output:
Output:
The Walk Operator
Note: The current implementation assumes that the block-encoding unitary is also Hermitian. For the non-Hermitian generalization, see the Technical Notes.For the block-encoding of , , we define the Szegedy quantum walk operator, , according to Eq. (1) above.
Verifying the Block-Encoding
As a sanity check before the main algorithm, we verify the Hamiltonian block-encoding: we apply on the initial state and check that the post-selected result matches as expected.Output:

Output:
Implementation
We build an LCU of the unitaries with coefficients . Theselect operator over a series of unitary powers is implemented efficiently: instead of applying multi-controlled operations, we apply single-controlled operations, where the -th control qubit applies (analogous to the QPE circuit structure).

QubitizationBlock, contains the block variable from the Hamiltonian block-encoding, and a block variable on which we apply the PREPARE operation of the LCU to construct the sum of Chebyshev polynomials of .
The data variable follows that of the Hamiltonian encoding.
In addition, we assemble the lcu_cheb function using prepare_select with the efficient select_powered_unitaries as the select operation.
lcu_cheb function on the randomly prepared vector, synthesizes it, executes the resulting quantum program, and verifies the results.
Output:

Output:
References
[1]: Berry, D. W., Childs, A. M., & Kothari, R. Hamiltonian simulation with nearly optimal dependence on all parameters. In Proceedings of the 56th IEEE Symposium on Foundations of Computer Science (FOCS), pp. 792–809 (2015). [2]: Szegedy, M. Quantum speed-up of Markov chain based algorithms. In 45th Annual IEEE Symposium on Foundations of Computer Science, pp. 32–41 (2004). [3]: Lin, L. Lecture notes on quantum algorithms for scientific computation. arXiv:2201.08309 [quant-ph] (2022).Technical Notes
Generalizing to Non-Hermitian Block-Encoding Unitaries
The current implementation assumes that the block-encoding unitary is also Hermitian. This assumption underlies the walk operator’s spectral properties. For a non-Hermitian block-encoding unitary, an analogous walk operator can be defined as , which satisfies equivalent spectral properties. See Section 7.4 in Ref. [3] for details.Comparison with Other Methods
| Method | extra block qubits | Controlled ? | Amplitude amplification? | Classical preprocessing |
|---|---|---|---|---|
| GQSP | 1 | Yes | No | Angle computation |
| QSVT | 2 | No | Yes (for a factor of 2) | Angle computation |
| Qubitization | Yes | Yes (for the sum of Cheb. coefficients) | None |