Magnetic omniconversion: Source-independent molding of magnetostatic fields Jaume Cunill-Subiranas, Natanael Bort-Soldevila, Fabian Resare, Nuria Del-Valle, Witlef Wieczorek, Carles Navau Abstract Magnetic fields are constrained by the geometry and location of their sources, limiting the ability to freely tailor their spatial distribution. We introduce a general framework to passively convert the magnetic field generated by arbitrary sources into any prescribed desired field within a finite source-free region. Our method relies on field shaping using linear magnetic materials, enabling source-independent magnetic field molding. We provide the general recipe, analytical and numerical demonstrations for some paradigmatic examples, and a proof-of-concept experiment that validates the idea and materials implementation. This approach enables original possibilities in magnetic shielding, targeted field delivery, advanced imaging technologies, and a broad range of field-control applications. INTRODUCTION Precisely generating and controlling magnetic fields in certain regions of space is pivotal in many different scientific and engineering domains. For example, highly uniform magnetic fields are required in particle physics, in medical imaging, for atomic clocks, or in nuclear magnetic resonance (–). In precision mass spectroscopy, quantum magnetomechanics, magnetic confinement fusion, or microrobotics, highly precise dipolar, quadrupolar, or more complex fields are essential for the performance of experiments (–). In general, the desired magnetic field distribution in a specified region of space is achieved through a careful selection of magnetic sources that approximate the target field but never reproduce it exactly. This limitation arises not only from unavoidable imperfections in the experimental implementation but also from the truncated or discretized source representations that are used to obtain the fields. Moreover, despite the apparent necessity of superposing multiple coils or magnets to obtain arbitrary field configurations, one could ask whether the field of a single given source can be manipulated to convert it into any desired field in a certain region. It is well known that magnetic materials can alter field lines by expelling or attracting them, enabling magnetic shielding or field concentration in free space (–). Transformation optics (, ) spurred new methods to control electromagnetic and magnetostatic fields via metamaterials (, ), enabling perfect lenses or cloaks (–), among other devices (–). Here, we show how to generate any type of magnetostatic field shape in a finite and bounded source-free region of space using an arbitrary source located outside this region. The targeted field would be an exact field—not as an nth order approximations nor as a truncated scheme—with ideal materials. Our concept is grounded in the idea of magnetic field shaping (), taking it to the next level by transforming, in the finite bounded region, any applied field into any other desired field distribution, which can be, for example, uniform, monopole-like, dipole-like, parabolic-like, etc. As a corollary, our work is a generalization of the concept of magnetic shielding, which aims to nullify the field in a specific region. In the following, we will state the problem and describe the general solution. We will introduce illustrative and relevant examples, considering the implementation with realistic materials and a proof-of-concept experiment that validates both the general idea and the availability of materials with the required properties. RESULTS AND DISCUSSION General description of magnetic omniconversion We aim to have, in some extended volume, a desired static magnetic field H(r), independently of the applied sources, which produce a field Ha(r). This, which could seem impossible, is indeed possible if the region does not contain the sources of Ha. The idea is to reshape the field lines of the sources by converting them into the desired field lines using adequate magnetic materials surrounding the region of interest. The desired field H(r) must first satisfy ∇⋅H=0 and ∇×H=0 in a given extended region of space V in which we assume that there are no sources. One can then write H(r)=−∇φ(r), where φ(r) is the scalar magnetic potential. φ satisfies the Laplace equation ∇2φ(r)=0 for r∈V. Because of the uniqueness theorem for the solutions of the Laplace equation, if we find a volume V0⊂V whose surfaces satisfy the boundary conditions of the desired field, then the magnetic field H(r) for r∈V0 will have exactly the same shape as the desired one, independently of the field created by the sources Ha(r). We now show how to find these surfaces and how to define V0. If the field does not have singular points (points where H=0) in the volume V, we start by choosing a closed line Γ0 belonging to any equipotential surface S0={r∈V∣φ(r)=φ0}; see . In S0, the field H=−∇φ is perpendicular to the surface. In particular, starting from all the points belonging to Γ0⊂S0, one could generate a new closed line considering differential displacements dl parallel to the field at each point. That is, the new points are obtained after solving In this way, we can generate a set of closed lines that ultimately form a surface. is a differential equation, whose solution with the Γ0 points as boundary conditions yields a surface such that the field H is parallel to each point of the surface. We call this surface SL. Last, we take another equipotential surface S1={r∈V∣φ(r)=φ1}, with φ1≠φ0. Surfaces S0, S1, and SL enclose a volume V0⊂V such that in all their boundary surfaces, the field is either parallel (at the points belonging to SL) or perpendicular (at the points belonging to S0 and S1) to the surfaces. In other words, we have constructed the volume V0⊂V in such a way that the boundary conditions for the scalar potential φ are exactly those that yield the desired field H. Because of the uniqueness theorem, the field inside V0 must have the shape of the desired one. To avoid obtaining the trivial solution H=0 for all r∈V0, one should locate an applied field source outside the volume V0 such that φ1≠φ0 and modify its field lines with adequate materials that satisfy the required conditions at the surfaces S0, S1, and SL. The external field fixes the value of the potentials at S0 and S1. Thus, the inner field’s magnitude depends on the external source, but the shape of the field does not. Changing the source (position, nature, and magnitude) will change only the magnitude of the magnetic field inside V0. This will work for any external field and any desired nonsingular magnetic field. We have designed a magnetostatic omniconverter. Note that if the field source is located in such a way that the potential created in S0 and S1 is exactly the same, then the trivial H=0 solution is the only solution: The field shape remains unchanged, but its magnitude goes to zero. For fields containing an isolated singular point at r0, i.e., H(r0)=0, the entire space can be divided into nonintersecting regions such that a field line starting in one region does not cross into another. In addition, nullclines may appear as lines along which the field is parallel and passes through the singular point (e.g., in cylindrically symmetric systems, the symmetry axis is a nullcline). By arbitrarily setting the singular point at φ=0, the equipotential surfaces form separate sheets (some with φ>0, and others with φ<0). If we want our region V0 to contain the singular point, the above procedure can be generalized by considering initial closed equipotential lines Γ0 that (i) enclose a nullcline, (ii) lie on equipotential sheets with the same sign of φ, and (iii) correspond one-to-one with the separated regions—i.e., there must be as many Γ0 lines as there are regions, with each line belonging to a different region. After generating the surfaces SL from each Γ0 using , the equipotential surfaces with the other sign of φ are then used to shut the volume V0. An example of this process is shown below for a quadrupolar field. Up to now, the definition of V0 has been a mathematical construction. We show now how to implement these S0, S1, and SL surfaces based on physical materials. On the one hand, the equipotential surfaces can be implemented with infinite-magnetic-permeability (IMP) media as materials in which the H-magnetic field is always zero inside them. Equivalently, they can be characterized as linear magnetic materials with permeability μ→∞. The tangential component of the field must be continuous across the material surface. For IMP media, this contour condition ensures that the H-field is always perpendicular to the IMP surface, as required for the equipotential surfaces S0 and S1. This material is also known as a perfect magnetic conductor (–). It is important to note that soft linear ferromagnetic materials with high permeability (such as mu-metal or cast iron) are excellent practical approximations to the ideal IMP case (). On the other hand, the SL surface can be implemented using zero-magnetic-permeability (ZMP) materials. These materials have the property that the B-field is 0 inside them. Thus, in its exterior surface, the field H=B/μ0 must be parallel to the surface. This is the requirement for the SL surface. Important to note also is that it has been shown in [, ] that superconducting materials (especially type I ones, with small London penetration depth at the working scales) are good practical approximations to ZMP materials. When using superconductors, however, one must consider that ideal superconductors behave as ZMP materials but also exhibit an additional property: They preserve the fluxoid through any closed loop entirely contained within them (). This imposes an extra constraint. To bypass fluxoid conservation, a possible solution is to introduce a small slit in the surface SL (, ), preventing current from circulating around it. In this way, fluxoid conservation no longer applies, and superconductors can function as practical realizations of ZMP materials. Alternatively, if no slit is introduced, superconductors can be field cooled, meaning that the magnetic field present within V0 after cooling the omniconverter will remain trapped inside, regardless of later changes in the external sources. Representative examples In the following, we will explain and formulate in detail how to implement these ideas in some paradigmatic and useful cases. We start with the simplest case of desiring a perfectly uniform field H(x,y,z)=H0zˆ in an extended region. The scalar potential is φ=−H0z+C, where C is an arbitrary constant. An equipotential surface can be the z=0 surface and a closed line Γ0 can be a circle of radius R in the z=0 plane. reduces to H0(dyxˆ−dxyˆ)=0, whose obvious solution is dx=dy=0. This indicates that, starting with the circle Γ0, the surface SL is a cylinder of radius R, parallel to the z axis. The volume can be closed at any other equipotential surface (another plane with constant z), say z=L. This indicates that inside the cylindrical region limited by two IMP materials with internal surfaces at z=0 and z=L and a ZMP material with interior surface at x2+y2=R2, the magnetic field is exactly uniform, irrespective of the field source one locates outside the cylindrical region (and, of course, outside the materials). In , we show a calculated case where the field in the region of interest is perfectly uniform, regardless of whether the field source is a dipole or a coil. Following the same principle, one can also generate an exact dipolar field in a given region, irrespective of the source fields. In this case, the desired field and the corresponding scalar potential, using standard spherical coordinates (r,θ,φ) and, without loss of generality, assuming that the desired dipolar field is that of a dipole at the origin with magnetic moment m=mzˆ, are H(r,θ,φ)=m4πr3(2cosθrˆ+sinθθˆ) and φ(r,θ,φ)=m4πcosθr2, respectively. An equipotential surface with scalar potential φ0 is defined by those points satisfying for a given A=m4πφ0. From any closed line Γ0 on this surface, the lateral SL surface is found by solving , which in this case becomes Hrr dθ=Hθ dr. For r≠0, the solution is where C is a constant determined by the specific Γ0 selected. It is crucial to note that the region where the field is exactly dipolar must avoid the r=0 point, as the external sources must be outside the V0 region. As shown in , we have created an exact dipolar field as if it were generated by a vertical dipole at the origin but which is actually generated by a horizontal dipole outside the region of interest. Hence, this confirms once more that the field shape inside the region V0 is independent of the field sources outside that region. Another interesting case is to have exactly a monopolar field in a given region. Approximate monopolar fields can be obtained from superconducting vortices (), for example. Here, however, we demonstrate that an exact monopolar field can be generated in a large region of space from any external source. In this case, the desired field and scalar potential have the form (in spherical coordinates) H(r)=Ar2rˆ and φ(r)=−Ar+C, respectively, being A and C constants. To define the volume V0, we start with a sphere of radius R0 centered at the origin (equipotential surface) and a closed line Γ0 as the intersection of this sphere with the plane z=z0 for z0R0. This volume and the simulation using a dipole as the external source are shown in . If we want to generate an exact linear quadrupolar field and include the singular point within V0, we must consider several starting Γ0 lines, as explained previously. This field and the scalar potential can be expressed as: H(x,y,z)=A0(−xxˆ−yyˆ+2zzˆ), φ(x,y,z)=A0(−x22−y22+z2), for some constant A0. Without loss of generality, we have assumed the potential at the singular point (r=0) is zero, that A0>0, and that the quadrupolar field is symmetric with respect to the z axis. In this case, there are several disconnected sheets of equipotential surfaces, defined by For φ0>0, it represents two sheets of surfaces lying on the ∣z∣>ρ/2 volume (one for z>0 and one for z<0). For φ0<0, it describes a cylindrically symmetric surface lying in the region ρ>2∣z∣. In addition, no field line can cross the z=0 plane [two-dimensional (2D) manifold], effectively dividing the space into two regions: z>0 and z<0. To define the volume V0, one should consider two equipotential closed lines, Γ01 and Γ02, one in the z>0 region and the other in the z<0 region and both circulating the z axis (1D nullcline). From both lines, one builds the lateral surfaces SL1 and SL2 using . Lateral surfaces satisfy with i∈{1,2}. C1 and C2 are determined by the selection of Γ01 and Γ02 lines, respectively. Note that each Γ0 yields one SL surface. Last, the volume V0 is determined by closing the volume with another equipotential surface with a potential of opposite sign. A simulation illustrating the transformation of a dipole field into a quadrupolar field containing the singular point is shown in . Note that, to make sure the two IMP surfaces actually have the same potential as intended, they need to be magnetically connected using IMP material outside V0. If we want to achieve a particular geometry for the field lines instead of a specific expression for the field, the ideas discussed above can be applied in a straightforward way. One would build a ZMP surface with the geometry of the field lines and find a set of surfaces perpendicular to the field and choose two IMP of such surfaces that, together with the ZMP surface, enclose a volume V0 where the field will have exactly the desired shape. For example, suppose one desires a field with parabolic field lines. In that case, one can choose a ZMP surface in the shape of an extruded parabola and use the corresponding conjugate-parabola surfaces as IMP surfaces. Then, any source located outside the volume V0 will generate, inside V0, a field with parabolic field lines, as desired. This example is shown in . If we want to generate a given field in a nonsimply connected volume [i.e., a volume with a hole ()], we can choose, for the nonsingular case, two different nonintersecting starting lines Γ0 with the same potential. From each of these, we construct the lateral surfaces. Once enclosed by another equipotential surface S1, the resulting V0 volume will be nonsimply connected and, by construction, the field inside it will have the desired shape. More complicated cases can also be envisaged as combinations of the presented ideas. Another particular case would be that SL already determines a closed volume (i.e., a toroid). In that case, there would be no need for IMP surfaces, but one should use an external source that ensures that the field is not zero inside (). Proof-of-principle experiment In the following, we illustrate the basic working principle of our proposed method through a proof-of-concept experiment. To this end, we fabricated a proof-of-concept device—an omniconverter—designed to transform the nonuniform field of a single planar circular coil into a homogeneous field within a defined spatial region. This study region is a 92-mm-long cylinder with a 22.5-mm radius, located externally to the coil (as in the example of ). The cylinder’s end caps, made of cast iron, act as an IMP medium, oriented perpendicular to the desired magnetic field. The cylindrical side wall is a 100-mm-long, 2.5-mm-thick tube of high-purity aluminum, which is a type I superconductor at our working temperatures (<150 mK). The London penetration depth is ∼50 nm, negligible with respect to all the dimensions of the tube. Thus, the aluminum acts as a ZMP material aligned parallel to the field lines. A 1-mm axial slit in the aluminum tube oriented in the axial direction prevents net current circulation (as the system is zero-field cooled). We mapped the magnetic field within the study region using 11 commercial tunneling magnetoresistance sensors, soldered onto a custom printed circuit board (PCB) and aligned axially inside the tube (), forming a pattern that enables the study of the field’s homogeneity. The entire system was housed in a dilution refrigerator, with a multiturn coil wound from NbTi wire coaxially positioned 12 mm from the aluminum tube to prevent the tube from exceeding its critical magnetic field. Measurements were conducted across four distinct configurations to compare the magnetic field produced by: () the coil alone, () the coil with cast-iron end caps, () the coil with the superconducting aluminum tube, and () the complete omniconverter system. The aluminum tube and PCB remained fixed, while the cast-iron caps were only installed for cases () and (). The superconducting state of the aluminum tube was controlled by temperature, activating below 1.0 K [cases () and ()] and deactivating above this temperature [cases () and ()]. For each case, current was swept through the coil from −0.1 to 0.1 A. Room temperature data for cases () and () were corrected for thermal drift in sensor outputs using measurements at 1.28 K, accounting for sensor response variations at cryogenic temperatures. Given the linear response of the sensors, the measured voltage was directly mapped to the axial component of the magnetic field via a linear fit. Details are provided in the Supplementary Materials. These normalized axial magnetic field measurements are presented in . For comparison, four corresponding numerical simulations were performed using the finite element method to solve Ampère’s law. Cast-iron caps were modeled as a nearly ideal IMP (μ/μ0=105) material, and superconducting aluminum as an almost ideal ZMP (μ/μ0=10−5) medium. Simulated normalized axial field components are shown in . A clear agreement is observed between the experimental () and simulated () relative magnetic field values. To quantify this agreement, we calculate two quantities: the root-mean-square error, RMSEnorm=111∑i=111(biexp−bisim)2, and the maximum discrepancy, Δmaxexp−sim=maxi∣biexp−bisim∣. Here, bi∗=Bz,i∗/Bz,max∗ (∗=exp,sim) denotes the normalized z-component of the magnetic field at sensor i. Both quantities are expressed as percentages and reported in (left columns). Experimental and simulated fields are independently normalized to their respective maxima, so these two quantities characterize differences in the spatial distribution rather than in the absolute field amplitude. The standalone coil generates a nonuniform field (), confirmed by the curved field lines in simulation (). With the cast-iron end caps, the field remains nonuniform, showing enhancement near the cap closest to the coil (). However, simulations () indicate a slight improvement in field uniformity toward the tube ends. Crucially, when the aluminum tube becomes superconducting, a distinct and marked change occurs: The magnetic field inside the tube becomes substantially more uniform, with the field lines becoming straight and parallel to the tube axis (). The spatial field uniformity is quantified in (right columns) for both simulations and experiments through (i) the relative SD, uσ=σb/b ̄, where σb is the SD and b ̄ the mean value, and (ii) the maximum relative deviation, umax=maxi∣bi−b ̄∣/b ̄, evaluated over the 11 sensor positions. Given the tube’s aspect ratio, the superconductor has a stronger influence on the field uniformity than the ferromagnetic caps alone, explaining the observed similarities between cases () and (), and cases () and (). However, the influence of the ferromagnetic material would become more dominant closer to the edges or if the tube were wider/shorter. Consistently, the deviation values are larger for cases () and () than for cases () and (), indicating that the latter exhibit slightly greater field uniformity due to the presence of the caps. This effect is also visible, though more subtly, in the slight bending of the field lines in the upper region of , which is absent in . As a general trend, the relative influence of the superconducting and ferromagnetic surfaces is governed by the geometry of the target region. Superconducting surfaces play a greater role where the magnetic field is predominantly tangential to the boundary, whereas ferromagnetic surfaces become more influential where the field is predominantly normal to it. Consequently, elongated geometries are often dominated by the lateral superconducting surfaces, while in more compact geometries, the ferromagnetic end caps generally play a larger role. In the fully assembled omniconverter configuration (), remaining minor deviations from perfect field uniformity are not primarily due to real material imperfections. This is supported by the close agreement between simulation and experiment, () and , indicating that the actual materials faithfully implement ideal IMP and ZMP behavior at these scales. The nonuniformities—uσ= 11% (12%) or umax= 17% (19%) in the simulations (experiment)—are mainly attributed to the presence of the slit, which is also accounted for in the simulations. This confirms the suitability of the chosen materials for practical implementation and suggests that further improvements should focus on minimizing the slit separation. Further details on the robustness and nonidealities of the system, including simulations of the effect of the tube aspect ratio, slit width, source, source position, permeability of the materials, and target field, are provided in the Supplementary Materials. Overall, these analyses show that omniconversion remains fairly robust under a broad range of deviations from ideality and material parameters, indicating that its experimental implementation is feasible. In this work, we have focused on magnetostatic fields, as IMP and ZMP surfaces can be effectively approximated by conventional materials such as cast iron and superconducting aluminum, respectively. Although the same theoretical principles could be extended to electrostatic fields, while good conductors could approximate infinite-electrical-permittivity media, for zero-electrical-permittivity media one would need active materials, since passive ones cannot have a static permittivity below the free-space value (). The procedure presented in this work is a general recipe to generate the desired field with the available sources, so it is relevant far beyond a particular application. In principle, one can envisage any applied field and, designing the adequate omniconverter, convert any source field into the desired one. This could be beneficial for improving existing technologies—such as particle traps, medical imaging, or particle accelerators—by obtaining more controllable magnetic fields. Moreover, the present work paves the way for innovative solutions that would otherwise appear unattainable if they relied on inaccessible magnetic field configurations. MATERIALS AND METHODS Experimental methods The experimental setup consists of a high-purity aluminum tube (4 N) with a wall thickness of 2.5 mm, an inner radius of 22.5 mm, and a length of 100 mm. The end caps are made of cast iron, each with a thickness of 6.5 mm, of which 4 mm are inserted inside the tube and 2.5 mm extend longitudinally. Throughout the experiment, the aluminum tube is positioned horizontally inside the dilution-refrigerator cryostat (Bluefors LD250), supported by press-fitting it into two brass mounts and secured with screws to the mixing stage. The PCB used for measurements contains 11 commercial 1D linear tunneling magnetoresistance sensors, Allegro CT100, arranged to map the axial component of the field across different regions of the tube. The sensors were soldered onto the PCB using lead-free solder paste. The board is placed horizontally inside the tube, with its dimensions (90 mm by 45 mm) such that the tube itself acts as a support, securing it in place to prevent movement. The aluminum tube has a 1-mm-thick slit running the entire length, parallel to the tube axis. Through this slit, the 24 copper wires pass. A multiturn NbTi coil is used as the magnetic field source. It is mounted near the aluminum tube on a 3D-printed spool, leaving a 12-mm gap between the coil and the tube. This spacing prevents exceeding the critical field of aluminum, which might occur if the coil were wound directly onto the tube. Throughout the experiments, the coil is always positioned in the same location, near one end of the tube (adjacent to one of the brass mounts). To carry out the measurements of the magnetostatic field, the voltage values measured by each of the 11 sensors on the PCB were recorded as a function of the current flowing through the NbTi coil. This procedure was repeated under different conditions to obtain the four distinct cases presented in . The system was also measured at temperatures below 1.0 K (zero-field cooling), allowing the high-purity aluminum tube to enter the superconducting state. Although the sample itself lacked a temperature sensor, we monitored the temperature using the mixing-stage sensor of the cryostat. However, since the temperature difference between the measurements performed at room temperature and those at cryogenic temperatures is large and slightly affects the sensors, the voltages were also recorded at a cryogenic temperature of (1.28 ± 0.01) K, which is above the critical temperature of aluminum. These measured values allow a correction factor to be applied to the voltages measured at room temperature for comparison with those obtained at low temperatures. With all these data, we performed linear fits of the sensor voltages as a function of the coil current (proportional to the applied field). The resulting slopes are directly proportional to the field experienced by each sensor relative to the applied field. Further details can be found in the Supplementary Materials. Numerical methods Numerical simulations were performed using COMSOL Multiphysics 6.2 with the Magnetic Fields (mf) interface, which solves the equations ∇×H=J, B=∇×A, and J=σE, with boundary conditions n×A=0 at the borders of the simulation domain. The simulations were carried out in the stationary state, using either 3D, 2D, or 2D axisymmetric spatial representations as appropriate. The simulation mesh was defined with a maximum element size of 0.05 mm, a minimum element size of 0.01 mm, a maximum element growth rate of 1.1, a curvature factor of 0.2, and a resolution of narrow regions of 1. For material properties, unless otherwise specified, a relative permeability of 105 was assigned to IMP media and 10−5 to ZMP materials. The total calculation domain in cylindrical axisymmetry, used for simulations corresponding to the experiment (), was a rectangle of 350 mm by 500 mm, with the region of interest ∼60 mm by 160 mm, containing the study region of 22.5 mm by 92 mm.