Let . For a constant uniform magnetic field, choose the symmetric gauge
which has and . With , one may take . The coordinate is then absent from the Lagrangian, so it is an ignorable coordinate. Its generalized momentum
is conserved. Hence
which is the canonical momentum parallel to a uniform magnetic field in this gauge.