Mildly relativistic magnetized shocks in electron-ion plasmas -- II. Particle acceleration and heating

Particle acceleration and heating at mildly relativistic magnetized shocks in electron-ion plasma are investigated with unprecedentedly high-resolution two-dimensional particle-in-cell simulations that include ion-scale shock rippling. Electrons are super-adiabatically heated at the shock, and most of the energy transfer from protons to electrons takes place at or downstream of the shock. We are the first to demonstrate that shock rippling is crucial for the energization of electrons at the shock. They remain well below equipartition with the protons. The downstream electron spectra are approximately thermal with a limited supra-thermal power-law component. Our results are discussed in the context of wakefield acceleration and the modelling of electromagnetic radiation from blazar cores.


INTRODUCTION
High-energy charged particles produce intense nonthermal emission that is observed from many astronomical objects in the Universe. They are also copiously registered at Earth as cosmic rays (CRs) with energy reaching 10 21 eV, and possibly even higher at their sources. The acceleration of these particles is one of the unsolved questions in astrophysics.
Ultra-high-energy cosmic rays (UHECRs) with energies in excess of ∼ 10 18 eV are often associated with relativistic shocks formed in jets of active galactic nuclei (AGN) and/or gamma-ray bursts (GRBs). Blazar jets emit strong nonthermal synchrotron and inverse-Compton radiation across the entire electromagnetic spectrum, which provides evidence for electron acceleration to ultrarelativistic energies in these sources. High-energy electrons are most likely also responsible for the inverse-Compton component of the GRB jet's afterglow emission at sub-TeV γ-ray energies (Acciari et al. 2019a,b;Abdalla et al. 2019). Observations of high-energy neutrinos from the flaring blazar TXS 0506+056 indicate that relativistic jets also produce CR hadrons (IceCube Collaboration et al. 2018).
Extragalactic jets probably harbour shocks whose Lorentz E-mail: jacek.niemiec@ifj.edu.pl factor, γ sh , spans the range from near unity to a few hundred. Diffusive shock acceleration (DSA) may not work at ultra-relativistic (γ sh 1) magnetized outflows, on account of inherent superluminal conditions at such shocks, in which particle diffusion across the magnetic field is suppressed (e.g. Begelman & Kirk 1990;Niemiec, Ostrowski, & Pohl 2006). Particle-in-cell (PIC) simulation studies confirmed that ultrarelativistic shocks cannot be efficient particle accelerators through DSA-like processes unless the plasma magnetization is very small (σ 10 −3 , where σ is the ratio of the Poynting flux to the kinetic energy flux) or the shock is subluminal (Martins et al. 2009;Sironi & Spitkovsky 2009, 2011, see also recent review by Pohl, Hoshino, & Niemiec (2020)).
As an alternative to the DSA model, collective waveparticle interactions can lead to efficient particle acceleration at superluminal magnetized relativistic shocks. Largeamplitude coherent X-mode waves are generated by the synchrotron maser instability (SMI) driven by the particles reflected off the shock-compressed magnetic field. Upstream of the shock they form a so-called precursor wave, which has been demonstrated with particle-in-cell (PIC) simulations for ultrarelativistic shocks (γ sh ≥ 10) in one-dimensional (1D) (e.g. Langdon, Arons, & Max 1988;Hoshino & Arons 1991;Gallant et al. 1992;Hoshino et al. 1992;Amato & Arons 2006;Plotnikov & Sironi 2019) and high-resolution two-dimensional (2D) studies (Iwamoto et al. 2017(Iwamoto et al. , 2018(Iwamoto et al. , 2019Babul & Sironi 2020, see also Plotnikov, Grassi, & Grech (2018)). Strong precursor waves in electron-ion plasma induce in their wake large-amplitude longitudinal electrostatic oscillations (Lyubarsky 2006;Hoshino 2008). Nonlinear collapse of the Langmuir waves generates nonthermal electrons and ions in a way similar to wakefield acceleration (WFA, Hoshino 2008), known from studies of laboratory plasma (e.g. Tajima & Dawson 1979;Kuramitsu et al. 2008). We recently demonstrated that ultrarelativistic shocks with high electron magnetization in electron-ion plasma can accelerate electrons and ions in the turbulent wakefield to power-law spectra with index close to 2 (Iwamoto et al. 2019).
Efficient heating of electrons to equipartition with the ions was reported by Sironi & Spitkovsky (2011) to happen before the flow reaches the shock. This strong electron-ion coupling was argued to operate only for shocks with γ sh (mi/me) 1/3 , where mi/me is the ion-to-electron mass ratio (Lyubarsky 2006). PIC simulations of shocks with γ sh 10 that violate that condition showed very weak or no wakefield and little energy transfer from ions to electrons (Lyubarsky 2006;Sironi & Spitkovsky 2011). However, these simulations were performed at low numerical resolution, whereas high resolution is required to properly account for the upstream wave generation (Iwamoto et al. 2017).
This is the second of two articles in which we study mildly-relativistic strictly perpendicular shocks in electronion plasma with unprecedentedly high-resolution and largescale 2D PIC simulations, that account for ion-scale shock rippling. In Ligorini et al. (2021, hereafter Paper I), we presented the electromagnetic structure of a shock with the Lorentz factor γ sh 3.3 in plasma with total magnetization σ = 0.1. These parameters may be relevant for internal shocks in AGN jets (e.g. Ghisellini, Tavecchio, & Chiaberge 2005). Here we discuss particle acceleration and heating at the shock to estimate the efficiency of WFA and electron-proton coupling in the mildly-relativistic regime. Energy transfer between protons and electrons at mildly-relativistic shocks is of importance in models of synchrotron and inverse-Compton emission from blazar jets. Very strong coupling of electrons and ions would have consequences for the radiation spectra that impose quite strong constraints on the location of the emission sites in the jet and on the pair content (e.g. Sikora et al. 2013). Weak coupling for mildly relativistic conditions may relax some of those constraints.

SIMULATION SETUP
Results presented in this paper are based on the same PIC simulations as in Paper I. Here we briefly reiterate the simulation setup that is illustrated in Fig. 1. Initially cold, v th,beam = 0, electron-ion plasma is reflected off a conducting wall at the left side of the simulation box. Its interaction with the incoming particles provides a shock moving in +x direction. We use a modified version of the relativistic electromagnetic PIC code TRISTAN (Buneman 1993) with MPI-based parallelization (Niemiec et al. 2008) and the option to trace individual particles.
We perform simulations in 2D3V in the x − y plane, in which we track all three components of particle momenta and electromagnetic fields. We probe two configurations of the large-scale perpendicular magnetic field, B0, with respect to the simulation plane -the out-of-plane orientation with ϕB = 90 o (B0 = B0zẑ) and the in-plane setup with ϕB = 0 o (B0 = B0yŷ). Together with B0, the beam carries the motional electric field E0 = −v0 × B0, where v0 is the beam flow velocity.
The final size of our simulation box, that expands in xdirection, is Lx × Ly = 160000 × 5760∆ 2 , where ∆ is the grid cell size. We use the ion skin depth, λsi = c/ωpi, as the unit of length, and Lx × Ly 283 × 10 λ 2 si . Here, the ion plasma frequency is ωpi = e 2 Ni/γ0 0mi, where e is the electron charge, and 0 is the vacuum permittivity. The unit of time is the relativistic ion cyclotron frequency, Ωci = (eB0)/(miγ0). The simulation time is tmaxΩci = 84.3. We also ran a complementary 1D simulation up to tmaxΩci = 163.1.
The numerical resolution is set to λse = 80∆, where λse = me/miλsi is the electron skin depth. This unprecedentedly high resolution is necessary to avoid artificial damping of the precursor waves. 1 The ion skin depth is thus λsi 566∆. We also set the number of particles per cell to Nppc = 10 per species. All parameter values have been selected after extensive tests that are described in detail in Paper I.

ELECTROMAGNETIC SHOCK STRUCTURE
We briefly summarize the shock structure that is in detail discussed in Paper I. As a point of reference, Fig. 2 shows normalized maps of the magnetic field oscillations associated with the X-mode waves, Ex fluctuations, and profiles of transversely averaged electric field, Ex , at time t = tmax for the 1 As discussed in Iwamoto et al. (2017), numerical damping of high-frequency precursor waves may result from the application of digital filtering, used to suppress the numerical short-wavelength Cherenkov modes. Precursor waves must therefore be resolved on scales larger than the wavelengths on which the filters operate. A specific resolution depends on the numerical PIC model used and must be determined through test runs. For each magnetic-field configuration the SMI operates in agreement with theoretical predictions and produces coherent emission of upstream-propagating electromagnetic waves. For out-of-plane magnetic field these precursor waves are entirely of the X-mode type, with fluctuating magnetic field along B0, whereas for in-plane magnetic field mode conversion provides also O-mode waves. The strength of the waves, δB/B0 0.19 for ϕB = 90 o and δB/B0 0.15 for ϕB = 0 o , is much smaller than at high-γ sh shocks, where δB/B0 1, but they persist and have comparable amplitudes as in a 1D simulation. Shock-front corrugation heavily influences the upstream plasma and the structure of downstream turbulence. In particular, it amplifies the precursor waves and counters suppression by the inhomogeneous shock surface and the high temperature of the inflowing plasma. The driver of shock rippling depends on the magnetic-field orientation -it is the process described by Burgess & Scholer (2007) for ϕB = 90 o and the Alfvén Ion Cyclotron (AIC) temperature-anisotropy instability for ϕB = 0 o . The wavelength of the ripples is λ rippl 3.3λsi and λ rippl 5λsi, respectively. For out-ofplane magnetic field the precursor waves are on average emitted obliquely to the shock normal, which reflects wave emission in a direction normal to the local tangent to the ripplings' arcs and the effects of retardation and aberration, as the ripples move with v rippl ≈ 0.8c along the shock surface. The AIC-generated shock front corrugations in the in-plane case are of slightly lower amplitude, and the waves are mostly propagating along the shock normal with only a weak oblique component.
In all simulations we observe density filaments upstream of the shock that are generated by the parametric filamentation instability (Kaw, Schmidt, & Wilcox 1973;Drake et al. 1974). Likewise, in each case electrostatic wakefield of moderate amplitude is excited in the upstream plasma. Using the so-called strength parameter, a = eδE/mecω, where δE is the electricfield amplitude and ω is the wave frequency (Kuramitsu et al. 2008 Fig. 3 shows electron and ion phase-space distributions across the shock, as well as the mean particle kinetic energy, γ − 1 m l c 2 . Electrons streaming toward the shock are accelerated toward it and gradually heated, reaching γ ≈ 20 close to the shock. Panel e) indicates that some 50λsi ahead of the shock the mean electron energy commences a steady but slow growth that results from interactions with the wakefield. We know from Fig. 2 that further away the amplitude of the wakefield does not exceed Ex /B0c ≈ 4 × 10 −3 , and closer than 50λsi to the shock it is only marginally larger than that. Incoming electrons interacting with a Langmuir wave of such amplitude should show an acceleration-deceleration pattern in the mean electron energy that we can indeed see in Fig. 3(e). There is little or no net gain in energy, but the coherent oscillations in velocity can be effectively regarded as heating to the maximum energy (Hoshino 2008

Electron interactions with upstream waves
where L ≈ 1/kL is the scale-length of the wakefield and ξ = 1/2 is appropriate for a linearly polarized precursor wave. We inserted the peak value of the strength parameter, a = 0.3. This energy level is compatible with the typical amplitude of electron energy fluctuations. The electrons with γ ≈ 20 that we noted in Fig. 3 are very few, do not represent the bulk, and are likely involved in nonlinear interactions with the wakefield.
In electron-ion plasma the wakefield is generated by the ponderomotive force on electrons exerted by the precursor wave that leads to collective motion and Langmuir waves (Hoshino 2008). Wakefield formation can be also understood as result of the parametric decay instability (PDI; e.g. Kruer 1988). Parametric instabilities are common wave-wave interactions that arise from wave coupling at a nonlinearity such as a pressure gradient. Frequency and wavenumber matching are consequences of energy and momentum conservation. In our case, nonlinear stimulated Raman scattering turns a large-amplitude electromagnetic (pump) wave into a Langmuir wave and a scattered electromagnetic (light) wave. If the pump wave frequency is much larger than the plasma frequency, we have Forward Raman Scattering (FRS), and the scattered electromagnetic wave and the Langmuir wave propagate in the same direction as the pump wave. In subsequent stages the scattered electromagnetic waves can further decay into other electromagnetic waves and Langmuir waves, and eventually broadband wave spectra can be generated. In the upstream plasma frame, the waves propagate outward, but in the simulation frame part of the electromagnetic and Langmuir waves can propagate in downstream direction (Hoshino 2008). Fig. 2(e) indicates a much higher wakefield amplitude close to the shock than in the far-upstream region, which reflects amplification of precursor-wave emission through shock rippling. We demonstrated in Section 3.2.5 of Paper I, that in the region extending as far as (x − x sh )/λsi ≈ 70 from the shock the wakefield moves toward the shock, which we interpret as a signature of nonlinear FRS, during which the wakefield can collapse and transfer energy to particle heat and bulk acceleration.
As at ultrarelativistic shocks, the downstream-propagating Langmuir waves can resonantly interact with the electrons through the so-called phase-slippage effect, boost them toward the shock, and create an asymmetric wing in the px phase-space distribution. The Langmuir waves also facilitate shock-surfing acceleration (SSA) that would accelerate trapped electrons in the y-direction and cause the anisotropy in the pye distribution toward positive momenta that is evident in Fig. 3(b). The trajectory analysis in Section 4.1.3 demonstrates energy gains and losses correlated with motion in y-direction. Note that also the ions show similar disturbances in their phase-space distribution.
Despite the presence of coherent precursor waves, the bulk energy of electrons increases by only 5% before they hit the shock (see Fig. 3e). Most of the energy transfer from ions to electrons takes place at the shock and in the near-downstream region, as we discuss next.
4.1.2 Downstream particle spectra Fig. 4 shows kinetic-energy spectra of electrons and ions at time tΩci = 84.3, taken in the near-downstream region at x/λsi = 113−123. The particle spectrum represents a steadystate distribution that does not appreciably change with time and distance from the shock. Although some electrons reach energies exceeding the kinetic energy of upstream ions, on average they have only 13% of that of the ions. The two species do not reach the equipartition that is typically observed at ultrarelativistic shocks (e.g. Lyubarsky 2006;Sironi & Spitkovsky 2011). Downstream of the shock ions and electrons carry 81.5% and 10.6% of the initial ion kinetic energy, respectively. In the simulation frame the mean kinetic energy in the upstream region should be similar to that downstream, and so about 8% of the energy are available for transfer to electromagnetic waves and turbulence.
The ion spectrum tends towards a 2D relativistic Maxwellian distribution, (2) The high-energy particles with Lorentz factors up to γi ≈ 6 bounced off the shock and typically perform a single loop in the upstream motional electric field, experiencing one shockdrift acceleration (SDA) cycle. The electron distribution is more asymmetric and best fitted with two Maxwellians. The hotter Maxwellian peaks at (γe − 1)me/mi 0.2, and the other one is about 6 times colder. The electron spectrum also shows a weak supra-thermal component at (γ − 1)/mi 1, that is compatible with a power-law of index p ≈ 2, shown with the yellow dotted line in Fig. 4(b).

Energization processes
Although coherent precursor waves and wakefield exist upstream, they cause only little energy transfer from ions to electrons. Nevertheless, superadiabatic particle heating is observed at the shock, and some supra-thermal electrons are produced. On account of weak electron-ion coupling in the upstream region, the ions enter the shock with much larger energy than do electrons, reach deeper in the shock-compressed magnetic field, and cause charge separation producing electrostatic field in upstream direction. With out-ofplane field, B0 = B0z, particle motion is constrained in the x − y plane, and so the cross-shock electric potential cannot provide electron heating parallel to B0. In this section we analyze particle trajectories to study electron energization at the shock. Fig. 5 illustrates the main stages of electron energization as they cross the shock. The particles are selected in the farupstream region at the same x-location, and they approach the shock ramp at the same time. Some trajectories are shown with thin grey lines in panels (a)-(c), and a single electron in each panel is highlighted in red. The temporal evolution of the kinetic energy averaged over all traced particles, not only those visible in panels (a) to (c), is shown in red in panel (d), where we also plot the normalized work done by the Ex (green line) and Ey (blue line) electric-field components, where i = x, y. The local electric field is measured at the particle position and t0Ωci = 20. Finally, in panel (e) we plot in red the average of the magnetic moment, µ, and the Bz profile (blue line) along the particle trajectories. Here, µ = p ⊥ /(2me|Bp|), where p ⊥ is the transverse momentum of the particles in the local magnetic field, Bp, and µ0 = µ(t0).
As electrons approaching the shock interact with the wakefield, far upstream most of the particles only oscillate in the electrostatic field but do not significantly gain energy. Closer to the shock the wakefield is stronger and the electrons may become decoupled from the bulk flow (compare Sironi & Spitkovsky 2011). SSA kicks in, and the decoupled electrons are accelerated in the y-direction, which should be visible as anisotropy in the pye − x phase-space distribution. To be noted from Fig. 5(a) is that only a small fraction of particles are decoupled from the bulk flow and show smallamplitude oscillations in their trajectories.
A significant impact of the upstream waves can be observed just in front of the shock. Fig. 5(a) shows strong waves emitted by a shock ripple that form an arc-like feature in the Bz distribution and corresponding Ex and Ey components (not shown). The Ex wave field is strong enough to effectively stop an electron and decouple it from the bulk flow. This causes wiggles in the trajectory, well visible for the highlighted electron at (x/λsi, y/λsi) ≈ (33.2, 4.2) and the particles below it at y/λsi ≈ 3.2 − 4 that were smashed by the waves emitted by the lower ripple, and particles at y/λsi ≈ 5.9 − 7.4, affected by the upper ripple. Note, that at time ta the affected electrons have already passed through the waves. After decoupling, the electrons gain significant energy by the Ex field and to a lesser degree by the motional Ey field. The strong electrostatic Ex field is a combination of the strong wakefield close to the ripple and the standard cross-shock field. The jump in the average magnetic moment (panel (e)) indicates that energization at this stage is nonadiabatic.
This scenario of electron acceleration close to the shock is a crucial and necessary step for their subsequent energization.
It fully relies on strong rippling of our mildly relativistic shock and is, to our knowledge, described here for the first time.
Deeper in the shock, electrons are adiabatically heated while they undergo E × B drift in the −ExBzŷ direction with the same speed as the shock ripples. The combination of penetration and drifting of ions causes the charge-separation electric field in the ripples whose components have amplitudes Ex ≈ Ey E0. In the simulation frame the electrons are dragged together with the ripples and are accelerated by the Ey field and decelerated by the Ex field. Hence the components of work (γ − 1)E x and (γ − 1)E y diverge at t ta. The drifting of electrons is evident in Fig. 5(b).
Obviously, the behavior of individual particles may differ from that of the average particle. Electrons that decoupled from the bulk flow in the upstream region and started gyrating there may hit the shock with unfavorably low energy. After adiabatic heating at the shock they will be advected downstream and form the thermal pool together with electrons that passed through the shock without interacting with the ripple structures.
Having non-adiabatically gained energy around time ta, the average electron resides at the overshoot, and its further energy evolution is predominantly adiabatic. Fig. 5 illustrates that around time t b the magnetic moment is conserved while the magnetic field becomes weaker, which results in a gradual energy loss due to decompression. Later, around t ≈ tc, the mean electron energy again increases, associated with a second jump of the magnetic moment. The particle trajectories in panel (c) show that the gyroradii of some electrons are comparable to the scale of the turbulent field, allowing resonant scattering off these waves. Essentially all electrons with Lorentz factor γe 10 can gain energy in this way and populate the high-energy wing of the spectrum downstream.
At times t > tc the average electron energy saturates, probably for want of large-scale turbulence with which they could interact. The turbulence exists only in a narrow zone downstream of the overshoot, and its scale is commensurate with the ripple wavelength.
The features discussed here for the average electron can explain the downstream electron spectrum as shaped by a single population of particles that was energized in the shock. The particles, that decoupled from the bulk flow in the upstream region and were energized through ripple-mediated processes, can experience further acceleration in resonant interactions with turbulence. A consequence is the smooth transition between the low-energy and high-energy component in the electron spectrum. Some energization at the shock can be described as a stochastic second-order Fermi process. An example is given by the particle shown in Fig. 6. After decoupling from the flow this electron experienced multiple instances of inelastic scattering in the shock transition, gaining energy on average and finally reaching γe ≈ 80. Such particles form the supra-thermal power-law portion of the electron spectrum. Most of the scattering is less successful, and the electrons are in the bulk of the population. In our mildly relativistic magnetized shock, the layer of strong electromagnetic turbulence is relatively narrow, and stochastic scattering does not provide significant energy gain to the average electron.
Double-Maxwellian downstream electron distributions were reported before for ultrarelativistic superluminal shocks (Sironi & Spitkovsky 2011). However, their high-energy spectral component results from energization through wakefield in the shock upstream, that is not efficient in our mildly relativistic shock. Here, the formation of the hotter Maxwellian and its supra-thermal component entirely results from electron interactions with turbulence at the shock and downstream, that is related to the shock ripples.

Upstream particle-wave interactions and downstream spectra
For the in-plane case the phase-space distributions of electrons and ions and the mean kinetic-energy profiles presented in Fig. 7 are very similar to those for the simulation with ϕB = 90 o . The amplitudes of the precursor waves and the wakefield are compatible in both runs, and so essentially the same physical mechanisms of wave-particle interaction operate. In particular, electrons can be accelerated by strong wakefield propagating toward the shock, reach energies in excess of γe ∼ 20, and develop anisotropy in the pxe distribution. SSA works as well, although the corresponding pze anisotropy along the motional electric field cannot be observed in our 2D simulation. The bulk energy gain of electrons before they reach the shock is again about 5% of their initial kinetic energy, and the electrons and ions are far from energy equipartition. Fig. 8 shows downstream particle spectra. As with outof-plane magnetic field, the ions are in the process of thermalization, and the reflected particles undergo SDA at the shock. The electron distribution is close to a combination of two 3D Maxwellians with moderately different temperature,  each described by A single 3D Maxwellian provides a slightly worse fit. Inset (b) of Fig. 8 features a weak supra-thermal component with spectral index p ≈ 2, similar to that in the out-of-plane simulation.
Downstream of the shock electrons and ions are far from energy equipartition, as in the setup with ϕB = 90 o . To facilitate a direct comparison, in Fig. 9 we once again show the electron spectra for both 2D runs and also for a 1D simulation. With in-plane field, the downstream electrons carry 12.6% of the initial ion kinetic energy, the ions account for 77.2%, and the rest is available for fields and turbulence. The electron/ion energy ratio is thus slightly larger in the in-plane Figure 10. Trajectories of electrons (a-c), the evolution of the average kinetic energy and electric work (d), and the magnetic moment and the magnetic-field profile (e) in the simulation with ϕ B = 0 o . The format is the same as in Fig. 5, except that the normalized magnitude of the magnetic field, |B|/B 0 , is shown in panels (a-c) and (e), and the acceleration rates are split into components parallel (blue line) and perpendicular (green line) to the local magnetic field. For (γ − 1) Epar we also show its y-component in orange. The inset in panel (b) shows zoom-in of the fields configuration in a region marked with a square box, where red arrows present the in-plane electric field, black lines the contours of the Az-component of the vector potential (displaying the in-plane magnetic field lines), and the green thick line shows the region with strong electric field parallel to the magnetic field.
case, but comparable in both 2D runs. In 1D simulations the coupling is slightly stronger, the electrons gain 16, 8% of the energy, which is still well below equipartition.

Electron energization mechanisms
As for the out-of-plane run in Section 4.1.3, we describe electron heating and acceleration by analyzing the behaviour of traced particles. Fig. 10 illustrates the main electron energization phases in a format similar to that in Fig. 5. We split the work done by the electric field into components parallel and perpendicular to the local magnetic field (see caption of Fig. 10).
Qualitatively, with in-plane B0 the electron energization proceeds as described for ϕB = 90 o . Generally, particles that later gain significant energy are decoupled from the bulk flow when interacting with large-amplitude waves emitted by the ripples. An initial energy gain at time t = ta is provided by the perpendicular electric field components, Ex and the motional electric field, Ez. The magnetic moment increases. Note, that magnetic gyration proceeds in the x−z plane, and the E × B drift motion due to the Ex field is normal to the simulation plane and hence not visible.
At the shock the particles are adiabatically heated, and the magnetic moment remains roughly constant until the electrons come close to the overshoot at time t b (Fig. 10b). Then the magnetic moment starts to increase, and particles significantly gain energy as work of the y-component of the parallel electric field. The inset in panel (b) shows that magneticfield-aligned electric fields exist everywhere along the magnetic overshoot. Their structure in the larger context of the overshoot is shown in Fig. 11.
At the overshoot the density of ions is much larger than that of electrons, on account of ion deceleration during reflection in the shock-compressed magnetic field. Chargeseparation causes a strong electrostatic field associated with the cross-shock potential that reflects the ions and pulls the electrons toward downstream. In a laminar shock the cross- Figure 11. Normalized charge density (left panel) and the electricfield component aligned with the magnetic field (right panel) at time tΩce = 24.2 in a region around the shock overshoot. Red arrows show the in-plane electric field. Magnetic field lines in the right panel are shown with black and magenta lines, the latter highlighting the region, in which Epar has a substantial amplitude.
shock electric field is aligned with the shock normal, i.e., lies in x-direction in our setup and flips sign at the overshoot. The red arrows in Fig. 11 in principle conform with this picture, but it is also evident that the electric field follows a complex set of thin and highly warped filaments. The charge-separation field thus acquires a component along the magnetic field, that is largely in the y-direction. The red trajectory in Fig. 10(b) gives an example of an electron that moves freely along the magnetic field and is efficiently accelerated by the aligned electric field.
Electrostatic field perpendicular to the shock normal is quite common in nonrelativistic systems. Electrons that are accelerated by the cross-shock potential can excite the twostream instabilities (Thomsen et al. 1983;Goodrich & Scudder 1984) and may do so here. Fig. 11 demonstrates modulation of the overshoot structure by the shock ripples. The presence of modulations at scales of the ion skin depth and smaller suggests that other instabilities may also operate in the overshoot. Disentangling the coupling between these unstable modes is difficult and beyond the scope of this paper. We do note that the role of the E field is observable only with the in-plane magnetic-field configuration. The strength of this electric field component is much larger than that typically observed at nonrelativistic shocks and may be specific to mildly relativistic and magnetized shocks. After crossing the overshoot the average kinetic energy of the particles and the magnetic moment keep increasing, despite the magnetic-field decompression. As with out-of-plane B0, this nonadiabatic acceleration is due to gyroresonant or stochastic scattering of electrons off downstream turbulence created at shock front ripples (Fig. 10c). Note, that magnetic-field aligned electric field persists in an extended region past the overshoot.

SUMMARY AND CONCLUSIONS
This work is the second of two articles in which we use PIC simulations to investigate mildly-relativistic superluminal magnetized shocks in electron-ion plasma. Paper I described the electromagnetic shock structure, plasma instabil-ities, and waves. Here we discussed particle acceleration and heating.
It has been suggested that wakefield acceleration at ultrarelativistic shocks may account for the production of highly energetic particles through nonlinear collapse of the waves (Lyubarsky 2006;Hoshino 2008;Iwamoto et al. 2017Iwamoto et al. , 2018Iwamoto et al. , 2019. At mildly relativistic shocks, shock ripples at times generate strong precursor waves that lead to nonlinear wakefield amplitudes. Then nonlinear FRS is triggered, producing downstream-propagating wakefield that accelerates electrons through the phase-slippage effect combined with SSA (Hoshino 2008). However, the WFA is less efficient than in the ultrarelativistic regime, and only few particles reach the bulk energy of upstream ions, much less exceed it. Consequently, and in contrast to ultrarelativistic shocks, electrons and ions do not reach equipartition by the time they arrive at the shock.
The ion-to-electron energy transfer is comparable for inplane and out-of-plane magnetic field. In both cases it is far below equipartition, with electrons on average carrying 11% − 13% of the initial ion kinetic energy or six times their own initial energy. Going beyond adiabatic compression at the shock, most of the energy transfer takes place at the shock and immediately downstream. The downstream electron spectra are close to thermal distributions with small supra-thermal components. Shock rippling is crucial for electron energization. Strong precursor waves emitted by the shock ripples excite wakefield that decouples particles from the bulk flow. They are then further accelerated in the electrostatic field at the shock.
With the out-of-plane magnetic field, electrons crossing the shock ramp experience adiabatic heating in the overshoot. Particles that were significantly accelerated at the rippled shock front now have gyro-radii comparable to scale of the downstream turbulence, and they can gain more energy through resonant wave-particle interactions. Stochastic second-order Fermi-like scattering also provides some particles with supra-thermal energies. Similar processes shape the downstream energy spectra for the in-plane magnetic field scenario. In addition, significant energization happens at the overshoot, where charge-separation associated with the crossshock potential and modified by the shock ripples reorganizes the electric field into a complex structure of warped filaments. Electric and magnetic fields partially align, leading to efficient electron acceleration.
We argued in Paper I that SMI-generated precursor waves should persist in realistic 3D systems and generate wakefield. We expected that the precursor waves have similar strength in 3D and in 2D, and that shock rippling operates to amplify them. This rippling operates on small scales and is not to be confused with MHD-scale rippling that results from fluctuations in the upstream medium (Lemoine, Ramos, & Gremillet 2016). Similar conclusions should apply to the particleenergization efficiency. For both magnetic-field configurations we observe similar processes that heat and accelerate electrons and thermalize the ions, although for the in-plane configuration in 2D cross-field diffusion is suppressed (Jokipii, Kota, & Giacalone 1993). The coherence of the precursor waves is likely not higher in 3D than in lower-dimensional simulations. We conclude that the particle-acceleration efficiency is expected to be at most the same in 3D as it is in 2D simulations, and we do not anticipate a stronger ion-electron coupling in three-dimensional studies of ion-electron shocks. At ultrarelativistic superluminal shocks, in which the energy transfer occurs in the turbulent precursor, the level of coupling increases with the shock obliquity as the strength of the precursor wave is larger for obliquities approaching a strictly perpendicular configuration (Lyubarsky 2006;Sironi & Spitkovsky 2011). Future studies may explore whether shock rippling can enhance the coupling at not strictly perpendicular mildly relativistic shocks.
The absence of energy equipartition between ions and electrons has important astrophysical implications. The presence of ions in blazar jets appears to be energetically required (Celotti & Ghisellini 2008). It is evident that high-energy emission from blazars requires a particle energy much in excess of that seen in our simulation. A second-stage acceleration to TeV-scale energies is required, whatever the type of radiating particle. Diffusive shock acceleration at mildly relativistic shocks is a possible process, because it can extract a large fraction of the jet energy flux and the post-shock plasma can be reasonably well confined (Marcowith et al. 2016;Pelletier et al. 2017). In blazar jets internal shocks are magnetized and likely superluminal though, which strongly limits the efficiency of shock acceleration and suggests that other processes may be at play. Our simulations suggest that WFA is not one of them, at least for mildly relativistic systems. Weakly magnetized ultrarelativistic shocks can also not accelerate to very high energies (Reville & Bell 2014). It is possible that shocks in blazar jets do not produce the highenergy particles that produce their X-ray and gamma-ray emission, and instead turbulence provides stochastic acceleration in a larger volume (e.g. Chen, Pohl, & Böttcher 2015;Chen et al. 2016).
The pre-acceleration at the shock provides the initial condition for the subsequent acceleration to the TeV scale. It also shapes the electron spectra below the GeV scale, whose observational consequences can be used to make inferences about electron-ion coupling in blazar jets. If there were equipartition between ions and electrons, one would find few electrons with Lorentz factor γe 10 3 . Indeed, internal-shock models for blazar jets tend to require electron-ion equipartition to reproduce blazars SEDs (see, e.g., Spada et al. 2001). It is also implicitely called for in the radiation modelling, where it appears as minimum Lorentz factor of electrons (Dermer et al. 2009;Archambault et al. 2016), otherwise the models predict too much flux in X-rays and soft gamma rays. There is explicit evidence for a low-energy cut-off at γ ≈ 10 4 in the electron spectrum in the lobes of a radio galaxy (Blundell et al. 2006).
Leptonic blazar models are based on either external Compton scattering or the internal synchrotron-self-Compton process, or a combination of the two. External Compton scattering with strong electron-ion coupling, i.e. γ 10 4 , would give X-ray spectra that are much harder than observed (see, e.g., Sikora et al. 2013). Better agreement is reached, if the electrons would have cooled to low energies, resulting in a low-energy spectral tail ∝ γ −2 , that would produce consistent X-ray spectra by synchrotron-self-Compton scattering. The energy loss time of γ = 100 electrons in blazar jets is on the order of years, and so cooling tails would not be expected during flares, but rather for baseline conditions. Our simulations suggest that there is a large population of low-energy electrons on account of limited electron-ion coupling, from which particles are accelerated to very high energies. Then the low-energy part of the electron spectrum would not need cooling to form, and the observed X-ray spectra would be naturally explained.
Recently, a high-energy neutrino event was observed in association with the flaring blazar TXS 0506+056 (Ansoldi et al. 2018). This result requires the presence of ultrarelativistic protons in these sources and seems to exclude pure pair plasma in the jets, at least for this particular source. In mixed plasma composed of ions, electrons, and positrons an additional process may operate that accelerates electrons and positrons. Reflected ions gyrating at the shock emit lefthanded elliptically polarized magnetosonic waves with frequencies that are harmonics of the ion cyclotron frequency (the ion SMI). If the spectrum of the ion-emitted waves has enough power at high harmonics at and above the cyclotron frequencies of positrons and electrons, then positrons traversing the shock can be efficiently accelerated to non-thermal energies through resonant relativistic synchrotron absorption of the magnetosonic waves (Hoshino & Arons 1991;Hoshino et al. 1992). Non-thermal electrons are also created, but not as efficiently on account of the left-handed polarization of the ion waves (Amato & Arons 2006;Stockem et al. 2012). New high-resolution and large-scale PIC simulations are necessary to investigate in 2D this scenario for mildly relativistic shocks in ion-pair plasmas.