Vanishing net charge density does not require vanishing current. Positive and negative charge carriers can cancel in charge density while their oppositely directed motions add to a nonzero current. Charge conservation only requires
for magnetostatics this becomes .
Because , one may introduce a magnetic vector potential with
It is not unique: gives the same field for any scalar .
For the stated current,
so it is consistent with stationary charge conservation. Direct calculation gives
Thus is a Beltrami field. For , choose
Then and . A convenient Coulomb-gauge potential is
since and . Gradient gauge terms may of course be added.
If , the current is the constant field . The formulas involving do not apply; one valid choice is