Time-dependent harmonic potentials for momentum or position scaling