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 1ϵ, choose

tn+log2(2+12ϵ).

See [7], [4] chapter 5.2.