QuadraticExpression#
- class QuadraticExpression(quadratic_program, coefficients)[ソース]#
ベースクラス:
QuadraticProgramElement
Representation of a quadratic expression by its coefficients.
Creates a new quadratic expression.
The quadratic expression can be defined via an array, a list, a sparse matrix, or a dictionary that uses variable names or indices as keys and stores the values internally as a dok_matrix. We stores values in a compressed way, i.e., values at symmetric positions are summed up in the upper triangle. For example, {(0, 1): 1, (1, 0): 2} -> {(0, 1): 3}.
- パラメータ:
Attributes
- bounds#
Returns the lower bound and the upper bound of the quadratic expression
- 戻り値:
The lower bound and the upper bound of the quadratic expression
- 例外:
QiskitOptimizationError – if the quadratic expression contains any unbounded variable
- coefficients#
Returns the coefficients of the quadratic expression.
- 戻り値:
The coefficients of the quadratic expression.
- quadratic_program#
Returns the parent QuadraticProgram.
- 戻り値:
The parent QuadraticProgram.
Methods