## How to efficiently save and resume calculation

How do I use this algorithm? What does that parameter do?
yuchihe
Posts: 6
Joined: 26 Apr 2021, 16:46

### How to efficiently save and resume calculation

My question is related to "circumvent" time-wall of computer clusters.
If principle, we can save data before the hitting the time-wall and start a new job to continue the calculation with the data.
However, my experience is that for iDMRG, only saving the MPS (psi) is not efficient enough. Because starting a calculation only with psi seems to cost time not much shorter than that of a completely new calculation.

Should save and load "environment" mitigate the problem? Is there a relatively simple way to do that?
yuchihe
Posts: 6
Joined: 26 Apr 2021, 16:46

### Re: How to efficiently save and resume calculation

I did not notice that in the more recent version (0.8.4), the simulation module exactly enables the resume from checkpoints. The logger system has also been updated and completely moved to the simulation module. Thanks for the author.
Johannes
Posts: 324
Joined: 21 Jul 2018, 12:52
Location: TU Munich

### Re: How to efficiently save and resume calculation

Indeed, the tenpy.simulations.Simulation classes are built to support exactly this in a generic way for the various algorithms.
The idea is that you start your simulation with run_simulation, it saves snapshot at certain checkpoints (e.g. during DMRG between sweeps), and you can resume from these checkpoint files with tenpy.simulations.simulation.resume_from_checkpoint given only the filename.

It's not yet well documented at the moment, sorry about that.
Fabio_Mendez
Posts: 3
Joined: 01 Feb 2022, 01:50

### Re: How to efficiently save and resume calculation

Hi there, I wasn't able to make this work. Do you have an example code of the usage of the checkpoints?
Regards,
F. P. M. Méndez-Córdoba.