AQC#
- class qiskit.transpiler.synthesis.aqc.AQC(optimizer=None, seed=None)[소스]#
기반 클래스:
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
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, there’s only one implementation based on 4-rotations CNOT unit blocks:
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, there are two implementations based on 4-rotations CNOT unit blocks:
DefaultCNOTUnitObjective
and its accelerated versionFastCNOTUnitObjective
. Both implementations share the same idea of maximization the Hilbert-Schmidt product between the target matrix and its approximation. The former implementation approach should be considered as a baseline one. It may suffer from performance issues, and is mostly suitable for a small number of qubits (up to 5 or 6), whereas the latter, accelerated one, can be applied to larger problems.One should take into consideration the exponential growth of matrix size with the number of qubits because the implementation not only creates a potentially large target matrix, but also allocates a number of temporary memory buffers comparable in size to the target matrix.
- 매개변수:
Methods
- 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 usingapproximate_circuit
as a template for the approximate circuit.- 매개변수:
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 (ndarray | None) – initial values of angles/parameters to start optimization from.