Skip to content

Commit 29542d8

Browse files
committed
try to make SciMLOperator v1 work in sprepost
1 parent a39687c commit 29542d8

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/qobj/superoperators.jl

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,11 @@ _sprepost(A::AbstractMatrix, B::AbstractSparseMatrix) = kron(transpose(B), spars
1515
_sprepost(A::AbstractSparseMatrix, B::AbstractMatrix) = kron(transpose(sparse(B)), A)
1616
_sprepost(A::AbstractSparseMatrix, B::AbstractSparseMatrix) = kron(transpose(B), A)
1717
function _sprepost(A, B) # for any other input types
18-
Id_cache = I(size(A, 1))
19-
return _spre(A, Id_cache) * _spost(B, Id_cache)
18+
# TODO: use the commented code (since it is optimized for certain types of SciMLOperators, and was able to give correct results before `SciMLOperators v1.0.0`)
19+
# Id_cache = I(size(A, 1))
20+
# return _spre(A, Id_cache) * _spost(B, Id_cache)
21+
22+
return kron(transpose(B), A)
2023
end
2124

2225
## if input is AbstractSciMLOperator

0 commit comments

Comments
 (0)