AmplitudeEstimation.i_objective

property AmplitudeEstimation.i_objective

Get the index of the objective qubit. The objective qubit marks the |psi_0> state (called ‘bad states’ in https://arxiv.org/abs/quant-ph/0005055) with |0> and |psi_1> (‘good’ states) with |1>. If the A operator performs the mapping

A |0>_n |0> = sqrt{1 - a} |psi_0>_n |0> + sqrt{a} |psi_1>_n |1>

then, the objective qubit is the last one (which is either |0> or |1>).

If the objective qubit (i_objective) is not set, we check if the Q operator (q_factory) is set and return the index specified there. If the q_factory is not defined, the index equals the number of qubits of the A operator (a_factory) minus one. If also the a_factory is not set, return None.

Returns

the index of the objective qubit

Return type

int