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

68 lines
2.3 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: FastCNOTUnitObjective
description: API reference for qiskit.transpiler.synthesis.aqc.FastCNOTUnitObjective
in_page_toc_min_heading_level: 1
python_api_type: class
python_api_name: qiskit.transpiler.synthesis.aqc.FastCNOTUnitObjective
---
# FastCNOTUnitObjective
<Class id="qiskit.transpiler.synthesis.aqc.FastCNOTUnitObjective" isDedicatedPage={true} github="https://github.com/qiskit/qiskit/tree/stable/0.23/qiskit/transpiler/synthesis/aqc/fast_gradient/fast_gradient.py" signature="FastCNOTUnitObjective(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")
Implementation of objective function and gradient calculator, which is similar to `DefaultCNOTUnitObjective` but several times faster.
**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.FastCNOTUnitObjective.gradient" signature="FastCNOTUnitObjective.gradient(param_values)">
Computes the gradient of objective function. See description of the base class method.
**Return type**
`ndarray`
</Function>
### objective
<Function id="qiskit.transpiler.synthesis.aqc.FastCNOTUnitObjective.objective" signature="FastCNOTUnitObjective.objective(param_values)">
Computes the objective function and some intermediate data for the subsequent gradient computation. See description of the base class method.
**Return type**
`float`
</Function>
## Attributes
### num\_cnots
<Attribute id="qiskit.transpiler.synthesis.aqc.FastCNOTUnitObjective.num_cnots">
Returns: A number of CNOT units to be used by the approximate circuit.
</Attribute>
### num\_thetas
<Attribute id="qiskit.transpiler.synthesis.aqc.FastCNOTUnitObjective.num_thetas">
Returns: Number of parameters (angles) of rotation gates in this circuit.
</Attribute>
### target\_matrix
<Attribute id="qiskit.transpiler.synthesis.aqc.FastCNOTUnitObjective.target_matrix">
Returns: a matrix being approximated
**Return type**
`ndarray`
</Attribute>
</Class>