We consider a model system that consists of two intertwined, yet spatially separated, ferromagnetic nanohelices. This three-dimensional nanomagnetic system has a complex energy landscape defined by the balance of competing intra- and interhelix effects (terms defined above). The nanoscale double helix combines effects of curvature and torsion that may result in curvature-induced magnetic anisotropy and chirality effects^{20,21,22}. Specifically, the two helices are designed to have the same chirality, and are offset by half a period, leading to a constant interhelix separation along the length of the system. We fabricate the system of two intertwined cobalt nanohelices with focused electron beam induced deposition^{23}. Scanning electron microscope (SEM) images of two nanoscale double helices are presented in Fig. 1: the first (double helix A, Fig. 1c) with lower pitch and higher radius, the second (double helix B, Fig. 1d) more elongated with higher pitch and lower radius (geometries defined in Table 1). Both double helices have a nanowire diameter of approximately 70–80 nm with an interhelix distance of ~50–70 nm and therefore exhibit strong magnetostatic coupling.

To probe the magnetic state of these complex three-dimensional magnetic nanostructures, we employ scanning transmission X-ray microscopy (STXM, Fig. 1e). By tuning the X-ray energy to the Co L_{2} edge (796 eV) and measuring images with circular polarization, we exploit X-ray magnetic circular dichroism (XMCD) to obtain a high-spatial-resolution projection of the magnetization parallel to the X-ray beam (Fig. 1f). We first probe the as-grown state of the two magnetic double helices in Fig. 1f,g, where we can see that in both XMCD images the double helices are composed of a dark and a bright helix, which corresponds to the individual helices being in antiparallel-magnetized single-domain states with a quasi-tangential magnetization distribution. This is expected due to the radii of curvature and torsion (defined in Table 1) being much larger than both the exchange length (4–6 nm) and the diameter of the nanowires^{20}. These two antiparallel double-helix states (magnetizations of helices A and B either positive and negative or negative and positive, respectively) represent the degenerate ground states of the system (Methods), and are a result of the fabrication sequence of the helices, which are grown in parallel: at the start of the growth when the helices are small, the magnetic moments reorient to minimize the magnetostatic energy, aligning antiparallel to one another. This antiparallel state is maintained as the helices are grown, leading to the formation of these single-domain, micrometre-length structures^{7}.

Although the two double-helix systems form similar antiparallel states in their as-grown configuration, they exhibit very different configurations following the application of a magnetic field perpendicular to the long axis of the helix. The XMCD projection of double helix A again reveals a pair of dark and bright helices, indicating the return to an antiparallel state (specifically the opposite antiparallel state, Fig. 1h). However, the XMCD projection of double helix B is different, with alternating regions of dark and bright contrast within individual helices (Fig. 1i), indicating the formation of a multidomain state with a regular array of domain walls. With both double-helix systems composed of the same material and exposed to the same external magnetic field, we attribute this difference in behaviour to their different curvatures, torsions and interhelix couplings.

To elucidate the influence of the three-dimensional geometry on the remanent magnetic configuration, we simulate the magnetic configuration formed after the application of a saturating transverse magnetic field for a variety of helix pitches and radii using finite-element micromagnetic simulations^{24}. We identify three remanent magnetic configurations. The first is the antiparallel state (Fig. 2a, left), as observed experimentally for double helix A (Fig. 1f). The second is an unlocked domain wall state (Fig. 2a, centre), in which the transverse domain walls are aligned in the direction of the applied magnetic field. This unidirectional state is characterized by having the net magnetic surface charge of the walls located at the outer curved section of the wires^{25,26}, as favoured by the curvature-induced anisotropy and the curvature-induced Dzyaloshinskii–Moriya interaction (DMI), which promote a particular domain wall chirality^{25}. This state is consistent with the equivalent magnetic configurations of planar magnetic nanowires^{27}. For geometries that host the unlocked state at remanence, the curvature-induced effects dominate over the interstructure magnetostatic interaction. We also observe a third, unconventional domain wall configuration (Fig. 2a, right), in which the domain walls fully reverse with respect to both the direction of the applied magnetic field and the curvature-induced DMI, becoming locked in place due to the strong interhelix interaction, as shown schematically in Fig. 2b.

To determine whether the locked domain wall state is present in double helix B, we perform soft-X-ray magnetic laminography^{12,13,28,29} (Fig. 1e) to map its three-dimensional magnetization vector field with nanoscale resolution The reconstructed magnetization is given by arrows in Fig. 2d, where a reversal of the direction of the magnetization within the magnetic domain walls can be observed, consistent with the locked domain wall state. An additional representation of the magnetization with streamlines (Fig. 2e) reveals a distinctive figure-of-eight structure in the reconstructed magnetization. When compared with micromagnetic simulations in Fig. 2f,g (see also Extended Data Fig. 1), the figure-of-eight structure is reproduced, providing confirmation of the reversal of the domain wall direction and the resulting locked domain wall array in double helix B.

The formation of these different remanent states—the antiparallel state and locked domain wall state for double helices A and B, respectively—occurs due to the geometry of the double helices strongly affecting the competing interactions. Specifically, the higher torsion:curvature ratio of double helix B, associated with its higher helix pitch and lower helix radius, promotes the formation of a stable array of locked domain walls. After the formation of the unlocked domain walls following transverse saturation, the domain walls reorient owing to the magnetostatic interaction overcoming the curvature-induced DMI of the domain wall. In particular, the higher torsion:curvature ratio decreases the distance between the helices, increasing the magnetostatic interaction between them, while at the same time decreasing the curvature-induced DMI, promoting the rotation of the domain walls to the locked state (Methods). This reorientation creates a more confined magnetic flux, reducing the magnetostatic energy, as shown schematically in Fig. 2b. In contrast, the antiparallel state observed in double helix A forms due to the higher curvature and lower torsion. Specifically, as the interdomain wall distance in different helices increases, the coupling between domain walls in different helices decreases, and the distance between domain walls within a single helix is reduced. Both effects favour the annihilation of neighbouring domain wall pairs and the formation of the antiparallel state. This geometry-dependent behaviour in intertwined double helices is confirmed both by mapping the phase diagram of this system with micromagnetic simulations and by an analytical model (Methods and Supporting Sections I and II), confirming that the locked domain wall state forms as a result of the influence of the geometry on these competing effects.

The locked domain wall state observed here occurs due to the balance between intrahelix properties and interhelix coupling. While it is known that curvature and torsion influence intrananowire properties such as anisotropies and chirality^{5,20,21,22,30}, their influence on internanostructure coupling—that is, the magnetic stray field generated by neighbouring three-dimensional structures—remains unexplored. To elucidate the influence of the three-dimensional geometry on the magnetostatic coupling, we calculate the magnetic induction **B** = *μ*_{0}(**H** + **M**) in the whole space (including both the magnetic material and free space) by taking the magnetization configuration **M** of the locked domain wall state from micromagnetic simulations and computing its stray field (**H**). We first consider the overall structure of **B** within the helix: the formation of the regular array of domain walls results in the double helix being split into two main domains, as shown in Fig. 3a, where on the left the magnetization points down along (- hat {mathbf{x}}) (blue), and on the right the magnetization points up along (+ hat {mathbf{x}}) (red). This asymmetry in **B** within the double helix results in a similar asymmetry in **B** in free space, seen by considering the variation in the stray field surrounding the domain walls. While the highest magnitude stray fields in free space (({{{mathit{B}}}} = mu _0{{{mathit{H}}}} > 0.3mu _0M_{mathrm{s}})) are found to mostly align horizontally ((hat {mathbf{y}})) between the domain wall pairs (left panel of Fig. 3b), as lower-magnitude stray fields are considered (middle and right panels of Fig. 3b) we observe a growing component of the stray field in the plane of the domain wall cross-section (*x*–*z* plane), which becomes more noticeable when weaker stray fields of magnitude >0.1 *M*_{s} are plotted. In fact, the stray field is seen to rotate asymmetrically into the *x*–*z* plane to channel the magnetic flux of magnetic domains of the same direction in the two different helices (Fig. 3c): on one side the stray field develops a (blue) negative vertical (hat {mathbf{x}}) component to channel the flux of the (blue) negative *m*_{x} domains, while on the other side the stray field tilts into the (red) positive (hat {mathbf{x}}) direction to connect domains of (red) positive *m*_{x}, indicated by blue and red arrows in Fig. 3c.

The formation of these asymmetric magnetic flux channels not only results in a deviation from the direct horizontal coupling of the domain walls but also induces a distinctive asymmetric structure into the magnetic induction itself. Indeed, when the magnetic induction is projected onto the *x*–*z* plane perpendicular to the direction of the domain walls (indicated in Fig. 4a), the asymmetric (hat {mathbf{x}}) components of the induction caused by the flux channels result in the formation of a saddle-like structure surrounding the domain wall pair that resembles an antivortex quadrupole structure^{31} (Fig. 4b). We confirm the presence of antivortices in the magnetic induction by calculating the winding number of the normalized components of the induction in the *x*–*z* plane to be −1. These textures are of interest not only for their topological nature, but also for the type of magnetic force that could be generated. Indeed, the non-trivial in-plane structure exhibits well defined gradients in the *x*–*z* plane components of the magnetic field, offering a new route to the design of nanoscale gradients in the magnetic induction.

Due to the periodic geometry of the double helix, the in-plane antivortices are not isolated objects: the regular array of locked domain walls leads to an array of effective antivortices in the magnetic stray field (Fig. 4b). In addition, the magnetization configuration of the locked domain wall state in the chiral double helix forms an array of vortices of constant chirality in **B** (with winding number +1), which is defined by the chiral geometry. The combination of the alternating chiral vortices and antivortices in **B** is reminiscent of the cross-tie wall in planar magnetic elements^{14,32} (Fig. 4c), where the continuity of the magnetization requires the presence of a crossing of the magnetization between like-handed vortices^{33}. Here, we observe this contained effective cross-tie *B* field domain wall-like structure composed of vortices in the magnetization and antivortices in the **B** field in free space.

To confirm the role of the chirality of the helix in the formation of these complex **B** field textures, we consider the equivalent domain wall configuration in a non-helical, achiral geometry composed of straight nanowires. To remove the helical geometry, we perform additional simulations after applying a coordinate transformation to the locked domain configuration, effectively unwinding the helices to form a pair of straight nanowires (Methods) and removing the influence of the three-dimensional chiral geometry of the helices and the associated curvilinear effects. Following the relaxation of the magnetization from the locked state under this new geometry (Fig. 4d), we observe no vertical component of the stray field coupling domains of the same direction in different nanowires (Fig. 4e), indicating that no flux channelling (as observed in the double helix, Fig. 3c) occurs. Due to the absence of flux channelling, no antivortex textures are observed in the stray field, confirming that the stray field textures observed surrounding the locked domain wall state are a direct consequence of the twisting of the chiral helix structure.

We have demonstrated that the three-dimensional geometry not only can alter intrastructure properties, but also offers an opportunity to tailor the magnetic field itself. This is showcased in our double-helix system, where the three-dimensional geometry results in highly stable and robust locked domain wall pairs, with prospects for robust domain wall motion and synchronous dynamics^{34,35} in three-dimensional interconnectors, key to the realization of spin logic in large-scale integrated three-dimensional circuits. These phenomena are of great interest for domain wall conduit-based information processing^{36}, which includes emerging applications such as reservoir computing^{2,37} where the strong interaction between neighbouring magnetic textures and the controlled reconfigurability that these systems present is of key importance. In particular, the introduction of nonlinear interactions into a system provides the opportunity for the combination of information transmission and processing, and the possibility to go beyond von Neumann computing architectures. Moreover, the creation of an array of planar antivortices in the magnetic field in free space sets a precedent for the creation of topological magnetic field textures with complex nanoscale field gradients using three-dimensional magnetic nanostructures. The design of controlled gradients in the magnetic field is key for applications such as particle^{18} and cold-atom^{17} trapping, while the ability to define complex nanotextures in the magnetic field has important implications for imaging^{19,38,39} and magnetic field manipulation^{40}. While emergent topological features in the magnetic stray field have previously been found to result in chiral behaviour in frustrated nanomagnet arrays^{41}, here three-dimensional nanopatterning results in the controlled creation of well localized magnetic field antivortices. These results demonstrate that the properties of a three-dimensional system can not only be used to tailor the material internal spin states but also play a key role in defining the magnetic stray field, and thus the interaction of neighbouring features in the magnetization.