Hi there,

I have some old v2 ITensor code that I would like to make current with v3. I would just like to access tensor elements (real part). This might be similar to https://itensor.org/support/1209/accessing-elements-of-tensor-with-variable-rank?show=1209#q1209.

I've done a DMRG calculation with an output `psi`

(MPS). This is a snippet of my proceeding code.

```
int N = length(psi);
auto sites = SpinHalf(N);
ITensor cap;
for (auto i : range1(N)) {
auto tensor = i == 1 ? psi.A(i) : cap * psi.A(i);
auto rho = prime(dag(tensor), "Site") * tensor;
auto I = sites(i);
auto Ip = prime(I);
vector<Real> weights(2+1);
for (auto idx : range1(2)) {
weights[idx] = rho.real(I(idx), Ip(idx));
}
// irrelevant stuff
}
```

This returns the following error (see https://github.com/ITensor/ITensor/blob/1011a6f9c56eccf60b117920fc06d6f296ca8e58/itensor/tensor/permutation.h#L135):

```
terminate called after throwing an instance of 'std::runtime_error'
what(): sets are not permutations of each other
Aborted (core dumped)
```

The line that's giving me trouble is `rho.real(I(idx), Ip(idx))`

. What's the new way of doing this?

Thank you for your help. I hope you all are staying safe!