partial transpose of MPO

Hi,

Is it possible to realize partial transpose of a density operator? Suppose I have a MPO type object rho as my density operator. And the whole system Hilbert space is \mathcal{H}_A \otimes \mathcal{H}_B with A and B as the left/right half of the system. Then my density operator looks like \rho = \sum_{ijkl} c_{kl}^{ij} \ket{i}\bra{j}\otimes \ket{k}\bra{l}. I want to get the partial transpose \rho^{T_B} = \sum_{ijkl} c_{kl}^{ij} \ket{i}\bra{j}\otimes \ket{l}\bra{k}.

Thanks

This should work:

function partial_transpose(A::MPO, sites)
  A = copy(A)
  for n in sites
    A[n] = swapinds(A[n], siteinds(A, n)...)
  end
  return A
end

which you can use like this:

julia> using ITensors

julia> s = siteinds("Qubit", 4);

julia> rho = MPO(s, "Id")
MPO
[1] ((dim=2|id=931|"Qubit,Site,n=1")', (dim=2|id=931|"Qubit,Site,n=1"), (dim=1|id=283|"Link,l=1"))
[2] ((dim=2|id=111|"Qubit,Site,n=2")', (dim=2|id=111|"Qubit,Site,n=2"), (dim=1|id=735|"Link,l=2"), (dim=1|id=283|"Link,l=1"))
[3] ((dim=2|id=666|"Qubit,Site,n=3")', (dim=2|id=666|"Qubit,Site,n=3"), (dim=1|id=692|"Link,l=3"), (dim=1|id=735|"Link,l=2"))
[4] ((dim=2|id=756|"Qubit,Site,n=4")', (dim=2|id=756|"Qubit,Site,n=4"), (dim=1|id=692|"Link,l=3"))


julia> partial_transpose(rho, 3:4)
MPO
[1] ((dim=2|id=931|"Qubit,Site,n=1")', (dim=2|id=931|"Qubit,Site,n=1"), (dim=1|id=283|"Link,l=1"))
[2] ((dim=2|id=111|"Qubit,Site,n=2")', (dim=2|id=111|"Qubit,Site,n=2"), (dim=1|id=735|"Link,l=2"), (dim=1|id=283|"Link,l=1"))
[3] ((dim=2|id=666|"Qubit,Site,n=3"), (dim=2|id=666|"Qubit,Site,n=3")', (dim=1|id=692|"Link,l=3"), (dim=1|id=735|"Link,l=2"))
[4] ((dim=2|id=756|"Qubit,Site,n=4"), (dim=2|id=756|"Qubit,Site,n=4")', (dim=1|id=692|"Link,l=3"))
4 Likes

Got it. Thanks Matt.