Closed ytdHuang closed 4 months ago
the tensor
or kron
function, seems to be only defined for Kets, Bras, and Operators, is it still necessary to write methods for the super operators
I can’t figure out what a tensor product between two superoperators should make, physically. So, I think that the definition of tensor product on the superoperators is meaningless
It is defined in the qutip permute
for these types but i'm not sure how to think about them either atm.
@albertomercurio @aarontrowbridge
There are some rare situations which we want the SuperOperator
to be in block matrix form (easier to analyze the dynamics in some specific topics).
Consider a Operator
with sub-systems $A$ and $B$ ($\mathcal{H}_A \otimes \mathcal{H}_B$). The Hilbert space of it's corresponding SuperOperator
could be written as:
$$\mathcal{H}_A \otimes \mathcal{H}_B \otimes \mathcal{H}_{A'} \otimes \mathcal{H}_{B'}$$
What I have in my mind is some functions that allow me to obtain the SuperOperator
with the following Hilbert space order:
$$\mathcal{H}_A \otimes \mathcal{H}_{A'} \otimes \mathcal{H}_B \otimes \mathcal{H}_{B'}$$
But this could actually be done by transferring the SuperOperator
back to Operator
form, apply the permute
, and then transfer it back to SuperOperator
type:
A = Qobj(rand(NA, NA))
B = Qobj(rand(NB, NB))
AB = tensor(A, B)
S = spre(AB) # super operator
op1 = Qobj(S, type = Operator, dims = [NA, NB, NA, NB])
op2 = permute(op1, [1, 3, 2, 4])
S_new = Qobj(op2, type = SuperOperator, dims = [NA, NB])
So, yes !
I think for current stage, we can just focus on permute
for Ket
, Bra
, and Operator
types of QuantumObject
.
@ytdHuang thanks for the feedback! I'm in the process of making all of the changes you suggested. I'm in the process of groking what's going on in the ptrace
function as it relates to permutations, it is definitely a more elegant approach than mine!
Support the function
permute
inQuTiP
, something like:Should support for the following types of quantum object:
KetQuantumObject
BraQuantumObject
OperatorQuantumObject
SuperOperatorQuantumObject
OperatorKetQuantumObject
OperatorBraQuantumObject