Deforming polar active matter in a scalar field gradient