Superoperator Unity#
Class representing unity superoperator
Class Details#
- class quantarhei.qm.liouvillespace.supopunity.SOpUnity(dim: int | None = None, data: Any = None)[source]#
Bases:
SuperOperatorClass representing a unity superoperator
- Parameters:
dim (int) – Dimension of the unity superoperator
data (array) – If data is specified, only their first dimension is used to construct a unity superoperator
Examples
Creation of an empty operator is not allowed
>>> empty = SOpUnity() Traceback (most recent call last): ... quantarhei.exceptions.QuantarheiError: Dimension of the superoperator has to be defined
Creating unity superoperator of defined dimensions
>>> SU = SOpUnity(dim=3) >>> print(SU.data.shape) (3, 3, 3, 3)
>>> import numpy >>> A = numpy.array([[0, 1.0, 2.0], ... [1.0, -3.0, 0.0], ... [-2.0, 0.0, 1.0]])
Application of SU on A should not change the matrix, because it corresponds to multiplication by unity
>>> B = SU.apply(A) >>> numpy.allclose(A,B) True
Knowing the dimension of A, we can create corresponding unity superoperator using A as the data argument:
>>> SU2 = SOpUnity(data=A) >>> C = SU2.apply(A) >>> numpy.allclose(A,C) True