Superoperator¶
Class representing superoperators
This class represents operators on the space of Hilbert space operators. Usually, we refer to such operators as superoperators.
Class Details¶
-
class
quantarhei.qm.liouvillespace.superoperator.
SuperOperator
(dim=None, data=None, real=False)[source]¶ Class representing superoperators
Parameters: - dim (int) – Dimension of the superoperator
- data (array) – Data of the superoperator
- real (bool) – Is this data real? False if they are complex
Examples
Creation of an empty SuperOperator is allowed
>>> So = SuperOperator() >>> print(So.dim is None) True
But calling uninitialize data attribute raises an exception >>> print(So.data is None) Traceback (most recent call last):
…AttributeError: ‘SuperOperator’ object has no attribute ‘_data’
Creating with dim arguments creates a zero superoperator
>>> So = SuperOperator(dim=3) >>> print(So.dim) 3 >>> print(So.data.shape) (3, 3, 3, 3)
Creating superoperator from data checks, if the data object has the correct shape
>>> data = numpy.zeros((3,3,3)) >>> So = SuperOperator(data=data) Traceback (most recent call last): ... Exception: The data do not represent a superoperator
>>> data = numpy.zeros((3,1,3,2)) >>> So = SuperOperator(data=data) Traceback (most recent call last): ... Exception: `data` has to be `square` four-dimensional matrix
Attributes: - data
Methods
apply
(oper[, copy])Applies superoperator to an operator transform
(SS[, inv])Transforms the superoperator to a new basis get_current_basis protect_basis set_current_basis unprotect_basis -
apply
(oper, copy=True)[source]¶ Applies superoperator to an operator
Parameters: oper (Operator) – Operator on which the present superoperator is applied Examples
>>> import quantarhei as qr >>> import numpy >>> op = qr.ReducedDensityMatrix(data=[[0.0, 1.0], [1.0, 0.0]])
Let’s take a matrix A
>>> A = numpy.zeros((2,2)) >>> A[0,1] = 1.0 >>> A[1,0] = 1.0
and create a superoperator equivalent to matrix multiplication
\[ \begin{align}\begin{aligned}A\rho = \sum_{i}A_{ik}\rho_{kj} = \ \sum_{kl}\delta_{jl}A_{ik}\rho_{kl} = \ \sum_{kl}D_{ijkl}\rho_{kl}\\D_{ijkl} = \delta_{jl}A_{ik}\end{aligned}\end{align} \]>>> data = numpy.zeros((2,2,2,2)) >>> for i in range(2): ... for j in range(2): ... for k in range(2): ... for l in range(2): ... if j == l: ... data[i,j,k,l] = A[i,k] ... else: ... data[i,j,k,l] = 0.0 >>> Dd = SuperOperator(data=data)
Now we can check that maultiplication and application of the superoperator lead to the same result.
>>> B1 = Dd.apply(op) >>> B2 = numpy.dot(A,op.data) >>> numpy.allclose(B1.data, B2) True
Every time you do this, new density matrix object is created. To avoid this, we can apply the operation without copying the object.
>>> B3 = Dd.apply(op, copy=False) >>> print(B3 == op) True
B3 is now a different reference to the same object as op. We can check that the result of the operation is still correct:
>>> numpy.allclose(B3.data, B2) True
-
transform
(SS, inv=None)[source]¶ Transforms the superoperator to a new basis
Transformation of the superoperator follows similar rules as the one of operators. An operar \(A\) is transformed as follows:
\[A_{\alpha\beta} = \sum_{ij}(s^{-1})_{\alpha i}A_{ij}s_{j\beta}\]and
\[A_{ij} = \sum_{\alpha\beta} s_{i\alpha} \ A_{\alpha\beta}(s^{-1})_{\beta j}\]The transformation matrix \(s\) is obtained by standard diagonalization routines and its elements can be expressed in Dirac notation as
\[s_{i\alpha} = \langle i | \alpha \rangle\]The inverse matrix \(s^{-1}\) is obtained by transposition, because
\[\langle i | j \rangle = \delta_{ij} = \ \sum_{\alpha} \langle i | \alpha \rangle \ \langle \alpha | j \rangle\]and we see that
\[(s^{-1})_{\alpha i} = s_{i \alpha}.\]Given an operator \(A\) which is a result of an action of the superoperator \(R\) on operar \(A\) we can see that the transformation occurs as follows:
\[A_{ij} = \sum_{kl}R_{ijkl}B_{kl}\]\[A_{\alpha\beta} = \ \sum_{ij}(s^{-1})_{\alpha i}A_{ij}s_{j\beta} = \ \sum_{ijkl} (s^{-1})_{\alpha i} s_{j\beta} R_{ijkl} B_{kl}\]Using the back transformation of the operator \(B\) we obtaine
\[A_{\alpha\beta} = \ \sum_{ij}(s^{-1})_{\alpha i}A_{ij}s_{j\beta} = \ \sum_{\gamma\delta} \left [ \right ] B_{\gamma\delta}\]which translates into
\[R_{\alpha\beta\gamma\delta} = \ \sum_{ijkl} s_{i \alpha} \ s_{j\beta} R_{ijkl} \ s_{k\gamma}s_{l\delta}\]Parameters: - SS (float matrix) – Transformation matrix
- inv (float matrix, optional) – Inverse of the transformation matrix
Examples