Introduction

It is widely believed that cosmic voids host magnetic fields. Evidence for this comes chiefly from γ-ray observations of blazars1,2,3,4,5,6,7,8,9,10,11,12 (see refs. 13,14,15 for reviews): extragalactic magnetic fields (EGMFs) in voids would, if present, scatter the electrons produced in electromagnetic cascades of TeV γ-rays emitted by blazars, thus suppressing the number of secondary (GeV) γ-rays received at Earth. Such suppression is indeed observed, and can be used to constrain the root mean square strength \(B\equiv {\langle {{{{{{{{\bf{B}}}}}}}}}^{2}\rangle }^{1/2}\) and energy-containing scale λB of the magnetic fields. Using spectra measured by the Fermi telescope, refs. 3,12 estimate that

$$B\, \gtrsim \, 1{0}^{-17}\,{{{{{{{\rm{G}}}}}}}}\,{\left(\frac{{\lambda }_{B}}{1{{{{{{{\rm{Mpc}}}}}}}}}\right)}^{-1/2},$$
(1)

where 10−17 G can increase to 10−15 G depending on modelling assumptions, including the effect of time delay due to the larger distance travelled by scattered electrons3,16. Equation (1) may also be subject to some modification due to the cooling of cascade electrons by plasma instabilities17,18,19,20—what effect, if any, this has on the constraint (1) is poorly understood—see refs. 21,22 for recent discussions.

Where might fields in voids come from? A popular idea (although not the only one, see ref. 23) is that they could be relics of primordial magnetic fields (PMFs) generated in the early Universe24, including, prominently, at the electroweak phase transition (EWPT)25. If so, the physics of the early Universe could be constrained by observations of the fields in voids—a remarkable possibility—provided the magnetohydrodynamic (MHD) decay of the PMFs between their genesis and the present day were understood. However, the conventional theory of the decay24 (see refs. 13,14,15 for reviews) appears inconsistent with the EWPT-relic hypothesis: ref. 26 argue that the lower bound (1) on B is too high to be consistent with PMFs generated at the EWPT without magnetic helicity (a topological quantity that quantifies the number of twists and linkages in the field, which is conserved even as energy decays27). Furthermore, they show that the amount of magnetic helicity required for consistency with Equation (1) is greater than can be generated by baryon asymmetry at the EWPT, as estimated by ref. 28. In principle, other mechanisms of magnetic-helicity generation may have been present in the early Universe; one idea is chiral MHD (see29 and references therein). Whether enough net helicity can be generated via these mechanisms for PMFs to become maximally helical during their evolution remains an open question30,31. On the other hand, ref. 26 note that their conclusions could be subject to modification by the contemporaneous discovery of the inverse transfer of magnetic energy in simulations of non-helical MHD turbulence32,33 (see refs. 30,34,35,36 for schemes for modifying their conclusions based on decay laws obtained numerically). The inverse transfer was discovered by ref. 37 to be a consequence of local fluctuations in the magnetic helicity, which are generically present even when the global helicity vanishes, and whose mean square fluctuation level is conserved.

In this paper, we apply the theory of ref. 37 to the problem of predicting the strength of the relics of PMFs. We find that the constraint imposed by magnetic-helicity conservation, when taken together with the other key result of ref. 37, and of refs. 38,39,40, that the decay timescale is the one on which magnetic fields reconnect, restores consistency of the hypothesis of a non-helical EWPT-generated PMF with Equation (1). We also find that reasonably efficient magnetogenesis of non-helical magnetic field at the EWPT could produce relics with around the 10−11 G comoving strength that, it has been suggested, is sufficient to resolve the Hubble tension41,42. Relics of this strength would also constitute seed fields for galaxy clusters that would not require much amplification by turbulent dynamo after structure formation to reach their observed present-day strength43 (although dynamo would still be required to maintain cluster fields at present levels).

Results

We take the metric of the expanding Universe to be

$${{{{{{{\rm{d}}}}}}}}{s}^{2}={a}^{2}(t)(-{{{{{{{\rm{d}}}}}}}}{t}^{2}+{{{{{{{\rm{d}}}}}}}}{x}_{i}\,{{{{{{{\rm{d}}}}}}}}{x}^{i}),$$
(2)

where a(t) is the scale factor, normalised to 1 at the present day, t is conformal time (related to cosmic time \(\overline{t}\) by \(a(t){{{{{{{\rm{d}}}}}}}}t={{{{{{{\rm{d}}}}}}}}\overline{t}\)), and xi are comoving coordinates. The expanding Universe MHD equations can be transformed to those for a static Universe by a simple rescaling44: the scaled variables

$$\begin{array}{rc}\tilde{\rho }={a}^{4}\rho,\quad &\tilde{p}={a}^{4}p,\quad \tilde{{{{{{{{\bf{B}}}}}}}}}={a}^{2}{{{{{{{\bf{B}}}}}}}},\quad \tilde{{{{{{{{\bf{u}}}}}}}}}={{{{{{{\bf{u}}}}}}}},\\ &\tilde{\eta }=\eta /a,\quad \tilde{\nu }=\nu /a,\end{array}$$
(3)

[where ρ, p, B, u, η, and ν are the physical values of the total (matter + radiation) density, pressure, magnetic field, velocity, magnetic diffusivity, and kinematic viscosity, respectively] evolve according to the MHD equations in Minkowski spacetime. As in previous work (see refs. 13,14,15), we consider the dynamics of the tilded variables in Minkowski spacetime and transform the result to the spacetime (2) of the expanding Universe via Equation (3).

Selective decay of small-scale structure

Historically, it has been believed that statistically isotropic MHD turbulence decays while preserving the small-k asymptotic of the magnetic-energy spectrum \({{{{{{{{\mathcal{E}}}}}}}}}_{M}(k)\) (see refs. 13,14 and references therein). This idea, sometimes called selective decay of small-scale structure, amounts to a statement of the invariance in time of the magnetic Loitsyansky integral,

$${I}_{{{{{{{{{\bf{L}}}}}}}}}_{M}}\equiv -\int{{{{{{{{\rm{d}}}}}}}}}^{3}{{{{{{{\bf{r}}}}}}}}\,{r}^{2}\langle \tilde{{{{{{{{\bf{B}}}}}}}}}({{{{{{{\bf{x}}}}}}}}){{{{{{{\boldsymbol{\cdot }}}}}}}}\tilde{{{{{{{{\bf{B}}}}}}}}}({{{{{{{\bf{x}}}}}}}}+{{{{{{{\bf{r}}}}}}}})\rangle,$$
(4)

where angle brackets denote an ensemble average. For isotropic turbulence without long-range spatial correlations, \({I}_{{{{{{{{{\bf{L}}}}}}}}}_{M}}\) is related to \({{{{{{{{\mathcal{E}}}}}}}}}_{M}(k)\) by

$${{{{{{{{\mathcal{E}}}}}}}}}_{M}(k\to 0)=\frac{{I}_{{{{{{{{{\bf{L}}}}}}}}}_{M}}{k}^{4}}{24{\pi }^{2}}+O({k}^{6}).$$
(5)

Invariance of \({I}_{{{{{{{{{\bf{L}}}}}}}}}_{M}}\) implies

$${I}_{{{{{{{{{\bf{L}}}}}}}}}_{M}} \sim {\tilde{B}}^{2}{\lambda }_{B}^{5} \sim {{{{{{{\rm{const}}}}}}}}.$$
(6)

Here and in what follows, we use the symbol ~ to denote equality up to a dimensionless number of order unity. In writing Equation (6), we have assumed that the magnetic-energy spectrum is sufficiently peaked around the energy-containing scale λB for the latter to be equal to the correlation, or integral, scale of the field. This would not be the case for a scale-invariant magnetic field (often conjectured to be generated by inflationary mechanisms). We exclude such fields from our analysis in this paper, in which we consider causal fields—the sort that could be generated at a phase transition—exclusively.

Decay timescale

Equation (6) can be translated into a decay law for magnetic energy by a suitable assumption about how the energy-decay timescale,

$$\tau \,(\tilde{B},{\lambda }_{B},t)\equiv -{\left(\frac{{{{{{{{\rm{d}}}}}}}}\log {\tilde{B}}^{2}}{{{{{{{{\rm{d}}}}}}}}t}\right)}^{-1},$$
(7)

depends on \(\tilde{B}\), λB and t. Regardless of this choice, Equations (6) and (7) have the following important property. Suppose that, after some intermediate time tc, τ(B, λB, t) can be approximated by some particular product of powers of its arguments. Then, for all tτ(tc), \({\tilde{B}}^{2}\) decays as a power law: \({\tilde{B}}^{2}\propto {t}^{-p}\), where p is a number of order unity. Substituting this back into Equation (7), one finds

$$\tau \,(\tilde{B},{\lambda }_{B},t) \sim t,$$
(8)

which is an implicit equation for \(\tilde{B}=\tilde{B}({\lambda }_{B})\) that can be solved simultaneously with Equation (6) for \(\tilde{B}(t)\) and λB(t). Equation (8) was first suggested by ref. 24 on phenomenological grounds. Its great utility, which has perhaps not been spelled out explicitly, is that it implies that one need not know the functional form of \(\tau (\tilde{B},{\lambda }_{B},t)\) during the early stages of the decay in order to compute \(\tilde{B}\) and λB at later times. Thus, the effect of early Universe physics (e.g., neutrino viscosity) on the decay dynamics can be safely neglected.

Inconsistency with observations

Assuming that the decay satisfies Equation (6) and that its timescale is Alfvénic, viz.,

$$\tau \sim \frac{{\lambda }_{B}}{{\tilde{v}}_{A}},\quad {\tilde{v}}_{A}=\frac{\tilde{B}}{\sqrt{4\pi {\tilde{\rho }}_{b}}},$$
(9)

when it terminates at the recombination time trecomb14 [Equation (27) in Methods], Equation (8) implies24

$$\tilde{B}({t}_{{{{{{{{\rm{recomb}}}}}}}}}) \sim 1{0}^{-8.5}{{{{{{{\rm{G}}}}}}}}\,\frac{{\lambda }_{B}({t}_{{{{{{{{\rm{recomb}}}}}}}}})}{1\,{{{{{{{\rm{Mpc}}}}}}}}}$$
(10)

[see Equation (31) in Methods]. In (9), \({\tilde{\rho }}_{b}\) is the baryon density, which appears because photons do not contribute to the fluid inertia at scale λB at the time of recombination45 [see Equation (29) in Methods]. An approximate upper bound, \({I}_{{{{{{{{{\bf{L}}}}}}}}}_{M},\max }\), on \({I}_{{{{{{{{{\bf{L}}}}}}}}}_{M}}\) follows from assuming that the magnetic-energy density \({\tilde{\rho }}_{B}\equiv {\tilde{B}}^{2}/8\pi\) and the electromagnetic-radiation density \({\tilde{\rho }}_{\gamma }\) were equal at the time t* of the EWPT while λB(t*) was equal to the Hubble radius rH(t*). This corresponds to \(\tilde{B}({t}_{*}) \sim 1{0}^{-5.5}\,{{{{{{{\rm{G}}}}}}}}\) and λB(t*) ~ rH(t*) ~ 10−10 Mpc13,26. As is shown in Fig. 1, these values and Equation (10) together lead to values of \(\tilde{B}\) and λB at trecomb that violate the observational constraint (1). Note that λB(t*) ~ 10−2rH(t*) is, in fact, a more popular estimate, corresponding to the typical coalescence size of bubbles of new phase that form at the phase transition46; for this initial correlation scale, the predicted value of \(\tilde{B}\) is separated from the allowed values by around three orders of magnitude. A similar calculation led ref. 26 to conclude that genesis of EGMFs at the EWPT was unlikely (although we note that significant modification of Equation (1) by inclusion of the effects of plasma instabilities in the modelling of the electromagnetic cascade—see the comment below Equation (1)—could alter this conclusion).

Fig. 1: Inconsistency of the decay theory based on Equations (6) and (9) with observational constraints for EWPT-generated PMFs.
figure 1

Purple regions denote values of \(\tilde{B}\) and λB excluded on physical [\({\tilde{\rho }}_{B}(t)\, \lesssim \, {\tilde{\rho }}_{\gamma }({t}_{*})\)] or observational [the two forms of the constraint (1)] grounds. Under decays that conserve \({I}_{{{{{{{{{\bf{L}}}}}}}}}_{M}}\) [Equation (4)], \(\tilde{B}\) and λB evolve along lines parallel to the ones shown in blue. The predicted values of modern-day \(\tilde{B}\) and λB are given by the intersection of these lines with Equation (10). We see that even PMFs generated with \({\tilde{\rho }}_{B}({t}_{*}) \sim {\tilde{\rho }}_{\gamma }({t}_{*})\) and λB(t*) ~ rH(t*) produce modern-day relics that are inconsistent with Equation (1).

Saffman helicity invariant

We argue that the theory outlined above requires revision. First, the idea of selective decay of small-scale structure is flawed. This is because the kλB 1 tail of the magnetic-energy spectrum \({{{{{{{{\mathcal{E}}}}}}}}}_{M}(k)\) corresponds not to physical structures (as in the Richardson-cascade picture of inertial-range hydrodynamic turbulence) but to cumulative statistical properties of the structures of size λB47. Absent a physical principle to support the invariance of \({I}_{{{{{{{{{\bf{L}}}}}}}}}_{M}}\) (such as angular-momentum conservation for its hydrodynamic equivalent47,48), there is, therefore, no reason to suppose that the small-k asymptotic of \({{{{{{{{\mathcal{E}}}}}}}}}_{M}(k)\) evolves on a longer timescale than the dynamical one of λB-scale structures (if this is long compared to the magnetic-diffusion timescale at scale λB, then selective decay is valid, as the simulations of24,49 confirm, but this is not the regime relevant to PMFs).

Instead, we propose that the decay of PMFs is controlled by a different integral invariant37:

$${I}_{H}=\int{{{{{{{{\rm{d}}}}}}}}}^{3}{{{{{{{\bf{r}}}}}}}}\,\langle h({{{{{{{\bf{x}}}}}}}})h({{{{{{{\bf{x}}}}}}}}+{{{{{{{\bf{r}}}}}}}})\rangle,$$
(11)

where \(h=\tilde{{{{{{{{\bf{A}}}}}}}}}{{{{{{{\boldsymbol{\cdot }}}}}}}}\tilde{{{{{{{{\bf{B}}}}}}}}}\) is the helicity density (\(\tilde{{{{{{{{\bf{B}}}}}}}}}={{{{{{{\boldsymbol{\nabla }}}}}}}}\times \tilde{{{{{{{{\bf{A}}}}}}}}}\)). Equation (11) is equivalent to

$${I}_{H}=\mathop{\lim }\limits_{V\to \infty }\frac{1}{V}\left\langle {\left[{\int}_{V}{{{{{{{{\rm{d}}}}}}}}}^{3}{{{{{{{\bf{x}}}}}}}}h({{{{{{{\bf{x}}}}}}}})\right]}^{2}\right\rangle=\mathop{\lim }\limits_{V\to \infty }\frac{\langle {H}_{V}^{2}\rangle }{V},$$
(12)

where HV is the total magnetic helicity contained within the control volume V. The invariance of IH can therefore be understood intuitively as expressing the conservation of the net mean square fluctuation level of magnetic helicity per unit volume that arises in any finite volume of non-helical MHD turbulence (see Fig. 2; we refer the reader concerned about the existence of such fluctuations to Section B of the Supplementary Information). Numerical evidence supporting the invariance of IH has been presented by ref. 37 and independently by refs. 50,51,52. From \({I}_{H}={{{{{{{\rm{const}}}}}}}}\), we deduce

$${I}_{H} \sim {\tilde{B}}^{4}{\lambda }_{B}^{5} \sim {{{{{{{\rm{const}}}}}}}}.$$
(13)
Fig. 2: Slice of magnetic-helicity density from a simulation of decaying non-helical MHD turbulence.
figure 2

The turbulence breaks up into patches of positive and negative helicity h (computed in the Coulomb gauge; \({{{{{{{\boldsymbol{\nabla }}}}}}}}{{{{{{{\boldsymbol{\cdot }}}}}}}}\tilde{{{{{{{{\bf{A}}}}}}}}}=0\)), shown in red and blue, respectively (in units of the product of the root-mean-square values of \(\tilde{{{{{{{{\bf{A}}}}}}}}}\) and \(\tilde{{{{{{{{\bf{B}}}}}}}}}\), denoted \({\tilde{A}}_{{{{{{{{\rm{rms}}}}}}}}}\) and \({\tilde{B}}_{{{{{{{{\rm{rms}}}}}}}}}\), respectively). The invariance of IH [Equation (11)] is a manifestation of the conservation of the net magnetic-helicity fluctuation level arising in large volumes. Because of the complex magnetic-field topology, the rate-setting process for the decay is magnetic reconnection: reconnection sites, indicated in the figure by patches of large current density \(| \tilde{{{{{{{{\bf{J}}}}}}}}}|=| {{{{{{{\boldsymbol{\nabla }}}}}}}}\times \tilde{{{{{{{{\bf{B}}}}}}}}}|\) (black; plotted with a variable-opacity scale in units of the root-mean-square current density, Jrms), typically form between the helical structures. See the Numerical Simulation section of Methods for details of the numerical setup.

We make two brief remarks. First, growth of \({I}_{{{{{{{{{\bf{L}}}}}}}}}_{M}}\), and, therefore, the inverse transfer effect discovered by refs. 32,33,53, follows immediately from Equation (13). This is because \({I}_{{{{{{{{{\bf{L}}}}}}}}}_{M}} \sim {\tilde{B}}^{2}{\lambda }_{B}^{5} \sim {I}_{H}/{\tilde{B}}^{2}\) under self-similar evolution, so that \({{{{{{{{\mathcal{E}}}}}}}}}_{M}(k\to 0)\propto {I}_{{{{{{{{{\bf{L}}}}}}}}}_{M}}{k}^{4}\) [see Equation (5)] grows while \(\tilde{B}\) decays. Second, the value of the large-scale spectral exponent does not affect the late-time limit of the decay laws in our theory (see Section C of the Supplementary Information), unlike in the selective-decay paradigm.

Reconnection-controlled decay timescale

The second revision that we propose to the existing theory is that the field’s decay timescale τ should be identified not with the Alfvénic timescale (9), but with the magnetic-reconnection one. This is because relaxation of stochastic magnetic fields via the generation of Alfvénic motions is prohibited by topological constraints, which can only be broken by reconnection. Refs. 37,40,50 have presented numerical evidence for a reconnection-controlled timescale for decays that occur with a dominance of magnetic over kinetic energy (see refs. 38,39 for the same in 2D). Magnetically dominated conditions are relevant to the decay of PMFs because (i) the large neutrino and photon viscosities in the early Universe favour them, and (ii) once established, they are maintained, as reconnection is typically slow compared with the Alfvénic timescale. The identification of τ as the reconnection timescale implies that a number of different decay regimes are possible, as we now explain.

Under resistive-MHD theory, reconnecting structures in a fluid with large conductivity generate a hierarchy of current sheets at increasingly small scales via the plasmoid instability54. The global reconnection timescale is the one associated with the smallest of these sheets (the so-called critical sheet), which is short enough to be marginally stable55,56 (see ref. 57 for a review). This timescale is

$${\tau }_{{{{{{{{\rm{rec}}}}}}}}}={(1+{{{{{{{\rm{Pm}}}}}}}})}^{1/2}\,\min \left\{{S}^{1/2},{S}_{c}^{1/2}\right\}\frac{{\lambda }_{B}}{{\tilde{v}}_{A}},$$
(14)

where \({{{{{{{\rm{Pm}}}}}}}}=\tilde{\nu }/\tilde{\eta }\) is the magnetic Prandtl number, which appears because viscosity can suppress the outflows that advect reconnected field away from the reconnection site,

$$S=\frac{{\tilde{v}}_{A}{\lambda }_{B}}{\tilde{\eta }\,{(1+{{{{{{{\rm{Pm}}}}}}}})}^{1/2}}$$
(15)

is the Lundquist number based on the reconnection outflow and Sc ~ 104 is the critical value of S for the onset of the plasmoid instability. Equation (14) is a straightforward theoretical generalisation57 to arbitrary Pm of a prediction for Pm = 155 that has been confirmed numerically56,58. Pm is given by Spitzer’s theory59 [PmSp ~ 107 at recombination, see Equation (37) in Methods] if the plasma is collisional, i.e., if the Larmor radius of protons rL = micvth,i/aeB is large compared to their mean free path, λmfp (mi and \({v}_{{{{{{{{\rm{th}}}}}}}},i}\equiv \sqrt{2T/{m}_{i}}\) are the mass and thermal speed of protons respectively). If, on the other hand, rL < λmfp, which happens if B > Biso ≡ micvth,i/eaλmfp, then the components of the viscosity tensor perpendicular to the magnetic field are reduced by a factor \({({r}_{L}/{\lambda }_{{{{{{{{\rm{mfp}}}}}}}}})}^{2}\), because protons’ motions across \(\tilde{{{{{{{{\bf{B}}}}}}}}}\) are inhibited by their Larmor gyration60. These are the components that limit reconnection outflows because velocity gradients in reconnection sheets are perpendicular to the mean magnetic field. Therefore, \({{{{{{{\rm{Pm}}}}}}}}\to {({r}_{L}/{\lambda }_{{{{{{{{\rm{mfp}}}}}}}}})}^{2}{{{{{{{{\rm{Pm}}}}}}}}}_{{{{{{{{\rm{Sp}}}}}}}}}={({\tilde{B}}_{{{{{{{{\rm{iso}}}}}}}}}/\tilde{B})}^{2}{{{{{{{{\rm{Pm}}}}}}}}}_{{{{{{{{\rm{Sp}}}}}}}}}\) in Equation (14) if \(\tilde{B} \, > \, {\tilde{B}}_{{{{{{{{\rm{iso}}}}}}}}}\equiv {a}^{2}{B}_{{{{{{{{\rm{iso}}}}}}}}}\).

The validity of the resistive-MHD treatment that leads to Equation (14) requires the fluid approximation to hold at the scale of the critical sheet: its width

$${\delta }_{c} \sim \frac{{S}_{c}^{1/2}}{S}{\lambda }_{B},$$
(16)

must be larger than either rL or the ion inertial length \({d}_{i}=\sqrt{{m}_{i}{c}^{2}/4\pi {e}^{2}{n}_{i}{a}^{2}}\) (ni is the proton number density)55,61. If δc < rL, di, then the physics of the critical sheet is kinetic, not fluid, and the reconnection timescale is

$${\tau }_{{{{{{{{\rm{rec}}}}}}}}} \sim 10\frac{{\lambda }_{B}}{{\tilde{v}}_{A}},$$
(17)

rather than (14). Equation (17) is a robust numerical result whose theoretical explanation is an active research topic (see ref. 62 for a recent study,63,64 for reviews). We shall find in the next section that (17) is not the limiting timescale at recombination for almost any choice of initial condition consistent with EWPT magnetogenesis; our conclusions therefore do not depend sensitively on the validity of (17).

The decay timescale can also be limited by radiation drag due to photons24; this imparts a force \(-\tilde{\alpha }\tilde{{{{{{{{\bf{u}}}}}}}}}\) per unit density of fluid [see Equation (54) in Methods]. The drag is subdominant to magnetic tension at sufficiently small scales (as it does not depend on gradients of \(\tilde{{{{{{{{\bf{u}}}}}}}}}\)), so does not contribute to Pm in Equation (14). However, it can inhibit inflows to the reconnection layer. Balancing drag with magnetic tension at the integral scale λB, we find an inflow speed \(\tilde{u} \sim {\tilde{v}}_{A}^{2}/\tilde{\alpha }{\lambda }_{B}\), so the timescale for magnetic flux to be processed by reconnection is

$${\tau }_{\alpha }\equiv \frac{\tilde{\alpha }{\lambda }_{B}^{2}}{{\tilde{v}}_{A}^{2}}.$$
(18)

The timescale for energy decay depends on whether large-scale drag or small-scale reconnection physics is most restrictive:

$$\tau=\max \{{\tau }_{{{{{{{{\rm{rec}}}}}}}}},{\tau }_{\alpha }\}.$$
(19)

Comparison with observations

The locus of possible PMF states for different values of \({I}_{H} \sim {\tilde{B}}^{4}{\lambda }_{B}^{5}\) under the theory that we have described is represented by the blue-gold line in Fig. 3. We denote the largest value of IH consistent with EWPT magnetogenesis by \({I}_{H,\max }\); this corresponds to \({\tilde{\rho }}_{B}({t}_{*})={\tilde{\rho }}_{\gamma }({t}_{*})\) and λB(t*) = rH(t*). For \({I}_{H}\, \lesssim \, 1{0}^{-29}{I}_{H,\max }\), decays terminate on line (i) in Fig. 3 [Equation (40) in Methods], which represents Equation (8) with τ = τrec given by Equation (14) and Pm = PmSp. Use of Equation (14) is valid here because δcrL, di [see Equations (41) and (42) in Methods]. The Spitzer estimate of Pm is valid at recombination only if \(\tilde{B}\lesssim {\tilde{B}}_{{{{{{{{\rm{iso}}}}}}}}} \sim 1{0}^{-13}\,{{{{{{{\rm{G}}}}}}}}\) [Equation (44) in Methods], so decays with \({I}_{H}\gtrsim 1{0}^{-29}{I}_{H,\max }\) have a shorter timescale at recombination—they terminate on line (ii) [Equation (45) in Methods], which represents Equation (8) with τ = τrec given by Equation (14) and \({{{{{{{\rm{Pm}}}}}}}} \sim {({r}_{L}/{\lambda }_{{{{{{{{\rm{mfp}}}}}}}}})}^{2}{{{{{{{{\rm{Pm}}}}}}}}}_{{{{{{{{\rm{Sp}}}}}}}}}\). For \({I}_{H}\gtrsim 1{0}^{-2}{I}_{H,\max }\), the states on line (ii) have δc < di, rL [see Equations (46) and (47) in Methods], so Equation (14) is invalid for them. These decays pass through line (ii) at some time before recombination with timescale given by Equation (17). However, they do access the domain of validity of Equation (14) if, before trecomb, \(\tilde{B}\) becomes small enough for δc to be comparable with relevant kinetic scales. When that happens, their timescale becomes much larger than trecomb so further decay is prohibited—these decays all terminate with \(\tilde{B} \sim 1{0}^{-11}{{{{{{{\rm{G}}}}}}}}\), which corresponds to δc ~ di at trecomb [see Equation (46) in Methods]. Decays with \({I}_{H}\gtrsim 1{0}^{8}{I}_{H,\max }\) are radiation drag limited at recombination [line (iv); Equation (55) in Methods]—such decays are inconsistent with EWPT magnetogenesis, but could originate from magnetogenesis at the quantum-chromodynamic (QCD) phase transition, when rH ~ 10−6 Mpc13,26.

Fig. 3: Reconnection-controlled decay of non-helical PMFs.
figure 3

As in Fig. 1, purple regions denote values of \(\tilde{B}\) and λB excluded on physical or observational grounds [Equation (1)]. Under decays that conserve IH [Equation (11)], \(\tilde{B}\) and λB evolve along lines parallel to the ones shown in blue. The predicted values of modern-day \(\tilde{B}\) and λB are given by the intersection of these lines with Equation (8) evaluated at recombination [represented by lines (i–v), which are derived in Methods], with τ the prevailing decay timescale. The blue-gold line shows the locus of possible present-day states resulting from reconnection-controlled decays on the timescales explained in the main text, assuming that the microscopic viscosity of the primordial plasma was controlled by collisions between protons. The effective value of Pm in Equation (14) might have been heavily suppressed when \(\tilde{B} \, > \, {\tilde{B}}_{{{{{{{{\rm{iso}}}}}}}}}\) if viscosity were then instead governed by plasma microinstabilities—the red-gold line shows the locus of modern-day states corresponding to the extreme choice of Pm  1 for \(\tilde{B} > {\tilde{B}}_{{{{{{{{\rm{iso}}}}}}}}}\). In either case, we see that PMFs generated at the EWPT with a wide range of values of IH produce modern-day relics that are consistent with Equation (1), and even with the stronger version of this constraint [see text below Equation (1)] which is indicated by the pale purple region.

The EGMF parameters represented by the blue-gold line are consistent with Equation (1) for \({I}_{H}\gtrsim 1{0}^{-23}{I}_{H,\max }\), i.e.,

$${\left[\frac{\tilde{B}({t}_{*})}{1{0}^{-5.5}{{{{{{{\rm{G}}}}}}}}}\right]}^{4}{\left[\frac{{\lambda }_{B}({t}_{*})}{1{0}^{-10}{{{{{{{\rm{Mpc}}}}}}}}}\right]}^{5}\gtrsim 1{0}^{-23}.$$
(20)

The relic of a field with λB(t*) ~ 10−2rH(t*) ~ 10−10 Mpc at the EWPT would therefore be consistent with Equation (1)—modulo any modifications for plasma instabilities in voids17,18,19,20,21,22—if \({\tilde{\rho }}_{B}({t}_{*})\gtrsim 1{0}^{-6.5}{\tilde{\rho }}_{\gamma }({t}_{*})\). This confirms the assertion in the title of this paper. Intriguingly, if instead \({\tilde{\rho }}_{B}({t}_{*}) \sim {\tilde{\rho }}_{\gamma }({t}_{*})\) and λB(t*)  10−2rH(t*), then we find \(\tilde{B} \sim 1{0}^{-11}\,{{{{{{{\rm{G}}}}}}}}\) at recombination. PMFs of this strength would provide a seed for magnetic fields in galaxy clusters that would not require significant amplification by turbulent dynamo after structure formation to reach their present day strength of ~μG43, although dynamo would still be required to maintain cluster fields at present levels. We emphasise that a cluster field so maintained by dynamo need not (and, in all likelihood, would not) retain memory of its primordial seed. We also note that PMFs of 10−11 G strength are considered a promising candidate to resolve the Hubble tension, by modifying the local rate of recombination41,42.

As an aside, we note that the relevance of reconnection physics is not restricted to non-helical decay37. Some analogues for maximally helical PMFs of the results of this section (relevant for magnetogenesis mechanisms capable of parity violation) are presented in Section A of the Supplementary Information.

Role of plasma microinstabilities

Finally, we note that, for \(\tilde{B} > {\tilde{B}}_{{{{{{{{\rm{iso}}}}}}}}}\), the effective values of \(\tilde{\nu }\) and \(\tilde{\eta }\) might be dictated by plasma microinstabilities rather than by collisions between protons65 (this is conjectured to happen in galaxy clusters66). In Methods, we show that the decay of the integral-scale magnetic energy is too slow to excite the firehose instability that is important in the cluster context [see Equation (60)]. Nonetheless, we cannot rule out other microinstabilities—for example, the excitation of the mirror instability by reconnection has been studied by ref. 67, although its effect on the rate of reconnection remains unclear. The most dramatic effect that microinstabilities in general could plausibly have would be to reduce the effective value of Pm to  1 if \(\tilde{B} \, > \, {\tilde{B}}_{{{{{{{{\rm{iso}}}}}}}}}\) (see refs. 68,69). This corresponds to the red-gold line in Fig. 3, which remains consistent with Equation (1) for \({I}_{H}\, \gtrsim \, 1{0}^{-20}{I}_{H,\max }\). Compatibility between the EWPT-magnetogenesis scenario and the observational constraints on EGMFs therefore appears robust.

Methods

Post-recombination evolution

In the matter-dominated Universe after recombination, the transformation that maps Minkowski spacetime MHD onto its expanding Universe equivalent is not Equation (3), but24

$$\begin{array}{rc}\tilde{\rho }={a}^{3}\rho,\quad &\tilde{p}={a}^{4}p,\quad \tilde{{{{{{{{\bf{B}}}}}}}}}={a}^{2}{{{{{{{\bf{B}}}}}}}},\quad \tilde{{{{{{{{\bf{u}}}}}}}}}={a}^{1/2}{{{{{{{\bf{u}}}}}}}},\\ &\tilde{\eta }=\eta /{a}^{1/2},\quad \tilde{\nu }=\nu /{a}^{1/2},\quad {{{{{{{\rm{d}}}}}}}}\tilde{t}={{{{{{{\rm{d}}}}}}}}t/{a}^{1/2}.\end{array}$$
(21)

As at2 in the matter-dominated Universe, \(\tilde{t}\propto \log t\), so a power-law decay in rescaled variables corresponds to only a logarithmic decay in comoving variables14. Thus, in computing the expected present-day strength of EGMFs, one may assume the decay of \(\tilde{B}\) to terminate at recombination with negligible error.

Derivation of Equation 10

In order to apply Equation (8), we require an expression for the conformal time at recombination, trecomb. From the Friedmann equation,

$$\frac{1}{{a}^{4}}{\left(\frac{{{{{{{{\rm{d}}}}}}}}a}{{{{{{{{\rm{d}}}}}}}}t}\right)}^{2}=\frac{8\pi G\rho }{3},$$
(22)

where G is the gravitational constant, the entropy equation

$$g{T}^{3}{a}^{3}={{{{{{{\rm{const}}}}}}}},$$
(23)

where g is the number of degrees of freedom of the radiation field and T is the temperature, and Stefan’s law for the radiation density

$$\rho=3\chi g{T}^{4},$$
(24)

where χ = π2/90c53 (we work in energy units for temperature, with Boltzmann constant kB = 1), it can be shown that

$${\left(\frac{{{{{{{{\rm{d}}}}}}}}T}{{{{{{{{\rm{d}}}}}}}}t}\right)}^{2}=8\pi G{g}_{0}\chi {T}^{4}{T}_{0}^{2}{\left(\frac{g}{{g}_{0}}\right)}^{1/3},$$
(25)

where the subscript 0 refers to quantities evaluated at the present day. Because \({(g/{g}_{0})}^{1/6}\simeq 1\), one may solve Equation (25) to give an expression for the cosmic temperature as a function of conformal time,

$$T=\frac{1}{t{T}_{0}}\sqrt{\frac{1}{8\pi G{g}_{0}\chi }}.$$
(26)

With g0 = 2 (for the two photon-polarisation states), one obtains

$$t \sim 1{0}^{16.5}{{{{{{{\rm{s}}}}}}}}{\left(\frac{T}{0.3{{{{{{{\rm{eV}}}}}}}}}\right)}^{-1}.$$
(27)

Therefore, Equation (8) becomes

$$\tau \sim 1{0}^{16.5}{{{{{{{\rm{s}}}}}}}}{\left(\frac{T}{0.3{{{{{{{\rm{eV}}}}}}}}}\right)}^{-1}.$$
(28)

Thus, trecomb ~ 1016.5 s. Equation (28) can be used to relate \(\tilde{B}\) and λB under the assumption that the decay occurs on the Alfvénic timescale \(\tau \sim {\lambda }_{B}/{\tilde{v}}_{A}\) [Equation (9)]. As noted in the main text, \({\tilde{v}}_{A}\) should be computed using the baryon density \({\tilde{\rho }}_{b}\), because the photon mean free path13

$${\lambda }_{{{{{{{{\rm{mfp}}}}}}}},\gamma }=\frac{1}{a{\sigma }_{T}{n}_{e}} \sim 1{{{{{{{\rm{Mpc}}}}}}}}{\left(\frac{T}{0.3{{{{{{{\rm{eV}}}}}}}}}\right)}^{-2}$$
(29)

(where σT is the Thompson-scattering cross-section) is large compared with λB at the time of recombination, indicating that photons are not strongly coupled to the fluid45. However, because \({\tilde{\rho }}_{b}\simeq {\tilde{\rho }}_{\gamma }\) at the time of recombination, the decoupling of photons does not affect Equation (10). The Alfvén speed is

$${\tilde{v}}_{A}=\frac{\tilde{B}}{\sqrt{4\pi {\tilde{\rho }}_{b}}}\simeq 1{0}^{16}{{{{{{{\rm{cm\,{s}}}}}}}^{-1}}}\frac{\tilde{B}}{1G}{\left(\frac{T}{0.3{{{{{{{\rm{MeV}}}}}}}}}\right)}^{1/2},$$
(30)

where we have used \({\tilde{\rho }}_{b}={a}^{4}{\rho }_{b}\simeq {a}^{4}{m}_{i}{n}_{b}\), with mi the proton mass and nb the WMAP value for the baryon number density nb 2.5 × 10−7 cm−3a−370, and taken aT0/T [Equation (23)]. Comparing Equation (9) and Equation (28), and substituting Equation (30), we have

$$\tilde{B} \sim 1{0}^{-8.5}\,{{{{{{{\rm{G}}}}}}}}\,\left(\frac{{\lambda }_{B}}{1\,{{{{{{{\rm{Mpc}}}}}}}}}\right){\left(\frac{T}{0.3{{{{{{{\rm{eV}}}}}}}}}\right)}^{1/2}.$$
(31)

Evaluated at T = T(trecomb) = 0.3 eV, this is Equation (10).

Derivation of line (i) of Fig. 3

Line (i) represents Equation (14) evaluated at the time of recombination trecomb, with \({{{{{{{\rm{Pm}}}}}}}}={{{{{{{{\rm{Pm}}}}}}}}}_{{{{{{{{\rm{Sp}}}}}}}}}\equiv {\tilde{\nu }}_{{{{{{{{\rm{Sp}}}}}}}}}/{\tilde{\eta }}_{{{{{{{{\rm{Sp}}}}}}}}}\), where \({\tilde{\nu }}_{{{{{{{{\rm{Sp}}}}}}}}}\) and \({\tilde{\eta }}_{{{{{{{{\rm{Sp}}}}}}}}}\) are the comoving Spitzer values of kinematic viscosity and magnetic diffusivity respectively59. We first evaluate PmSp.

Under Spitzer theory, the dominant component of the plasma viscosity at the scale of the rate-determining current sheet is due to ion-ion (i.e., proton–proton) collisions. The collision frequency is59

$${\nu }_{ii} \sim \frac{{e}^{4}{n}_{i}\ln {{{\Lambda }}}_{ii}}{{m}_{i}^{1/2}{{T}_{i}}^{3/2}},$$
(32)

where e is the elementary charge, ni the ion number density, mi the ion mass, Ti the ion temperature, and \(\ln {{{\Lambda }}}_{ii}\) the Coulomb logarithm for ion-ion collisions. Neglecting any anisotropising effect of the magnetic field (see main text), the comoving isotropic kinematic viscosity is71

$${\tilde{\nu }}_{{{{{{{{\rm{Sp}}}}}}}}} \sim \frac{{v}_{{{{{{{{\rm{th}}}}}}}},i}^{2}}{a{\nu }_{ii}} \sim \frac{{T}_{i}^{5/2}}{a{m}_{i}^{1/2}{e}^{4}{n}_{i}\ln {{{\Lambda }}}_{ii}} \sim 1{0}^{18}{{{{{{{\rm{c{m}}}}}}}^{2}{s}^{-1}}}{\left(\frac{T}{0.3{{{{{{{\rm{eV}}}}}}}}}\right)}^{1/2},$$
(33)

where \({v}_{{{{{{{{\rm{th}}}}}}}},i}=\sqrt{2{T}_{i}/{m}_{i}}\) is the thermal speed of ions, and we have assumed TiT, used a T0/T [Equation (23)], taken ni to be equal to the WMAP value for the baryon number density nb 2.5 × 10−7 cm−3a−370, and estimated the Coulomb logarithm \(\ln {{{\Lambda }}}_{ii}\) by

$$\ln {{{\Lambda }}}_{ii}\simeq \ln \frac{{T}_{i}^{3/2}}{{e}^{3}{n}_{i}^{1/2}}\simeq 20.$$
(34)

Similarly, the electron-ion collision frequency is71

$${\nu }_{ei} \sim \frac{{e}^{4}{n}_{e}\ln {{{\Lambda }}}_{ei}}{{m}_{e}^{1/2}{{T}_{e}}^{3/2}},$$
(35)

where neni is the electron number density, Te the electron temperature, and \(\ln {{{\Lambda }}}_{ei}\) the Coulomb logarithm for electron-ion collisions. Equation (35) leads to the Spitzer59 value for the magnetic diffusivity

$${\tilde{\eta }}_{{{{{{{{\rm{Sp}}}}}}}}} \sim \frac{{\nu }_{ei}{m}_{e}{c}^{2}}{4\pi {n}_{e}{e}^{2}a} \sim 1{0}^{10.5}{{{{{{{\rm{c{m}}}}}}}^{2}{s}^{-1}}}{\left(\frac{T}{0.3{{{{{{{\rm{eV}}}}}}}}}\right)}^{-1/2},$$
(36)

where we have used \(\ln {{{\Lambda }}}_{ei}\simeq \ln {{{\Lambda }}}_{ii}\simeq 20\), assumed the electron temperature TeT, and again neglected any anisotropy resulting from the magnetic field. From Equations (33) and (36), we have

$${{{{{{{{\rm{Pm}}}}}}}}}_{{{{{{{{\rm{Sp}}}}}}}}}=\frac{{\tilde{\nu }}_{{{{{{{{\rm{Sp}}}}}}}}}}{{\tilde{\eta }}_{{{{{{{{\rm{Sp}}}}}}}}}} \sim \frac{{T}^{4}}{{m}_{e}^{1/2}{m}_{i}^{1/2}{e}^{6}{n}_{i}\ln {{{\Lambda }}}_{ii}\ln {{{\Lambda }}}_{ei}} \sim 1{0}^{7}\left(\frac{T}{0.3\,{{{{{{{\rm{eV}}}}}}}}}\right).$$
(37)

Let us now evaluate the Lundquist number, Equation (15), in order to compare it with Sc, as Equation (14) requires. Note that, as above, it is the Alfvén speed based on baryon inertia that appears in Equation (15); photons are even more weakly coupled to the cosmic fluid at reconnection scales than at scale λB as the former are typically small compared with the latter. Using Equations (13), (30), and (37), we find the Lundquist number

$$S= \frac{1}{\sqrt{1+{{{{{{{{\rm{Pm}}}}}}}}}_{{{{{{{{\rm{Sp}}}}}}}}}}}\frac{{\tilde{v}}_{A}({t}_{*}){\lambda }_{B}({t}_{*})}{\tilde{\eta }}{\left[\frac{{\lambda }_{B}({t}_{*})}{{\lambda }_{B}}\right]}^{1/4} \sim 1{0}^{9}\left[\frac{\tilde{B}({t}_{*})}{1{0}^{-5.5}\,{{{{{{{\rm{G}}}}}}}}}\right]\left[\frac{{\lambda }_{B}({t}_{*})}{1{0}^{-12}\,{{{{{{{\rm{Mpc}}}}}}}}}\right]\\ \times {\left[\frac{T}{0.3{{{{{{{\rm{eV}}}}}}}}}\right]}^{1/2}{\left[\frac{{\lambda }_{B}({t}_{*})}{{\lambda }_{B}}\right]}^{1/4}.$$
(38)

Equation (38) shows that SSc ~ 104 [unless \(\tilde{B}({t}_{*})\) or λB(t*) are very small, in which case their evolution is inconsistent with the observational constraint (1), so we neglect this possibility for simplicity]. Substituting Equation (37), we find that the decay timescale (14) is

$$\tau \sim 1{0}^{5.5}{\left(\frac{T}{0.3{{{{{{{\rm{eV}}}}}}}}}\right)}^{1/2}\frac{{\lambda }_{B}}{{\tilde{v}}_{A}}.$$
(39)

Comparing Equations (28) and (39), and again substituting Equation (30), we find

$$\tilde{B} \sim 1{0}^{-3}{{{{{{{\rm{G}}}}}}}}\,\left(\frac{{\lambda }_{B}}{1\,{{{{{{{\rm{Mpc}}}}}}}}}\right)\left(\frac{T}{0.3\,{{{{{{{\rm{eV}}}}}}}}}\right).$$
(40)

Evaluated at T = T(trecomb) = 0.3 eV, this is line (i) of Fig. 3.

Finally, we note that when reconnection occurs under large-Pm conditions with isotropic Spitzer viscosity, the ratio of δc [Equation (16)] to rL [defined below Equation (15)] prior to recombination is independent of the magnetic-field strength, temperature and density:

$$\frac{{\delta }_{c}}{{r}_{L}} \sim {S}_{c}^{1/2}{\left(\frac{{m}_{e}}{{m}_{i}}\right)}^{1/4} \sim 10,$$
(41)

where we have used Eqs (36), (37) and (30). Thus, δc > rL always. Furthermore, we find from Equations (15), (16), (30), (36), (37) and the definition of di [see below Equation (16)] that

$$\frac{{\delta }_{c}}{{d}_{i}} \sim {S}_{c}^{1/2}{\left(\frac{{m}_{e}}{{m}_{i}}\right)}^{1/4}\frac{{v}_{{{{{{{{\rm{th}}}}}}}},i}}{{\tilde{v}}_{A}} \sim {\left(\frac{\tilde{B}}{1{0}^{-9}{{{{{{{\rm{G}}}}}}}}}\right)}^{-1}.$$
(42)

Therefore, δc > di, rL at recombination for all relevant field strengths, so we are justified in using fluid theory to describe decays with \(\tilde{B} < {\tilde{B}}_{{{{{{{{\rm{iso}}}}}}}}}\) [evaluated in Equation (44)].

As described in the main text, Equation (40) is valid when \(\tilde{B}\) is small enough for the Larmor radius of ions rL to be larger than their mean free path

$${\lambda }_{{{{{{{{\rm{mfp}}}}}}}}} \sim \frac{{v}_{{{{{{{{\rm{th}}}}}}}},i}}{{\nu }_{ii}a} \sim 1{0}^{12}{{{{{{{\rm{cm}}}}}}}}.$$
(43)

The critical magnetic field strength above which this condition is no longer satisfied is

$${\tilde{B}}_{{{{{{{{\rm{iso}}}}}}}}} \sim \frac{{m}_{i}c{\nu }_{ii}{a}^{2}}{e} \sim 1{0}^{-13}\,{{{{{{{\rm{G}}}}}}}}{\left(\frac{T}{0.3{{{{{{{\rm{eV}}}}}}}}}\right)}^{-1/2}.$$
(44)

Derivation of line (ii) of Fig. 3

Line (ii) represents Equation (14) evaluated at the time of recombination trecomb, with magnetic Prandtl number \({{{{{{{\rm{Pm}}}}}}}} \sim {({r}_{L}/{\lambda }_{{{{{{{{\rm{mfp}}}}}}}}})}^{2}{{{{{{{{\rm{Pm}}}}}}}}}_{{{{{{{{\rm{Sp}}}}}}}}}={({\tilde{B}}_{{{{{{{{\rm{iso}}}}}}}}}/\tilde{B})}^{2}{{{{{{{{\rm{Pm}}}}}}}}}_{{{{{{{{\rm{Sp}}}}}}}}}\). Note that this suppression of Pm relative to PmSp increases the value of S at any given \({\tilde{v}}_{A}\) and λB relative to the value (38) of S that corresponds to Pm = PmSp. We therefore expect this family of decays also to have SSc ~ 104.

The inclusion of the factor of \({({\tilde{B}}_{{{{{{{{\rm{iso}}}}}}}}}/\tilde{B})}^{2}\) in Pm modifies Equation (40) straightforwardly: it becomes

$$\begin{array}{l}\tilde{B} \sim 1{0}^{-3}{{{{{{{\rm{G}}}}}}}}\,\left(\frac{{\tilde{B}}_{{{{{{{{\rm{iso}}}}}}}}}}{\tilde{B}}\right)\left(\frac{{\lambda }_{B}}{1\,{{{{{{{\rm{Mpc}}}}}}}}}\right)\left(\frac{T}{0.3\,{{{{{{{\rm{eV}}}}}}}}}\right).\\ \ \Rightarrow \ \tilde{B} \sim 1{0}^{-8}{{{{{{{\rm{G}}}}}}}}\,{\left(\frac{{\lambda }_{B}}{1{{{{{{{\rm{Mpc}}}}}}}}}\right)}^{1/2}{\left(\frac{T}{0.3{{{{{{{\rm{eV}}}}}}}}}\right)}^{1/4}.\end{array}$$
(45)

Evaluated at T = T(trecomb) = 0.3 eV, this is line (iv) of Fig. 3.

The analogue of Equation (42) for \({{{{{{{\rm{Pm}}}}}}}} \sim {({\tilde{B}}_{{{{{{{{\rm{iso}}}}}}}}}/\tilde{B})}^{2}{{{{{{{{\rm{Pm}}}}}}}}}_{{{{{{{{\rm{Sp}}}}}}}}}\) is

$$\frac{{\delta }_{c}}{{d}_{i}} \sim {S}_{c}^{1/2}{\left(\frac{{m}_{e}}{{m}_{i}}\right)}^{1/4}\frac{{v}_{{{{{{{{\rm{th}}}}}}}},i}}{{\tilde{v}}_{A}}\frac{{\tilde{B}}_{{{{{{{{\rm{iso}}}}}}}}}}{\tilde{B}} \sim {\left\{\tilde{B}\bigg/\left[1{0}^{-11}{{{{{{{\rm{G}}}}}}}}{\left(\frac{T}{0.3{{{{{{{\rm{eV}}}}}}}}}\right)}^{-1/4}\right]\right\}}^{-2},$$
(46)

while the corresponding analogue of Equation (41) is

$$\frac{{\delta }_{c}}{{r}_{L}} \sim {S}_{c}^{1/2}{\left(\frac{{m}_{e}}{{m}_{i}}\right)}^{1/4}\frac{{\tilde{B}}_{{{{{{{{\rm{iso}}}}}}}}}}{\tilde{B}} \sim {\left\{\tilde{B}\bigg/\left[1{0}^{-12}{{{{{{{\rm{G}}}}}}}}{\left(\frac{T}{0.3{{{{{{{\rm{eV}}}}}}}}}\right)}^{-1/2}\right]\right\}}^{-1}.$$
(47)

Equation (46) shows that δcdi at trecomb if \(\tilde{B}\, \lesssim \, 1{0}^{-11}{{{{{{{\rm{G}}}}}}}}\), while Equation (47) indicates that δcrL if \(\tilde{B} \, \lesssim \, 1{0}^{-12}{{{{{{{\rm{G}}}}}}}}\). Following the prescription described in55, we use the former condition on \(\tilde{B}\) as the domain of validity of Equation (14) in Fig. 3, though we note that our results do not depend strongly on this choice—the order-of-magnitude difference between the two critical values of \(\tilde{B}\) is comparable to the degree of accuracy to which our scaling arguments are valid.

We also note that the temperature dependence of Equation (46) means that a decaying field that developed δcdi before recombination would have done so at a field strength \(\tilde{B} \, < \, 1{0}^{-11}{{{{{{{\rm{G}}}}}}}}\); strictly, therefore, the decay of primordial fields should terminate somewhere below the horizontal part of the blue-gold curve in Fig. 3, not directly on it. However, the difference is order unity and thus negligible for the purposes of our order-of-magnitude estimates. This is because magnetic decay was strongly suppressed by radiative drag at early times [a consequence of the strong temperature dependence of Equation (55)]—i.e., when temperatures exceeded around 102 × 0.3 eV. For all relevant values of IH, the magnetic-field strength would therefore have greatly exceeded the critical value required for δc ~ di until the time that corresponds to this temperature, and by that time the critical field strength indicated by Equation (46) was already within a small factor of its value at recombination.

Derivation of line (iii) of Fig. 3

Line (iii) represents Equation (14) at the time of recombination trecomb, with Pm  1. With Pm  1, Equation (38) should be replaced by

$$S \sim 1{0}^{12.5}\left[\frac{\tilde{B}({t}_{*})}{1{0}^{-5.5}\,{{{{{{{\rm{G}}}}}}}}}\right]\left[\frac{{\lambda }_{B}({t}_{*})}{1{0}^{-12}\,{{{{{{{\rm{Mpc}}}}}}}}}\right] \times \left[\frac{T}{0.3\,{{{{{{{\rm{eV}}}}}}}}}\right]{\left[\frac{{\lambda }_{B}({t}_{*})}{{\lambda }_{B}}\right]}^{1/4},$$
(48)

so that SSc ~ 104 for all decays of interest. The decay timescale (14) therefore becomes

$$\tau \simeq 1{0}^{2}\frac{{\lambda }_{B}}{{\tilde{v}}_{A}}.$$
(49)

Comparing Equations (28) and (39), and substituting Equation (30), we find

$$\tilde{B} \sim 1{0}^{-6.5}{{{{{{{\rm{G}}}}}}}}\,\left(\frac{{\lambda }_{B}}{1\,{{{{{{{\rm{Mpc}}}}}}}}}\right){\left(\frac{T}{0.3{{{{{{{\rm{eV}}}}}}}}}\right)}^{1/2}.$$
(50)

Evaluated at T = T(trecomb) = 0.3 eV, this is line (iii) of Fig. 3.

The analogues of Equations (42) and (41) for Pm  1 (but \(\tilde{\eta } \sim {\tilde{\eta }}_{{{{{{{{\rm{Sp}}}}}}}}}\)) are

$$\frac{{\delta }_{c}}{{r}_{L}} \sim {S}_{c}^{1/2}\frac{c}{{v}_{{{{{{{{\rm{th}}}}}}}},e}}\frac{\ln {{{\Lambda }}}_{ei}}{{{{\Lambda }}}_{ii}} \sim 1{0}^{-2.5}{\left(\frac{T}{0.3{{{{{{{\rm{eV}}}}}}}}}\right)}^{-1/2},$$
(51)

and

$$\frac{{\delta }_{c}}{{d}_{i}} \sim {S}_{c}^{1/2}\frac{c}{{\tilde{v}}_{A}}{\left(\frac{{m}_{e}}{{m}_{i}}\right)}^{1/2}\frac{\ln {{{\Lambda }}}_{ei}}{{{{\Lambda }}}_{ii}} \sim {\left\{\tilde{B}\bigg/\left[1{0}^{-13}{{{{{{{\rm{G}}}}}}}}{\left(\frac{T}{0.3{{{{{{{\rm{eV}}}}}}}}}\right)}^{-1/2}\right]\right\}}^{-1}.$$
(52)

Note that the field strength at which δc ~ di is approximately equal to \({\tilde{B}}_{{{{{{{{\rm{iso}}}}}}}}}\) at recombination (both are ~10−13 G), while δcrL. The red-gold line in Fig. 3 therefore extends past line (iii) to line (iv) along the line \(\tilde{B} \sim {\tilde{B}}_{{{{{{{{\rm{iso}}}}}}}}}\).

Radiation drag and the derivation of line (iv) of Fig. 3

As well as by viscosity arising from collisions between ions, the kinetic energy of primordial plasma flows (after neutrino decoupling) can be dissipated by electron–photon collisions (Thompson scattering). Around the time of recombination, the comoving mean free path of photons, Equation (29), is much larger than the anticipated correlation scale of the magnetic field (and, therefore, of any magnetically driven flows). Under these conditions, the effect of Thompson scattering is to induce a drag on electrons. Owing to the collisional coupling between ions and electrons, this drag can dissipate bulk plasma flows.

The comoving drag force on the fluid per unit baryon density is

$${\tilde{{{{{{{{\bf{F}}}}}}}}}}_{D}=-\tilde{\alpha }\tilde{{{{{{{{\bf{u}}}}}}}}},$$
(53)

where24

$$\tilde{\alpha } \sim \frac{c}{{\lambda }_{{{{{{{{\rm{mfp}}}}}}}},\gamma }}\frac{{\rho }_{\gamma }}{{\rho }_{b}} \sim 1{0}^{-13.5}{{{{{{{{\rm{s}}}}}}}}}^{-1}{\left(\frac{T}{0.3{{{{{{{\rm{eV}}}}}}}}}\right)}^{3}.$$
(54)

As explained in the main text, the effect of drag is most important at the scale λB (it becomes increasingly subdominant to magnetic tension at smaller scales) where it inhibits inflows to the reconnection layer. When the timescale \({\tau }_{\alpha }\equiv \tilde{\alpha }{\lambda }_{B}^{2}/{\tilde{v}}_{A}^{2}\) on which flux can be delivered to the layer by strongly dragged inflows is larger than the reconnection timescale of the critical sheet τrec [see Equation (19)], τα gives the timescale for energy decay. Equation (28) with τ = τα yields, after substitution of Equations (30) and Equation (54)

$$\tilde{B} \sim 1{0}^{-7}{{{{{{{\rm{G}}}}}}}}\,\left(\frac{{\lambda }_{B}}{1\,{{{{{{{\rm{Mpc}}}}}}}}}\right){\left(\frac{T}{0.3{{{{{{{\rm{eV}}}}}}}}}\right)}^{3/2}.$$
(55)

Evaluated at T = T(trecomb) = 0.3 eV, this is line (iv) of Fig. 3.

Non-excitation of the firehose instability

Plasma with an anisotropic viscosity tensor can, in principle, be unstable to a variety of instabilities that develop at kinetic scales. For a decaying magnetic field, an instability of particular importance is the firehose, which can generate the growth of small-scale magnetic fields in response to the decay of large-scale ones65,72. This happens if the size of the (negative) pressure anisotropy Δ exceeds a critical value:

$${{\Delta }}\equiv \frac{{p}_{\perp }-{p}_{\parallel }}{{p}_{\parallel }}\le -\frac{2}{{\beta }_{i}}$$
(56)

where p and p are the thermal pressures parallel and perpendicular to the magnetic field, and

$${\beta }_{i}\equiv \frac{{p}_{\parallel }}{{B}^{2}/8\pi }$$
(57)

is the plasma beta. Δ can be estimated as65

$${{\Delta }} \sim \frac{1}{{\nu }_{ii}}\frac{1}{B}\frac{{{{{{{{\rm{d}}}}}}}}B}{{{{{{{{\rm{d}}}}}}}}\bar{t}} \sim -\frac{1}{a{\nu }_{ii}\tau } \sim -1{0}^{-11}{\left(\frac{T}{0.3{{{{{{{\rm{eV}}}}}}}}}\right)}^{1/2},$$
(58)

where \(\bar{t}\) is cosmic time [defined below Equation (2)]. Naturally, the value of βi at any given T depends on the evolution of the magnetic field. A lower bound on the value of \(\tilde{B}\) at any given time for a given initial condition is the one that would develop from a decay on the kinetic reconnection timescale, \(\tau \sim 10{\lambda }_{B}/{\tilde{v}}_{A}\) [Equation (17)]. Solving Equations (13), (17), (28), and (30) simultaneously, we find that this is

$$\tilde{B}(t) \sim 1{0}^{-13}\,{{{{{{{\rm{G}}}}}}}}{\left(\frac{T}{0.3{{{{{{{\rm{eV}}}}}}}}}\right)}^{5/18} \times {\left[\frac{{\lambda }_{B}({t}_{*})}{1{0}^{-12}{{{{{{{\rm{Mpc}}}}}}}}}\right]}^{5/9}{\left[\frac{\tilde{B}({t}_{*})}{1{0}^{-5.5}{{{{{{{\rm{G}}}}}}}}}\right]}^{4/9}.$$
(59)

Using this lower bound on \(\tilde{B}\), we can obtain an upper limit on βiΔ:

$$| {\beta }_{i}{{\Delta }}| \lesssim 1{0}^{-6}{\left(\frac{T}{0.3{{{{{{{\rm{eV}}}}}}}}}\right)}^{-1/18} \times {\left[\frac{{\lambda }_{B}({t}_{*})}{1{0}^{-12}{{{{{{{\rm{Mpc}}}}}}}}}\right]}^{-10/9}{\left[\frac{\tilde{B}({t}_{*})}{1{0}^{-5.5}{{{{{{{\rm{G}}}}}}}}}\right]}^{-8/9}.$$
(60)

Equation (60) suggests that the threshold for instability (56) is never met, unless λB(t*) and/or \(\tilde{B}({t}_{*})\) are so small as to be inconsistent with the observational constraint (1).

Numerical simulation

The numerical simulations visualised in Fig. 2 and described in Section B of the Supplementary Information were conducted using the spectral MHD code Snoopy73. The code solves the equations of incompressible MHD in Minkowski spacetime with hyper-viscosity and hyper-resistivity both of order n, viz.,

$$\frac{\partial {{{{{{{\bf{u}}}}}}}}}{\partial t}+{{{{{{{\bf{u}}}}}}}}{{{{{{{\boldsymbol{\cdot }}}}}}}}{{{{{{{\boldsymbol{\nabla }}}}}}}}{{{{{{{\bf{u}}}}}}}} =-{{{{{{{\boldsymbol{\nabla }}}}}}}}p+({{{{{{{\boldsymbol{\nabla }}}}}}}}\times {{{{{{{\bf{B}}}}}}}})\times {{{{{{{\bf{B}}}}}}}}-{(-1)}^{n/2}{\nu }_{n}{\nabla }^{n}{{{{{{{\bf{u}}}}}}}},\\ \frac{\partial {{{{{{{\bf{B}}}}}}}}}{\partial t} ={{{{{{{\boldsymbol{\nabla }}}}}}}}\times ({{{{{{{\bf{u}}}}}}}}\times {{{{{{{\bf{B}}}}}}}})-{(-1)}^{n/2}{\eta }_{n}{\nabla }^{n}{{{{{{{\bf{B}}}}}}}},$$
(61)

where p, the thermal pressure, is determined via the incompressibility condition

$${{{{{{{\boldsymbol{\nabla }}}}}}}}{{{{{{{\boldsymbol{\cdot }}}}}}}}{{{{{{{\bf{u}}}}}}}}=0.$$
(62)

Snoopy uses a pseudo-spectral algorithm with a 2/3 dealiasing rule. It performs time integration of non-dissipative terms using a low-storage, third-order, Runge-Kutta scheme, while solving the dissipative terms using an implicit method that preserves the overall third-order accuracy of the numerical scheme. In all runs presented here, we employ νn = ηn = 10−12, n = 6 and use a resolution of 5123. The size of the periodic simulation domain is Lbox = 2π.