how to create a density matrix from a ground state (MPS obtained from dmrge)

I am new to ITensor, and I am trying to apply Kraus operator on the density matrix at zero temperature. To this end, I first obtain the ground state wavefunction (\psi) from dmrg. Then, I use “outer”, i.e.,
‘’
rho0=outer(psi’, psi)
‘’
However, the program just keeping running for a long time, and I have to terminate it by hand. Do you know anything going wrong with this code? Or, do you have any suggestions on this issue?

Glad you’re trying out ITensor. Almost certainly what’s going on in this case is that the scaling of outer is the bond dimension of the MPO you are making to the third power, so let’s say D^3, but that bond dimension is the square of your original MPS bond dimension D=\chi^2 so that the overall scaling is D^3 = \chi^6. That’s just the way that outer works.

So either you will need to truncate your MPS a lot more, though that will introduce more approximation errors, or apply the Kraus operators to the two copies of your MPS (that define the density matrix) in a different more custom pattern that scales better. I.e. change the order of operators so that you do not form the entire outer product first, but instead apply the maps to just some of the MPS tensors then introduce the next MPS tensors etc. The exact specifics depend a lot on what you are trying to do in the end: whether to obtain the post-Kraus-mapped density matrix at the end as an MPO? Or to obtain some specific property of the mapped density matrix?