Our goal for Hamiltonian simulation using QSVT is to apply a polynomial to an encoded hamiltonian that approximates the function

To this end, we need to find the QSVT angles that fit both the sine and cosine functions. Using a series expansion up to order inclusive for these trigonometric functions, use PennyLane's qml.poly_to_angles to find the QSVT angles that approximate the polynomials for and . The angles will depend on

def cosine_angles(t):
"""
Returns an np.array of coefficients of cos(tx) as a function of t
"""

poly_cos = # Coefficients (array of length at most 5)
angles_cos = # Use qml.poly_to_angles to get QSVT angles

return angles_cos

def sine_angles(t):
"""
Returns an np.array of coefficients of sin(tx) as a function of t
"""

poly_sin = # Coefficients
angles_sin = # Use qml.poly_to_angles to get QSVT angles

return angles_sin



or to submit your code

To interact with codercises, please switch to a larger screen size.

Learning Objectives:

  • Understand the statement and consequences of the QSVT theorem.
  • Use the QSVT algorithms to simulate Hamiltonian time evolution.