The first if block in the while loop (line 7) is only executed if the TD-ADGA algorithm has found that the PES was no longer converged after the previous time-step. If this is the case the current time (t), wave function (y), wave function derivatives ( dy dt ), and PES (V ) is reset to a previous time. If the full restart scheme is used, the wave function parameters are all set to their initial values at t 0 but the PES is set to the updated potential (V upd ).