You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So at the very least the behavior of spre has changed for nonsquare operators. I haven't installed the master branch to see what the current behavior is there but if I'm reading this commit correctly, then it appears as though the master branch will just throw a ValueError("Can't create and identity like a non square matrix.").
From searching throw past issues, it looks like these are the relevant pull requests:
For sprepost for rectangular operators, it's clear that the expected behavior should correspond to a supoperator taking density matrices in an input hilbert space to one in a potentially different dimensional output hilbert space. However, I think that it's not completely clear what behavior one should expect of spre (and spost) for rectangular operators. One potentially sensible behavior would be to view spre and spost as special cases of sprepost where one uses the identity isometry between input and output hilbert spaces to form a superoperator which will act like sprepost(A, A.dag()). However, I don't think such superoperators will necessarily correspond to CPTP channels as they may not admit Kraus decompositions which obey the completeness relation (I haven't actually checked this, it's just my intuition). Since it appears somewhat doubtful that anyone is currently using spre or spost with nonsquare operators, my suggestion would actually be to raise a more helpful error that acknowledges there still may be use cases for such a situation.
The text was updated successfully, but these errors were encountered:
qutip 4.7.1 and 5.0.0a1 both allow one to take spre (and spost) of nonsquare operators, but not in a sensible way, for example with qutip 4.7.1
while in qutip 5.0.0a1
So at the very least the behavior of spre has changed for nonsquare operators. I haven't installed the master branch to see what the current behavior is there but if I'm reading this commit correctly, then it appears as though the master branch will just throw a
ValueError("Can't create and identity like a non square matrix.")
.From searching throw past issues, it looks like these are the relevant pull requests:
For
sprepost
for rectangular operators, it's clear that the expected behavior should correspond to a supoperator taking density matrices in an input hilbert space to one in a potentially different dimensional output hilbert space. However, I think that it's not completely clear what behavior one should expect ofspre
(andspost
) for rectangular operators. One potentially sensible behavior would be to viewspre
andspost
as special cases ofsprepost
where one uses the identity isometry between input and output hilbert spaces to form a superoperator which will act likesprepost(A, A.dag())
. However, I don't think such superoperators will necessarily correspond to CPTP channels as they may not admit Kraus decompositions which obey the completeness relation (I haven't actually checked this, it's just my intuition). Since it appears somewhat doubtful that anyone is currently usingspre
orspost
with nonsquare operators, my suggestion would actually be to raise a more helpful error that acknowledges there still may be use cases for such a situation.The text was updated successfully, but these errors were encountered: