Skip to main contentIBM Quantum Documentation

ApproximatingObjective

class qiskit.synthesis.unitary.aqc.ApproximatingObjective

GitHub(opens in a new tab)

Bases: ABC(opens in a new tab)

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.


Attributes

num_thetas

Returns: the number of parameters in this optimization problem.

target_matrix

Returns: a matrix being approximated


Methods

gradient

abstract gradient(param_values)

GitHub(opens in a new tab)

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

Parameters

param_values (ndarray(opens in a new tab)) – a vector of parameter values for the optimization problem.

Returns

an array of gradient values.

Return type

ndarray(opens in a new tab)

objective

abstract objective(param_values)

GitHub(opens in a new tab)

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

Parameters

param_values (ndarray(opens in a new tab)) – a vector of parameter values for the optimization problem.

Returns

a float value of the objective function.

Return type

SupportsFloat(opens in a new tab)

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