from_ising#
- from_ising(qubit_op, offset=0.0, linear=False)[source]#
Create a quadratic program from a qubit operator and a shift value.
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:
- Returns:
The quadratic program corresponding to the qubit operator.
- Raises:
QiskitOptimizationError – if there are Pauli Xs or Ys in any Pauli term
QiskitOptimizationError – if there are more than 2 Pauli Zs in any Pauli term
QiskitOptimizationError – if any Pauli term has an imaginary coefficient
- Return type: