Growth of Sobolev norms for unbounded perturbations of the Schrödinger equation on flat tori