To perform a linear combination of two unitaries

we need the circuit

where

Create the k-dependent unitary matrix V_prepare. Then, build the two_unitary_combo circuit that implements the linear combination of unitaries.

or to submit your code

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

Learning Objectives:

  • Define the concept of block encoding.
  • Implement the PREPSELPREP routine to encode a linear combination of unitaries.