Bengali
Languages
English
Bengali
French
German
Japanese
Korean
Portuguese
Spanish
Tamil

AmplificationProblem

class AmplificationProblem(oracle, state_preparation=None, grover_operator=None, post_processing=None, objective_qubits=None, is_good_state=None)[source]

Bases: 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.

প্যারামিটার
  • oracle (Union[QuantumCircuit, Statevector]) -- The oracle reflecting about the bad states.

  • state_preparation (Optional[QuantumCircuit]) -- A circuit preparing the input state, referred to as \(\mathcal{A}\). If None, a layer of Hadamard gates is used.

  • grover_operator (Optional[QuantumCircuit]) -- 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 (Optional[Callable[[str], Any]]) -- A mapping applied to the most likely bitstring.

  • objective_qubits (Union[int, List[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 (Union[Callable[[str], bool], List[int], List[str], 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 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.

রিটার্ন টাইপ

Optional[QuantumCircuit]

রিটার্নস

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.

রিটার্ন টাইপ

Callable[[str], bool]

রিটার্নস

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.

রিটার্ন টাইপ

List[int]

রিটার্নস

The indices of the objective qubits as list of integers.

oracle

Return the oracle.

রিটার্ন টাইপ

Union[QuantumCircuit, Statevector]

রিটার্নস

The oracle.

post_processing

Apply post processing to the input value.

রিটার্ন টাইপ

Callable[[str], Any]

রিটার্নস

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

state_preparation

Get the state preparation operator \(\mathcal{A}\).

রিটার্ন টাইপ

QuantumCircuit

রিটার্নস

The \(\mathcal{A}\) operator as QuantumCircuit.