Relative distribution of cosmic rays and magnetic fields
Amit Seta Anvar Shukurov Toby S. Wood Paul J. Bushby Andrew P. Snodin


firstpage–lastpage
The influence of small-scale magnetic field
       on the evolution of inclination angle and precession damping
       in the framework of
       3-component model of neutron star
      
    K Y Kraav^1, M V Vorontsov^1, 
        D P  Barsukov^2,1
       
    
==========================================================================================================================================================================================


Synchrotron radiation from cosmic rays is a key observational probe of the galactic magnetic field.
Interpreting synchrotron emission data requires knowledge of the cosmic ray number density,
which is often assumed to be in energy equipartition (or otherwise tightly correlated)
with the magnetic field energy.
However, there is no compelling observational or theoretical reason to expect such tight correlation to hold across all scales.
We use test particle simulations, tracing the propagation of charged particles (protons) through a random magnetic field,
to study the cosmic ray distribution at scales comparable to
the correlation scale of the turbulent flow in the interstellar medium (≃ 100 in spiral galaxies).
In these simulations, we find that there is no spatial correlation between the cosmic ray number density and the magnetic field energy density.
In fact, their distributions are approximately
statistically independent.
We find that low-energy cosmic rays can become trapped between magnetic mirrors,
whose location depends more on the structure of the field lines than on the field strength.



cosmic rays – ISM:magnetic fields – scattering – dynamo – MHD – radio continuum:ISM




§ INTRODUCTION
 
Synchrotron emission is the main source of information about the nonthermal components of the interstellar
and intergalactic medium (ISM and IGM). Its interpretation depends
crucially on the relative distribution of magnetic fields and
cosmic ray electrons. Cosmic rays tend to gyrate around magnetic field lines, so it is natural to expect some
correlation between the cosmic ray and magnetic energy densities. 
On sufficiently long length- and time-scales, the cosmic ray distribution may achieve energy equipartition <cit.>,
or pressure balance, with the magnetic field <cit.>.
Although the assumption of a tight, point-wise correlation between cosmic 
rays and magnetic fields across a wide range of scales lacks a compelling justification, it is often used in
interpretations of synchrotron observations, regardless of the spatial resolution.
Most of the energy of cosmic rays is carried by protons and heavier particles; therefore,
such interpretations rely on an additional assumption that
relativistic electrons are distributed similarly to the heavier cosmic ray particles.

The diffusivity of 5 cosmic rays in a 5 magnetic field is
believed to be about 10^28–10^29^2^-1, implying
a diffusion length
of the order of 1 over the time scale of cosmic ray confinement in galaxies, 10^6 <cit.>.
This suggests that the cosmic ray distribution will be significantly more uniform than that
of the interstellar magnetic field, which varies strongly on scales smaller than 0.1 <cit.>.
However, cosmic rays are more tightly confined to field lines where the field is strongest, and so we might still expect some positive correlation 
between cosmic ray density and magnetic energy on small scales. On the other hand, overall pressure balance can, equally
plausibly, lead to local anticorrelation between cosmic ray and magnetic energy densities <cit.>.
Indeed, from a comparison of the observed and modelled magnitude of the fluctuations in synchrotron intensity in the Milky Way and nearby spiral galaxies, <cit.> suggested 
that cosmic ray electrons and interstellar magnetic fields are slightly anticorrelated at scales ≲ 100.

Large-scale simulations of cosmic ray propagation in the advection-diffusion
approximation rely on various (often crude) parameterisations of the diffusion tensor and its dependence
on the magnetic field. 
Using a fluid description of cosmic rays in nonlinear dynamo simulations, assuming anisotropic (but constant) diffusion coefficients,
<cit.> found no correlation between magnetic field and cosmic ray energy densities.
Such simulations may be appropriate at scales exceeding the diffusion length (of order
1), but not at the smaller scales that are relevant in the present study. 
For a typical cosmic ray proton, with energy 1–10,
in a 5 magnetic field, the Larmor radius
is about 10^-6–10^-5, which is much
smaller than the correlation length of magnetic field (50–100) or 
the diffusion length of cosmic rays (which is of the order of 1). Thus, the small-scale structure
of the magnetic field will be particularly important for the propagation of cosmic rays in this energy range.

In this paper, we use test particle simulations to explore, in detail, the
spatial distribution of cosmic ray particles propagating in a random magnetic field.
Whereas previous test particle simulations
have been mostly concerned with the calculation of the cosmic ray diffusion coefficient,
we primarily consider the spatial distribution of cosmic rays and its relation to the magnetic field.
Our model is kinematic,
i.e., we only consider the effect of the magnetic field on the cosmic rays
and neglect any effects of cosmic ray pressure on the gas flow and hence on the magnetic field.
In Section <ref> we describe the numerical model for random magnetic fields and 
in Section <ref> we present our model for simulating cosmic ray propagation.
Our results on cosmic ray density and its relation to the magnetic field are presented in Section <ref>. We conclude in Section <ref> and suggest further avenues for study.




§ IMPLEMENTATION OF RANDOM MAGNETIC FIELDS

The propagation of cosmic rays is sensitive to rather subtle details of the magnetic field in which they move.
The spectrum provides a complete statistical description of a Gaussian random 
magnetic field, so it must also determine the corresponding cosmic ray diffusivity for a given energy of particle. 
The propagation of cosmic rays in an isotropic Gaussian random magnetic field (for which the probability distribution function of each vector component is Gaussian) 
has been the subject of many studies <cit.>.
However, radio <cit.>,
submillimeter <cit.>
and neutral hydrogen <cit.> 
observations
suggest
that the magnetic field in the ISM is
strongly non-Gaussian, spatially intermittent, and 
filamentary.
Such an intermittent field is
also expected theoretically,
as a result of turbulent dynamo action 
<cit.> and 
random shock compression <cit.>.
The magnetic field generated by dynamo action in galaxy clusters is also likely to be intermittent
<cit.>.
The presence of magnetic intermittency can significantly affect the propagation of cosmic rays
<cit.>. In non-Gaussian fields, the separation and size of magnetic structures may play an important role 
<cit.>, especially for low energy particles. In this section, we describe the magnetic fields that
are used in our analysis of cosmic ray propagation. 
A discussion of the structure of small-scale interstellar magnetic field can be found in Appendix <ref>. 
Throughout the text, the small-scale or fluctuating field is represented by b⃗, the large-scale (or mean) field
by B⃗_⃗0⃗ and the total field by B⃗=b⃗+B⃗_⃗0⃗.




 §.§ Magnetic fields generated by a random flow


For our numerical study, we use a random magnetic field produced by kinematic fluctuation (small-scale) dynamo action.
Using a triply-periodic cubic box of length L, with 512^3 grid points, we solve the induction equation

    b⃗t = ∇× (u⃗×b⃗) + η∇^2 b⃗,
 
where u⃗(x⃗,t) is a prescribed velocity field and η is the magnetic diffusivity,
which we take to be constant.
To ensure ∇·b⃗ = 0, we numerically solve for the corresponding magnetic vector potential.
We define the magnetic Reynolds number to be = l_0 u_0/η,
where l_0 is the outer scale of the turbulent velocity flow and u_0 is the
root-mean-square (rms) velocity.
Dynamo action occurs, i.e., the magnetic field grows exponentially,
if  exceeds a critical magnetic Reynolds number, , whose value depends on the velocity field.


 





We construct the velocity field, u⃗, by superposing Fourier modes with a range of wavenumbers, k,
and a chosen energy spectrum E(k),
using the same prescription as <cit.> and <cit.>:

    u⃗(x⃗,t) = ∑_n=0^N-1[C⃗_n(k⃗_n) cosϕ_n + D⃗_n(k⃗_n) sinϕ_n],

where ϕ_n = k⃗_n ·x⃗ + ω_n t, k⃗_n is a randomly oriented wavevector of magnitude k_n,
and ω_n=[k_n^3 E(k_n)]^1/2 is
the frequency at that scale.
The vectors C⃗_n(k⃗_n) and D⃗_n(k⃗_n) have random directions in the 
plane perpendicular to k⃗_n,
so that the flow is incompressible (∇·u⃗ = 0).
Their magnitudes determine
the power spectrum E(k),
and are chosen
such that E(k) ∝ k^-5/3
and the rms velocity is u_0.
We chose N=40 with k⃗_n such that the flow is periodic, and with distinct k_n between 2 π/L to 8 π/L, where L=2π is the width of our domain which is also equal to the outer scale, l_0, of the velocity flow.
This flow acts as a dynamo if > ≃ 1000, and produces a spatially intermittent magnetic field,
as can be seen in the left-hand panel of bvec and b2. 

The presence of structures in the magnetic field affects the propagation of cosmic rays, especially for low energy particles.
For such particles, intermittency enhances cosmic ray diffusion <cit.>. 
Here we are interested in exploring the correlation between the magnetic field and cosmic rays.
The intermittent nature of this dynamo-generated magnetic field provides an excellent test case for this study since there are localized regions of strong magnetic field.

We also consider a Gaussian random magnetic field having 
the same power spectrum M_b(k) as the intermittent magnetic field. 
Such a Gaussian random field is obtained as follows: First, a spatial Fourier transform of the intermittent magnetic field is taken and then each complex mode is multiplied with a random phase. 
Then taking an inverse Fourier transform gives a Gaussian randomized magnetic field with unchanged M_b(k), but where coherent structures have been destroyed <cit.>.
The structural difference between intermittent and Gaussian random magnetic field is illustrated in bvec which 
shows the magnetic fields in a 2D cut through the middle of the numerical domain, with colours showing the third component.
Figure <ref> shows the filamentary structure of the 
intermittent magnetic field (at b^2/^2 of order ten).
The probability distribution function (PDF) of a single component of both the intermittent and randomized field is shown in bpdf. The intermittent field has long heavy tails, whereas the
randomized field has a Gaussian probability distribution. 



 §.§ Large-scale magnetic field
 
The ISM contains both fluctuating (small-scale)
and mean (large-scale) magnetic fields 
<cit.>. 
The large-scale component is correlated over several  whereas the small-scale 
component has a correlation length less than the correlation scale of turbulence (≲ 0.1).
The small-scale and the large-scale components of the magnetic field contain comparable energies.
By comparing large-scale magnetic field models (with resolution of ∼ 75) of a spiral galaxy with observations, 
<cit.> found that a spatially uniform distribution of cosmic rays 
was better at matching the observations than an equipartition assumption between cosmic rays and large-scale  
magnetic field. This suggest that the cosmic rays may not be correlated with large-scale magnetic field.

To explore the effects of a large-scale magnetic field on the propagation of cosmic rays,
we add a uniform mean field directed along the x-axis
to the random magnetic field as described in Section <ref>.
We consider several values for
the ratio of the mean field B_0 to the random field, ,
up to B_0/ = 3.








§ COSMIC RAY PROPAGATION
 
The propagation of cosmic rays in random magnetic fields is largely determined by the ratio between the Larmor radius  of 
the particle gyration and the length scale l_b of magnetic field variations, e.g., its correlation length.
The Larmor radius and Larmor frequency of a relativistic particle of 
rest mass m and charge q, 
travelling at a speed v in a magnetic field of strength B, are given by

    = γ m c v/qB        ω_0 = v/,

respectively,
where γ = (1 - v^2/c^2)^-1/2 
is the Lorentz factor, and c is the speed of light in a vacuum. 
The correlation length l_b of an isotropic random field
with power spectrum M_b(k) is defined as <cit.> 

    l_b = π/2∫_0^∞ k^-1 M_b(k)  k/∫_0^∞ M_b(k)   k .

The correlation length of a magnetic field produced by the fluctuation dynamo action is significantly
smaller than l_0, at least in the kinematic stage 
where l_b/l_0 is of order ^-1/2 <cit.>. 
For =3182, we have l_b/l_0≈0.0244.








 §.§ Test particle simulations of cosmic rays

 
We consider relativistic charged particles propagating in a 
static magnetic field, B⃗(x⃗).
The trajectory of each particle satisfies


    ^2r⃗t^2 = v_0/ r⃗t×B⃗/,

where r⃗ is the particle's position,  v_0 is its speed,
B⃗/ is the total magnetic field normalized to its rms value ,
and  is the Larmor radius (defined with respect to ).
The time-scale over which interstellar magnetic fields change significantly is of the order
of the eddy turnover time in interstellar turbulence, 10^7 <cit.>.
This time-scale is longer than the (diffusive) confinement time of cosmic rays in galaxies, which is of the order of 10^6
<cit.>.
It is therefore customary to neglect any time dependence of the magnetic field in lf and, 
correspondingly, neglect any electric fields <cit.>.
This means that the speed of each particle remains constant. This is equivalent
to neglecting particle acceleration, a process physically distinct from diffusive particle 
propagation (which is the focus of this article) which is due to scattering of
cosmic ray particles by magnetic inhomogeneities. Since we consider static magnetic field, the diffusive 
reacceleration <cit.>,
which is due to moving magnetic inhomogeneities, is also neglected.

We solve lf numerically for an ensemble of cosmic ray particles (specifically, 8192),
all of the same speed v_0, but giving each a random initial position and velocity direction.
The initial conditions are chosen randomly, and 
are uniformly distributed over all positions and directions, but do not very uniformly fill the magnetic field cube,
due to there only being a finite number of particles.
For a given energy of particle, we find the smallest Larmor time (2π/ω_0) based on the 
maximum magnetic field in the domain and then fix the time step as 0.001 times the
smallest Larmor time, to ensure that we carefully resolve all particle gyrations. We also check that the energy 
is conserved (as far as is permitted by the numerical scheme) throughout the total propagation time T.
For a given magnetic field configuration, the 
nature of the trajectories depends only on the parameter /l_0, which is indicative of the particle energy, as illustrated in traj.
By construction, the static magnetic field through which the particle propagates is periodic in all three
directions, with period L= 2 π.
Even though the magnetic field is periodic, 
the particle trajectories are not: they enter and leave the domain at different points. 
There is an important distinction between the Eulerian frame of the computational domain and the Lagrangian frame moving with each particle. 
Whilst the magnetic field is periodic in the Eulerian sense, there is no periodicity in the magnetic field along each particle trajectory (however many times the particle enters and leaves the domain).

A high-energy particle, with ≫ l_b, is typically deflected by only a small angle of order l_b/
over a distance l_b and its trajectory is, therefore, rather insensitive to the structural properties of the 
magnetic field at scales smaller than . 
By the central limit theorem, the statistical properties of an ensemble of
cosmic ray particles become Gaussian after a large number of such deflections.
Particles of smaller energies, ≲ l_b,
are more sensitive to the fine structure of the magnetic field,
and it is not obvious how the spatial distribution of such cosmic
rays will be related to the magnetic energy density, especially given that their
diffusion tensor is sensitive to magnetic intermittency  <cit.>.
In particular,
the distribution of cosmic rays may be intermittent in a spatially intermittent magnetic field.
Figure <ref> shows the trajectories of particles of low and high energy (left- and right-hand panels, 
respectively). The latter move
faster (note the different axis scales in the two panels) and, at the scale of the left-hand panel,
the trajectory of the higher-energy particle is nearly straight almost everywhere.

The random nature of the magnetic field makes the particle propagation diffusive at sufficiently
large spatial and temporal scales. Without a mean field, the propagation is isotropic.
We therefore calculate the isotropic diffusion coefficient as the limit of the
finite-time diffusivity κ(t),

    κ = lim_t →∞κ(t),
        κ (t) = 1/6t⟨ |r⃗(t)-r⃗(0)|^2 ⟩,

where
the angular brackets denote averaging over the ensemble of particles.
Figure <ref> shows κ (t) for the two magnetic fields shown in Fig. <ref>,
one intermittent and the other statistically Gaussian, and for several values of /l_0.
In each case there is an initial phase of ballistic particle motion, in which κ(t) is 
approximately linear in t, followed by a diffusive phase where κ(t) 
settles to its asymptotic value. The start of the diffusive phase, ,
is the time when the slope of κ(t) becomes small, κ/(ω_0 t) ≃ 10^-6;
this time is indicated by a vertical dashed line in tdiff.

To obtain the number density of cosmic rays, , from the test particle simulations
we calculate the coordinates of each particle modulo L=2π,
i.e., relative to the periodic magnetic field. Next,
we divide the periodic domain into 512^3 cubes and
count the number of particles within each cube.
The size of the cubes was chosen to match the spatial resolution of the magnetic field,
which was obtained from a dynamo simulation on a 512^3 grid,
but we have checked that the results are not very sensitive to the exact size of the cubes.
The result is the instantaneous number density of the particles ñ(x⃗,t).
We then average the density of particles within each cube over a sufficiently long
period T (≫), to obtain the cosmic ray density 
(x⃗)=(T- )^-1∫_^T ñ(x⃗,t')  t'. 
We have checked that the results are not dependent on the sampling time (t')
as long as it is smaller than a few times the Larmor time (2π/ω_0).
But for lower sampling rate the simulation has to be averaged over a longer total time (higher T) to collect sufficient statistics. 
We note that different energies were simulated over different periods T to obtain
roughly the same ⟨(x⃗)⟩ for all energies.
 

 
 
 
 
 
 
 





 §.§ Magnetic field at the Larmor scale
 
Cosmic ray particles are especially sensitive to magnetic fluctuations at a scale 
comparable to their Larmor radius. As described by <cit.>,
when a cosmic ray particle encounters such a magnetic fluctuation,
its pitch angle θ defined via

    μ≡cosθ = v⃗·B⃗/ |v⃗| |B⃗| ,
    	    v⃗=r⃗t ,

changes by

    δθ = -πδ B/Bcosχ ,

where
δ B/B
is the ratio of the fluctuation amplitude
at the Larmor scale to the local mean magnetic field
(i.e., the field averaged over a scale significantly larger than ), and
χ is the relative phase between the cosmic ray velocity vector and the wavevector
of the magnetic fluctuation with which the particle interacts.

Magnetic fluctuations at the Larmor scale can be 
a part of a magnetic energy spectrum that extends from larger scales or be
excited by cosmic rays themselves via the streaming instability <cit.>.
The latter are usually referred to as `self-generated waves'.
The scattering due to magnetic fluctuations at the Larmor scale is referred to as pitch angle scattering, and <cit.> stress its 
importance for cosmic ray diffusion. The magnitude of the magnetic fluctuations that are associated with
pitch angle scattering due to self-generated waves is estimated in Appendix <ref> as δ B/B≃10^-2 in the hot
interstellar gas.

The spectrum of hydromagnetic turbulence in the ISM extends to very small 
scales. <cit.> suggest that the spectrum of kinetic Alfvén waves is truncated by
dissipation at scales as small as the 
thermal electron Larmor radius, which is approximately 3×10^6 in the warm ionized ISM.
This scale is much smaller than the Larmor radius of the relativistic particles of cosmic rays.
However the spectrum of Alfvén wave turbulence is rather steep:
k^-5/3 at larger scales <cit.> where the gas is collisional and,
at smaller scales, k_∥^-2 
for the perturbations parallel to the magnetic field
<cit.>.
For such steep spectra, the relative magnitude of the magnetic fluctuations at
the Larmor radius of a 5 particle is of the order of δ B/B≃10^-4, which is negligible
in comparison with the self-generated waves.


Within our model the magnetic field is imposed and the streaming instability cannot occur. We
therefore parametrize the cosmic ray scattering by self-generated waves. This is done 
by rotating the velocity vector of each particle every Larmor time (2 π/ ω_0) 
by an angle given by deltatheta, with δ B/B = 10^-2 and χ uniformly distributed between 0 and 2π.
Throughout the text, this is referred to as pitch angle scattering (PAS).











 

















§ RESULTS

Figure <ref> shows the probability density function (PDF) of the particle 
number density 
obtained in intermittent and randomized (Gaussian) magnetic fields.
For cosmic rays of relatively high energy (/l_b > 1 or /l_0 > 0.0244),
the number density  is very nearly uniform in space, and its PDF is Gaussian.
At lower energies, the PDF has a long, heavy tail,
which signifies the presence of spatially localized structures in the cosmic ray
distribution. It is remarkable that the distribution of cosmic rays 
is intermittent in both intermittent and Gaussian magnetic fields. 
The PDF of  on including mean magnetic fields
of various strength, with (right-hand panel) and without (left-hand panel) 
particle pitch angle scattering is shown in ncrpdf2. Here too, 
for low energies the cosmic ray number density distribution has a long tail.




 §.§ Spatial intermittency of cosmic rays

Cosmic rays fill all the volume available.
However, the distribution for low energy cosmic rays (especially for /l_0 = 0.0016 or 
/l_b ≃ 0.06) is not homogeneous.
Random magnetic fields 
produce cosmic ray distributions where a significant fraction of the volume is occupied
by strong particle concentrations. 
The PDFs of  shown in Fig. <ref> have a Gaussian core and a heavy tail,
a manifestation of the spatial intermittency.
The core contains most of the particles and has  close to 
its mean value. The tail represents rare but intense small-scale
spatial structures. 
Figure <ref> shows the number density of cosmic rays, obtained as described 
in Section <ref>, in the intermittent magnetic field
shown in the left-hand panel of bvec and b2. The distribution is inhomogeneous and evidently
sensitive to the magnetic field structure. 
The distribution of cosmic rays is affected by both the mean magnetic field and 
pitch angle scattering.
As shown in ncrpdf2,
the mean magnetic field enhances the intermittency in 
the cosmic ray distribution, whereas
pitch angle scattering reduces it.
Fig. <ref>
illustrates how the shape and number of structures in the cosmic ray distribution are affected.
With a mean field, the structures
are more numerous and many extend along the mean field direction, aligned with the
x-axis in the example shown.
This effect becomes significant when
B_0/≥ 1. 
On the other hand, pitch angle scattering 
enhances cosmic ray diffusion and, consequently, reduces their intermittency, 
as shown in the right-hand panel of Fig. <ref>.
The degree of intermittency can be measured in terms of
the parameter f =  ⟨⟩^2/⟨^2 ⟩
(see Table <ref>).
For high energy particles, /l_0 = 0.1592 or 
/l_b ≃ 6.52,
f is close to unity, indicating a homogeneous particle distribution.
This feature of the cosmic
ray distribution is further detailed in ff where we show the dependence 
of the fractional volume
of a region where /⟨⟩≥ν
on ν for the configurations of Table <ref>. 
Particles of sufficiently high energy, 
/l_b ≫ 1, are not sensitive to the
fine structure of the magnetic field and the 
probability distribution of their number density is Gaussian.
The dependence of the fractional volume, shown in ff, 
on the presence of the mean magnetic field and its change due to pitch angle scattering 
confirms that the spatially intermittency increases on including mean field and decreases on including pitch angle scattering.
Figure <ref> shows the PDF of
magnetic field energy density and cosmic ray distribution for the 
tail region (values higher than the mean for each of the distributions). 
Both distributions are power laws and the exponent for the magnetic field roughly matches that  
for the cosmic ray number density. The cosmic ray distribution for low
energy particles is intermittent with heavy power law tails.





 §.§ Statistical relation between magnetic field and cosmic rays
 
The simplest measure of a relation between
cosmic rays and magnetic field is their cross-correlation coefficient,

    C(,B^2) = 
    	   B^2 
    	  	- n_crB^2/σ_σ_B^2 ,

where the overbar denotes an average over the whole domain, and σ is the standard 
deviation of the quantity specified in the subscript. The value of C ranges from 
C=1 for perfect correlation to C=-1 for perfect anti-correlation.
In all cases considered, we find that the two distributions are uncorrelated,
C≈ 0.
This is true even for the lowest-energy cosmic rays considered (/l_0=0.0016),
despite the fact that they are closely confined to magnetic lines.
The correlation does not emerge even when the cosmic ray density and magnetic 
field are smoothed to a coarser spatial grid. To confirm that this behaviour is not 
an artefact of the initial conditions used for the cosmic ray particles,
we have also performed a simulation with their initial 
positions in the regions of the strongest magnetic field
shown in b2. The value of C in this 
case is very close to unity initially but vanishes quickly, within 
the time .

Figure <ref> shows the scatter plot of the cosmic ray number
density and magnetic field energy density, whose form confirms that 
the two variables are uncorrelated. We also confirm that cosmic 
rays and magnetic field distributions are statistically independent.
As demonstrated in Appendix <ref> (where more details can be found), the joint probability 
distribution function of cosmic rays and magnetic field distributions, p(, b^2), 
can be factorized as follows: 

    p(,b)≈(1.6+9.9
    		^-10.5 b^2/^2) ^-(/⟨⟩-1)^2/0.18 ,

for the intermittent magnetic field and

    p(,b)≈ 0.5 (b^2/^2)^-1^-0.3 ln(b^2/^2)^2^-(/⟨⟩-0.9)^2/0.32 ,

for the randomized (Gaussian) magnetic field. In both cases, 
the joint PDF is separable which illustrates that the cosmic rays and magnetic field distributions are independent
in the diffusive regime of the cosmic rays.







 §.§ Random magnetic traps

Since  is not correlated with the magnetic field strength,
the regions of high cosmic ray density must instead be caused
by some geometrical property of the magnetic field lines.
In fact, we find that these regions occur where cosmic rays become trapped
between two magnetic mirrors,
i.e., positions where magnetic lines converge.
As shown in mir,
if a magnetic flux tube is pinched at both ends,
then particles are repeatedly reflected
between the two ends,
creating a `magnetic trap'.
Because the field lines must be reasonably smooth in order to form a trap,
the regions of high cosmic ray density are typically smaller than the magnetic correlation length, l_b.
The cosine of the particle's pitch angle, μ, defined in mu, is shown in the
right-hand panel of Fig. <ref> as a function of position and magnetic field 
strength. This quantity reverses sign along the trajectory whenever the particle 
is reflected at an end of the magnetic trap. This happens where the magnetic field 
is relatively strong. Magnetic trapping is associated with the conservation of v_⊥^2/B,
an adiabatic invariant <cit.>, where v_⊥=vsinθ is
the particle speed perpendicular to the local magnetic field. We
have verified that v_⊥^2/B=const with relative accuracy
of order 10^-5 along the trajectories of the trapped particles.

We estimate the enhancement of cosmic ray number density due to magnetic traps as follows.
Consider a magnetic trap of a length l in a magnetic flux tube of a radius d. 
For an ensemble of particles within the trap, the expected trapping time τ is d^2/κ_⊥, where κ_⊥ is the local transverse diffusivity of cosmic rays.
Defining N to be the number of times that a particle travels along the trap before leaving it, we 
expect N∼τ v/l.
The resulting 
number density of particles within the trap is given by n_0=Nn_cr
with  n_cr the mean number density of cosmic rays.
The number density of the particles within the trap follows as

    n_0≃v d^2/lκ_⊥n_cr.

According to this order of magnitude estimate, we therefore expect that
the number of trapped particles will depend inversely upon the local cosmic ray diffusivity 
as well as upon the size and number of traps.

A mean magnetic field introduces a specific direction which particles follow
and so increases the probability for a magnetic trap to occur, as shown in
the left-hand panel of ncrconcsec. 
On the other hand, the pitch angle scattering due to self-generated waves
decreases the level of intermittency in the cosmic ray number density, as
shown in the right-hand panel of ncrconcsec, because
it facilitates the transverse diffusion.  When the distribution on the right-hand panel of Fig. <ref>
is smoothed over a coarser scale, it does not correlate with the distribution on the 
left-hand panel of Fig. <ref>. This further illustrates that the pitch angle scattering
not only reduces the length of trapping region but also changes the propagation of particles
significantly.


It is important to note that the spatial intermittency of cosmic rays 
does not require the intermittent structure of the random magnetic field.
Even in the randomized magnetic field, which has an almost perfect Gaussian statistics 
and is free of intermittency, magnetic traps occur and lead to a spatial intermittency
of cosmic rays.



§ CONCLUSIONS AND DISCUSSION

Using test particle simulations of cosmic ray propagation, we have demonstrated that the spatial 
distribution of cosmic rays is not correlated with magnetic field strength on 
spatial scales that are less than (or comparable to) the 
outer scale, l_0, of a random flow that produces magnetic field. 
This implies that the local equipartition between cosmic ray and magnetic field energy 
densities does not occur on these scales. In fact, we find that cosmic ray number density
and magnetic field are approximately statistically independent.

At high energies, > l_b with l_b the correlation length of the magnetic field, the cosmic ray distribution is uniform. 
At low energies, < l_b, the spatial distribution of cosmic rays is 
intermittent in both Gaussian and non-Gaussian (spatially intermittent) magnetic fields.
This occurs because of the presence of magnetic traps in random magnetic fields
where the local magnetic field has a specific structure but is not necessarily
strong. As a result, the cosmic ray number density is not directly related to the 
local magnetic field strength.  

The trapping, and the ensuing intermittency in the cosmic ray distribution, are 
enhanced by a mean magnetic field and reduced by the pitch angle scattering of
cosmic ray particles or any other additional diffusion. The number density
of cosmic ray particles within the traps depends on the size of the trap
and the transverse diffusivity of cosmic rays with respect to the local magnetic field. 
Statistical properties
of the traps (such as their rate of occurrence, size, etc.) are controlled by
subtle properties of the random magnetic field; it appears that finding
them is a non-trivial probabilistic problem.

For cosmic rays to become trapped, their Larmor radius must be
smaller than the correlation length of the magnetic field, i.e., ≤ l_b.
In spiral galaxies, where l_b ≲ 100, the proton energy
in a 5 field with = 100 is 10^8. Thus, the 
trapping of cosmic rays described above should be effective and efficient for 
galactic cosmic rays. 
In galaxy clusters, with l_b≲10 and 
b≃1, protons of energy up to 10^9 can be trapped and thus exhibit
spatial intermittency.
This particle trapping 
can effectively confine higher energy particles for which other confinement
mechanisms (scattering by self-generated waves, magnetic field structure, field line random walk)
are not very active <cit.>.

The lack of correlation between cosmic rays and magnetic field in galaxies at small 
scales (below a few kiloparsecs) is suggested by analyses of the radio–far-infrared 
correlation <cit.>. Here we have presented a physical reason 
for that. Energy equipartition (or pressure balance) 
between cosmic rays and magnetic field may yet hold at
scales much larger than the driving scale of turbulence, l_0≃100
in spiral galaxies and 10 in galaxy clusters.

The assumption of energy equipartition between cosmic rays and magnetic fields,
and related assumptions of their pressure balance or minimum energy,
are routinely used in interpretations of synchrotron observations
<cit.>. Apart from
assuming that the cosmic ray energy density, dominated by protons, is
related to the local magnetic energy density, these interpretations also rely
on a fixed ratio of the number densities of cosmic ray electrons and protons and
presume that the electrons and protons are identically distributed in space. We have 
shown that local, small-scale energy equipartition between cosmic rays and 
random magnetic field does not occur. The spatial distribution of cosmic
ray energy is sensitive to the geometry of magnetic field rather than its strength.
However, the distribution of cosmic ray electrons 
responsible for synchrotron emission must be modelled separately with allowance for 
their synchrotron and inverse-Compton energy losses. We expect that the 
distribution of cosmic ray electrons would differ significantly from that of protons, 
plausibly exhibiting stronger intermittency since the electrons would 
spend more time in magnetic traps as they 
lose their energy. This would mean 
that equipartition-type estimates are even less reliable when applied to the local 
energy densities. 
It cannot be excluded, however, that the spatial distributions of cosmic
ray and magnetic field energy densities are related at larger scales of order
kiloparsec, comparable to the diffusion length of cosmic ray particles over
their confinement time. We shall discuss elsewhere this version of the equipartition arguments.

The intermittency in the distribution of cosmic ray particles discussed above
is a robust feature of their propagation in a random magnetic field that emerges
in both Gaussian and non-Gaussian magnetic fields. This extreme small-scale
inhomogeneity may affect interactions of cosmic rays with interstellar gas
<cit.>, including spallation reactions and 
ionization, e.g., producing strong local variations in the ionization rate. The 
γ-ray emissivity can also be affected by the trapping of cosmic rays 	
particles in random magnetic traps. Quantifying the effect of cosmic ray intermittency on these and other observables (such as spectra)
will require energy losses to be included in the model, which we aim to do in the future.The effects of intermittency in the cosmic ray 
distribution may be numerous and require a careful, systematic study.

Test particle simulations are constrained by the need to resolve the Larmor 
radius and period of the particle gyration.
For this reason, it is not practical
to model those particles of energies of order GeV that contribute most to the 
energy density of cosmic rays if the magnetic field structure is to be resolved
in full. For example, the Larmor radius of a 5 proton in a 5 ISM magnetic field 
is 10^8 times smaller than 100, the typical scale of the magnetic field. Our conclusions are based on an extrapolation of the results obtained for 
particles of effectively much larger energies. Then modelling of cosmic ray propagation at lower energies
requires a fluid model based on a variant of the diffusion-advection equation but
with the diffusion tensor that allows for the non-trivial structure of the magnetic 
field. Such modelling is beyond the scope of this paper but remains our high priority.




§ ACKNOWLEDGMENTS

We are grateful to Ellen Zweibel, Prateek Sharma and Pasquale Blasi for useful discussions. We thank the anonymous referee for her/his helpful suggestions and comments.
This work was supported by the STFC (ST/N000900/1, Project 2), the Leverhulme Trust (RPG-2014-427) and the Thailand Research Fund (RTA5980003).

mnras








§ FINE STRUCTURE OF INTERSTELLAR MAGNETIC FIELDS
 
Several mechanisms produce
the random magnetic fields in the interstellar medium. Tangling of the
large-scale magnetic field by turbulent flows produces a volume-filling random field whose statistical properties
are controlled by the turbulence. This magnetic field is a byproduct of the large-scale (mean-field) dynamo action.
If the turbulent velocity has Gaussian statistical properties, the resulting random magnetic field is also a
Gaussian random field. Random motions can also generate a random magnetic field directly through the small-scale (fluctuation) dynamo action. The resulting magnetic field
is spatially intermittent (magnetic field concentrated in filaments and ribbons) and has strongly non-Gaussian statistical properties 
<cit.>. 
Another similarly structured
contribution is produced by compression in random shock fronts driven
by supernova explosions <cit.>. The result of such compression is a complex random magnetic field 
represented by both Gaussian and non-Gaussian parts that scatter cosmic rays differently <cit.>. 
In this section we estimate the contribution of each of the above mechanisms to the small-scale interstellar magnetic fields. 
For clarity, we denote b⃗_1, b⃗_2 and b⃗_3 the random magnetic fields produced
by tangling of the mean field, by the fluctuation dynamo action and by shock compression, respectively.

The tangling of a large-scale magnetic field B⃗_⃗0⃗ by a random flow u⃗ can be 
described by
the induction equation, indeqn, with magnetic diffusion 
neglected over the time-scales of interest,
∂b⃗_1/∂ t ≈∇×(u⃗×B⃗_⃗0⃗)
<cit.>. 
By order of magnitude, b_1≃ uB_0τ/l, where τ and l are
the relevant time and length scales. Assuming that τ is equal to the eddy turnover time, l/u,
we obtain b_1 ≃ B_0.
This part of the random magnetic field is present wherever B_0≠0, i.e., presumably at all positions.
The strength of the interstellar large-scale magnetic field is controlled by the global properties of ISM, such as
the velocity shear rate due to differential rotation, the Rossby number and the magnetic helicity flux 
<cit.>.
Observations suggests B_0 ≃ 1–5, varying between
galaxies and between various locations within a given galaxy  <cit.>. Thus b_1≃ 1–5.

Magnetic structures produced by the small-scale dynamo due to a turbulent flow, with the kinetic energy
spectrum E∝ k^-s (where k is the wave number), produce magnetic structures of length l_0 that
have a typical width of l_0^-1/2 and thickness l_0^-2/(1+s) <cit.>.
The magnetic correlation length scale l_b discussed in Section <ref> (l_b/l_0≃0.02 in our simulations of the kinematic dynamo)
lies between the three characteristic scales. <cit.> find that 
l_b/l_0≃^-0.4.
<cit.> suggests that the statistically steady (saturated) state of the dynamo corresponds to the
effective value of the magnetic Reynolds number ≃, where ≃10^2–10^3 is the 
critical magnetic Reynolds number for the dynamo action. Then l_b/l_0≃^-0.4≃
0.2–0.05. Given that the magnetic field strength within such structures is close to
energy equipartition with the turbulent energy, the root-mean-square magnetic field strength (averaged
over a volume l_0^3, or larger) follows as 
b_2 ≃(l_b/l_0)^3/2≃^-0.6≃(0.02–0.06)
with =(4πρ u_0^2)^1/2≃5. 
Numerical simulations suggest that the fluctuation dynamo produces a stronger rms magnetic field, 
b_2≃0.3 <cit.> in a saturated state of non-linear dynamo. This implies that random magnetic fields 
outside the filaments and ribbons contribute significantly to the magnetic energy density. 

Another contribution to non-Gaussian magnetic fields in the ISM is due to shocks. Primary and secondary shock fronts produced by supernova explosions and 
strong stellar winds can be described as pervasive shock-wave turbulence in the interstellar medium <cit.>. 
The typical separation between random shocks in the warm interstellar medium is 10^16–10^17 <cit.>. 
The magnetic field associated with shock-wave turbulence has a spectrum close to k^-2 and 
is intermittent at scales smaller than the separation of the shock fronts.
It is reasonable to expect that the energy density of these random magnetic fields is of the same order of 
magnitude as the kinetic energy of turbulence, b_3≃.

Overall, the small scale magnetic field in the ISM is a combination 
of both the non-Gaussian (due to fluctuation dynamo and shocks) and Gaussian (due to tangling of mean field) components of comparable 
energy density. Thus, we consider both the intermittent and randomized field for our study of cosmic ray propagation.

The magnetic field structure is likely to be different in different phases of the ISM. The warm, partially ionized
gas occupies a large fraction of the galactic disc volume and hosts both the large-scale and small-scale dynamos. The
gas has a scale height larger than the disk thickness and flows up to fill the hot galactic corona. Numerical simulations
of the multiphase ISM driven by supernovae suggest that the large-scale magnetic field is 
stronger in the warm phase whereas
random fields are present in all the phases of the ISM <cit.>. Also, scattering of cosmic rays due to self-generated
waves depends on the wave damping mechanisms, which differs in different phases of ISM <cit.>. 
The damping is strongest in the cold phase and is weakest in the hot phase (leading to efficient 
pitch angle scattering of cosmic rays).
So, the structure of the magnetic field and the self-generated waves would vary depending on the phase of the ISM. 




§ MAGNITUDE OF MAGNETIC FLUCTUATIONS AT THE LARMOR SCALE DUE TO SELF-GENERATED WAVES
 
When the  velocity of cosmic rays is greater than the local speed, 
the streaming instability excites Alfvén waves of a wavelength
comparable to the particles' Larmor radius <cit.>.
Cosmic rays (originally propagating at speeds very close to the
speed of light) are slowed down by pitch angle scattering till they move around with the local speed. We assume that the cosmic rays,
moving initially with the speed of light, transfer all of 
their momentum to waves (no damping processes are assumed). 
Using conservation of momentum we can then estimate the maximum possible amplitude (i.e. δ B) of these waves. 

The initial momentum of cosmic rays is

    p = n mv ≃ n mc ≃ϵ/c ,

where n is the number density of cosmic ray particles, m is the 
proton mass, v is the particle speed (taken to be close to c, the speed of 
light) and ϵ is the energy density of cosmic rays.
When all the momentum has been transferred to Alfvén waves, the
bulk speed of the ensemble of cosmic ray particles reduces to the Alfvén 
speed. Momentum conservation then implies that

    p = δ B^2/8π1/V + n m V ,

where δ B is the amplitude of the Alfvén waves generated by the streaming
instability, and V is the local Alfvén speed.
Combining Eqs. (<ref>) and (<ref>), we obtain, for V≪ c,

    ϵ≃δ B^2/8πc/V .

Assuming that the energy density of cosmic rays is comparable to the energy density 
of the magnetic field at larger scales, 
ϵ≃ B^2/(8π), it follows that

    δ B/B≃ (V/c)^1/2.

The pitch angle scattering is most efficient in the hot phase of the ISM 
<cit.>, where B ≃ 5 μG and 
n ≃ 10^-3cm^-3 for the thermal gas number density, 
the speed is of the order of 10^7^-1.
Equation (<ref>) then yields δ B/B ≃ 10^-2. 
Since the damping of Alfvén waves <cit.> is neglected,
this is an upper estimate.

A similar estimate can be obtained without direct appeal to the energy equipartition
between the magnetic fields at a larger scale and cosmic rays. <cit.>, 
using properties of MHD turbulence, obtain δ B/B ≃ (/l_0)^1/4,
where  is the Larmor radius of the particle and l_0 is the outer scale
of turbulence (∼ 100 for the ISM). 
For a 5 proton in a 5 magnetic field, the Larmor radius of the particle is 10^12.
Thus, at that scale, δ B/B ≃ (10^12/10^18)^1/4≃ 10^-2, which agrees with our estimate
in the previous paragraph.









§ STATISTICAL INDEPENDENCE OF COSMIC RAY AND MAGNETIC FIELD DISTRIBUTIONS
 


The distributions of cosmic rays and magnetic field energy density are uncorrelated (as discussed in Sec. <ref>) and we
check for their statistical independence, i.e., whether p(, b^2), the joint
probability distribution function of two components is equal to p()p(b^2), the product
of the probability distribution function of each component. 
This is tested especially for the core region where  is close to its mean value. 
The upper left panels of Figures <ref> and <ref> show the joint probability 
densities of magnetic field strength and cosmic ray number densities
in the intermittent and Gaussian (randomized) magnetic fields,
respectively. We use the Kolmogorov–Smirnov (KS) test to check
whether the two distributions are independent. We perform KS 
test on marginal probability distributions, p(b|)
and p(|b) to check whether each of them are drawn
from the same distribution. This is measured by the D statistics of
the test, which is the absolute maximum distance between the cumulative
distribution function of the two samples.
A value of D smaller than 0.087 represents 95% confidence
that the two samples are drawn from the same distribution.
For this we consider two samples from the marginal probability distribution   
p(b|) with consecutive  (cuts along consecutive values of 
y axis of upper left panel of probint). We performed the KS test for
all such pairs and found the mean value of D to be ≃ 0.062.
A similar calculation for p(|b) gives ≃0.072. 
The mean D values for Gaussian (randomized) magnetic fields are
≃0.054 for p(|b) and ≃0.114 for p(b|) respectively.
The small D
values suggest that the cosmic ray number
density and magnetic field distributions are independent of each other
and the joint probability p(, b^2) can be factorized into 
p() and p(b^2). We find the functional dependence of 
p() on  and p(b^2) on b^2 as follows.
Cuts through the joint PDF in the intermittent magnetic 
field, shown in the upper right panel of Fig. <ref>
are well fitted with a Gaussian which, remarkably, has neither the mean
value nor the standard deviation dependent on b. The dependence
of the maximum value of the conditional PDF p_n(|b^2) on b^2
is shown in the lower left panel of Fig. <ref> together with its
fit with an exponential function.  Thus, the joint PDF of 
and b has the form

    p(,b)≈(1.6+9.9
    		^-10.5 b^2/^2) ^-(/⟨⟩-1)^2/0.18

for 0 ≤ b^2/^2 ≤ 0.3 and 0.25 ≤/≤ 1.75.
The relative accuracy of the fitted parameters is better than 
5 per cent.
This is confirmed by the 2d histogram of the measured and fitted
values of p(,b) shown in the lower left panel of 
Fig. <ref>: for a perfect fit, the points would be all on
the bisector of the quadrant angle. The scatter about that 
line, shown dashed (blue) provides a measure of the accuracy of the fit.
A very small number of points systematically deviate from the main dependence,
yet lying on a straight line as well. The joint PDF is thus factorizable
emphasizing that both the distribution are independent. 
 
Similar analysis for p(,b) in the randomized (Gaussian)
magnetic field is illustrated in probG. As in the intermittent
magnetic field, the joint PDF is roughly factorizable and thus  and b are
statistically independent. The form of the conditional PDF of
magnetic field strength is a lognormal distribution,

    p(b|)≈ 0.5 (b^2/^2)^-1^-0.3 ln(b^2/^2)^2

for 0≤ b^2/^2≤3. We find that 

    p(,b)≈ 0.5 (b^2/^2)^-1^-0.3 ln(b^2/^2)^2^-(/⟨⟩-0.9)^2/0.32 .

The 2d histogram of the measured and fitted values is shown (with the dashed (blue)
line for the perfect match) in the lower right panel of probG.

To summarize, the distributions of cosmic ray number density and
magnetic field strength are statistically independent in the diffusive 
regime of the cosmic rays. In the intermittent magnetic field, the joint 
PDF of  and b is well approximated by a Gaussian in 
and a modified Gaussian in b. In randomized (Gaussian) field, the joint
PDF is approximated by a Gaussian in  and a lognormal distribution in b^2.
The two variables remain statistically independent for cosmic rays of other energies too. 
The exact parameters of the joint PDF are likely to depend on details of the magnetic field structure
and the energy of the particle. 


