Magnetic textures such as vortex cores or skyrmions are key candidates for non-volatile information processing1,2,3,4. This exploits the texture movement by current pulses that is typically opposed by pinning5,6,7. A detailed understanding of pinning is hence crucial. Moreover, intentional defect configurations can enable reliable positioning of textures in future devices such as race-track memories1,3,4, i.e., adequate defect configurations could avoid interactions with edges that might annihilate the texture or could locally pin the texture for readout8,9. However, previous experiments probing the interaction between texture and defects were either limited in terms of controlled positioning of the texture10,11 or in terms of spatial resolution12,13,14,15,16,17,18,19, such that novel methods are urgently needed. In detail, previous experiments probed domain walls12,14,18, magnetic vortices13,15,17,19,20 or skyrmions10 embedded in stripes14,18, rings16, islands13,15,17,19,20 or thin films10,11,12 revealing pinning at large, artificial structures (size: 10–100 nm), such as notches16, holes15,20 or locally thinned areas of the film13,14 as well as at intrinsic irregularities, e.g., due to surface roughness21 or dislocations11. Recently, the pinning of skyrmions at single magnetic impurities has also been probed, but without exerting controlled forces10. But, so far, experiments were not able to deduce the pinning potential of point defects with the required sub-nm spatial resolution.

Here, we employ spin polarized scanning tunneling microscopy (STM) to study pinning of the curled magnetization of a magnetic vortex core22,23. We apply well defined lateral forces by in-plane magnetic fields B24 and independently tune the size of the vortex core by an out-of-plane field B. The latter enables control on the non-collinearity of the core magnetization and, hence, on the strength of exchange energy density uexch in the core. Surprisingly, we find that a vortex core with diameter 3.8 nm within an island of height 10 nm (~104 Fe-atoms) jumps between defects only a few nm apart. The exact pinning position is deduced by measuring topography and core magnetization simultaneously, revealing an eccentric core pinning  ~2 nm away from the next adsorbate. We reproduce the measured core path along several defects via superposing pinning potentials, each consisting of an attractive part with amplitude 200 meV originating from an absent exchange energy and an even stronger repulsive part of unknown origin.


Vortex core squeezing and positioning via 3D field

First, we describe the vortex core squeezing and positioning via the 3D magnetic field. Atomically flat, elliptical Fe islands with vortex configuration are prepared by molecular beam epitaxy on W(110) (“Methods”)23,25. STM with antiferromagnetic Cr tips26 records the topography and the spin polarized differential conductance dI/dV simultaneously (“Methods”). Figure 1a displays an overlay of these signals for a typical island. The dark spot in the center indicates the area of the vortex core. The contrast is caused by the spin-polarized dI/dV contribution proportional to the dot product of tip and sample magnetization vectors27. Defects are visible (Fig. 1b–d) via the non-magnetic part of dI/dV probing the local density of states27.

Fig. 1: Vortex core trajectories.
figure 1

a Superposition of STM topography (3D representation) and simultaneously acquired spin-polarized dI/dV map (color) for an Fe island on W(110), V = −450 mV, I = 0.5 nA. Insets: sketch of deduced tip magnetization vector (left) and spin configuration of the vortex core (right). bd dI/dV-images of vortex core at identical contrast, identical scale and different B. The labeled scale bars show FWHM of mz extracted by core fitting (“Methods”). e Superposition of topography (brightness) and three semi-transparent dI/dV maps of vortex core (color) after subtracting the signal related to in-plane magnetization (Supplementary Note 3) for \({{\bf{B}}}_{\parallel }^{{\rm{A}}}=(20.5,-11.5)\) mT, \({{\bf{B}}}_{\parallel }^{{\rm{B}}}=(16,0)\) mT, and \({{\bf{B}}}_{\parallel }^{{\rm{C}}}=(11.5,11.5)\) mT at B = 0 T. Blue vectors connect the deduced vortex core centers (circles) showcasing the linear core motion. f Topography overlaid with vortex core center positions (blue circles) and five selected dI/dV maps (color) for 44 equidistant B steps with ΔB = (136 − 227) μT at B = −1.5 T. The core center positions are connected to the corresponding B (lower axis) by lines. The dI/dV maps (in-plane magnetization subtracted) correspond to B = −6 mT,  −3 mT, 0 mT, 3 mT, 6 mT, V = −2 V, I = 1 nA. A video of the vortex motion including all 45 dI/dV images is available in the supplementary movies. The island size is 255 × 165 × 10 nm3 in bf and 292 × 210 × 10.4 nm3 in a.

A 3D vector magnet provides B and B = (BxBy)28, hence, tunes the vortex core size and its position, respectively23. Figure 1b–d show dI/dV-images of the core at increasing B opposing the core magnetization. The magnetization can be represented by the normalized out-of plane contribution mz. The Zeeman energy increases and the core diameter shrinks with full width at half maximum (FWHM) of the mz distribution of 11.0 ± 0.1 nm (0 T), 5.48 ± 0.05 nm (−1.2 T) and 4.34 ± 0.04 nm (−1.5 T)23. This is reproduced by micromagnetic simulations (Supplementary Note 2) implying a large modification of uexch at the core center due to increasing spin canting: 18 meV/nm3 (0 T), 95 meV/nm3 (−1.2 T), 180 meV/nm3 (−1.5 T). The uexch tuning enables varying the vortex-defect-interaction for all defects that modify exchange interaction.

 Figure 1e reveals the presence of, at least, two types of defects. The 15 pm deep depressions are presumably oxygen adsorbates as remainders from the sample preparation. The 40 pm high protrusions are Cr atoms originating from tip preparation by voltage pulses. Surprisingly, we find that both defects exhibit a quite similar pinning potential (see below). To study the interaction between the vortex core and the defects, we use B to exert a lateral force on the vortex that shifts the core towards a target position. We monitor the deviation from the target due to defect pinning. For a defect-free magnetic cylinder, the core center position r = (xy) with respect to the island center is adequately described by the rigid vortex model29. It minimizes the potential \(E({\bf{r}},{{\bf{B}}}_{\parallel })=\frac{1}{2}k({x}^{2}+{y}^{2})-k{\chi }_{{\rm{free}}}({B}_{y}x+{B}_{x}y)\) with k being a proportionally constant and χfree describing the lateral displacement per field strength. Solving leads to r(B) = (χfreeByχfreeBx)17, i.e., the displacement is proportional to B. Albeit elliptic islands lead to a directional dependence of k and χfree, the core displacement remains largely proportional to B (Supplementary Note 4). With additional defects, the potential changes leading to deviations from the regular displacement along a straight path.

Determining the field induced displacement rate

In order to determine the field induced displacement rate, firstly at B = 0T, the vortex core is recorded at three equidistant B (Fig. 1e). The resulting two displacement vectors exhibit equal lengths Δr = 21.5 ± 0.2 nm implying a constant displacement rate χ(0 T) = 1.74 nm/mT as corroborated in Fig. 2f. In contrast, Fig. 1f shows irregular vortex core motion for B = −1.5 T and 45 equidistant B. The core positions are neither equidistant nor along a straight path, but cluster in the vicinity of defects indicating attractive pinning of the core. Remarkably, a vortex core containing  ~104 Fe atoms (diameter: 3.8 nm, height: 10 nm) appears to be pinned close to a single adsorbate. Bending of the core tube is relatively small as verified by micromagnetic simulations (Supplementary Note 5). Long-range interaction of magnetic textures with single adsorbates has previously been shown for skyrmion lattices, where the magnetization has been influenced on a 10-nm scale by switching single coronene molecules30. This provides another example of a dramatic influence of single adsorbates on long-range magnetism albeit for a monolayer texture.

Fig. 2: Mapping the strength of vortex core pinning.
figure 2

a Measurement scheme: B is stepped equidistantly (B1 to B5) to move the vortex core from r1 to r5, while dI/dV is recorded at fixed tip position. The resulting dI/dV(B) displays the core shape in case of a constant core displacement rate. b STM topography overlaid with vortex core center positions at two different B for the B highlighted by grey dashed lines in d, e. The positions are deduced from dI/dV images at the corresponding B. Dotted lines connect start and end point illustrating the target paths. The grayscale colormap represents local height values from −25 pm (black) to 25 pm (white). ce dI/dV recorded at the tip position marked by “B” in Fig. 1e for c, “A” in b for d and “B” in b for e while sweeping B at B = 0 T, −1.2 T, and −1.5 T, respectively. The B sweep moves the vortex core from “A” to “C” in Fig. 1e, as well as from leftmost to rightmost square or circle in b, respectively. The real space dI/dV profiles recorded along the dashed lines in Fig. 1b, 1c, and 1d, respectively, are plotted in gray. The upper and lower axis are linked by the measured average displacement rate, i.e., (rC − rA)/(B,C − B,A) for c and, respectively, for d, e. fh Deduced core positions from ce assuming a rigid vortex core profile and a straight path (symbols). Solid black lines are micromagnetically simulated core positions for an Fe cylinder (diameter: 280 nm, thickness: 10 nm) with a single pinning site exhibiting Aex = 0 for a volume of 1.1 × 1.1 × 0.5 nm3 at the surface center. Dotted gray lines show simulated displacement without pinning center. The violet line in g marks the displacement at rate χpinned.

The observed pinning of the vortex core naturally reduces the displacement rate χ. To determine the resulting χpinned(B), a second type of experiment is performed. While the vortex core is displaced by 99 equidistant B, dI/dV is measured at fixed tip position (Fig. 2a). We target for the identical defect-free path of length  ~35 nm along several defects for different B (Fig. 2b). For B = 0 T, the resulting dI/dV(B) features an identical shape as the core shape probed by dI/dV(r) in real space at constant B (gray solid line), i.e., dI/dV is the same for a tip scanning across a fixed vortex core and for a vortex core scanned below a fixed tip by B. This confirms, that the large core at B = 0 T barely interacts with the defects. In contrast, the datasets at B = −1.2 T and −1.5 T show sudden jumps not appearing in the real space data (Fig. 2d, e). They split the curve into segments of reduced slope χpinned due to core pinning. The transitions between the segments correspond to jumps between different pinning sites.

To compare these data with theory, we firstly establish a link between the measured dI/dV(B) and the core displacement (“Methods”). The conversion uses the real space dI/dV(r), implicitly assuming an immutable core profile and a straight core path. The core shape indeed exhibits negligible FWHM changes by less than  ± 5% along the path (Supplementary Note 6). The motion is not straight (Fig. 2b), but the relatively small excursions imply an error of χpinned by only 5% (0.3%) at B = −1.5 T (−1.2 T) (Supplementary Note 6). Figure 2f–h display the converted data. For B = 0 T, we find one constant slope χ = χfree(0 T) = 1.8 ± 0.1 nm/mT, while, for B = −1.2 T (−1.5 T), segments with average slope χpinned (−1.2 T) = 1.0 ± 0.1 nm/mT (χpinned (−1.5 T) = 0.1 ± 0.1 nm/mT) are interrupted by jumps. A small segment with even negative slope appears (Fig. 2h, B = 1–2 mT) likely originating from a larger sidewards excursion of the core. We deduce a large tuning of the displacement rate ratio χpinned/χfree = 100%, 42%, and 3% at B = 0 T, −1.2 T, and −1.5 T, respectively.

To reproduce this, we conduct micromagnetic simulations of an Fe cylinder (diameter: 280 nm, height: 10 nm) with exchange stiffness Aex, saturation magnetization Msat, and uniaxial anisotropies Kx, Ky and Kz in the according directions as known from previous experiments23. The pinning site is modeled by suppressing Aex, leading to uexch = 0, within 1.1 × 1.1 × 0.5 nm3. Note that Aex is a parameter independent of the canting of adjacent spins, while uexch depends on neighboring spin canting. This defect is moved laterally through the vortex in the island center emulating the vortex movement through the defect by equidistant B (“Methods”). The deduced core path as function of B is plotted as solid lines in Fig. 2f–h. It reveals slopes χpinned around B = 0 very close to the segment slopes of the experimental data, i.e., we find theoretical χpinned/χfree = 96%, 40%, and 6% for B = 0 T, −1.2 T, and −1.5 T, respectively. This strongly suggests that quenching of Aex is the origin of pinning.

To corroborate this conjecture, simulations are pursued for defects with changed Ky, Kz, and Msat. Figure 3b–d and g–i show resulting pinning potentials deduced from the energy of the vortex core at the corresponding positions (“Methods”). The defect with absent Aex features a purely attractive potential with an order of magnitude variation in amplitude by B (Fig. 3g). The defects with changed anisotropy show more complex potentials with amplitudes that are less dependent on B. Tuning Ky toward in-plane anisotropy at the defect (Fig. 3i) leads to repulsion for the out-of-plane oriented area of the vortex core in the absence of B. At finite B, the outer areas of the island are oriented along the field, i.e., out-of-plane, and, thus, only the rim of the vortex core shows in-plane magnetization, such that it gets attracted by such a defect. Using a defect with out-of-plane anisotropy (Fig. 3h) naturally leads to attraction of the core without B, but repels the rim area at finite B, since being the only area without out-of plane contribution to the magnetization.

Fig. 3: Micromagnetic simulation of pinning potentials.
figure 3

a Scaled, perpendicular magnetization mz = Mz/Msat of a simulated vortex core in a disk of height 10 nm and diameter 280 nm at B = 0 T (upper half) and B = −1.5 T (lower half) with magnetic parameters indicated. bd Defect potentials for vortex core in meV at different types of magnetic defects, where only the marked parameters are changed with respect to a within a central area at the surface of 1.1 × 1.1 × 0.5 nm3 (3 × 3 × 1 cells). The display type is as in a. The spatial dependency of the vortex energy is simulated by scanning the defect through the vortex core (“Methods”). fi Profile lines through the middle of ad (from left to right) covering the 0 T and the −1.5 T area separately. An additional profile calculated for B = −1.2 T is added. e Simulated displacement rate ratio χpinned/χfree for the vortex core being trapped in the minima of the potentials shown in gi. For the Aex defect, Aex = 0 is used and the defect size is adapted to fit the experimental data. For the Ky and Kz defects, we kept the defect size, while Ky and Kz are changed to fit the experimental data as good as possible. For the Ky defect, we show two values for the optimized Ky = 300 MJ/m3 and the full line with realistic Ky = 20 MJ/m3 connected by dotted lines to the optimized points. For the Msat defect, we use Msat = 0 within the same defect volume. The point for B = 0 T of the defect with easy y-axis is missing, since the purely repulsive potential did not enable a reliable determination of χpinned due to a strong dependence of vortex movement on starting conditions. Experimental data points are deduced from the average slope of the segments such as in Fig. 2f–h with statistical error bars.

For each kind of defect, we simulated the displacement rate χpinned around the potential minimum and compared χpinned/χfree(B) with experimental values (Fig. 3e). The measured trend is quantitatively reproduced for a defect with absent Aex, but not for the other types. Using Kz and Ky as unrestricted fit parameters, χpinned/χfree can, at most, be reproduced for one of the three B within error bars. The optimal fitting, moreover, leads to unrealistically large cumulative anisotropies for a single adsorbate: Vdefect × Kz = 86 meV, Vdefect × Ky = 1.1 eV. These values are orders of magnitude larger than known values of anisotropies, i.e. the bulk anisotropy of Fe would lead to a cumulative anisotropy of 0.2 meV, while the interface anisotropy of Fe to W(110) would lead to 10 meV for the considered defect size31,32 (see also the ab initio values discussed in Supplementary Note 10). Absent magnetization does barely pin the core at all implying that absent Aex is indeed the main origin of pinning.

Determining the interaction potential

Next, we evaluate the precise pinning position of the vortex core center with respect to the closest adsorbate (Fig. 4a). They cluster at 1–2 nm away from the adsorbate indicating an additional repulsion. Moreover, the offset is mostly directed perpendicular to the target path as expected for an isotropic potential preferentially attracting an object along a line perpendicular to its target path.

Fig. 4: Extracting the defect interaction potential.
figure 4

a Vortex core positions (symbols) with respect to the position of the closest adsorbate, differently colored for the two types of adsorbates. Targeted path (dashed line) reveals that pinning is mostly offset perpendicular to the target path. b Simulation of the vortex core path (red circles) within the displayed interaction potential (color map) that superposes the same pinning potential as displayed in c centered at each adsorbate. Adsorbate positions are taken from topography (Fig. 1f, white box). Experimental core positions (blue points, Fig. 1f) and target core positions (red crosses) are added. c The optimized, axially symmetric single defect potential consisting of an attractive part due to absent exchange energy (Fig. 3g) and a repelling Gaussian part. The three relevant fit parameters are marked.

To estimate the repelling part of the potential, we employed a fit of 24 subsequent experimental pinning positions (blue dots, Fig. 4b) by adapting three parameters for an identical potential centered at each adsorbate, namely a scaling factor for the axially symmetric (Aex = 0)-potential (Fig. 3g, B = −1.5 T) as well as height Arep and FWHM wrep of an axially symmetric Gaussian repelling part (Fig. 4c). The energetic cost of moving the core from the target path toward pinning is firstly calculated without defects via micromagnetic simulations of the vortex energy required to force the core away from its target path. Subsequently, this energy is combined with the pinning potentials yielding the minimum energy position (“Methods”). Figure 4b shows rather good agreement of resulting optimized path (red circles) and measured core positions (blue circles) employing the defect potential of Fig. 4c.

It is a mexican hat with minima located 1.5 nm away from the center as expected from the pinning positions (Fig. 4a). The mexican hat also reproduces the queuing of the core in front of the double defect located above the target path (Fig. 4b). This queuing is markedly different from the slow motion during pinning at a single defect. It cannot be reproduced by overlapping two (Aex = 0)-potentials with arbitrary independent positions and, hence, corroborates the mexican hat shape. Naturally, the (Aex = 0)-part of Fig. 3g has to be rescaled to compensate for the repelling part, i.e. the (Aex = 0)-defect has to be slightly enlarged.

We were not able to pinpoint the origin of the repulsive part. Since it is smaller than the vortex core, it cannot be reproduced by simply changing parameters constantly within a certain area. We refrained from optimizing more complex defect structures avoiding the increasing parameter space.

Employing simulations based on density functional theory (DFT), we investigated the impact of single Cr and O adatoms on the magnetic properties of Fe(110). We find remarkably strong changes of the pairwise magnetic exchange interactions Jij (i, j: atomic sites) affecting up to 70 neighboring Fe atoms (Supplementary Note 10). The summed up change is  ~200 meV consisting of similar amounts of weakening and strengthening of Jij due to the oscillatory behavior of the interactions as function of distance. Hence, the sum of changes of Jij amounts to 2.5 eV. However, if the vortex core texture is not changed by the defect as implied by the barely changing spin contrast in STM (Supplementary Note 6), the amplitude of the core-adsorbate interaction amounts to only 10–15 meV (Supplementary Note 10). Thus, while the DFT results reveal that single Cr or O adsorbates influence the core path on the 0.5 nm scale (Supplementary Note 10), they do not explain the experiments quantitatively. We speculate that the adsorbate structure is either different than anticipated or that the adsorbate is accompanied by particular strain fields below the surface accounting for the missing energy. It might be that the adsorbate marks an interface defect via an induced preferential adsorption site.


Our method provides the first quantitative handle on pinning energies of magnetic textures at the sub-nm scale. In principle, it can be applied to different kinds of deliberately placed defects on different types of magnetic islands featuring vortices. It can also be used for other non-collinear textures such as skyrmions or transverse domain walls anticipated to be used in racetrack memories1,3,4. Both have been imaged by spin polarized STM10,27,33. For skyrmions, additionally the spin canting and, hence, uexch can be tuned by B34. Forces on domain walls can be exerted by B,16,35, while skyrmions can be moved by electric currents5,6, for which respective forces are deduced by combining micromagnetic simulations and an analytic description via the Thiele equation36. Pinning of single skyrmions at defects has already been imaged, e.g. limiting the skyrmion Hall angle37. Hence, our method would straightforwardly enable the experimental probing of the so far only theoretically predicted skyrmion-defect interaction strenghts9,38,39,40. Eventually, the method could provide tailoring rules for defect induced guiding of magnetic textures in racetrack memories8,9.



A W(110) crystal (surface orientation better than 0.1°) is cleaned in ultra high vacuum (UHV) (base pressure: 10−10 mbar) by repeated cycles of annealing in oxygen atmosphere (partial pressure: 10−7 mbar) at 1400 °C for 10 min and subsequent flashing to 2200 °C for 10 s. Afterwards, ten pseudomorphic monolayers of Fe are deposited at room temperature by electron beam evaporation from an Fe rod (purity 99.99+%). The sample is then annealed at 710 °C for 20 min leading to the formation of Fe islands such as in Fig. 1a on top of an Fe wetting layer25. The method has been optimized to reduce the defect density in the Fe bulk, but we cannot exclude remaining defects, in particular, at the interface of Fe/W(110).

Spin polarized STM

The tunneling tip is fabricated from a 0.5 × 0.5 mm2 beam of polycrystalline, antiferromagnetic Cr (purity 99.99+%). Tip sharpening employs electrochemical etching by a suspended film of 2.5 M NaOH solution within a PtIr loop that is at potential of 5.5 V with respect to the tip. Etching is stopped at drop off of the lower beam part via differential current detection. The upper part of the beam is immediately rinsed with DI water and glued onto a custom tip holder. The tip is then loaded into the UHV system and, subsequently, into the STM scan head at 6 K28. The atomic structure of the tip is optimized during tunneling by voltage pulses (10 V/30 ms) between tip and sample until spin contrast is achieved. Voltage V is applied to the sample. The differential conductance dI/dV is measured by adding a 50 mV RMS sinusoidal voltage (1384 Hz) to the applied DC V and recording the resulting oscillation amplitude of the tunnel current I using a lock-in amplifier. The system enables a 3D magnetic field B = (BxByB) with out-of-plane component B up to 7 T and simultaneous in-plane part B = (BxBy) up to 1 T in each in-plane direction28.

Adjusting the magnetic field direction

In order to orient the much stronger out-of-plane field B avoiding contributions to B by misalignment, we used all three magnets to adjust the field direction until the field increase in the resulting direction did not move the vortex core within experimental accuracy. Typically, this required 1.7% of B to be applied into the nominal B direction.

Micromagnetic simulations

The program mumax341 is used to simulate relaxed magnetization states of an Fe cylinder of height 10 nm and diameter 280 nm with cell size 0.36 × 0.36 × 0.5 nm3. Magnetic parameters are marked in Fig. 3a. Defects are emulated by altered magnetic parameters in 3 × 3  × 1 cells at the top layer. We optimized this size to reproduce the observed pinning restricting ourselves to defects of one layer thickness and a square geometry after crosschecking that the geometry barely changes the pinning behavior as long as the defect volume remains unchanged. For sweeps of B with defect, two approximations are employed in order to reduce computational time. Instead of sweeping B = B,target, we keep B = 0 T and shift the defect through the vortex core by  −χfree B,target with  −χfree deduced from a simulation of the vortex with varying B but without defects. Second, we crop the simulation area down to 256 × 256 × 20 cells via adding the previously calculated demagnetization field of the neglected area manually. This leads to an effective, spatially varying external magnetic field Beff(r) = B + Bdemag,exterior(r). The reasonable validity of these approximations is described in Supplementary Note 7. The resulting core center positions (mz maxima) as a function of defect position are deduced from spline interpolations of mz in the layer below the defect. This avoids the more ambiguous evaluation of the partially discontinuous mz within the surface layer in the presence of defects.

Vortex core fitting to determine its center position

To reproduce the experimental spin polarized dI/dV images and, hence, to deduce the vortex core center positions, vortex magnetization patterns are firstly simulated via mumax3. The result is then adapted to the experimental dI/dV image at corresponding B. Therefore, the polar and azimuthal angle of the tip magnetization are optimized using the dot product between sample and tip magnetization vector as dI/dV image contrast. The resulting dI/dV values are additionally offset and scaled to account for the non-spin-polarized dI/dV signal and the unknown amplitude of the spin-polarized dI/dV signal, respectively. Moreover, the vortex core center position is optimized in both lateral directions and the calculated image is slightly scaled laterally to account for inaccuracies of the fit (Supplementary Note 2).

The seven parameters (2 tip magnetization angles, dI/dV offset, dI/dV scaling factor, 2×  core position, lateral scaling factor) are fitted towards minimum RMS deviation between the simulated and the measured dI/dV map. The blue circles in Fig. 1e–f as partly also displayed in Fig. 4b and the squares and circles in Fig. 2b are the fitted lateral positions of the vortex core center with each symbol belonging to a fit of one dI/dV map. The fit error in core center position turns out to be ≤ ±0.05 nm. Fit images, residual images and standard deviations for all fit parameters are given in Supplementary Note 3.

For the superposition of topography and sequences of dI/dV data (Fig. 1e–f), the in-plane magnetization contribution of the fitted dI/dV image is removed from the measured one and, for Fig. 1f, the resulting image is scaled by a Gaussian envelope function for the sake of visibility.

Conversion from dI/dV(B ) to core positions

To calculate a vortex core position from a dI/dV value measured at fixed tip location r0 but varying B, we use the line profile dI/d\(V(r^{\prime} )\) of the vortex core measured at constant B (Fig. 1b–d). We first employ the fit procedure as explained in the previous section and then utilize the less noisy profile from the fitted, simulated dI/dV images. Angle of chosen profile line and lateral shift of the profile line with respect to the core center are selected such that the maximum value in dI/dV(B) and the dI/dV values at maximum and minimum of B (Fig. 2c–e) are reproduced by a straight target path (Supplementary Note 4). The parameter \(r^{\prime}\) is set to zero at maximum dI/dV. Using the resulting dI/d\(V(r^{\prime} )\), the measured dI/dV(B) at r0 is assigned to a core center position \({{\bf{r}}}_{0}+{\bf{u}}r^{\prime}\)(dI/dV(B)) with u being the unit length vector in the selected profile direction. Principally, there are two possibilities of \(r^{\prime}\)(dI/dV(B)), left and right from the center of the profile line. They are handled such that the core center always moves to the closer of the two \(r^{\prime}\) and continuously across r0.

Calculating vortex core pinning potentials

To calculate the pinning potentials as displayed in Fig. 3, the parameters are homogeneously changed within 3 × 3 × 1 cells mimicking the defect. Subsequently the defect is moved through the fixed vortex core and the resulting vortex energy is calculated by mumax3. The approximation to move the defect instead of the vortex core is discussed in Supplementary Note 7.

Simulating the vortex path for multiple defects

The vortex core position for an immutable core profile is given by minimizing the potential energy \({E}_{{\rm{pot}}}({{\bf{r}}}_{{\rm{vortex}}})={E}_{{\rm{flex}}}({{\bf{r}}}_{{\rm{vortex}}}-{{\bf{r}}}_{{\rm{target}}})+\mathop{\sum }\nolimits_{i = 1}^{N}{E}_{{\rm{i}},{\rm{pin}}}({{\bf{r}}}_{{\rm{vortex}}}-{{\bf{r}}}_{{\rm{i,adsorbate}}})\). Eflex(rvortex − rtarget) is the energetic cost to move the vortex away from its target rtarget(B) in the absence of defects. It is deduced from a set of mumax3 simulations fixing the vortex core artificially at different rvortex. This employs fixing mz within 4 × 4 cells on the surface located away from rtarget. The mz values in that area are set to the values found in the center of the vortex core, if calculated without defects. The vortex core, consequently, moves to a particular rvortex with respect to rtarget. For this position, we calculate the vortex energy. We checked that the area of fixed mz leads to negligible changes of the vortex energy (Supplementary Note 8). For sake of simplicity, we approximate the resulting Eflex(rvortex − rtarget) by an excellently fitting paraboloid (Supplementary Note 8).

The pinning potential of a single adsorbate Ei,pin(rvortex) is emulated as the sum of a repelling Gaussian and an analytic representation of the attractive part due to a defect with absent Aex. This pinning potential eventually reproduces the profile of Fig. 4c by fitting the core path in Fig. 4b. The analytic representation of the attractive part is derived straightforwardly from an analytic part of the core magnetization profile reading \({m}_{z}(r)=(1-a)/\!\cosh (| r| /w)+a\) with fit parameters a and w42. The deduced analytic uexch(r) is fitted to the result from mumax3 (Fig. 3g) with respect to a and w exhibiting an RMS deviation of only 0.6 meV/nm3 between analytic and micromagnetic representation of uexch(r) (Supplementary Note 8).

The subsequent fitting of the core path optimizes FWHM and amplitude of the repelling Gaussian as well as a scaling parameter for the attractive, analytic exchange part (Fig. 4c) towards minimizing the RMS of the distances between calculated and measured core center positions (Fig. 4b). Additionally, the start and end point of the target path are varied by up to  ±3 nm during the fit with respect to the observed first and last core positions to account for possible pinning at these sites.