Skip to main contentIBM Quantum Documentation
This page is from an old version of Qiskit SDK and does not exist in the latest version. We recommend you migrate to the latest version. See the release notes for more information.

ApproximatingObjective

class ApproximatingObjective

GitHub

Bases: abc.ABC

A base class for an optimization problem definition. An implementing class must provide at least an implementation of the objective method. In such case only gradient free optimizers can be used. Both method, objective and gradient, preferable to have in an implementation.


Methods Defined Here

gradient

abstract ApproximatingObjective.gradient(param_values)

Computes a gradient with respect to parameters given a vector of parameter values.

Parameters

param_values (ndarray) – a vector of parameter values for the optimization problem.

Return type

ndarray

Returns

an array of gradient values.

objective

abstract ApproximatingObjective.objective(param_values)

Computes a value of the objective function given a vector of parameter values.

Parameters

param_values (ndarray) – a vector of parameter values for the optimization problem.

Return type

float

Returns

a float value of the objective function.


Attributes

num_thetas

Returns: the number of parameters in this optimization problem.

Return type

int

target_matrix

Returns: a matrix being approximated

Return type

ndarray

Was this page helpful?
Report a bug or request content on GitHub.