sf.program_utils.RegRef

class RegRef(ind)[source]

Bases: object

Quantum register reference.

The objects of this class refer to a specific subsystem (mode) of a quantum register.

Within the scope of each Program instance, only one RegRef instance should exist per subsystem. Program keeps the authoritative mapping of subsystem indices to RegRef instances. Subsystem measurement results are stored in the “official” RegRef object. If other RegRef objects referring to the same subsystem exist, they will not be updated. Once a RegRef is assigned a subsystem index it will never change, not even if the subsystem is deleted.

The RegRefs are constructed in Program._add_subsystems().

Parameters

ind (int) – index of the register subsystem referred to

par

Convert the RegRef into a measured parameter.

par

Convert the RegRef into a measured parameter.

Returns

measured parameter linked to this RegRef

Return type

MeasuredParameter