# compiler **Repository Path**: donghufeng/compiler ## Basic Information - **Project Name**: compiler - **Description**: Compiler module for mindquantum - **Primary Language**: Python - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 1 - **Created**: 2022-08-27 - **Last Updated**: 2022-10-08 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Compiler for MindQuantum ## Example ```python from compiler.dag import DAGCircuit from compiler.rules import NeighborCancler from mindquantum.core.circuit import Circuit circ = Circuit().x(0).h(1).x(0).h(0) dag_circ = DAGCircuit(circ) NeighborCancler().do(dag_circ) new_circ = dag_circ.to_circuit() ``` Origin circuit is: ```bash q0: ──X────X────H── q1: ──H──────────── ``` After compiler: ```bash q0: ──H── q1: ──H── ```