qiskit_addon_opt_mapper.translators.to_ising¶
- to_ising(optimization_problem)[source]¶
Return the Ising Hamiltonian of this problem.
Variables are mapped to qubits in the same order, i.e., i-th variable is mapped to i-th qubit. See https://github.com/Qiskit/qiskit-terra/issues/1148 for details.
- Parameters:
optimization_problem (OptimizationProblem) – The problem to be translated.
- Returns:
A tuple (qubit_op, offset) comprising the qubit operator for the problem and offset for the constant value in the Ising Hamiltonian.
- Raises:
OptimizationError – If an integer variable or a continuous variable exists in the problem.
OptimizationError – If constraints exist in the problem.
- Return type: