Partial transpose of a reduced density matrix of type ITensor

Hi,

I wish to ask for advice regarding the problem of partial transposing a reduced density matrix (RDM) when the latter is of ITensor type (and not an MPO). I ask this because I have used the approach described in Is this a correct way to calculate one-site and two-site entanglement spectrum and entropy? to obtain a n-site RDM as I found this approach (among others described in this forum and elsewhere - thanks to the OP of that thread) as the one that I could best imagine and work with (and it has benchmarked correctly with literature on a couple of canonical models), but the RDM thus constructed is of ITensor type as opposed to an MPO… As such, the approach suggested in partial transpose of MPO doesn’t work or at least I am unable to make it work.

I’ve tried a few things but to no avail - I’ve tried printing out the indices and using swapinds directly on the ITensor-typed-RDM but I get shown errors about the Indexes , I’ve also tried converting the ITensor-typed-RDM to first an MPS and then to MPO and then using what Matt suggested in the second link above, and a few related things like that.

I am sure there’s a silly mistake I am doing or a loophole in my thinking, so I would be grateful if someone could suggest me a correct way to partial transpose an Itensor-typed-RDM.

Thanks,
aditya