Implement a function contract(::MPS, ::MPS)/*(::MPS, ::MPS) that contracts two MPS over common site indices down to an ITensor. This would make it easy to compute a reduced density matrix, for example:
A question about the design would be if you did something like this:
contract(psidag', psi)
it would be an outer product of the two MPS, which would be exponentially large. In theory it could output an MPO in that case, but then one would have to decide what the threshold is for making an MPO vs an ITensor.
Implement a function
contract(::MPS, ::MPS)
/*(::MPS, ::MPS)
that contracts two MPS over common site indices down to anITensor
. This would make it easy to compute a reduced density matrix, for example:A question about the design would be if you did something like this:
it would be an outer product of the two MPS, which would be exponentially large. In theory it could output an MPO in that case, but then one would have to decide what the threshold is for making an MPO vs an ITensor.