mindquantum.algorithm.compiler

MindQuantum compiler related modules.

Fixed decompose rules

mindquantum.algorithm.compiler.ch_decompose

Decompose controlled HGate gate.

mindquantum.algorithm.compiler.crx_decompose

Decompose controlled RX gate.

mindquantum.algorithm.compiler.rxx_decompose

Decompose Rxx gate.

mindquantum.algorithm.compiler.crxx_decompose

Decompose Rxx gate with control qubits.

mindquantum.algorithm.compiler.cry_decompose

Decompose controlled RY gate.

mindquantum.algorithm.compiler.ryy_decompose

Decompose Ryy gate.

mindquantum.algorithm.compiler.cryy_decompose

Decompose Ryy gate with control qubits.

mindquantum.algorithm.compiler.rzz_decompose

Decompose Rzz gate.

mindquantum.algorithm.compiler.cs_decompose

Decompose controlled SGate gate.

mindquantum.algorithm.compiler.cswap_decompose

Decompose controlled SWAPGate gate.

mindquantum.algorithm.compiler.swap_decompose

Decompose SWAPGate gate.

mindquantum.algorithm.compiler.ct_decompose

Decompose controlled TGate gate.

mindquantum.algorithm.compiler.ccx_decompose

Decompose a toffoli gate.

mindquantum.algorithm.compiler.cy_decompose

Decompose controlled YGate gate.

mindquantum.algorithm.compiler.cz_decompose

Decompose controlled ZGate gate.

Universal decompose rules

mindquantum.algorithm.compiler.euler_decompose

One-qubit Euler decomposition.

mindquantum.algorithm.compiler.cu_decompose

Decompose arbitrary-dimension controlled-U gate.

mindquantum.algorithm.compiler.qs_decompose

Quantum Shannon decomposition for arbitrary-dimension unitary gate.

mindquantum.algorithm.compiler.abc_decompose

Decompose two-qubit controlled gate via ABC decomposition.

mindquantum.algorithm.compiler.kak_decompose

KAK decomposition (CNOT basis) of an arbitrary two-qubit gate.

mindquantum.algorithm.compiler.tensor_product_decompose

Tensor product decomposition of a 2-qubit gate.

Compiler rules

mindquantum.algorithm.compiler.BasicCompilerRule

The basic compiler rule class.

mindquantum.algorithm.compiler.KroneckerSeqCompiler

Kronecker sequential compiler.

mindquantum.algorithm.compiler.SequentialCompiler

A sequential of compiler.

mindquantum.algorithm.compiler.BasicDecompose

Decompose gate into a simple gate set.

mindquantum.algorithm.compiler.CZBasedChipCompiler

A compiler that suitable for chip that use cz gate.

mindquantum.algorithm.compiler.CXToCZ

Convert cx to cz gate.

mindquantum.algorithm.compiler.CZToCX

Convert cz to cx gate.

mindquantum.algorithm.compiler.GateReplacer

Replace given gate with given circuit.

mindquantum.algorithm.compiler.FullyNeighborCanceler

Merge neighbor gate until we cannot merge anymore gates.

mindquantum.algorithm.compiler.SimpleNeighborCanceler

Merge two nearby gate if possible.

mindquantum.algorithm.compiler.compile_circuit

Directly compile a given circuit and return the result.

DAG circuit

mindquantum.algorithm.compiler.DAGCircuit

A Directed Acyclic Graph of a quantum circuit.

mindquantum.algorithm.compiler.DAGNode

Basic node in Directed Acyclic Graph.

mindquantum.algorithm.compiler.GateNode

DAG node that work as quantum gate.

mindquantum.algorithm.compiler.DAGQubitNode

DAG node that work as quantum qubit.

mindquantum.algorithm.compiler.connect_two_node

Connect two DAG node through given local_index.

mindquantum.algorithm.compiler.try_merge

Try to merge two gate nodes.