  We demonstrate sensing of inhomogeneous dc magnetic fields by employing
entangled trapped ions, which are shuttled in a segmented Paul trap. As
\textit{sensor states}, we use Bell states of the type
$\left|\uparrow\downarrow\right>+\text{e}^{\text{i}\varphi}\left|\downarrow\uparrow\right>$
encoded in two $^{40}$Ca$^+$ ions stored at different locations. Due to the
linear Zeeman effect, the relative phase $\varphi$ serves to measure the
magnetic field difference between the constituent locations, while common-mode
fluctuations are rejected. Consecutive measurements on sensor states encoded in
the $\text{S}_{1/2}$ ground state and in the $\text{D}_{5/2}$ metastable state
are used to separate an ac Zeeman shift from the linear dc Zeeman effect. We
measure magnetic field differences over distances of up to $6.2~\text{mm}$,
with accuracies of around 300~fT, sensitivities down to $12~\text{pT} /
\sqrt{\text{Hz}}$, and spatial resolutions down to $10~\text{nm}$. For
optimizing the information gain while maintaining a high dynamic range, we
implement an algorithm for Bayesian frequency estimation.
