mindquantum.algorithm.compiler.GateReplacer#

class mindquantum.algorithm.compiler.GateReplacer(ori_example_gate, wanted_example_circ)#

将给定的量子门替换成给定的量子线路。

参数:
  • ori_example_gate (BasicGate) - 想要替换的量子门。请注意,相同类型且拥有相同个数的作用为和控制为的量子门会被替换。

  • wanted_example_circ (Circuit) - 想要的量子线路。

do(dag_circuit)#

执行门替换规则。

参数:
  • dag_circuit (DAGCircuit) - 想要编译的量子线路的 DAG 图。