@@ -110,9 +110,16 @@ For operators ``A``, ``B`` the relation
110110
111111holds. `op` can be a dense or a sparse operator.
112112"""
113- spre (op:: AbstractOperator ) = SuperOperator ((op. basis_l, op. basis_l), (op. basis_r, op. basis_r), tensor (op, identityoperator (op)). data)
113+ function spre (op:: AbstractOperator )
114+ if ! samebases (op. basis_l, op. basis_r)
115+ throw (ArgumentError (" It's not clear what spre of a non-square operator should be. See issue #113" ))
116+ end
117+ SuperOperator ((op. basis_l, op. basis_l), (op. basis_r, op. basis_r), tensor (op, identityoperator (op)). data)
118+ end
114119
115120"""
121+ spost(op)
122+
116123Create a super-operator equivalent for left side operator multiplication.
117124
118125For operators ``A``, ``B`` the relation
@@ -123,8 +130,27 @@ For operators ``A``, ``B`` the relation
123130
124131holds. `op` can be a dense or a sparse operator.
125132"""
126- spost (op:: AbstractOperator ) = SuperOperator ((op. basis_r, op. basis_r), (op. basis_l, op. basis_l), kron (permutedims (op. data), identityoperator (op). data))
133+ function spost (op:: AbstractOperator )
134+ if ! samebases (op. basis_l, op. basis_r)
135+ throw (ArgumentError (" It's not clear what spost of a non-square operator should be. See issue #113" ))
136+ end
137+ SuperOperator ((op. basis_r, op. basis_r), (op. basis_l, op. basis_l), kron (permutedims (op. data), identityoperator (op). data))
138+ end
139+
140+ """
141+ sprepost(op)
127142
143+ Create a super-operator equivalent for left and right side operator multiplication.
144+
145+ For operators ``A``, ``B``, ``C`` the relation
146+
147+ ```math
148+ \\ mathrm{sprepost}(A, B) C = A C B
149+ ```
150+
151+ holds. `A` ond `B` can be dense or a sparse operators.
152+ """
153+ sprepost (A:: AbstractOperator , B:: AbstractOperator ) = SuperOperator ((A. basis_l, B. basis_r), (A. basis_r, B. basis_l), kron (permutedims (B. data), A. data))
128154
129155function _check_input (H:: AbstractOperator{B1,B2} , J:: Vector , Jdagger:: Vector , rates) where {B1,B2}
130156 for j= J
0 commit comments