qiskit.algorithms.EstimationProblem(state_preparation, objective_qubits, grover_operator=None, post_processing=None, is_good_state=None)
object (opens in a new tab)
The estimation problem is the input to amplitude estimation algorithm.
This class contains all problem-specific information required to run an amplitude estimation algorithm. That means, it minimally contains the state preparation and the specification of the good state. It can further hold some post processing on the estimation of the amplitude or a custom Grover operator.
- state_preparation (QuantumCircuit) – A circuit preparing the input state, referred to as .
- objective_qubits (int (opens in a new tab) |list (opens in a new tab)[int (opens in a new tab)]) – A single qubit index or a list of qubit indices to specify which qubits to measure. The
is_good_statefunction is applied on the bitstring of these objective qubits.
- grover_operator (QuantumCircuit | None) – The Grover operator used as unitary in the phase estimation circuit.
- post_processing (Callable[[float (opens in a new tab)], float (opens in a new tab)] | None) – A mapping applied to the result of the algorithm , usually used to map the estimate to a target interval. Defaults to the identity.
- is_good_state (Callable[[str (opens in a new tab)], bool (opens in a new tab)] | None) – A function to check whether a string represents a good state. Defaults to all objective qubits being in state .
Get the operator, or Grover operator.
If the Grover operator is not set, we try to build it from the operator and objective_qubits. This only works if objective_qubits is a list of integers.
The Grover operator, or None if neither the Grover operator nor the operator is set.
Check whether an
is_good_state function is set.
True, if a custom
is_good_state is set, otherwise returns
Checks whether a bitstring represents a good state.
Handle to the
Get the criterion for a measurement outcome to be in a ‘good’ state.
The criterion as list of qubit indices.
Apply post processing to the input value.
A handle to the post processing function. Acts as identity by default.
Get the operator encoding the amplitude .
The operator as QuantumCircuit.
Rescale the good state amplitude in the estimation problem.
scaling_factor (float (opens in a new tab)) – The scaling factor in [0, 1].
A rescaled estimation problem.