In order to build the walk operator and implement qubitization, we need to multiply the PrepSelPrep operator with the reflection

where is the auxiliary register (aux_wires) and is the main register (main_wires). Complete the Reflection function below which returns the matrix representing the reflection

def reflection_matrix(main_wires, aux_wires):
"""
Builds the reflection matrix needed for qubitization.

Args:
- main_wires (list(int)): The wires that make up the main register.
- aux_wires (list(int)): The wires that make up the auxiliary register.
"""
####################
###YOUR CODE HERE###
####################

return


or to submit your code

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

Learning Objectives:

  • Define the walk operator and derive its properties.
  • Estimate Hamiltonian eigenvalues using qubitization in combination with phase estimation.