|View source on GitHub|
Applies an action to a state argument.
cirq.act_on( action: Any, sim_state: 'cirq.SimulationStateBase', qubits: Sequence['cirq.Qid'] = None, *, allow_decompose: bool = True )
For example, the action may be a
cirq.Operation and the state argument may
represent the internal state of a state vector simulator (a
For non-operations, the
qubits argument must be explicitly supplied.
The action is applied by first checking if
action._act_on_ exists and
True (instead of
NotImplemented) for the given object. Then
fallback strategies specified by the state argument via
are attempted. If those also fail, the method fails with a
Nothing. Results are communicated by editing