Skip to main contentIBM Quantum Documentation
This page is from an old version of Qiskit SDK and does not exist in the latest version. We recommend you migrate to the latest version. See the release notes for more information.
Important

IBM Quantum Platform is moving and this version will be sunset on July 1. To get started on the new platform, read the migration guide.

QuadraticProgramToNegativeValueOracle

class QuadraticProgramToNegativeValueOracle(num_value_qubits, measurement=False)

GitHub

Converts an optimization problem (QUBO) to a negative value oracle.

In addition, a state preparation operator is generated from the coefficients and constant of a QUBO, which can be used to encode the function into a quantum state. In conjunction, this oracle and operator can be used to flag the negative values of a QUBO encoded in a quantum state.

The construction of the oracle is discussed in [1].

References

[1]: Gilliam et al., Grover Adaptive Search for Constrained Polynomial Binary Optimization.

arxiv:1912.04088.

Parameters

  • num_value_qubits (int) – The number of qubits required to represent the output.
  • measurement (bool) – Whether the A operator contains measurements.

Methods

encode

QuadraticProgramToNegativeValueOracle.encode(problem)

A helper function that converts a QUBO into an oracle that recognizes negative numbers.

Parameters

problem (QuadraticProgram) – The problem to be solved.

Return type

Tuple[Custom, CustomCircuitOracle, Dict[Union[int, Tuple[int, int]], int]]

Returns

A state preparation operator A, an oracle O that recognizes negative numbers, and a dictionary representation of the function coefficients, where the key -1 represents the constant.

Was this page helpful?
Report a bug or request content on GitHub.