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

45 lines
3.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: AQC
description: API reference for qiskit.transpiler.synthesis.aqc.AQC
in_page_toc_min_heading_level: 1
python_api_type: class
python_api_name: qiskit.transpiler.synthesis.aqc.AQC
---
# AQC
<Class id="qiskit.transpiler.synthesis.aqc.AQC" isDedicatedPage={true} github="https://github.com/qiskit/qiskit/tree/stable/0.20/qiskit/transpiler/synthesis/aqc/aqc.py" signature="AQC(optimizer=None, seed=None)" modifiers="class">
Bases: `object`
A generic implementation of Approximate Quantum Compiler. This implementation is agnostic of the underlying implementation of the approximate circuit, objective, and optimizer. Users may pass corresponding implementations of the abstract classes:
* Optimizer is an instance of [`Optimizer`](qiskit.algorithms.optimizers.Optimizer "qiskit.algorithms.optimizers.Optimizer") and used to run the optimization process. A choice of optimizer may affect overall convergence, required time for the optimization process and achieved objective value.
* Approximate circuit represents a template which parameters we want to optimize. Currently, theres only one implementation based on 4-rotations CNOT unit blocks: [`CNOTUnitCircuit`](qiskit.transpiler.synthesis.aqc.CNOTUnitCircuit "qiskit.transpiler.synthesis.aqc.CNOTUnitCircuit"). See the paper for more details.
* Approximate objective is tightly coupled with the approximate circuit implementation and provides two methods for computing objective function and gradient with respect to approximate circuit parameters. This objective is passed to the optimizer. Currently, theres only one implementation based on 4-rotations CNOT unit blocks: [`DefaultCNOTUnitObjective`](qiskit.transpiler.synthesis.aqc.DefaultCNOTUnitObjective "qiskit.transpiler.synthesis.aqc.DefaultCNOTUnitObjective"). This is a naive implementation of the objective function and gradient and may suffer from performance issues.
**Parameters**
* **optimizer** (`Optional`\[`Optimizer`]) an optimizer to be used in the optimization procedure of the search for the best approximate circuit. By default [`L_BFGS_B`](qiskit.algorithms.optimizers.L_BFGS_B "qiskit.algorithms.optimizers.L_BFGS_B") is used with max iterations is set to 1000.
* **seed** (`Optional`\[`int`]) a seed value to be user by a random number generator.
## Methods Defined Here
### compile\_unitary
<Function id="qiskit.transpiler.synthesis.aqc.AQC.compile_unitary" signature="AQC.compile_unitary(target_matrix, approximate_circuit, approximating_objective, initial_point=None)">
Approximately compiles a circuit represented as a unitary matrix by solving an optimization problem defined by `approximating_objective` and using `approximate_circuit` as a template for the approximate circuit.
**Parameters**
* **target\_matrix** (`ndarray`) a unitary matrix to approximate.
* **approximate\_circuit** (`ApproximateCircuit`) a template circuit that will be filled with the parameter values obtained in the optimization procedure.
* **approximating\_objective** (`ApproximatingObjective`) a definition of the optimization problem.
* **initial\_point** (`Optional`\[`ndarray`]) initial values of angles/parameters to start optimization from.
**Return type**
`None`
</Function>
</Class>