Main

Topological magnetic solitons1 are localized magnetic textures that have properties similar to those of ordinary particles. In particular, they can mutually interact and move under the influence of external stimuli. Chiral magnetic skyrmions12,13,14,15 are notable examples of such objects. In thick three-dimensional (3D) samples, the magnetization vector field of skyrmions usually forms vortex-like strings that can penetrate an entire sample from one surface to another. Such filamentary magnetic textures, which arise as a consequence of competition between Heisenberg exchange and the Dzyaloshinskii–Moriya interaction (DMI)16,17, have been observed in noncentrosymmetric crystals using various experimental techniques2,3.

Recent studies have shown that skyrmion strings in isotropic chiral magnets are not rigid textures, but can twist and bend18,19,20,21. A prominent example of such elastic properties of skyrmion strings is the formation of skyrmion braids20—rope-like structures composed of skyrmion strings that wind around each other. Here we report a fundamentally different phenomenon. We use state-of-the-art transmission electron microscopy (TEM) and micromagnetic simulations to show that twisted skyrmion strings can be bent into rings in magnetic crystals, leading to the emergence of a different topology.

The concept of closed twisted skyrmion strings in field theories was first proposed by Ludwig Faddeev in 1975 (ref. 4). Such structures are now commonly termed hopfions9, after Heinz Hopf, who built the theory that underlies their homotopy classification22. According to this theory, localized magnetization field configurations m(r) = M(r)/Ms can be classified according to the linkage of their fibres {m = mP}, which, for any fixed points P on a unit sphere \({{\mathbb{S}}}^{2}\), represent closed loops in \({{\mathbb{R}}}^{3}\) space. When any pair of such loops is linked once, as a pair of chain segments, the Hopf index of the field configuration is one, H = 1, and this configuration contains a hopfion.

Previous theoretical studies have predicted the existence of confined and isolated hopfions in chiral magnets8,23,24,25. However, the mechanism for hopfion stabilization that we describe below is essentially different. In our experiment, hopfions appear as rings around skyrmion strings and remain stable exclusively owing to intrinsic interactions and not as a result of the sample shape. The confined geometry of the sample has an essential role only in the nucleation of these hopfions, and is not relevant for their stability. To distinguish between hopfions that appear around skyrmion strings from isolated hopfions and hopfions in a nanoscale multilayer disk11, we refer to the former as hopfion rings.

Micromagnetic simulations of hopfion rings

Figure 1a–e illustrates the concept of hopfion rings and the process of their nucleation, according to the field-swapping protocol used in our experimental set-up below. In these micromagnetic simulations, we used a 0.5-μm-diameter disk with a thickness of 180 nm, with the external magnetic field applied parallel to the central axis of the disk. The magnetic states shown in Fig. 1a–e were obtained by direct energy minimization of the micromagnetic functional for an isotropic chiral magnet, taking into account demagnetizing fields. We also took into account the presence of a thin damaged layer on the sample surface (Fig. 1a), which typically results from sample preparation by focused ion beam (FIB) milling. (See Methods for more details about micromagnetic calculations, the properties of the damaged layer and Lorentz image simulations.)

Fig. 1: Hopfion rings on skyrmion strings in FeGe samples of confined geometry.
figure 1

Sequence of magnetic states in a 180-nm-thick, 0.5-μm-diameter disk obtained by energy minimization in different external magnetic fields applied perpendicular to the disk plane. ad, Field-swapping protocol for the nucleation of a hopfion ring. a, The initial configuration. b, The state at a reversed field direction. c, The edge modulations formed at the magnetic field reversed back to a positive direction. d, The hopfion ring formed with increasing field. Top row, the magnetization on the lower face of the disk, as well as isosurfaces of mz = 0.5 in c and mz = 0 elsewhere. Middle row, over-focus Lorentz images of corresponding magnetic states calculated for a defocus distance of 400 μm with the electron beam parallel to the disk axis. Bottom row, the magnetization in a diametrical section of the sample. The dashed line in a marks the borders of a 7.5-nm-thick FIB-damaged layer (see Methods). e, The magnetization in transverse sections of the sample for the final state in d, with a hopfion ring on three skyrmion strings. The distance between the transverse sections is 10 nm. The colour code is explained by arrows superimposed on the diametrical and transverse sections: white and black correspond to mz = 1 and mz = −1, respectively; red–green–blue defines the direction of magnetization in the xy plane. f, Experimental over-focus Lorentz images recorded in an FeGe plate of dimensions 1 μm × 1 μm and with a thickness of 180 nm. g, Experimental Lorentz images of double hopfion rings on three skyrmion strings at 200 mT and a corresponding magnetic induction map reconstructed from a phase-shift image recorded using off-axis electron holography. The experimental images in f,g were recorded at T = 95 K and at a defocus distance of 400 μm.

Figure 1a shows an initial state with three skyrmion strings, demonstrating a weak braiding effect and conical modulations along the sample thickness. In a confined geometry, such modulations exhibit an additional twist that resembles a vortex-like structure26,27 in any transverse section. Swapping the direction of the external magnetic field leads to a flip of the magnetization along the perimeter of the disk, as shown in Fig. 1b. To prevent the collapse of the skyrmions in a negative field, we apply a relatively weak field of −50 mT. Swapping the field back to the positive direction results in the appearance of edge modulations, representing a volume with magnetization pointing against the external field (Fig. 1c). On further increasing the field in the positive direction, the edge modulations contract towards the centre of the sample, forming a hopfion ring around three skyrmion strings (Fig. 1d). Figure 1d shows that each colour line (fibre) winds about the isosurface of the hopfion ring only once, which indicates that the Hopf index of the corresponding texture is nontrivial. The middle cross-section of the hopfion ring surrounding the three skyrmion strings shown in Fig. 1e resembles a skyrmion bag, as predicted theoretically for a two-dimensional (2D) model of a chiral magnet28,29. Our analysis shows that such textures have negative skyrmion topological charge, Q, in all transverse sections (see Methods). However, the rings shown in Fig. 1d represent hopfions, which is not possible in 2D materials30 and is different from skyrmion bags with a positive topological charge31. It is therefore essential to distinguish between magnetic textures with hopfion rings and skyrmion bags.

Experimental observation of hopfion rings

Following the protocol suggested by the micromagnetic simulations, we demonstrated the nucleation of hopfion rings in a square-shaped FeGe sample of lateral size 1 μm × 1 μm and thickness 180 nm. (See Methods for details about sample preparation and the TEM experimental set-up.) A representative example of a magnetic configuration with edge modulations after field swapping is shown in Fig. 1f. On increasing the external field, the bright contrast loop of the edge modulations contracts around two skyrmions. The final state (at 200 mT) corresponds to a hopfion ring around two skyrmion strings. The intermediate configurations at 180 mT and 190 mT are seldom observed in our experiments. In most cases, contraction of the edge modulations occurs abruptly on a timescale that is much shorter than the temporal resolution of the detector in our TEM.

As a result of the excitation of the magnetization induced by the abrupt contraction of the edge modulations and thermal fluctuations, the above protocol has a probabilistic character. The final state shown in Fig. 1f (at 200 mT) is an example of a successful contraction.

Notably, the sequential application of the above field-swapping protocol can result in the nucleation of a second hopfion ring with high probability. Figure 1g shows an example of such a double hopfion ring around three skyrmion strings. Further images with multiple hopfion rings are provided in Extended Data Figs. 5 and 6. These images illustrate the successful contraction of the second ring. However, because hopfion rings are metastable states, further application of the field-swapping protocol can cause a transition to a lower energy state, resulting in the collapse of the hopfion rings.

The above protocol becomes more reliable at a higher sample temperature, indicating that thermal fluctuations have a key role in hopfion-ring nucleation. However, the range of applied magnetic fields over which the hopfion rings remain stable decreases gradually with increasing temperature. We found an optimal range of T = 180–200 K, over which the above protocol exhibits the greatest efficiency. Below 180 K, nucleation of hopfion rings is still possible, but typically requires more field-swapping cycles. At a lower temperature, the edge modulations can move towards the edges of the sample and disappear. By contrast, at higher temperatures the edge modulations can contract towards the centre of the sample. Above 200 K, abrupt contraction of the edge modulations can lead to their collapse. The behaviour of the edge modulations at different temperatures can be explained by the presence of an energy barrier that prevents their contraction towards the centre of the domain. The probability of overcoming this energy barrier then becomes greater at high temperature.

The process of hopfion-ring nucleation is shown in Supplementary Videos 15. These videos were captured in situ at a temperature of T = 180 K. We performed several field-swapping cycles in the first stage with a small amplitude of approximately ±50 mT. This step was designed to generate edge modulations that formed closed loops and propagated towards the centre of the sample. Once one or a few of these loops had been created, we gradually increased the applied magnetic field up to approximately 150 mT, which resulted in the formation of various hopfion rings.

The tilt angle of the external magnetic field to the plate normal is an essential parameter for hopfion-ring nucleation. In our experiment, we found that the tilt angle of the field should not exceed 5°. Otherwise, the edge modulations mainly form on one side of the sample, resulting in a strongly asymmetric configuration.

Diversity and in-field evolution of hopfion rings

Figure 2 illustrates the evolution of diverse configurations of hopfion rings in increasing applied magnetic fields. It should be noted that the Lorentz TEM images shown in Fig. 2 were recorded with the sample at different temperatures, which can affect the stability range of the hopfion rings and skyrmions. As a result, the applied magnetic field is only indicated schematically above the figure. The complete series of images, showing the entire field of view and exact values of the external magnetic field and specimen temperature, is provided in Extended Data Figs. 1, 2 and 3. Other representative images of multiple skyrmions surrounded by a single hopfion ring are provided in Extended Data Fig. 4. Additional Lorentz TEM images illustrating the in-field evolution of magnetic states with different topological charges and symmetries composed of skyrmions and hopfion rings are shown in Extended Data Figs. 5 and 6.

Fig. 2: Evolution of hopfion rings with an increasing applied magnetic field.
figure 2

Each row shows the evolution of hopfion rings surrounding skyrmion strings, shown as a function of the external magnetic field from left to right in the form of experimental over-focus Lorentz images. The topological charge Q and the temperature at which each row was recorded are indicated on the left side. The value of the perpendicular field increases from left to right between around 150 mT and around 450 mT. The values of the external magnetic field are given in Extended Data Figs. 13. The images have identical sizes of around 450 × 450 nm2 and have been extracted from larger fields of view. The dashed circles in the images for Q = −3 and Q = −4 mark spots of low contrast, which result from the nucleation of chiral bobbers or dipole strings during the collapse of the hopfion ring.

Figure 2 shows that the hopfion ring shrinks with increasing applied field. As a result, the distance between the skyrmions inside the ring decreases. By contrast, in ordinary skyrmion clusters (without a hopfion ring) the distance between the skyrmions increases with applied field32. Figure 2 shows that the symmetry of the magnetic texture of skyrmions and hopfion rings also changes with increasing applied field. For instance, the hopfion ring shown in the bottom row has a triangular shape at low field. With increasing magnetic field, it adopts a pentagonal and then a circular shape. Such symmetry transitions are found to be reversible with respect to increasing and decreasing field.

With increasing field, the contrast of the hopfion rings in Lorentz TEM images becomes weaker, suggesting that the magnetic modulations become localized in a smaller volume. The distance between the hopfion ring and the skyrmions also decreases, with bright spots of skyrmion strings nearly touching the hopfion ring just before it collapses. After the collapse of the hopfion ring, the distance between the skyrmions increases abruptly. In most cases, bright spots of weak contrast, which are identified as chiral bobbers33 or dipole strings34, are often observed. Their positions are marked by dashed circles in Fig. 2. Because chiral bobbers and dipole strings have nearly identical contrast in Lorentz TEM images35, they cannot be distinguished reliably in these experiments. They disappear on increasing the applied magnetic field further. The appearance of such objects, which contain magnetic singularities, indicates that the collapse of a hopfion ring represents a topological transition.

Figure 3 shows exotic states with negative and positive topological charges obtained using the above protocol in a 180-nm-thick sample. Magnetic textures with such contrast in our experiments are observed less frequently than those depicted in Fig. 2 (see also Extended Data Fig. 5). The figure shows that a hopfion ring surrounding skyrmion strings can have different sizes, which seem to be limited only by the geometry of the sample. The latter observation agrees with theoretical predictions for 2D skyrmion bags28, which also have no limitation in their size. The theoretical Lorentz TEM images shown in Fig. 3 are in excellent agreement with the experimental images.

Fig. 3: Exotic magnetic states with hopfion rings.
figure 3

ah, Top, experimental Lorentz TEM images of magnetic states with different topological charges (Q = −11 (a), Q = −3 (b), Q = −2 (c), Q = −1 (d,e), Q = 0 (f), Q = 1 (g) and Q = 3 (h)) in different external magnetic fields in a 180-nm-thick sample recorded in the over-focus and under-focus regimes. The images in cfh were recorded at T = 95 K; the other images were recorded at T = 180 K. Bottom, theoretical Lorentz TEM images calculated for corresponding magnetic textures using micromagnetic simulations for identical external magnetic fields to the experimental values. All of the experimental and theoretical images have identical sizes of around 450 × 450 nm2. The magnetization of the entire 1 μm × 1 μm domain and corresponding theoretical Lorentz TEM images are provided in Extended Data Fig. 7. The 3D magnetization vector fields of the magnetic states shown in ad are provided in Fig. 4. See Extended Data Fig. 8 for the 3D magnetization vector fields of the magnetic states shown in eh.

Figure 4 and Extended Data Figs. 7 and 8 show corresponding magnetic textures obtained by direct energy minimization of the micromagnetic functional. In particular, Fig. 4 shows the 3D magnetic textures of the first four states in Fig. 3a–d, and Extended Data Fig. 8 shows magnetic textures of the other four states in Fig. 3e-h. By starting from different initial states, we found slightly different stable configurations for most of the configurations shown in Fig. 3. Figure 4 shows the magnetic textures with the lowest energies.

Fig. 4: Micromagnetic simulations of magnetic textures with hopfion rings.
figure 4

ad, Each row of images corresponds to the magnetic textures shown in Fig. 3a–d, with Q = −11 (a), Q= −3 (b), Q = −2 (c) and Q = −1 (d). The first column shows the magnetization field in the middle plane of the sample. The isosurfaces mz = 0 shown in the second and third columns are identical and differ only in their representations. In particular, the second column shows the isosurface of the hopfion ring alone, to highlight the linkage of the pre-images. The third column shows complete isosurfaces of hopfion rings and skyrmions. Analogous images for the magnetic textures depicted in Fig. 3e–h are provided in Extended Data Fig. 8a–d. eh, Images showing hopfion rings in a bulk system. As well as the isosurfaces mz = 0, we show the magnetization at the edges of the simulated box to visualize the conical modulations along the z axis (see also Extended Data Fig. 8e-h for other hopfion rings in the bulk). A pair of indices (Q, H) defines the skyrmion–hopfion topological charge of the corresponding texture (see Methods). e and f show topologically identical states of different morphology. g, The pair of hopfion rings on a single skyrmion string. h, The pair of hopfion rings on three skyrmion strings. Note that, for the states shown in b,c, the Hopf charge is uncertain.

The hopfion rings shown in Fig. 4a,b,d are located in the middle plane of the sample. However, this is not always the case. In Fig. 4c, the hopfion ring is shifted slightly towards one of the surfaces and is also stretched slightly along the z axis. A similar configuration is shown in Extended Data Fig. 8a. In these cases, the projected magnetization of the hopfion ring onto the xy plane overlaps with the magnetization of the interior ring, leading to a visible contrast difference in Lorentz TEM images of the corresponding magnetic textures. For example, the outer rings shown in Fig. 4c,e have higher contrast when compared to the other images. The contrast in the theoretical images shows the same features. Additional comparisons between experimental and theoretical Lorentz TEM images and electron optical phase images are provided in Extended Data Figs. 9 and 10.

Skyrmion–hopfion topological charge

It is essential to find a complete topological classification of the observed magnetic textures. Our homotopy-group analysis (see Methods) reveals that these textures are classified according to their skyrmion–hopfion topological charge, which can be represented by an ordered pair of integers, (Q, H). Notably, the Hopf charge H here depends not only on the intrinsic structure of the hopfion rings but also on their linking to skyrmion strings. For instance, for the configuration shown in Fig. 4d (right), if there were no skyrmion string at the centre, the Hopf charge would be −1. However, linkage to the skyrmion string results in an actual Hopf charge of +1. Consequently, when such a ring detaches continuously from the string, there must be a profound transformation of its internal structure, leading to its conversion into an anti-hopfion (see Supplementary Video 6).

Despite the presence of hopfion rings in all of the magnetic textures shown in Fig. 4, it is worth emphasizing that we do not specify the Hopf charge for the cases depicted in Fig. 4b,c. Because the inner rings are near the open boundaries of the plate, the compactification condition is not satisfied (see Methods), and a homotopy classification based on the Hopf charge is unsuitable in this case. Another type of texture that does not satisfy the compactification condition is fractional hopfions24,36.

Discussion

In our experiments, the sizes of the hopfion rings are much smaller than the in-plane sample sizes, and hopfion rings can move in at least two spatial dimensions. In thicker samples, we speculate that hopfion rings can also move and interact with each other in the third spatial dimension—along the skyrmion strings. Figure 4e–h and Extended Data Fig. 8e–h illustrate a wide diversity of stable solutions for hopfion rings in bulk systems (see Methods). On the basis of the general principles of classical field theory, it is understood that the Hopf charge of skyrmion strings can be affected by longitudinal twists of skyrmions, as well as by skyrmion braiding37,38,39. However, owing to the chiral nature of the DMI present in the system studied here, stable states with skyrmion twists of multiples of 2π are not observed. Nevertheless, we speculate that such states might be possible in systems that have frustrated exchange interactions9,40. On the other hand, the phenomenon of skyrmion braiding has already been demonstrated in chiral magnets20. Extended Data Fig. 8h shows an example of a skyrmion braid with two hopfion rings and H = 12. This example can be compared with Fig. 4h, which shows straight skyrmion strings surrounded by two hopfion rings and H = 10.

A notable property of the hopfion solutions is the presence of a zero mode arising from the intrinsic symmetry of the Hamiltonian (see Methods). The rotational–translational motion of the hopfion ring along the string preserves energy (see Supplementary Videos 7 and 8), which suggests high mobility of the hopfion rings.

Our findings open broad perspectives for the study of the dynamical41,42 and transport properties43,44 of hopfion rings, and will have practical applications in spintronics, neuromorphic computing and other technologies.

Methods

Micromagnetic simulations

The micromagnetic approach was followed in this work. The total energy of the system includes the exchange energy, the DMI energy, the Zeeman energy and the energy of the demagnetizing fields45:

$$\begin{array}{l}{\mathcal{E}}\,=\,{\int }_{{V}_{{\rm{m}}}}{\rm{d}}{\bf{r}}{\mathcal{A}}\sum _{i=x,y,z}| \nabla {m}_{i}{| }^{2}+{\mathcal{D}}\,{\bf{m}}\,\cdot (\nabla \,\times \,{\bf{m}})-{M}_{{\rm{s}}}\,{\bf{m}}\,\cdot \,{\bf{B}}+\\ \,\,\,\,+\frac{1}{2{\mu }_{0}}{\int }_{{{\mathbb{R}}}^{3}}{\rm{d}}{\bf{r}}\sum _{i=x,y,z}| \nabla {A}_{{\rm{d}},i}{| }^{2},\end{array}$$
(1)

where m(r) = M(r)/Ms is a unit vector field that defines the direction of the magnetization, Ms = M(r) is the saturation magnetization and μ0 is the vacuum permeability (μ0 ≈ 1.257 μN A−2). The constants \({\mathcal{A}}\) and \({\mathcal{D}}\) are the exchange stiffness and the isotropic bulk DMI, respectively. The ratio between \({\mathcal{A}}\) and \({\mathcal{D}}\) defines the equilibrium period of the conical phase, \({L}_{{\rm{D}}}=4\pi {\mathcal{A}}/D\). The magnetic field in equation (1), B = Bext +  × Ad, is the sum of the external magnetic field and the demagnetizing field, where Ad(r) is the component of the magnetic vector potential induced by the magnetization. For the calculations in the bulk system, we set the external magnetic field \({{\bf{B}}}_{{\rm{ext}}}=0.5\,{B}_{{\rm{D}}}{\widehat{{\bf{e}}}}_{z}\), where \({B}_{{\rm{D}}}={{\mathcal{D}}}^{2}/(2{M}_{{\rm{s}}}{\mathcal{A}})\) is the conical phase saturation field in the absence of demagnetizing fields20. We used the following material parameters for FeGe20,33: \({\mathcal{A}}\) = 4.75 pJ m−1, \({\mathcal{D}}\) = 0.853 mJ m−2 and Ms = 384 kA m−1. For the 0.5-μm-diameter and 180-nm-thick disk sample depicted in Fig. 1a–e, the calculations were performed on a mesh with 256 × 256 × 64 cuboids. Calculations for the 1 μm × 1 μm × 180 nm sample were performed on a mesh with 400 × 400 × 72 cuboids. For the bulk magnet, we exclude dipole–dipole interactions and consider a domain of size 5LD × 5LD × 10LD under periodic boundary conditions on a mesh with 256 × 256 × 512 cuboids.

Following the arguments presented in a previous study35, a thin surface layer of the isotropic chiral magnet crystal is damaged during FIB milling and can be effectively approximated by material parameters that are identical to those of the bulk crystal, but with the DMI coupling constant set to zero. In the previous report35, the thickness of the FIB-damaged layer of an FeGe nanocylinder was estimated to be 6 ± 1 nm. According to another report21, the thickness of the damaged layer of an FeGe needle-like sample is around 10 nm. Here, we assume an intermediate thickness for the damaged layer of 7.5 nm (corresponding to three surface cuboids).

It should be noted that the presence or absence of a damaged layer in our simulations has almost no effect on the stability of the solutions shown in Fig. 4. The contrast in theoretical Lorentz TEM images in Fig. 3 also does not change significantly when the presence of a damaged layer is ignored. However, the presence of a damaged surface layer has a crucial role in hopfion-ring nucleation. In the simulations, through the application of a magnetic field in the negative and positive directions with respect to the z axis, we only succeeded in observing hopfion-ring nucleation, as shown in Fig. 1a–d, in the presence of a damaged surface layer.

Statically stable solutions of the Hamiltonian (equation (1)) were found by using the numerical energy minimization method described previously20 using the Excalibur code46. The solutions were double-checked using the publicly available software Mumax47. In the Supplementary information, we also provide three Mumax scripts, which can be used to reproduce the results of our micromagnetic simulations. Script I allows the hopfion-ring nucleation depicted in Fig. 1a–d to be reproduced. Because the states depicted in Fig. 1a,d are two states with different energies that are stabilized in identical conditions, the transition between them requires additional energy pumping. The energy balance between these states depends on the applied field. In the experimental set-up, this in-field transition is enhanced by thermal fluctuation and, as a result, has a probabilistic character. To make the nucleation of the hopfion ring deterministic (reproducible), in the micromagnetic simulations we use an abrupt switch of the magnetic field (with a step of around 100 mT) to overcome the barrier between the metastable states. Script II, with minor modifications of the initial states discussed in the next section, can be used to reproduce the states shown in Fig. 4. For a description of Script III, see the following section.

Initial state for hopfion rings in micromagnetic simulations

On the basis of experimental observations and theoretical analysis, we noticed that the presence of the conical phase around different localized states results in an additional contribution to the electron optical phase shift that changes around the perimeter of the sample. To obtain the magnetic textures in nanoscale samples, we used initial configurations corresponding to a superposition of cylindrical domains, with their magnetization pointing up and down, embedded in a conical phase and with an additional phase modulation resembling a vortex in the xy plane of the form

$$\Theta ={\rm{acos}}\left(\frac{{B}_{{\rm{ext}}}}{{B}_{{\rm{D}}}+{\mu }_{0}{M}_{{\rm{s}}}}\right),\,\Phi ={\rm{atan}}\frac{y}{x}+\frac{\pi }{2}+kz,$$
(2)

where k = 2π/LD is the wave number. In another study27, similar vortex-cone configurations were discussed in the context of screw dislocations in bulk chiral magnets. Here, a magnetic configuration approximated by equation (2) appears owing to an interplay between short-range interactions (Heisenberg exchange and DMI) and a long-range demagnetizing field. This effect has previously been observed in samples of confined geometry26,32,33.

Representative examples of two initial states are illustrated in Extended Data Fig. 9a. Stable magnetic states obtained from these initial states after energy minimization are shown in Extended Data Fig. 9b,c. The state with a compact hopfion ring not only has lower energy, but also provides contrast in theoretical Lorentz TEM images that accurately match experimental images (Extended Data Fig. 9e,f). The results shown in Extended Data Fig. 9 can be reproduced by using Mumax Script II.

For simulations of the bulk, skyrmion strings with hopfion rings were embedded into the uniform conical phase:

$$\Theta ={\rm{acos}}\left(\,{B}_{{\rm{ext}}}/{B}_{{\rm{D}}}\right),\,\Phi =kz.$$
(3)

For hopfion rings, we used the following toroidal ansatz:

$$\Theta =\pi \,\left(1-\frac{\eta }{{R}_{1}}\right),\,\,0\le \eta \le {R}_{1},$$
(4)
$$\Phi ={\rm{atan}}\,\left(\frac{y}{x}\right)-{\rm{atan}}\,\left(\frac{z}{{R}_{2}-\rho }\right)-\frac{\pi }{2},$$
(5)

where R1 and R2 are the minor and major radii of a torus, respectively, \(\rho =\sqrt{{x}^{2}+{y}^{2}}\) and \(\eta =\sqrt{{({R}_{2}-\rho )}^{2}+{z}^{2}}\). We also refer the reader to the Mumax Script III for initial state implementation. By default, Script III can reproduce a complex configuration in the bulk system, as shown in Extended Data Fig. 8h. With minor modifications, it can also be used to replicate all other states.

Simulations of electron optical phase-shift and Lorentz TEM images

By using the phase object approximation and assuming that the electron beam is antiparallel to the z axis, the wave function of an electron beam can be written as follows48:

$${\Psi }_{0}(x,y)\propto \exp \left(i\varphi (x,y)\right),$$
(6)

where φ(x, y) is the magnetic contribution to the phase shift49

$$\varphi (x,y)=\frac{2\pi e}{h}\underset{-\infty }{\overset{+\infty }{\int }}\,{\rm{d}}z\,{{\bf{A}}}_{{\rm{d}}}\cdot {\widehat{{\bf{e}}}}_{{\rm{z}}},$$
(7)

e is an elementary (positive) charge (around 1.6 × 10−19 C) and h is Planck’s constant (approximately 6.63 × 10−34 m2 kg s−1). Because our approach for the solution of the micromagnetic problem recovers the magnetic vector potential Ad, simulation of the electron optical phase shift is straightforward.

In the Fresnel mode of Lorentz TEM, neglecting aberrations other than defocus, aperture functions and sources of incoherence and blurring, the wave function at the detector plane can be written in the form

$${\Psi }_{\Delta z}(x,y)\propto \int \,\int \,{\rm{d}}{x}^{{\prime} }{\rm{d}}{y}^{{\prime} }\,{\Psi }_{0}({x}^{{\prime} },{y}^{{\prime} })K(x-{x}^{{\prime} },y-{y}^{{\prime} }),$$
(8)

where the kernel is given by the expression

$$K(\xi ,\eta )=\exp \left(\frac{i\pi }{\lambda \Delta z}({\xi }^{2}+{\eta }^{2})\right),$$
(9)

the relativistic electron wavelength is

$$\lambda =\frac{hc}{\sqrt{{(eU)}^{2}+2eU{m}_{e}{c}^{2}}},$$
(10)

Δz is the defocus of the imaging lens, c is the speed of light (approximately 2.99 × 108 m s−1), U is the microscope accelerating voltage and me is the electron rest mass (around 9.11 × 10−31 kg). The image intensity is then calculated using the expression

$$I(x,y)\propto | {\Psi }_{\Delta z}(x,y){| }^{2}.$$
(11)

For more details about the calculation of Lorentz TEM images, see ref. 20.

Homotopy-group analysis

Skyrmion topological charge

For magnetic textures localized in the plane area \(\Omega \subseteq {{\mathbb{R}}}^{2}\), such that at the boundary of this area ∂Ω the magnetization field m(∂Ω) = m0, the classifying group is the second homotopy group of the space \({{\mathbb{S}}}^{2}\) at the base point m0, and there is an isomorphism to the group of integers (Abelian group with respect to addition):

$${\pi }_{2}({{\mathbb{S}}}^{2},{{\bf{m}}}_{0})={\mathbb{Z}}.$$
(12)

This implies that any continuous magnetic texture satisfying the above criteria of localization can be attributed to an integer number, which is commonly referred to as the skyrmion topological charge (or skyrmion topological index), and can be calculated as follows:

$$\left\{\,\begin{array}{ll} & Q=\frac{1}{4\pi }{\int }_{\Omega }{\rm{d}}{r}_{1}{\rm{d}}{r}_{2}\,{\bf{F}}\cdot {\widehat{{\bf{e}}}}_{{r}_{3}},\\ & {{\bf{m}}}_{0}\cdot {\widehat{{\bf{e}}}}_{{r}_{3}} > 0,\end{array}\right.$$
(13)

where

$${\bf{F}}=\left(\begin{array}{l}{\bf{m}}\cdot [{\partial }_{{r}_{2}}{\bf{m}}\times {\partial }_{{r}_{3}}{\bf{m}}]\\ {\bf{m}}\cdot [{\partial }_{{r}_{3}}{\bf{m}}\times {\partial }_{{r}_{1}}{\bf{m}}]\\ {\bf{m}}\cdot [{\partial }_{{r}_{1}}{\bf{m}}\times {\partial }_{{r}_{2}}{\bf{m}}]\end{array}\right)$$
(14)

is the vector of curvature50,51, which is also known (up to a prefactor) as the gyro-vector or vorticity10,52,53,54, and r1, r2 and r3 are local right-handed Cartesian coordinates.

The unit field m can be parameterized on the \({{\mathbb{S}}}^{2}\) sphere using polar and azimuthal angles Θ and Φ, respectively, in the form \({\bf{m}}=(\cos \Phi \sin \Theta ,\sin \Phi \sin \Theta ,\cos \Theta )\). The corresponding topological invariant, up to the sign, is the degree of mapping of the skyrmion localization area onto the sphere55, which can be calculated using the top part of equation (13), assuming that r1 and r2 lie in the skyrmion plane. It should be noted that the sign of the integral in the top part of equation (13) depends on the choice of the orientation of the coordinate system. For example, in Fig. 4a the sign of Q depends on whether the r3 axis is parallel or antiparallel to the z axis and equals − 11 or 11, respectively. The condition in the bottom part of equation (13) removes this ambiguity. A justification for this statement, based on the theory of fundamental invariants, can be found in a previous study56. The local coordinate system (r1, r2, r3) for calculating the topological charge Q of a particular skyrmion is chosen according to the condition in the bottom part of equation (13).

For skyrmions that have different m0 in the global coordinate system, equation (12) is not globally applicable because the base points57 are different. However, isomorphisms to the group of integers can always be completed through continuous individual transformations of vector fields to match the vectors m0 to one base point.

Here, we use the same convention for the sign of the topological charge as previous reports20,28,29,58, such that an elementary Bloch-type or Neel-type skyrmion has Q = −1.

Hopfion topological charge

For a magnetic texture localized within the 3D domain \(\Omega \subseteq {{\mathbb{R}}}^{3}\), with a fixed magnetization m(∂Ω) = m0 at the boundary ∂Ω of the domain, the classifying group corresponds to the third homotopy group of the space \({{\mathbb{S}}}^{2}\) at the base point m0:

$${\pi }_{3}({{\mathbb{S}}}^{2},{{\bf{m}}}_{0})={\mathbb{Z}}.$$
(15)

The corresponding topological charge, which is known as the Hopf invariant, can be calculated using Whitehead’s formula51,59:

$$H=-\frac{1}{16{\pi }^{2}}{\int }_{\Omega }{\rm{d}}{r}_{1}{\rm{d}}{r}_{2}{\rm{d}}{r}_{3}\,{\bf{F}}\cdot [{(\nabla \times )}^{-1}{\bf{F}}].$$
(16)

Skyrmion–hopfion topological charge

To analyse the continuous texture localized on a segment of a skyrmion string, we use the compactification approach and other methods of algebraic topology60. First, we note that, owing to the invariance of Q along a skyrmion string, the lower and upper cross-sections bounding the skyrmion string segment are related by a trivial transformation. This implies that the dimension along the skyrmion string can be compactified to a circle \({{\mathbb{S}}}^{1}\). Second, we note that the conical phase and the phase with uniform magnetization m0 are equivalent to each other up to a trivial transformation. By exploiting this observation, one can compactify the remaining two dimensions. The magnetic texture localized on a segment of a skyrmion string can be treated as if it is confined within a solid torus \(\Omega ={{\mathbb{D}}}^{2}\times {{\mathbb{S}}}^{1}\). The noncollinearities of m are then localized inside Ω, while everywhere on its surface \(\partial \Omega ={{\mathbb{S}}}^{1}\times {{\mathbb{S}}}^{1}\) the magnetization m(∂Ω) = m0 is fixed.

Thereby, the homotopy classification arises from a continuous map from a one-point compactified solid torus to the spin space:

$${{\mathbb{D}}}^{2}\,\times \,{{\mathbb{S}}}^{1}/{{\mathbb{S}}}^{1}\,\times \,{{\mathbb{S}}}^{1}\to {{\mathbb{S}}}^{2}.$$
(17)

By using the homeomorphism of the quotient spaces \({{\mathbb{D}}}^{2}\,\times \,{{\mathbb{S}}}^{1}/{{\mathbb{S}}}^{1}\,\times \,{{\mathbb{S}}}^{1}\) and \({{\mathbb{S}}}^{3}/{{\mathbb{S}}}^{1}\), as well as the homotopy equivalence between \({{\mathbb{S}}}^{3}/{{\mathbb{S}}}^{1}\) and \({{\mathbb{S}}}^{2}\vee {{\mathbb{S}}}^{3}\), we find a homotopy equivalent map

$${{\mathbb{S}}}^{2}\vee {{\mathbb{S}}}^{3}\to {{\mathbb{S}}}^{2}.$$
(18)

Taking the base point, m0, as a point common to the wedge sum, we immediately find the homotopy group

$$G={\pi }_{2}({{\mathbb{S}}}^{2},{{\bf{m}}}_{0})\times {\pi }_{3}({{\mathbb{S}}}^{2},{{\bf{m}}}_{0})={\mathbb{Z}}\times {\mathbb{Z}},$$
(19)

where π2 and π3 correspond to equations (12) and (15), respectively, and the components of the topological charge are subject to equations (13) and (16), respectively. The topological index for the textures depicted in Fig. 4 and Extended Data Fig. 8 then represents the ordered pair of integers (Q, H).

Calculation of topological charges

To compactify the textures obtained in micromagnetic simulations, we used the nested box approach. This method involves fixing and placing the box containing the studied texture at the centre of a slightly larger computational box. The computational box has periodic boundary conditions along the z direction, and the remaining boundaries are fixed \({{\bf{m}}}_{0}={\widehat{{\bf{e}}}}_{z}\). To ensure continuity of the vector field m in the transition regions between the nested boxes, we minimized the Dirichlet energy, ∫drm2. Next, to calculate F and the topological charge Q, we used a previously proposed lattice approach61. The vector potential of the divergence-free field F was obtained by evaluating the integral:

$${(\nabla \times )}^{-1}{\bf{F}}=\int {\rm{d}}x\,{\bf{F}}\times {\widehat{{\bf{e}}}}_{x}.$$
(20)

The Hopf index H was then determined by numerically integrating equation (16).

For additional verification, we also computed the index H by calculating the linking number for curves in real space that corresponded to two different points on the spin sphere62.

Derivation of zero mode

The zero mode is obtained by analysing the symmetries of the Hamiltonian presented in the supplementary material of a previous report32. Without dipole–dipole interactions, the energy density of the bulk system in equation (1) is invariant under the following transformations from \({{\bf{m}}}^{{\prime} }({{\bf{r}}}^{{\prime} })\) to m(r) and vice versa:

$${\bf{m}}({\bf{r}})=\left(\begin{array}{lll}\cos (k{z}_{0}) & -\sin (k{z}_{0}) & 0\\ \sin (k{z}_{0}) & \cos (k{z}_{0}) & 0\\ 0 & 0 & 1\end{array}\right)\cdot {{\bf{m}}}^{{\prime} }({{\bf{r}}}^{{\prime} }),$$
(21)

where

$${{\bf{r}}}^{{\prime} }=\left(\begin{array}{rcl}\cos (k{z}_{0}) & \sin (k{z}_{0}) & 0\\ -\sin (k{z}_{0}) & \cos (k{z}_{0}) & 0\\ 0 & 0 & 1\end{array}\right)\cdot {\bf{r}}-{z}_{0}{\widehat{{\bf{e}}}}_{z},$$
(22)

and z0 is an arbitrary parameter, which, in the most general case, defines the screw-like motion of an entire magnetic texture about the z axis with pitch 2π/k = LD. Of note, there are at least two cases in which the transformation (equations (21) and (22)) does not affect the magnetic texture, meaning that \({{\bf{m}}}^{{\prime} }({{\bf{r}}}^{{\prime} })={\bf{m}}({\bf{r}})\) holds for any value of z0. The first case is rather trivial and corresponds to the conical phase with the wave vector aligned parallel to the z axis (see equation (3)). The second case is particularly intriguing, and involves the skyrmion string in the conical phase, in which the primary axis of the string aligns with the rotation axis32. Applying the transformation in equations (21) and (22) to the skyrmion string with a hopfion ring describes the screw motion of the hopfion ring around the string representing a zero mode. The parameter z0, in this case, denotes the displacement of the hopfion ring along the string. Supplementary Videos 7 and 8 provide a visualization of such a screw motion of two different hopfion rings depicted in Fig. 4e,f. Evidence for such zero mode in other 3D solitons can be found in previous reports8,63.

Specimen preparation

FeGe TEM specimens were prepared from a single crystal of B20-type FeGe using a FIB workstation and a lift-out method20.

Magnetic imaging in the transmission electron microscope

The Fresnel defocus mode of Lorentz imaging and off-axis electron holography were performed in an FEI Titan 60-300 TEM operated at 300 kV. For both techniques, the microscope was operated in Lorentz mode with the sample at first in magnetic-field-free conditions. The conventional microscope objective lens was then used to apply out-of-plane magnetic fields to the sample of between −0.15 and + 1.5 T. A liquid-nitrogen-cooled specimen holder (Gatan model 636) was used to vary the sample temperature between 95 and 380 K. Fresnel defocus Lorentz images and off-axis electron holograms were recorded using a 4k × 4k Gatan K2 IS direct electron counting detector. Lorentz images were recorded at a defocus distance of 400 μm, unless otherwise specified. Multiple off-axis electron holograms, each with a 4 s exposure time, were recorded to improve the signal-to-noise ratio and analysed using a standard fast Fourier transform algorithm in Holoworks software (Gatan). The magnetic induction map shown in Fig. 1 was obtained from the gradient of an experimental magnetic phase image.

Supplementary Videos 15 show in situ Lorentz TEM images captured at a defocus distance of approximately 400 μm and at a sample temperature of 180 K. Each video begins with several cycles of field swapping, in which the applied magnetic field alternates between positive and negative directions perpendicular to the plate. The field amplitude is limited to 50 mT or less. As the magnetic field in the transmission electron microscope is provided by the objective lens, this alternating field leads to a visible rotation of the image on the screen. Counter-clockwise rotation indicates an increase in the field towards the viewer and vice versa. These field-swapping cycles induce edge modulations that propagate towards the centre of the sample. The primary objective of this cycle is to generate edge modulations that propagate out of the free edges. After a few field-swapping cycles, closed loops near the centre of the square sample form. To enhance visibility, the playback speed of all of the videos has been doubled. Once at least one closed loop has been formed away from the sample edges, the magnetic field is increased to approximately 150 mT, resulting in the nucleation of a hopfion ring. Supplementary Video 1 illustrates the nucleation of a double hopfion ring.

Supplementary Video 4 reveals instabilities of the hopfion ring. After hopfion-ring nucleation, the magnetic field was initially decreased below a threshold value of approximately 50 mT, causing the hopfion ring to lose its shape and elongate over the sample. Subsequently, the field was increased again, leading to the reformation of a compact hopfion ring surrounding six skyrmion strings. Finally, the field was increased further above 190 mT, leading to the collapse of the hopfion ring. The concluding frame of Supplementary Video 4 depicts a cluster of six skyrmions without a hopfion ring.