QuadraticProgram.from_ising(qubit_op, offset=0.0, linear=False)[fuente]

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.

  • qubit_op (OperatorBase) – The qubit operator of the problem.

  • offset (float) – The constant value in the Ising Hamiltonian.

  • linear (bool) – If linear is True, \(x^2\) is treated as a linear term since \(x^2 = x\) for \(x \in \{0,1\}\). Else, \(x^2\) is treated as a quadratic term. The default value is False.