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

84 lines
2.5 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.23/qiskit/transpiler/synthesis/aqc/cnot_unit_objective.py" signature="DefaultCNOTUnitObjective(num_qubits, cnots)" modifiers="class">
Bases: [`qiskit.transpiler.synthesis.aqc.cnot_unit_objective.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`) number of qubits.
* **cnots** (`ndarray`) a CNOT structure to be used in the optimization procedure.
## Methods Defined Here
### gradient
<Function id="qiskit.transpiler.synthesis.aqc.DefaultCNOTUnitObjective.gradient" signature="DefaultCNOTUnitObjective.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.
</Function>
### objective
<Function id="qiskit.transpiler.synthesis.aqc.DefaultCNOTUnitObjective.objective" signature="DefaultCNOTUnitObjective.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.
</Function>
## 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
**Return type**
`ndarray`
</Attribute>
</Class>