Hi all.
Hope you are doing well.
With this message, I would like to address a problem I am currently encountering in computing the partial transpose and the log negativity of a spin ring with N=14 sites.
To start with a simple case, I used a linear chain of say 14 sites for mixed spin chain (1, 1/2), and with some help (from here mainly) I got some results in finding the reduced density matrix (RDM) of the chain.
However, another important step would be to compute the partial transpose of let say some chosen sites via:
ket = psi[1]*psi[2]
bra= dag(ket)
rho = prime(ket,“Site”)*bra
;
N=partial_transpose_per(rho, 2, (6,6))
where for the partial transpose I use the following code:
function partial_transpose_per(x, sys, dims)
n = length(dims)
d = prod(dims)
s = n - sys + 1
p = collect(1:2n)
p[s] = n + s
p[n + s] = s
rdims = reverse(dims)
r = reshape(x, (rdims…, rdims…))
return reshape(permutedims(r,p),(d,d))
end
;
My problem is at the level of the partial transpose here since it seems there is a mismatch although rho has the dimension 232*3.
Please, do someone know how to solve the problem of dimension mismatch here since I’ve tried couple of things but so far none seems successful?
Sincerely,
Idriss