View on GitHub
Open this notebook in GitHub to run it yourself
control, power, within_apply, and invert.
The algorithm assumes we have the block-encoding of a matrix
with being the size of the block variable and some scaling factor.
Given this quantum function, we can define the following unitary (usually called the Szegedy quantum walk operator [2]):
where is a reflection operator about the block state
- The spectrum of the walk operator has a nice relation to the spectrum of the block-encoded Hamiltonian [3]:
Preliminaries
We start with defining some utility functions that are not implemented as part of Classiq, and might be included in the future. These functions are used for the specific block-encoding used in this notebook.Defining a specific usecase: a Molecule and its block-encoding Hamiltonian function
Output:
Output:
Output:
Defining a Walk Operator
We use thereflect_around_zero function from Classiq’s open library to define a walk operator function with the declaration below.
This function implements , so we must insert a minus phase (This can be done by adding a minus sign using the phase function).
Setting initial state and QPE size
A Naive QPE
Before going to the optimized implementation, designing a specific QPE that operates on a walk operator, we start with a naive QPE implementation.Output:
Output:

Optimized QPE design for the walk operator
We construct the model design according to Ref. [1], shown in the figure below, with being the reflection around zero operation, and is taken as the usual Hadamard transform for the phase initialization:
Output:
Output:

Output:
Output: