SubsystemMapping

class SubsystemMapping(matrix, in_subsystems, out_subsystems=None)[source]

Bases: object

A linear mapping from a list of subsystems representing a tensor product space to another.

This class represents a linear map \(A : V_1 \otimes \dots \otimes V_n \rightarrow W_1 \otimes \dots \otimes W_m\), where \(A\) is specified as a matrix, and the tensor factors of both the input and output spaces are given as lists of Subsystem instances. The main usage is for mapping abstract operators or QuantumSystemModel instances: the conjugate() method, or simply treating the mapping as Callable, conjugates an operator or all operators within the QuantumSystemModel by \(A\). As usual, for any subsystems in the in_subsystems of the mapping that the operator are not explicitly defined on, the operator is assumed to act as the identity.

See the How-to use advanced system modelling functionality userguide entry for example usage of this class.

Initialize.

Parameters:
  • matrix (ndarray) – The matrix form of the linear map.

  • in_subsystems (Union[Subsystem, List[Subsystem]]) – The list of input subsystems.

  • out_subsystems (Union[Subsystem, List[Subsystem], None]) – The list of output subsystems.

Methods

conjugate(operator)[source]

Conjugate a subsystem operator or model.

Returns a subsystem operator representing \(A O A^\dagger\), where \(A\) is the mapping matrix, and \(O\) is the input operator. If applied to a QuantumSystemModel, the mapping is applied to all operators in the model.

Parameters:

operator (Union[AbstractSubsystemOperator, QuantumSystemModel]) – The operator to be conjugated.

Returns:

The conjugated operator or model.

Return type:

Union[MappedOperator, QuantumSystemModel]

Attributes

in_subsystems

Subsystems for input to the mapping.

matrix

Concrete matrix encoding the action of the mapping.

out_subsystems

Subsystems for mapping output.