Printing bond dimensions in MPS time evolution

Hello - sorry if I missed this in the documentation but while I know how to set the max/min bond dimension in MPS time evolution, I would like to know how to print out the actual bond dimension being used at each timestep, or even just the max/min bond dimensions being used when I just set the cutoff. How can I do this?

Good question – the best way may depend a bit on how you are doing the time evolution. If you are calling the apply function in a loop (similar to the tutorial here) then you can just add some code inside the loop to print the bond dimensions like this:

@show linkdims(psi)

where psi is your MPS.

Would that approach cover your case?

2 Likes

Yes! This works perfectly thanks!

1 Like