In the following, it is assumed that the system is 2-dimensional with z as the invariant axis, i.e. ∂ ∂ ∂ ∂ z produces 0 for any quantity. Then the magnetic field can be written in cartesian coordinates as B = ( ∂ ∂ A ∂ ∂ y , − − ∂ ∂ A ∂ ∂ x , B z ( x , y ) ) , or more compactly, B = ∇ ∇ A × × z ^ ^ + B z z ^ ^ , where A ( x , y ) z ^ ^ is the vector potential for the in-plane (x and y components) magnetic field. Note that based on this form for B we can see that A is constant along any given magnetic field line, since ∇ ∇ A is everywhere perpendicular to B. (Also note that -A is the flux function ψ ψ mentioned above.)