Nanowire magnetic force sensors fabricated by focused electron beam induced deposition

We demonstrate the use of individual magnetic nanowires (NWs), grown by focused electron beam induced deposition (FEBID), as scanning magnetic force sensors. Measurements of their mechanical susceptibility, thermal motion, and magnetic response show that the NWs posses high-quality flexural mechanical modes and a strong remanent magnetization pointing along their long axis. Together, these properties make the NWs excellent sensors of weak magnetic field patterns, as confirmed by calibration measurements on a micron-sized current-carrying wire and magnetic scanning probe images of a permalloy disk. The flexibility of FEBID in terms of the composition, geometry, and growth location of the resulting NWs, makes it ideal for fabricating scanning probes specifically designed for imaging subtle patterns of magnetization or current density.


I. INTRODUCTION
In the early 1800s, images of the stray magnetic fields around permanent magnets and current-carrying wires made with tiny iron filings played a crucial role in the development of the theory of electromagnetism. Today, magnetic imaging techniques such as Lorentz microscopy, electron holography, and a number of scanning probe microscopies continue to provide invaluable insights. Images of magnetic skyrmion configurations 1 or of edge and surface currents in topological insulators 2 have provided crucial direct evidence for these phenomena. The ability to map magnetic field sensitively and on the nanometer-scale -unlike global magnetization or transport measurements -overcomes ensemble or spatial inhomogeneity in systems ranging from arrays of nanometer-scale magnets, to superconducting thin films, to strongly correlated states in van der Waals heterostructures. Local imaging of nanometer-scale magnetization 3 , local Meissner currents 4 , or current in edge-states 5 is the key to unraveling the microscopic mechanisms behind a wealth of new and poorly understood condensed matter phenomena.
The techniques combining the highest magnetic field sensitivity with the highest spatial resolution include scanning Hall-bar microscopy, scanning nitrogen-vacancy (NV) center magnetometry, and scanning superconducting quantum interference device (SQUID) microscopy. Each has demonstrated a spatial resolution better than 100 nm and a magnetic field sensitivity ranging from 500 µT/ √ Hz for Hall-bar microscopy 6 , to 60 nT/ √ Hz for NV magnetometry 7 , and 5 nT/ √ Hz for scanning SQUID microscopy 8 .
than to field gradient, as in the initial demonstration of NW MFM 9 . Furthermore, the FEBID fabrication process allows for a large degree of flexibility in terms of the geometry, composition, and location of the NW transducers. In particular, the possibility of long, thin, and sharp NWs is promising for further increasing field sensitivity and spatial resolution of the technique 10 .

II. FEBID NWS
FEBID is an additive-lithography technique where precursor gas molecules are adsorbed onto a surface and dissociated by a focused electron beam, forming a local deposit [11][12][13][14][15] . It can be used to pattern exceptionally small features, down to a few nanometers. This high resolution patterning is complemented by the capability to produce three-dimensional structures, as well as to pattern on unconventional non-planar surfaces, such as high-aspect-ratio tips. FEBID and its sister technique, focused ion beam induced deposition (FIBID), have been used to produce deposits of various materials with metallic 16 , magnetic 17,18 , superconducting 19 , or photonic 20 functionalities.
They have been used in industry and research for mask repair 21 , circuit editing, lamella fabrication 22 , tip functionalization 23 , and for the fabrication of nano-sensors 24 . They have also been employed in the production of free-standing NWs from both superconducting 25 and -as in this work -magnetic materials 18,26 .
We grow free-standing NWs by FEBID using Co 2 (CO) 8 as a gas precursor at specific positions along the cleaved edge of a Au-coated GaAs chip. Their lengths range from 9.1 µm to 11.0 µm and their base diameters from 105 nm to 120 nm as inferred from scanning electron microscopy (SEM) images. They consist of nanocrystalline Co, with a composition reaching up to 80% 26 , and residues of C and O. Their proximity to the edge of the chip allows optical access from the side for the detection of their flexural motion.
A SEM image of a Co NW standing at the chip edge is shown in Figure 1a. Surface roughness and geometric irregularities are part of the FEBID fabrication process and are present across the 11 NWs studied in this work.

III. MEASUREMENT SETUP
We grow free-standing NWs by FEBID using Co 2 (CO) 8 as a gas precursor at specific positions along the cleaved edge of a Au-coated GaAs chip. Their lengths range from 9.1 µm to 11.0 µm and their base diameters from 105 nm to 120 nm as inferred from scanning electron microscopy (SEM) images. They consist of nanocrystalline Co, with a composition reaching up to 80% 26 , and residues of C and O. Their proximity to the edge of the chip allows optical access from the side for the detection of their flexural motion.
A SEM image of a Co NW standing at the chip edge is shown in Figure 1a. Surface roughness and geometric irregularities are part of the FEBID fabrication process and are present across the 11 NWs studied in this work.
We mount the chip with as-grown Co NWs in a custom-built scanning probe microscope, enclosed in a high-vacuum chamber at a pressure of 1 × 10 −6 mbar. The microscope includes a piezoelectric translation stage, with which we position the NW of interest into the focal spot of fiber-coupled optical interferometer for the detection of the NW's flexural motion 27 . We use a second piezoelectric translation stage to approach and scan the sample of interest below the NW's free end, as illustrated in Figure 1d.
This combined apparatus allows us to use individual NWs as scanning probes operating in the pendulum geometry, i.e. with their long axes perpendicular to the sample surface to prevent snapping into contact 9,28 .
The fiber-coupled optical interferometer operates at 1550 nm and provides a calibrated measurement of the NWs flexural motion projected along the measurement axis (see Appendix A). Figure 1e shows a typical power spectral density (PSD) of an individual NW's thermally excited flexural motion at room temperature, revealing a splitting in resonance frequency of the fundamental mode. This well-known splitting is observed for all examined NWs and is a signature of two nearly degenerate, orthogonal flexural eigenmodes, resulting from cross-sectional asymmetries and/or non-isotropic clamping 29 .
The NW's coupling to the thermal bath results in a Langevin force that drives each mode equally. The difference in the amplitude of the two thermal noise peaks in Figure 1e

V. MAGNETIC PROPERTIES
We probe the magnetic properties of each NW by measuring its mechanical response to a uniform magnetic field B up to 8 T applied along its long axis. In particular, we measure the shift in the resonance frequency of each flexural mode, with T bath = 4.2 K. As in measurements of the other NWs, the data show a smooth V-shaped response for most of the field range, except for discontinuous inversions of the slope ("jumps") in reverse fields of around ±40 mT. These sharp features, which arise from the switching of the NW magnetization, and the steady stiffening of the mechanical response as |B| increases are characteristic of a strong magnet with a square magnetization hysteresis, whose easy axis is nearly parallel to the applied field 30 . Therefore, the data point to NWs with negligible magnetocrystalline anisotropy and an easy axis coincident with their long axis, as set by the magnetic shape anisotropy resulting from their extreme aspect ratio.
In order to extract specific magnetic properties from our measurements, we compare them to micromagnetic simulations, which model both the NW's magnetic state and the way in which its interaction with B affects the mechanical rigidity of the flexural modes. We use Mumax3 31,32 , which employs the Landau-Lifshitz-Gilbert micromagnetic formalism with finite-difference discretization, together with geometrical and material parameters to model each NW. For a given value of B in a hysteresis loop, the numerical simulation yields the equilibrium magnetization configuration and the total magnetic energy E m corresponding to that configuration. Just as in dynamic cantilever magnetometry (DCM) 30,33 , the frequency shift of each flexural mode is proportional to the curvature of the system's magnetic energy E m with respect to rotations θ i corresponding to each mode's oscillation: where l e is an effective length, which takes into account the shape of the flexural mode 34 .
Therefore, by numerically calculating the second derivatives of E m with respect to θ i at each B, we simulate ∆f i (B) (see Appendix B). Note that, unlike in standard DCM, where the magnetic sample is attached to the end of the cantilever, each NW is magnetic along its full length. Because of the mode shape, different parts of the NW rotate by different angles during a flexural oscillation. This effect must be carefully considered in order to correctly model the system.
The excellent agreement between the measured and simulated ∆f i (B) in Figure   we scan it across the Au wire at a fixed tip-sample spacing. Both the resonance frequencies f i and oscillation amplitudes r i are tracked using two phase-locked loops. The corresponding values of the force driving each mode on resonance are calculated using Supplementary Information). Figure 3c shows the response of mode 1 for a drive current amplitude of 47 µA as the NW is scanned above the Au wire at a fixed distance d z = 200 nm in the absense of static magnetic field (B = 0). Since the first mode is nearly aligned with the x-direction (α ≈ 7.3 • ) and thus along the direction of B AC , the orthogonal second mode has almost no response to the driving tone at f 2 and is not shown.
From our torque magnetometry measurements, we know that the magnetic NWs have an axially aligned remanent magnetization. Because the decay length of the magnetic field from our sample is much shorter than the NW length, the sample fields only interact with the monopole-like magnetic charge distribution at the free end of the NW 36 .
This charge distribution then determines the NW's response to magnetic field profiles produced by a sample. For a monopole-like NW tip, we can relate the driving magnetic field and the force it produces on the NW by where q 0 is an effective magnetic monopole moment describing the tip magnetization andr i is the unit vector in the direction of displacement of mode i. In this pointprobe approximation, we consider the interaction of dipole and higher multipoles of the magnetic charge with the driving field to be negligible. As shown by the agreement between the field calculated from the Biot-Savart law and the measured response of NW 4 in Figure 3c, this approximation is valid for our NWs. Control experiments, using the applied magnetic field to initialize the NW magnetization along the opposite direction also show that spurious electrostatic driving of the NW modes is negligible. Combining measurements at different d z and different driving currents, we find that NW 4 has an effective magnetic charge of q 0 = 9.7(4) × 10 −9 A m. Given our thermally limited force sensitivity of 25 aN/ √ Hz at T bath = 4.2 K, this value of q 0 gives our sensors a sensitivity to magnetic field of around 3 nT/ √ Hz. This sensitivity is similar to those of some of the most sensitive scanning probes available, including scanning NV magnetometers and scanning SQUIDs.
Furthermore, the magnetic charge model allows us to estimate the stray field and field gradients produced by the NW tip, so that we can assess its potential for perturbing the magnetic state of the sample below. At a distance of d z = 50 nm from the NW tip, the stray magnetic field and magnetic field gradients are B tip = µ 0 q 0 /(4πz 2 mono ) ≈ 60 mT and dB tip /dz ≈ 1 MT m −1 . The stray field is of similar size to that produced by a conventional MFM tip 40 . For future NW devices to be less invasive, i.e. having less magnetic charge at their tips, sharper tips than those produced here, which are more than 100 nm in diameter, will be required 41 . The large magnetic field gradients, however,  In addition to demonstrating the high-force sensitivity of FEBID-grown NWs, we also show their excellent magnetic properties. The Co NWs measured here maintain a saturation magnetization, which is 80% of the value of pure Co. They also have an axially aligned remanent magnetization with a switching field around 40 mT. These magnetic properties, combined with the aforementioned mechanical properties, make these NWs among the most sensitive sensors of local magnetic field. The ability to fine tune the NW geometry, especially making them thinner and sharper, may allow for even better field sensitivities and spatial resolutions in the future. NW MFM with such transducers may prove ideal for investigating subtle magnetization textures and current distributions on the nanometer-scale, which -so far -have been inaccessible by other methods.

Appendix A: Interferometric Measurement of Flexural Motion
We use a custom-built interferometer to detect the thermal or driven motion of the NW of interest. At its heart is a four arm fiber coupler with a 95:5 coupling ratio. A Toptica 1550 nm wavelength laser is connected to the input port and can be attenuated The thermal displacement noise PSD, which is the projection of the motion of the two first order flexural modes onto the direction of the local optical gradient, can be described by the fluctuation-dissipation theorem following the derivations in Ref. 10 as, where u(z) is the mode shape, k B the Boltzmann constant, T eff and m eff the effective temperature and mass of the NW resonator, ω 1,2 and Q 1,2 the resonance frequencies and quality factors of the two first order flexural modes, α the measurement angle between the direction of the first mode and the optical gradient, and S n the background noise. Depending on the position of the NW inside the beam waist, the optical gradient direction can be chosen at will. Ideally, however, it is aligned with the optical axis in order to achieve the best signal-to-noise ratio. The z-direction is aligned with the NW axis and its origin is located at the base of the NW. From the fit parameters, the spring constants k 1,2 = m eff ω 2 1,2 and the thermally limited force sensitivity F min = 4k B T m eff ω/Q can be calculated.

Appendix B: Micromagnetic Simulations
The principles of simulating the torque magnetometry signal with micromagnetic solvers are described in Refs. 9,30,46 . In these works, it is only the tip of the mechanical resonator which is magnetic, therefore the system can be modelled as a magnetic object oscillating in a homogeneous external magnetic field. The mode shape of the mechanical resonator enters into the calculation only in the form of the effective length, simplifying the mechanics to that of a harmonic oscillator. For the Co NWs, which are both the mechanical resonator and the magnetic object, the mode shape has to be taken into account. Each longitudinal segment of the NW rotates by a different angle during a flexural oscillation, experiencing a different tilt of the external magnetic field. We account for this effect by applying a spatially dependent external field in the simulation, rather than altering the geometry, which is impractical. For positive (negative) deflections in experiment, the tilt direction of the field in the simulations increases (decreases) with the z position along the NW. The magnitude of the tilt angle follows the Euler-Bernoulli equation, reflecting the mode shape. We choose a maximum oscillation amplitude (at the tip) large enough to account for the finite precision of the simulation. The torque signal can then be calculated using the magnetic energy of the system for small positive, negative, and no deflection given by the simulation combined with a finite difference approximation for the second derivative in equation (1) 33 .
The final geometry used in the simulation of Figure 2 is a 9.1 µm long, elliptic cylinder, whose diameters are modulated along the z direction, as determined from the SEM images. The average diameters along the two mode directions are d 1 = 135 nm and The latter has been chosen to match the switching field of the NW, and is significantly larger than other values reported for Co [47][48][49][50] . This discrepancy arises because the switching field also depends sensitively on geometrical and material imperfections, which we do not attempt to model. Nevertheless, control simulations confirm that the overall magnetization reversal process and the remanent states are unaffected by such differences in In an effort to determine the effect of nanocrystallinity in the NW, we have run simulations with NW divided into grains of around 10 nm size, giving each grain a uniaxial anisotropy with K 1 = 530 kJ m −3 and a random orientation of the anisotropy axis. We find that this refinement does not significantly change the simulation results with respect to standard simulations assuming homogeneous material without crystalline anisotropy.  T bath = 4.2 K and T bath = 77 K, while at T bath = 293 K, it appears roughly constant.

B. Focal position dependence
For a second set of measurements, the focal spot is moved along the z-axis (long axis) of the NW. Thermal noise PSDs are measured at the points shown in Figure 1. Figure 4 shows the resonance frequency and the NW temperature along the NW, extracted from thermal noise PSDs, while taking into account the mode shape u(z

II. BIOT-SAVART FIELD OF WIRE AND MONOPOLE MODEL
The magnetic field of an infinitely long conductor with rectangular cross section of width w, height h and a uniform current I = j y wh flowing in y-direction (see Figure   5), where j y is the current density along the y-direction, can be calculated using the two-dimensional Biot-Savart law where S is its cross-sectional area. Solving the surface integrals with the center of the coordinate system aligned with the geometrical center of the conductor yields (see also Refs. 3,4 ) B x (x, z) = µ 0 I 4πwh (w/2 − x) log (w/2 − x) 2 + (h/2 − z) 2 (w/2 − x) 2 + (h/2 + z) 2 + (w/2 + x) log (w/2 + x) 2 + (h/2 − z) 2 (w/2 + x) 2 + (h/2 + z) 2 and a similar expression for B z (x, z).
In order to extract a value for the monopole q 0 , the response of the NW to the driving tone is converted to a force using F i = r i k i /Q i (i = 1, 2 representing the two modes). The interferometric calibration factor between units of signal amplitude in volts and displacement in meters and the measurement position along the wire axis have to be taken into account. We then use equation (3) and the monopole model to fit the measured force response of NW 4 by assuming B AC (x, y, z) = (B x (x, z), 0, B z (x, z)) giving the fit function for the first mode where α is the angle between x-axis and the NWs first mode direction. It differs from α by the angle between the measurement direction and the optical axis, which is usually within the range of 2 • when centered on the wire. The optical axis is assumed to be aligned with the x-axis. The free parameters of the fit are the value of the monopole q 0 and its effective distance z = z mono . A typical fit is shown in Figure 4 of the main text for a distance between the tip and Au wire of d z = 200 nm and a driving current of 47 µA. The field profile fitting to the response curve locates the effective monopole not at the tip of the NW but higher along its axis at z mono = 472(5) nm.
This behavior is illustrated in more detail in Figure 6. The value of the monople is scattered, for different tip-sample distances, in a region around 9.7(4) × 10 −9 A m.
This spread can be related, on the one hand, to imperfections of the Au-wire structure resulting in a different field profile and, on the other hand, to the approximate nature of the monopole model used for fitting the data. The tip of the NW, which interacts with the Biot-Savart field of the Au wire, is an extended object. Depending on the tip-sample distance d z , its effective volume of interaction changes, leading to different values for q 0 and z mono . In addition, a small tilt of the NW from the xy-plane can also add error, since it introduces sensitivity to the z-component of B AC (x, y, z). It should also be noted that,  Figure 6: a) Value of the monopole q 0 and b) monopole distance z mono plotted against the tip-sample distance d. The monopole distance increases with the tip-sample distance. The fitted value of the monopole is scattered around a value of 9.7(4) × 10 −9 A m and seems to change substantially below a tip-sample distance closer than the NWs diameter.