mindquantum.core.circuit.DepolarizingChannelAdder
- class mindquantum.core.circuit.DepolarizingChannelAdder(p: float, n_qubits: int, add_after: bool = True)[source]
Add DepolarizingChannel.
- Parameters
Examples
>>> from mindquantum.core.circuit import MixerAdder, DepolarizingChannelAdder, GateSelector >>> from mindquantum.core.circuit import Circuit >>> circ = Circuit().h(0).x(1, 0) >>> adder = MixerAdder([GateSelector('cx'), DepolarizingChannelAdder(0.1, 2)]) >>> adder(circ) ┏━━━┓ ╔════════════╗ q0: ──┨ H ┠───■───╢ ╟─── ┗━━━┛ ┃ ║ ║ ┏━┻━┓ ║ DC(p=1/10) ║ q1: ────────┨╺╋╸┠─╢ ╟─── ┗━━━┛ ╚════════════╝