3.1.4. qupulse._program.transformation

class qupulse._program.transformation.ChainedTransformation(*transformations)[source]

Bases: qupulse._program.transformation.Transformation

chain(next_transformation)[source]
Return type

ChainedTransformation

property compare_key

Implements compare_key.

Return type

Tuple[Transformation, …]

get_input_channels(output_channels)[source]

Implements get_input_channels().

Return type

Set[Union[str, int]]

get_output_channels(input_channels)[source]

Implements get_output_channels().

Return type

Set[Union[str, int]]

property transformations
Return type

Tuple[Transformation, …]

class qupulse._program.transformation.IdentityTransformation[source]

Bases: qupulse._program.transformation.Transformation

chain(next_transformation)[source]
Return type

Transformation

property compare_key

Implements compare_key.

Return type

None

get_input_channels(output_channels)[source]

Implements get_input_channels().

Return type

Set[Union[str, int]]

get_output_channels(input_channels)[source]

Implements get_output_channels().

Return type

Set[Union[str, int]]

class qupulse._program.transformation.LinearTransformation(transformation_matrix, input_channels, output_channels)[source]

Bases: qupulse._program.transformation.Transformation

Parameters
  • transformation_matrix (ndarray) – Matrix describing the transformation with shape (output_channels, input_channels)

  • input_channels (Sequence[Union[str, int]]) – Channel ids of the columns

  • output_channels (Sequence[Union[str, int]]) – Channel ids of the rows

__init__(transformation_matrix, input_channels, output_channels)[source]
Parameters
  • transformation_matrix (ndarray) – Matrix describing the transformation with shape (output_channels, input_channels)

  • input_channels (Sequence[Union[str, int]]) – Channel ids of the columns

  • output_channels (Sequence[Union[str, int]]) – Channel ids of the rows

property compare_key

Implements compare_key.

Return type

Tuple[Tuple[Union[str, int]], Tuple[Union[str, int]], bytes]

get_input_channels(output_channels)[source]

Implements get_input_channels().

Return type

Set[Union[str, int]]

get_output_channels(input_channels)[source]

Implements get_output_channels().

Return type

Set[Union[str, int]]

class qupulse._program.transformation.OffsetTransformation(offsets)[source]

Bases: qupulse._program.transformation.Transformation

Adds an offset to each channel specified in offsets.

Channels not in offsets are forewarded

Parameters

offsets (Mapping[Union[str, int], Real]) – Channel -> offset mapping

__init__(offsets)[source]

Adds an offset to each channel specified in offsets.

Channels not in offsets are forewarded

Parameters

offsets (Mapping[Union[str, int], Real]) – Channel -> offset mapping

property compare_key

Implements compare_key.

Return type

frozenset

get_input_channels(output_channels)[source]

Implements get_input_channels().

get_output_channels(input_channels)[source]

Implements get_output_channels().

class qupulse._program.transformation.ParallelConstantChannelTransformation(channels)[source]

Bases: qupulse._program.transformation.Transformation

Set channel values to given values regardless their former existence

Parameters

channels (Mapping[Union[str, int], Real]) – Channels present in this map are set to the given value.

__init__(channels)[source]

Set channel values to given values regardless their former existence

Parameters

channels (Mapping[Union[str, int], Real]) – Channels present in this map are set to the given value.

property compare_key

Implements compare_key.

Return type

Tuple[Tuple[Union[str, int], float], …]

get_input_channels(output_channels)[source]

Implements get_input_channels().

Return type

Set[Union[str, int]]

get_output_channels(input_channels)[source]

Implements get_output_channels().

Return type

Set[Union[str, int]]

class qupulse._program.transformation.ScalingTransformation(factors)[source]

Bases: qupulse._program.transformation.Transformation

property compare_key

Implements compare_key.

Return type

frozenset

get_input_channels(output_channels)[source]

Implements get_input_channels().

get_output_channels(input_channels)[source]

Implements get_output_channels().

class qupulse._program.transformation.Transformation[source]

Bases: qupulse.comparable.Comparable

chain(next_transformation)[source]
Return type

Transformation

abstract get_input_channels(output_channels)[source]

Channels that are required for getting data for the requested output channel

Return type

Set[Union[str, int]]

abstract get_output_channels(input_channels)[source]

Return the channel identifiers

Return type

Set[Union[str, int]]

qupulse._program.transformation.chain_transformations(*transformations)[source]
Return type

Transformation