---
title: AmplificationProblem (v0.46)
description: API reference for qiskit.algorithms.AmplificationProblem in qiskit v0.46
source: https://eu-de.quantum.cloud.ibm.com/docs/en/api/qiskit/0.46/qiskit.algorithms.AmplificationProblem
---

# AmplificationProblem

*class* `qiskit.algorithms.AmplificationProblem(oracle, state_preparation=None, grover_operator=None, post_processing=None, objective_qubits=None, is_good_state=None)`

[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.46/qiskit/algorithms/amplitude_amplifiers/amplification_problem.py)

Bases: [`object`](https://docs.python.org/3/library/functions.html#object)

The amplification problem is the input to amplitude amplification algorithms, like Grover.

This class contains all problem-specific information required to run an amplitude amplification algorithm. It minimally contains the Grover operator. It can further hold some post processing on the optimal bitstring.

**Parameters**

- **oracle** ([*QuantumCircuit*](/docs/api/qiskit/0.46/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit")  *|*[*Statevector*](/docs/api/qiskit/0.46/qiskit.quantum_info.Statevector "qiskit.quantum_info.Statevector")) – The oracle reflecting about the bad states.
- **state\_preparation** ([*QuantumCircuit*](/docs/api/qiskit/0.46/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") *| None*) – A circuit preparing the input state, referred to as $\mathcal{A}$. If None, a layer of Hadamard gates is used.
- **grover\_operator** ([*QuantumCircuit*](/docs/api/qiskit/0.46/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") *| None*) – The Grover operator $\mathcal{Q}$ used as unitary in the phase estimation circuit. If None, this operator is constructed from the `oracle` and `state_preparation`.
- **post\_processing** (*Callable\[\[*[*str*](https://docs.python.org/3/library/stdtypes.html#str)*], Any] | None*) – A mapping applied to the most likely bitstring.
- **objective\_qubits** ([*int*](https://docs.python.org/3/library/functions.html#int)  *|*[*list*](https://docs.python.org/3/library/stdtypes.html#list)*\[*[*int*](https://docs.python.org/3/library/functions.html#int)*] | None*) – If set, specifies the indices of the qubits that should be measured. If None, all qubits will be measured. The `is_good_state` function will be applied on the measurement outcome of these qubits.
- **is\_good\_state** (*Callable\[\[*[*str*](https://docs.python.org/3/library/stdtypes.html#str)*],* [*bool*](https://docs.python.org/3/library/functions.html#bool)*] |* [*list*](https://docs.python.org/3/library/stdtypes.html#list)*\[*[*int*](https://docs.python.org/3/library/functions.html#int)*] |* [*list*](https://docs.python.org/3/library/stdtypes.html#list)*\[*[*str*](https://docs.python.org/3/library/stdtypes.html#str)*] |* [*Statevector*](/docs/api/qiskit/0.46/qiskit.quantum_info.Statevector "qiskit.quantum_info.Statevector") *| None*) – A function to check whether a string represents a good state. By default if the `oracle` argument has an `evaluate_bitstring` method (currently only provided by the [`PhaseOracle`](/docs/api/qiskit/0.46/qiskit.circuit.library.PhaseOracle "qiskit.circuit.library.PhaseOracle") class) this will be used, otherwise this kwarg is required and **must** be specified.

## Attributes

### grover\_operator

Get the $\mathcal{Q}$ operator, or Grover operator.

If the Grover operator is not set, we try to build it from the $\mathcal{A}$ operator and objective\_qubits. This only works if objective\_qubits is a list of integers.

**Returns**

The Grover operator, or None if neither the Grover operator nor the $\mathcal{A}$ operator is set.

### is\_good\_state

Check whether a provided bitstring is a good state or not.

**Returns**

A callable that takes in a bitstring and returns True if the measurement is a good state, False otherwise.

### objective\_qubits

The indices of the objective qubits.

**Returns**

The indices of the objective qubits as list of integers.

### oracle

Return the oracle.

**Returns**

The oracle.

### post\_processing

Apply post processing to the input value.

**Returns**

A handle to the post processing function. Acts as identity by default.

### state\_preparation

Get the state preparation operator $\mathcal{A}$.

**Returns**

The $\mathcal{A}$ operator as QuantumCircuit.
