IsingToQuadraticProgram
IsingToQuadraticProgram(linear=False)
Convert a qubit operator into a quadratic program
Parameters
linear (bool
) – If linear is True, is treated as a linear term since for . Else, is treat as a quadratic term. The default value is False.
Methods
encode
IsingToQuadraticProgram.encode(qubit_op, offset=0.0)
Convert a qubit operator and a shift value into a quadratic program
Parameters
- qubit_op (
WeightedPauliOperator
) – The qubit operator to be converted into aQuadraticProgram
- offset (
float
) – The shift value of the qubit operator
Return type
Returns
QuadraticProgram converted from the input qubit operator and the shift value
Raises
- QiskitOptimizationError – If there are Pauli Xs in any Pauli term
- QiskitOptimizationError – If there are more than 2 Pauli Zs in any Pauli term
Was this page helpful?
Report a bug or request content on GitHub.