QuadraticProgramToNegativeValueOracle
QuadraticProgramToNegativeValueOracle(num_value_qubits, measurement=False)
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.