# how to compute the overlap with the original MPS after time evolution?

Dear Itensor,

I'm computing the time evolution of MPS according to this webpage https://itensor.org/docs.cgi?page=formulas/tevol_mps_mpo. Say that before the time evolution, I have MPS psi0, and after the time evolution I end up with MPS psi1. How should I compute the inner product between psi0 and psi1? (I tried psi0 * psi1 directly, but it didn't seem to work.)

Thanks very much!
Yantao

commented by (310 points)
Never mind. I found the overlapC function!

+1 vote

Yes, glad you figured out the answer, which is to use the function "overlap" in case you expect a real-valued overlap or the function "overlapC" if you expect a complex-valued output.

It's an interesting idea to define * to do overlap between MPS. We'll think about it. But one issue is simply a C++ issue, which is that function calls can only return a single type, so it would have to be a complex number to work in general. We could have psi * phi, where psi and phi are two MPS, result in a scalar ITensor though, which can be either real or complex.

Best regards,
Miles

commented by (310 points)
Dear Miles,

Thanks very much for the reply. Much appreciated!

Yantao
commented by (310 points)
Dear Miles,

I have another question: is there any (convenient) way to carry out the infinite algorithm of time evolution within ITensor. I tried the toExpH and applyMPO way and it works very well, but it would be very nice if these algorithms can somehow be adapted to the thermodynamic limit.

Thanks very much!
Yantao
commented by (310 points)
Hmm... I just found the ITEBD code (https://github.com/hoihui/itebd) by Hoi Hui. That seems to an infinite system algorithm. Am I right?
commented by (310 points)
Never mind again! I figured this is indeed a infinite system algorithm. (Sorry for all these trouble!
commented by (9.8k points)
I just want to add that the ITensor v3 syntax is to use the innerC function, overlapC is deprecated.
commented by (310 points)
Got it. Thanks!