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 . Quantum Singular Value Transformation (QSVT) [1] achieves Hamiltonian simulation by exploiting the decomposition . Two QSVT blocks, one for the even polynomial and one for the odd polynomial (both approximated via the Jacobi–Anger expansion, Eqs. (3)-(4)), are combined via LCU. Unlike GQSP and Qubitization, QSVT operates directly on the block-encoding without requiring a walk operator or controlled block-encoding calls, using only two auxiliary qubits.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. We assume an exact -encoding of the Hamiltonian as input. The QSVT method outputs an approximated block-encoding of its time evolution: This is achieved by implementing a block-encoding for the polynomial approximation . To recover the exact unitary one would apply amplitude amplification to drive the prefactor ; here we instead employ projected statevector simulation. QSVT is a general method for implementing polynomial singular value transformation of block-encoded matrices, where each polynomial must have a well-defined parity (even or odd). The transformation is based on Quantum Signal Processing (QSP), achieved by a series of qubit rotations. In the case of general polynomial transformation, as in Hamiltonian simulation , one can apply two polynomial transformations, one for the even polynomial and one for the odd polynomial , combined via Linear Combination of Unitaries (LCU). The two QSVT circuits are combined using theComplexity: calls to the block-encoding, using two auxiliary qubits. No controlled block-encoding calls required. Requires classical preprocessing to compute QSVT rotation angles.
- 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, Quantum Singular Value Transformation, QSVT, Quantum Signal Processing, LCU, Oracle/Query complexity.
qsvt_lcu function, which implements an optimized select operation that interleaves the rotations of both polynomials within a single QSVT traversal.
The overall result is a -block-encoding of ,
where one block qubit comes from the QSVT and the second one, as well as the prefactor, originates from the LCU.
(In practice, our prefactor is slightly different, with which ensures numerical stability of the classical angle computation).
This notebook demonstrates Hamiltonian simulation using the QSVT method.For the other approaches, see the companion notebooks on GQSP and Qubitization.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 variable 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 polynomial approximation of the time evolution relies on the Jacobi–Anger expansion. For QSVT, we use the real Chebyshev forms and (Eqs. (3)–(4)), computed viapoly_jacobi_anger_cos and poly_jacobi_anger_sin.
From these, we derive the QSVT rotation angles using qsvt_phases.
Output:
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 define Quantum Structs for the QSVT block-encoding. Two block qubits are used: one for the QSVT signal processing (block_qsvt) and one for the LCU, selecting between odd and even polynomials (block_lcu).
These are added to the block variable of the Hamiltonian encoding.
The qsvt_hamiltonian_evolution function uses prepare_select with the qsvt_lcu as the select operation.
The LCU coefficients implement .
The projector_cnot function implements the QSVT projector onto the state of the Hamiltonian block variable.

qsvt_hamiltonian_evolution function on the randomly prepared vector , synthesizes it, executes the resulting quantum program, and verifies the results.
Output:

Output:
References
[1]: Martyn, J. M., Rossi, Z. M., Tan, A. K., & Chuang, I. L. Grand unification of quantum algorithms. PRX Quantum 2, 040203 (2021).Technical Notes
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 |