overhead of creating tvdp engines
Posted: 12 Oct 2021, 13:18
I want to code a step-wise Floquet drive using tdvp. Since I will be switching between two MPO-Hamiltonians, the pedestrian solution would be to create a tdvp engine every time evolution step, which also instantiates the engine class every time step. I was wondering if this will result in unnecessary overhead, as compared to preallocating two engines first (or one modified coupled engine), and then just using the engine_1.run(), engine_2.run() successively [as the state psi is being updated in place anyway].
I am aware that the above is currently likely not immediately doable with TeNPy, since the tdvp engine's __init__ also instantiates an environment variable. But it's also not too hard to do (I guess), as a trivial modification of the tdvp engine class. However, before I go for it, I thought I might consult the experts first, to make sure this idea makes sense from the perspective of the intrinsic tdvp engine code (it may well be that the overhead of creating the engines every new step is negligible anyway).
I am aware that the above is currently likely not immediately doable with TeNPy, since the tdvp engine's __init__ also instantiates an environment variable. But it's also not too hard to do (I guess), as a trivial modification of the tdvp engine class. However, before I go for it, I thought I might consult the experts first, to make sure this idea makes sense from the perspective of the intrinsic tdvp engine code (it may well be that the overhead of creating the engines every new step is negligible anyway).