mindquantum.algorithm.compiler.cy_decompose
- mindquantum.algorithm.compiler.cy_decompose(gate: gates.YGate)[source]
Decompose controlled
YGate
gate.- Parameters
- Returns
List[
Circuit
], all possible decompose solution.
Examples
>>> 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 ┠─── ┗━━━━┛ ┗━━━┛ ┗━━━┛