How do I add a pinning field only for certain numbers of sweeps?

Hi,

I am doing a DMRG calculation for a spin system.
I want to add a pinning field only to a limited number of sweeps, for example the first n sweeps, and then “unpin” the model for the rest of the sweeps. How do I do that?

Thank you!

Good question – currently we don’t have a way coded to change the Hamiltonian during a DMRG calculation. Would it work for your case to just call DMRG twice, first for the Hamiltonian including pinning then a second time using the Hamiltonian without pinning?

(This should mostly be as quick, but there will some cost at the beginning of the second call to DMRG where it has to rebuild the basis used within the DMRG calculation.)

Thank you for the quick answer! I will try that! :slight_smile: