View on GitHub
Open this notebook in GitHub to run it yourself
qpe
Arguments:
-
unitary: QCallable - The unitary operation for which the qpe estimation the eigenvalues
-
phase: QNum - The output of the qpe, holding the phase as a number in the range
qpe_flexible
The function is suitable when one wants to specialize the way the power of a unitary is defined, other than using the naive power.
For example it can be used to obtain the time evolution of hamiltonians or for Shor’s algorithm.
Arguments:
-
unitary_with_power: QCallable[CInt] - Power of a unitary.
phase: QNum
Examples
Example 1: QPE of a function
This example shows how to perform a simple phase estimation:- Initialize the state over two qubits.
- Apply a phase estimation on the the controlled-RZ gate, represeneted by the unitary matrix:
01.
Output:
Example 2: Flexible QPE
The following examples will specifiy directly how to take powers in the QPE. The unitary function issuzuki_trotter, where the number of repetitions will be
- In the case of diagonal hamiltonian it be exact exponentiation of the hamiltoian.
Output: