mindquantum.core.circuit.ChannelAdderBase

View Source On Gitee
class mindquantum.core.circuit.ChannelAdderBase(add_after=True)[source]

Add noise channel after or before quantum gate.

This class is the base class for channel adder. In the derived class, you need to define the _accepter, _excluder and _handler method. The _accepter method is a set of accept rules that every gate you want to add channel should be accepted by those rules. The _excluder method is a set of deny rules that every gate you want to add channel should not be accepted by those rules. The _handel is the action you want to do when _accepter is accepted and _excluder is denied.

Parameters

add_after (bool) – Whether add channel after gate or before gate. Default: True.