mindquantum.algorithm.compiler.try_merge
- mindquantum.algorithm.compiler.try_merge(father_node: GateNode, child_node: GateNode)[source]
Try to merge two gate nodes.
Following this method, we merge two hermitian conjugated into identity, and also merge two same kind parameterized gate into single parameterized gate.
- Parameters
- Returns
bool, whether successfully merged.
List[
GateNode
], the father node after merged.GlobalPhase
, the global phase gate after merge two given gate node.