guppyalgos.algorithms.phase_estimation¶
Initialization for the QPE module.
Functions
|
Apply the Hadamard test for a controlled unitary. |
|
Algorithmic primitive for canonical quantum phase estimation. |
|
Algorithmic primitive for canonical quantum phase estimation. |
|
Apply a controlled qubitization walk repeatedly as requested by QPE. |
Classes
Registers acted on by a qubitized walk operator during phase estimation. |
- class guppyalgos.algorithms.phase_estimation.QubitizationRegs¶
Registers acted on by a qubitized walk operator during phase estimation.
- target: TargetRegs¶
- guppyalgos.algorithms.phase_estimation.hadamard_test(ancilla, unitary_regs, controlled_unitary)¶
Apply the Hadamard test for a controlled unitary.
The caller supplies the control qubit, the system register, and a controlled unitary acting on that register. The ancilla is prepared in
|+>and returned through a final Hadamard so the usual Hadamard-test readout can be measured by the caller.- Parameters:
ancilla (
qubit) – Control qubit used for the Hadamard test.unitary_regs (
TypeVar(UnitaryRegs)) – The target unitary register, which may be an array or a structured register wrapper.controlled_unitary (
Callable[[qubit,TypeVar(UnitaryRegs)],None]) – Controlled oracle acting on(ancilla, unitary_regs).
- Return type:
- guppyalgos.algorithms.phase_estimation.iqpe(phase_reg, unitary_regs, inverse_power_oracle)¶
Algorithmic primitive for canonical quantum phase estimation.
- Parameters:
phase_reg (
array[qubit,TypeVar(n_q_a, bound=nat)]) – The phase register on which the phase is written.unitary_regs (
TypeVar(UnitaryRegs)) – Registers acted on by the powered controlled unitary. It is the responsibility of the powered unitary to interpret this set of registers correctly.inverse_power_oracle (
Callable[[qubit,TypeVar(UnitaryRegs),int],None]) – Controlled oracle for the inverse unitary powers.
- Return type:
- Returns:
The binary power phase kickback encoded ancilla register in superposition with the unitary registers.
- guppyalgos.algorithms.phase_estimation.qpe(phase_reg, unitary_regs, power_oracle)¶
Algorithmic primitive for canonical quantum phase estimation.
- Parameters:
phase_reg (
array[qubit,TypeVar(n_q_a, bound=nat)]) – The phase register on which the phase is written.unitary_regs (
TypeVar(UnitaryRegs)) – Registers acted on by the powered controlled unitary. It is the responsibility of the powered unitary to interpret this set of registers correctly.power_oracle (
Callable[[qubit,TypeVar(UnitaryRegs),int],None]) – Controlled oracle that applies the requested unitary power.
- Return type:
- Returns:
The binary power phase kickback encoded ancilla register in superposition with the unitary registers.
- guppyalgos.algorithms.phase_estimation.qubitized_power_oracle(control, regs, power, cntrl_walk)¶
Apply a controlled qubitization walk repeatedly as requested by QPE.
- Return type:
Modules
Phase estimation. |