Trigger
QuICT.core.operator.Trigger ¶
Trigger(targets: int, state_gate_mapping: Union[dict, list, tuple, FunctionType], position: Union[int, list] = None, name: str = None)
Bases: Operator
The trigger for switch the dynamic circuit; contains the target qubits and related circuits with different state.
Parameters:
-
targets(int) –The number of target qubits.
-
state_gate_mapping(Union[dict, list, tuple, FunctionType]) –The mapping of state and related composite gates. (Union[Dict[int, CompositeGate], List[CompositeGate], Tuple[CompositeGate], FunctionType])
-
position(int, default:None) –The insert position for mapping CompositeGate into Circuit.
-
name(str, default:None) –The name of current trigger, Default to Trigger.
Raises:
-
TypeError–Error input parameters.
Source code in QuICT/core/operator/trigger.py
mapping ¶
Return the related composite gate with given qubits' measured state.
Parameters:
-
state(int) –The qubits' measured state.
Returns:
-
CompositeGate–The related composite gate.