MPS Summation behavior

I’m trying to run some simple time evolution of my system under some Hamiltonian H, by projecting the initial state onto some energy eigenstates.

Namely, for some initial state |\psi\rangle , I’m consider some lowly excited states of H which will call \{|i\rangle \} by writing:

|\psi \rangle = \sum_i^N |i\rangle \langle i | \psi \rangle , s.t. \ \ \ e^{-iHt}|\psi \rangle =\sum_i^N c_i(\psi )e^{-iE_it} |i\rangle

For the system I’m considering, some overlap analysis seems to indicate only N \sim 20 suffice to have a good description of the initial state.

However in the MPS implementation this summation process turns out to be 1. slow 2. produces extremely large wavefunctions.
I assume this is because the summation is done by simply performing direct sums of the tensors at each site, and presumably without truncation at each step.

How do I potentially control this behavior? A quick look at the “+” operation defined for MPS object makes me think the ‘cutoff’ is hardcoded at 1e-15, and the maxdim seems to be controlled internally, which should not lead to the above behavior.

The relevant code I am using (this produces an error as cutoff is not accepted as kwarg)

            phase = exp.( -im * dt * staticenergy)
            teeigenwf = phase .* overlaps .* staticwf
            totalwf = sum(teeigenwf; cutoff=cutoff)

It could also simply mean that summing MPS is not a good practice in general, and I should explicitly evaluate the observables manually,

1 Like

I think if the code is running slowly, then you’re right about the cutoff not being provided at the lower level of the code that does the MPS summation.

Please try using the ITensor function add (documented here) which can add a set of MPS. You can “splat” the MPS like this:

result = add(teeigenwf...; cutoff=cutoff)

I think what might be going wrong in your code is that sum is a generic Julia Base function and is basically calling the + operator on the MPS, but not passing cutoff since the built-in Julia sum function does not know about that keyword argument.