---
title: ApproximatingObjective (v0.46)
description: API reference for qiskit.synthesis.unitary.aqc.ApproximatingObjective in qiskit v0.46
source: https://eu-de.quantum.cloud.ibm.com/docs/en/api/qiskit/0.46/qiskit.synthesis.unitary.aqc.ApproximatingObjective
---

# ApproximatingObjective

*class* `qiskit.synthesis.unitary.aqc.ApproximatingObjective`

[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.46/qiskit/synthesis/unitary/aqc/approximate.py)

Bases: [`ABC`](https://docs.python.org/3/library/abc.html#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.

## 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)`

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

**Parameters**

**param\_values** ([*ndarray*](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray)) – a vector of parameter values for the optimization problem.

**Returns**

an array of gradient values.

**Return type**

[*ndarray*](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray)

### objective

*abstract* `objective(param_values)`

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

**Parameters**

**param\_values** ([*ndarray*](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray)) – a vector of parameter values for the optimization problem.

**Returns**

a float value of the objective function.

**Return type**

[*SupportsFloat*](https://docs.python.org/3/library/typing.html#typing.SupportsFloat)
