Skip to main content

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 eiHte^{-iHt} for a Hermitian matrix HH. When access to the Hamiltonian is provided via block-encoding, this can be realized by applying an appropriate polynomial transformation within a desired precision ϵ\epsilon. 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 (O(logd)O(\log d), where dd is the polynomial degree) than GQSP or QSVT.
  • Input: A Hermitian operator HH given through a block-encoding unitary UHU_H with scaling factor αH\alpha \ge \|H\|, evolution time tt, and target error ϵ\epsilon.
  • Output: A unitary UU approximating eiHte^{-iHt}, with UeiHt<ϵ\|U - e^{-iHt}\| < \epsilon.
Complexity: O ⁣(αt+logϵ1log ⁣(e+log(ϵ1)/αt))O\!\left(\alpha t + \frac{\log \epsilon^{-1}}{\log\!\left(e + \log(\epsilon^{-1}) / \alpha t\right)}\right) calls to the block-encoding, using O(logd)O(\log d) auxiliary qubits. No classical angle preprocessing required.
Keywords: Hamiltonian Simulation, Block Encoding, Qubitization, Chebyshev Polynomials, Walk Operator, LCU, Oracle/Query complexity.
A block-encoded Hamiltonian refers to its embedding within a larger unitary matrix. Definition: A (s,m,ϵ)(s, m, \epsilon)-encoding of a 2n×2n2^n\times 2^n matrix AA refers to completing it into a 2n+m×2n+m2^{n+m}\times 2^{n+m} unitary matrix U(s,m,ϵ)AU_{(s,m,\epsilon)-A}: U(s,m,ϵ)A=(A/s),U_{(s,m,\epsilon)-A} = \begin{pmatrix} A/s & * \\ * & * \end{pmatrix}, with functional error (U(s,m,ϵ)A)0:2n1,0:2n1A/sϵ\left|\left|\left(U_{(s,m,\epsilon)-A}\right)_{0:2^n-1,0:2^n-1}-A/s \right|\right|\leq \epsilon. Here ss is a scaling factor that ensures the overall operator is unitary, mm is the number of auxiliary (block) qubits, and ϵ\epsilon 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 (s,m,0)(s, m, 0)-encoding of the Hamiltonian (denoting UHU(s,m,0)HU_H \equiv U_{(s,m,0)-H}), we define the Szegedy quantum walk operator [2] WΠ0mUH,(1)W \equiv \Pi_{|0\rangle_m}\, U_H, \qquad (1) where Π0m\Pi_{|0\rangle_m} reflects about the 0|0\rangle state of the block variable. The Chebyshev LCU approach presented here relies on the fact that the kk-th power of walk operator directly implements a Chebyshev polynomial block-encoding of HH: Wk=(Tk(H/s))=U(1,m,0)Tk(H/s).(2)W^k = \begin{pmatrix} T_k(H/s) & * \\ * & * \end{pmatrix} = U_{(1,m,0)-T_k(H/s)}. \qquad (2) 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: eiHtk=0dβkTk(H/s)=k=0dβkWk.e^{-iHt} \approx \sum_{k=0}^{d} \beta_k\, T_k(H/s) = \sum_{k=0}^{d} \beta_k\, W^k. The resulting block-encoding has scaling factor βˉ=kβk\bar{\beta} = \sum_k |\beta_k| and block size m+log2(d+1)m + \lceil\log_2(d+1)\rceil: U(βˉ,m~,ϵ)exp(iHt)=(eiHt/βˉ).U_{(\bar{\beta},\,\tilde{m},\,\epsilon)-\exp(-iHt)} = \begin{pmatrix} e^{-iHt}/\bar{\beta} & * \\ * & * \end{pmatrix}.
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 the lcu_pauli function to block-encode it via the Linear Combination of Unitaries (LCU) technique: H=iαiUi,U(αˉ,m,0)H=(H/αˉ),αˉ=iαi.H = \sum_{i} \alpha_i U_i, \qquad U_{(\bar{\alpha},m,0)-H} = \begin{pmatrix} H/\bar{\alpha} & * \\ * & * \end{pmatrix}, \qquad \bar{\alpha} = \sum_i |\alpha_i|. To treat different problems with the same algorithm, simply change theses hyperparameters.
Output:
Next, we define the block-encoding quantum function, and a Quantum Struct for its variable.
Output:
Finally, we set the initial state to evolve and calculate classically the expected evolved state for verifying the quantum methods.

Setting Up a Statevector Simulator

Working with block-encoding typically requires post-selection of the block register being at state 0|0\rangle. 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 from hamiltonian_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 eiHt=cos(Ht)isin(Ht)e^{-iHt} = \cos(Ht) - i\sin(Ht).
Output:
Output:

The Walk Operator

Note: The current implementation assumes that the block-encoding unitary UHU_H is also Hermitian. For the non-Hermitian generalization, see the Technical Notes.
For the block-encoding of HH, U(s,m,0)HU_{(s,m,0)-H}, we define the Szegedy quantum walk operator, W=Π0mU(s,m,0)HW = \Pi_{|0\rangle_m}\, U_{(s,m,0)-H}, 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 UHU_H on the initial state and check that the post-selected result matches (H/αˉ)ψ(H/\bar{\alpha})|\psi\rangle as expected.
Output:
Screenshot 2025-10-16 at 15.16.18.png
Output:

Implementation

We build an LCU of the unitaries {Wk}\{W^k\} with coefficients {βk}\{\beta_k\}. The select operator over a series of unitary powers is implemented efficiently: instead of applying 2l2^l multi-controlled operations, we apply ll single-controlled operations, where the ii-th control qubit applies W2iW^{2^i} (analogous to the QPE circuit structure). Screenshot 2025-10-12 at 14.44.44.png
First, we define Quantum Structs for the Qubitization block-encoding. The block part, 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 HH. 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.
The code in the rest of this section builds a model that applies the lcu_cheb function on the randomly prepared vector, synthesizes it, executes the resulting quantum program, and verifies the results.
Output:
Screenshot 2025-10-16 at 15.33.22.png
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 UHU_H 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 W~UHTΠ0mUHΠ0m\tilde{W} \equiv U_H^T \Pi_{|0\rangle_m} U_H \Pi_{|0\rangle_m}, which satisfies equivalent spectral properties. See Section 7.4 in Ref. [3] for details.

Comparison with Other Methods

Methodextra block qubitsControlled UHU_H?Amplitude amplification?Classical preprocessing
GQSP1YesNoAngle computation
QSVT2NoYes (for a factor of 2)Angle computation
QubitizationO(logd)O(\log d)YesYes (for the sum of Cheb. coefficients)None
All three methods share the same asymptotic query complexity. Differences in the table reflect the detailed implementation of this specific example.