mindquantum.algorithm.compiler.rzz_decompose
- mindquantum.algorithm.compiler.rzz_decompose(gate: gates.Rzz)[source]
Decompose
Rzz
gate.- Parameters
- Returns
List[
Circuit
], all possible decompose solution.
Examples
>>> from mindquantum.algorithm.compiler import rzz_decompose >>> from mindquantum.core.circuit import Circuit >>> from mindquantum.core.gates import Rzz >>> rzz = Rzz(1).on([0, 1]) >>> origin_circ = Circuit() + rzz >>> decomposed_circ = rzz_decompose(rzz)[0] >>> origin_circ ┏━━━━━━━━┓ q0: ──┨ ┠─── ┃ ┃ ┃ Rzz(1) ┃ q1: ──┨ ┠─── ┗━━━━━━━━┛ >>> decomposed_circ q0: ────■───────────────■───── ┃ ┃ ┏━┻━┓ ┏━━━━━━━┓ ┏━┻━┓ q1: ──┨╺╋╸┠─┨ RZ(1) ┠─┨╺╋╸┠─── ┗━━━┛ ┗━━━━━━━┛ ┗━━━┛