Effect of gradient alignment in heat assisted magnetic recording