IntegerToBinary

class IntegerToBinary[source]

Convert a QuadraticProgram into new one by encoding integer with binary variables.

This bounded-coefficient encoding used in this converted is proposed in [1], Eq. (5).

Examples

>>> from qiskit.optimization.problems import QuadraticProgram
>>> from qiskit.optimization.converters import IntegerToBinary
>>> problem = QuadraticProgram()
>>> var = problem.integer_var(name='x', lowerbound=0, upperbound=10)
>>> conv = IntegerToBinary()
>>> problem2 = conv.encode(problem)

References

[1]: Sahar Karimi, Pooya Ronagh (2017), Practical Integer-to-Binary Mapping for Quantum

Annealers. arxiv.org:1706.01945.

Methods

IntegerToBinary.decode(result)

Convert the encoded problem (binary variables) back to the original (integer variables).

IntegerToBinary.encode(op[, name])

Convert an integer problem into a new problem with binary variables.