84 lines
2.5 KiB
Plaintext
84 lines
2.5 KiB
Plaintext
---
|
||
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.21/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>
|
||
|