qiskit-documentation/docs/api/qiskit/0.44/qiskit.transpiler.synthesis...

80 lines
2.9 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
title: DefaultCNOTUnitObjective
description: API reference for qiskit.transpiler.synthesis.aqc.DefaultCNOTUnitObjective
in_page_toc_min_heading_level: 1
python_api_type: class
python_api_name: qiskit.transpiler.synthesis.aqc.DefaultCNOTUnitObjective
---
# DefaultCNOTUnitObjective
<Class id="qiskit.transpiler.synthesis.aqc.DefaultCNOTUnitObjective" isDedicatedPage={true} github="https://github.com/qiskit/qiskit/tree/stable/0.25/qiskit/transpiler/synthesis/aqc/cnot_unit_objective.py" signature="qiskit.transpiler.synthesis.aqc.DefaultCNOTUnitObjective(num_qubits, cnots)" modifiers="class">
Bases: [`CNOTUnitObjective`](qiskit.transpiler.synthesis.aqc.CNOTUnitObjective "qiskit.transpiler.synthesis.aqc.cnot_unit_objective.CNOTUnitObjective")
A naive implementation of the objective function based on CNOT units.
**Parameters**
* **num\_qubits** ([*int*](https://docs.python.org/3/library/functions.html#int "(in Python v3.12)")) number of qubits.
* **cnots** (*np.ndarray*) a CNOT structure to be used in the optimization procedure.
## Attributes
### num\_cnots
<Attribute id="qiskit.transpiler.synthesis.aqc.DefaultCNOTUnitObjective.num_cnots">
Returns: A number of CNOT units to be used by the approximate circuit.
</Attribute>
### num\_thetas
<Attribute id="qiskit.transpiler.synthesis.aqc.DefaultCNOTUnitObjective.num_thetas">
Returns: Number of parameters (angles) of rotation gates in this circuit.
</Attribute>
### target\_matrix
<Attribute id="qiskit.transpiler.synthesis.aqc.DefaultCNOTUnitObjective.target_matrix">
Returns: a matrix being approximated
</Attribute>
## Methods
### gradient
<Function id="qiskit.transpiler.synthesis.aqc.DefaultCNOTUnitObjective.gradient" signature="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 "(in NumPy v1.26)")) 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 v1.26)")
</Function>
### objective
<Function id="qiskit.transpiler.synthesis.aqc.DefaultCNOTUnitObjective.objective" signature="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 "(in NumPy v1.26)")) 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.12)")
</Function>
</Class>