mindquantum.algorithm.compiler.rzz_decompose
- mindquantum.algorithm.compiler.rzz_decompose(gate: gates.Rzz)[源代码]
分解一个的
Rzz
门。样例:
>>> 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) ┠─┨╺╋╸┠─── ┗━━━┛ ┗━━━━━━━┛ ┗━━━┛