mindquantum.algorithm.compiler.cy_decompose
- mindquantum.algorithm.compiler.cy_decompose(gate: gates.YGate)[源代码]
分解一个受控的
YGate
门。样例:
>>> from mindquantum.algorithm.compiler import cy_decompose >>> from mindquantum.core.circuit import Circuit >>> from mindquantum.core.gates import Y >>> cy = Y.on(1, 0) >>> origin_circ = Circuit() + cy >>> decomposed_circ = cy_decompose(cy)[0] >>> origin_circ q0: ────■───── ┃ ┏━┻━┓ q1: ──┨ Y ┠─── ┗━━━┛ >>> decomposed_circ q0: ───────────■─────────── ┃ ┏━━━━┓ ┏━┻━┓ ┏━━━┓ q1: ──┨ S† ┠─┨╺╋╸┠─┨ S ┠─── ┗━━━━┛ ┗━━━┛ ┗━━━┛