## 2 Some Mathematics on Spatial Resolution
### Longitudinal Spatial Resolution of a Magnetic Field
On the other hand for \(\lambda\) = 0.32 nm the difference are 5.5 gray values on a gray scale of 0-127, a small change of the wavelength to \(\lambda\) = 0.34 nm increases the difference to 32 gray values as shown in Figure 5. The longitudinal spatial magnetic resolution \(\Delta y\) is mainly a function of the path length s, s = s(s\({}_{spin-flip}\)), the size of B in the sample, on \(\lambda\) and the wavelength spread \(\frac{\Delta\lambda}{\lambda}\). Figure 4: Calculated polarized neutron images: magnetized coil (red) with B-fields = 4 mT and 7 mT, four image projections due to polarized neutron imaging (\(\lambda\) = 0.32 \(\times\) 10\({}^{-9}\) m) for sample orientations 0\({}^{\circ}\) (2) and 90\({}^{\circ}\) (2) with respect to neutron flight direction = y-axis, and the corresponding line plots illustrating the effect of position-dependent \(\int B\cdot ds\). Please note that the B-field is homogeneously distributed in the coil and therefore produces a homogeneous image at the 90\({}^{\circ}\) projections. The 4 mT B-field produces 5.3 spin flips, the 7 mT B-field 9.2 spin flips, so the gray values for the 90\({}^{\circ}\) orientations are very similar, gray scale = 0–127. Figure 3: Contrast reduction of spin flips (minima and maxima in plot) due to a wavelength spread \(\pm\Delta\lambda/\lambda\)\(\sim\)10% (mean \(\lambda\) = 0.32 nm), red and blue line corresponds to magnetic fields B = 4 mT and 7 mT. The larger \(\Delta\lambda/\lambda\) and B the shorter the path length for a number (6) of spin flips. A longitudinal magnetic transfer function can be achieved by measuring the image fringe contrast as a function of different B with decreasing path length s. A fringe pattern is obtained by a proper coil operated with different currents, and measured by polarized neutron imaging (see Figure 6). The longitudinal spatial B resolution refers to the path length in the direction of the neutron trajectory through B. A fraction of this path length correlates with a fraction of the spin-flip and results in a different gray value in the image than a full spin-flip. For the \(\{x,z\}\)-plane (and any other plane), one obtains a frequency-dependent contrast function of different fringe patterns with a coil and imaged with polarized neutrons. The magnetic field in a coil of finite length L and radius R, B is given by [50]  
\[B(x)=B_{0}\cdot\left(\frac{x+\frac{L}{2}}{\sqrt{R^{2}+\left(x+\frac{L}{2} \right)^{2}}}-\frac{x-\frac{L}{2}}{\sqrt{R^{2}+\left(x-\frac{L}{2}\right)^{2}} }\right);\quad B_{0}=\frac{\mu_{0}\cdot n\cdot I}{2} \tag{8}\]  
where the axis of the coil is parallel to \(\vec{B}=[B(x),0,0]\). For \(L\gg R\) one obtains for \(B(0)\approx\mu_{0}\cdot n\cdot I\), and \(B(\pm L/2)\approx 1/2\cdot B(0)\) (see Figure 7). Figure 5: Two magnetic fields (4 mT and 7 mT) show nearly the same gray value for \(\lambda\) = 0.32 nm and a path length = 28 mm, a small change of \(\lambda\) = 0.34 nm increases the difference from 5 to 32 gray values, i.e., if the B-field in a sample is unknown, changing the wavelength may help identify B.  
Figure 6: Calculated polarized neutron images: different fringe patterns due to different \(\int Bds\) in a coil, left: fringe pattern with a square coil, right: fringe pattern with a cylindrical coil. The B-field in a coil with a length L much greater than the radius R, is known to be \(\mu_{0}\cdot N\cdot I/L\), \(\mu_{0}=4\pi\cdot 10^{-7}\), \(N\) = number of winding, \(I\) = current and \(L\) = length. Figure 4 shows the calculated 2D polarized neutron images of a coil due to position-dependent depolarization of a polarized neutron beam, using the Radon Transform of the B-field of the sample. Such calculations (using the Radon Transform of a B-field) give perfect agreement with experimental results [36], even for rather complicated samples [51]. The images in Figure 4 were calculated with \(B=\mu_{0}\cdot N\cdot I/L\). For a coil, \(\mu_{o}\), \(N\) and \(L\) are given device parameters, the current I and thus also B can be varied.