qit.examples.phase_estimation

qit.examples.phase_estimation(t, U, s, implicit=False)

Quantum phase estimation algorithm.

Parameters
  • t (int) – number of qubits

  • U (Lmap) – unitary operator

  • s (State) – initial state

  • implicit (bool) – if True, use implicit measurement instead of partial trace

Returns

state of the index register after the phase estimation circuit, but before final measurement.

Return type

State

Estimate an eigenvalue of U using t qubits, starting from the state s.

To get a result accurate to n bits with probability \(\ge 1 -\epsilon\), choose

\[t \ge n + \left\lceil \log_2\left(2 +\frac{1}{2 \epsilon}\right) \right \rceil.\]

See [7], [4] chapter 5.2.