Solution (source code)

= Solution

Only $A_z$ depends on <position>. Taking the <curl>,
$$
\boxed{\mathbf B=\nabla\times\mathbf A=\frac{B_0x}{L}\,\hat{\mathbf y}.}
$$
The field reverses across $x=0$. Its <divergence> is zero, as required for a <magnetic field>; the vanishing field on the midplane is important for the crossing and <separatrix> <trajectories> below.