69 lines
2.8 KiB
Plaintext
69 lines
2.8 KiB
Plaintext
---
|
||
title: ApproximatingObjective (v1.2)
|
||
description: API reference for qiskit.synthesis.unitary.aqc.ApproximatingObjective in qiskit v1.2
|
||
in_page_toc_min_heading_level: 1
|
||
python_api_type: class
|
||
python_api_name: qiskit.synthesis.unitary.aqc.ApproximatingObjective
|
||
---
|
||
|
||
# ApproximatingObjective
|
||
|
||
<Class id="qiskit.synthesis.unitary.aqc.ApproximatingObjective" isDedicatedPage={true} github="https://github.com/Qiskit/qiskit/tree/stable/1.2/qiskit/synthesis/unitary/aqc/approximate.py#L55-L116" signature="qiskit.synthesis.unitary.aqc.ApproximatingObjective" modifiers="class">
|
||
Bases: [`ABC`](https://docs.python.org/3/library/abc.html#abc.ABC "(in Python v3.13)")
|
||
|
||
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
|
||
|
||
<Attribute id="qiskit.synthesis.unitary.aqc.ApproximatingObjective.num_thetas">
|
||
Returns: the number of parameters in this optimization problem.
|
||
</Attribute>
|
||
|
||
### target\_matrix
|
||
|
||
<Attribute id="qiskit.synthesis.unitary.aqc.ApproximatingObjective.target_matrix">
|
||
Returns: a matrix being approximated
|
||
</Attribute>
|
||
|
||
## Methods
|
||
|
||
### gradient
|
||
|
||
<Function id="qiskit.synthesis.unitary.aqc.ApproximatingObjective.gradient" github="https://github.com/Qiskit/qiskit/tree/stable/1.2/qiskit/synthesis/unitary/aqc/approximate.py#L79-L90" signature="gradient(param_values)" modifiers="abstract">
|
||
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 "(in NumPy v2.1)")) – 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 "(in NumPy v2.1)")
|
||
</Function>
|
||
|
||
### objective
|
||
|
||
<Function id="qiskit.synthesis.unitary.aqc.ApproximatingObjective.objective" github="https://github.com/Qiskit/qiskit/tree/stable/1.2/qiskit/synthesis/unitary/aqc/approximate.py#L66-L77" signature="objective(param_values)" modifiers="abstract">
|
||
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 "(in NumPy v2.1)")) – 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 "(in Python v3.13)")
|
||
</Function>
|
||
</Class>
|
||
|