sf.program_utils.Command¶
-
class
Command(op, reg)[source]¶ Bases:
objectRepresents a quantum operation applied on specific subsystems of the register.
A Command instance is immutable once created, and can be shared between several
Programinstances.- Parameters
op (Operation) – quantum operation to apply
reg (Sequence[RegRef]) – Subsystems to which the operation is applied. Note that the order matters here.
Methods
Subsystems the command depends on.
-
get_dependencies()[source]¶ Subsystems the command depends on.
Combination of
self.regandself.op.measurement_deps.Note
measurement_depsare used to ensure that the measurement happens before the result is used, but this is a bit too strict: two gates depending on the same measurement result but otherwise acting on different subsystems should commute.- Returns
set of subsystems the command depends on
- Return type
set[RegRef]