from_gurobipy#

from_gurobipy(model)[source]#

Translate a gurobipy model into a quadratic program.

Note that this supports only basic functions of gurobipy as follows:

  • quadratic objective function

  • linear / quadratic constraints

  • binary / integer / continuous variables

Parameters:

model (Model) – The gurobipy model to be loaded.

Returns:

The quadratic program corresponding to the model.

Raises:

QiskitOptimizationError – if the model contains unsupported elements.

Return type:

QuadraticProgram