Representation of quadratic objective function of the form: constant + linear * x + x * quadratic * x.

প্যারামিটার:

• constant (float) -- The constant offset of the objective.

• linear (ndarray | spmatrix | List[float] | Dict[int | str, float] | None) -- The coefficients of the linear part of the objective.

• quadratic (ndarray | spmatrix | List[List[float]] | Dict[Tuple[int | str, int | str], float] | None) -- The coefficients of the quadratic part of the objective.

• sense (ObjSense) -- The optimization sense of the objective.

Attributes

constant#

Returns the constant part of the objective function.

রিটার্নস:

The constant part of the objective function.

linear#

Returns the linear part of the objective function.

রিটার্নস:

The linear part of the objective function.

Returns the quadratic part of the objective function.

রিটার্নস:

The quadratic part of the objective function.

রিটার্নস:

sense#

Returns the sense of the objective function.

রিটার্নস:

The sense of the objective function.

Methods

evaluate(x)[source]#

Evaluate the quadratic objective for given variable values.

প্যারামিটার:

x (ndarray | List | Dict[int | str, float]) -- The values of the variables to be evaluated.

রিটার্নস:

The value of the quadratic objective given the variable values.

রেইজেস:

QiskitOptimizationError -- if the shape of the objective function does not match with the number of variables.

রিটার্ন টাইপ:

float

প্যারামিটার:

x (ndarray | List | Dict[int | str, float]) -- The values of the variables to be evaluated.

রিটার্নস:

The value of the gradient of the quadratic objective given the variable values.

রেইজেস:

QiskitOptimizationError -- if the shape of the objective function does not match with the number of variables.

রিটার্ন টাইপ:

ndarray