Shock Breakout from Stellar Envelopes: The relativistic limit

We calculate the observed luminosity and spectrum following the emergence of a relativistic shock wave from a stellar edges. Shock waves propagating at $0.6<\Gamma_\text{sh}\beta_\text{sh}$, where $\Gamma_\text{sh}$ is the shock Lorentz factor and $\beta_\text{sh}$ is its associated reduced velocity, heat the stellar envelope to temperatures exceeding $\sim 50$ keV, allowing for a vigorous production of electron and positron pairs. Pairs significantly increase the electron scattering optical depth and regulate the temperature through photon generation, producing distinct observational signatures in the escaping emission. Assuming Wien equilibrium, we find analytic expressions for the temperature and pair density profiles in the envelope immediately after shock passage, and compute the emission during the expansion phase. Our analysis shows that in pair loaded regions, photons are produced at a roughly uniform rest frame energy of $\sim 200$ keV, and reinforces previous estimates that the shock breakout signal will be detected as a short burst of energetic $\gamma$-ray photons, followed by a longer phase of X-ray emission. We test our model on a sample of low-luminosity gamma ray bursts using a closure relation between the $\gamma$-ray burst duration, the radiation temperature and the $\gamma$-ray isotropic equivalent energy, and find that some of the events are consistent with the relativistic shock breakout model. Finally, we apply our results to explosions in white dwarfs and neutron stars, and find that typical type Ia supernovae emit $\sim 10^{41}$ erg in the form of $\sim 1$ MeV photons.


INTRODUCTION
Shock waves produced in stellar explosions such as supernovae (SNe) gain initial characteristic velocities of the order v sh ∼ 2E exp /M ej , where E exp is the energy of the explosion and M ej is the ejected mass. Typical combinations of E exp and M ej (E exp ∼ 10 51 erg and M ej ∼ 1 − 10 M ) produce shock waves moving at Newtonian velocities of v sh ∼ 2, 000 − 7000 km s −1 . As a shock wave propagates in the internal regions of the star, it decelerates while depositing its energy in the stellar material, but starts accelerating once it encounters the steeply decreasing density profile at the edge of the stellar envelope: where R * is the stellar radius, r is the radial distance from the centre of the star, ρ * is a constant and the power law index n is determined by the adiabatic nature of the envelope, where n = 3 for radiative envelopes and n = 3/2 for convective envelopes. Depending on the explosion energy and the stellar radius, the shock may remain Newtonian or accelerate to relativistic velocities before the decreasing optical depth can no longer support it, and the shock breaks out of the star. At Newtonian velocities, β sh ≡ v sh /c 1 where c is the speed of light, the shock accelerates according to v sh ∝ ρ −0.19 (Sakurai 1960), and may reach 5, 000−10, 000 km s −1 in Red Supergiant explosions, or 30, 000 − 100, 000 km s −1 in explosions of Wolf-Rayet stars (e.g., Nakar & Sari 2010;Faran & Sari 2019). However, if the explosion is extremely energetic or takes place in a compact object like a white dwarf (WD) or a neutron star (NS), the shock may accelerate to mildly relativistic or even relativistic velocities, in which case the shock velocity evolves as Γ sh β sh ∝ t −0.23n , where Γ sh is the shock Lorentz factor and β sh its corresponding reduced velocity and t is the lab frame time, which decreases to 0 as the shock approaches the stellar surface. Hydrodynamic solutions for shocked relativistic flows can be found in e.g., Johnson & McKee (1971), Blandford & McKee (1976), Sari (2006) and Pan & Sari (2006).
As long as the shock propagates in the optically thick envelope of the star, the processes that decelerate the incoming flow (as seen in the shock frame) are governed by photon interactions such as Compton scattering, and under some conditions electron-positron pair-production, and the shock is therefore mediated by radiation. A deceleration zone of order a few photon diffusion lengths separates the upstream and the downstream, constituting the width of the shock (see e.g., Levinson & Nakar 2020, for a review). A radiation mediated shock wave can survive in the stellar envelope as long as the optical depth of the medium ahead of it is much larger than its width. Once the diffusion time of photons in the downstream (propagating towards the upstream) becomes comparable to the dynamical time of the shock, the photons that decelerate the incoming flow can escape to the upstream and the shock can no longer be sustained. This implies that the shock breaks out of the star once the electron scattering optical depth ahead of it becomes smaller than c/v sh . Photons escaping the shock deceleration zone give rise to the shock breakout emission, which is the first electromagnetic signal arriving from the explosion, typically in the UV to X-ray regime when the shock in Newtonian at breakout and in the γ-ray regime when it is relativistic. The breakout pulse is followed by the diffusion of photons from deeper regions inside the envelope that become optically thin due to expansion, often referred to as the 'shock cooling' emission.
The observed properties of Newtonian shock breakout and shock cooling emission have been discussed extensively in the literature (e.g., by Matzner & McKee 1999;Nakar & Sari 2010;Rabinak & Waxman 2011;Faran & Sari 2019;Kozyreva et al. 2020;Goldberg & Bildsten 2020) and are relatively well understood. However, the physics of shock breakout is more complicated in the relativistic regime. Once the temperature in the immediate downstream exceeds ∼ 50 keV, pairs of electron and positron begin to form in significant amounts, increasing the number density of leptons and the electronscattering optical depth. We denote the positron fraction with respect to protons as where n + and n p are the positron and proton number densities, respectively. Following the above definition, the electron number density is n − = n p (1 + z + ). A high multiplicity of pairs in the shocked envelope is expected to affect the observed signal, as will be shown in this work.
If advection of photons from the upstream dominates over photon generation in the downstream of the shock, like in subphotospheric internal shocks in GRBs, the shock is called 'photon rich' (Beloborodov 2017;Ito et al. 2018;Lundman et al. 2018;Lundman & Beloborodov 2019). In this paper we are concerned with the 'photon poor' regime, in which most of the radiation is generated by local processes in the downstream. This scenario is appropriate for describing shocks propagating in undisrupted stellar envelopes. Photon poor radiation mediated shocks attain higher downstream temperatures and therefore pair creation becomes significant already at sub relativistic speeds, in contrast to Γ sh β sh > 2 in photon rich shocks (Ito et al. 2018;Lundman et al. 2018). Until now, only a handful of works have treated the problem of photon poor relativistic shock breakout under the effect of pair production. Budnik et al. (2010) and Ito et al. (2018) calculate the profiles of the Lorentz factor, pair density and temperature in the deceleration zone of relativistic radiation mediated shocks that propagate in a cold electron-proton plasma, using detailed numerical simulations. They also calculate the emerging photon spectrum in the immediate downstream, that would constitute the breakout emission. Granot et al. (2018) develop an analytic model for a relativistic shock breakout from a stellar wind, and find predictions for the properties of the breakout signal, and Katz et al. (2010) find the radiation properties in the immediate downstream of a relativistic shock. All of the aforementioned studies treat only the breakout emission that originates from the shock deceleration region and the immediate downstream. However, the breakout signal is emitted over extremely short times scales (less than a millisecond) and is very faint, since only a small fraction of the shock energy is deposited in the layer from which the shock breaks out. Most of the energy is stored in deeper regions of the ejecta, and is emitted during the expansion phase of the envelope. The post breakout expansion dynamics are divided into a planar phase, before the radius of the envelope has doubled in size, and a spherical phase, in which the position of each fluid element evolves like r ∝ v · t , where v is the velocity. Nakar & Sari (2012) calculate the observed luminosity and spectrum following a relativistic shock breakout during the planar and spherical phases, while restricting their discussion to cases in which the relativistic ejecta ends its postbreakout acceleration during the planar phase. They do not, however, solve for the exact temperature profile inside the envelope, and instead put an estimate on the post shock temperature.
In this work, we solve for the temperature and pair density profiles in the outer, post shock envelope, and calculate the properties of the escaping photons during planar and spherical expansion. We require that the medium is in a steady state of pair production and annihilation, assuming that photons form a Wien spectral distribution. The validity of this assumption is verified in a parallel publication (Faran & Sari in prep,hereafter FS22), and is shortly discussed in Appendix A. We are therefore able to perform a robust calculation of the radiation properties of the pair loaded plasma. We also consider cases in which the post breakout acceleration proceeds during the spherical phase, and find the terminal Lorentz factor acquired by fluid elements during spherical acceleration. This enables us to also treat the breakout of ultra-relativistic shock waves.
The structure of the paper is as follows: in section 2 we summarize the equations governing our steady state model. In Section 3 we compute the envelope properties immediately after shock passage, and describe the hydrodynamics of planar and spherical expansion in section 4. The observed properties are calculated in Section 5 and applied to different systems in Section 6. We summarize and discuss our results in Section 7.

PAIR-LOADED EQUILIBRIUM PLASMA
In this section we describe the equations governing the pair-loaded stellar envelope after the passage of a relativistic shock wave. We use the following dimensionless parameters for the reduced temperature and the reduced photon energy where T is the temperature, k B is the Boltzmann constant, m e the electron mass, h Planck's constant and ν the photon frequency, measured in the fluid rest frame. We use unprimed symbols to denote quantities measured in the rest frame of the fluid, while primed symbols denote quantities measured in the upstream (lab) frame. The total photon density: In the optically thick regions of the stellar envelope, photon diffusion is unimportant relative to photon production. In addition, owing to the high temperatures expected in the downstream of relativistic shock waves, thermal equilibrium can only be achieved deep inside the envelope, where the temperatures are too low to allow for the existence of pairs. We therefore do not include photon escape nor absorption in our equations for the optically thick, pair loaded plasma (we do account for absorption in terms of the minimal energy below which the spectrum becomes a blackbody). In an optically thick plasma, the two main emission processes that dominate photon production are free-free and double-Compton (DC) emission, and the total photon density is given by: whereṅ ff andṅ DC are the photon production rates of free-free and double-Compton, respectively, and t is the available time for photon production in the rest frame of the fluid. There are generally two main contributions to the free-free emission rate: electron-proton and electron-positron bremsstrahlung, where the latter is the dominant process in pair-loaded plasma. Since we are concerned with the limit of 1 z + , only the second term is important and the free-free photon emission rate iṡ where α = 1/137 is the fine structure constant, Λ = log (θ/x m ), g ff log 4η θ/x m , η exp(−0.58) and g WE ≈ 1 + 3.76θ + 5.10θ 2 is a numerically fitted polynomial and is accurate to 0.06% (Svensson 1984). The photon energy x m is the typical photon energy below which the spectrum becomes a Planckian. This frequency is determined by the requirement that the time-scale for Compton upscattering to the Wien peak is equal to the free-free absorption time scale. Since the plasma temperature is mildly relativistic, only one scattering is required to change the photon energy considerably. In the limit of z + 1, the lowest photon energy that can upscatter to the Wien peak is where g KN is the Klein-Nishina correction factor (see Section 3) and λ = h/(m e c) is the Compton wavelength. For typical values of θ = 0.15, n p = 10 15 cm −3 , z + = 10 3 and g ff = 10, we find that Λ = log(θ/x ff m ) 12. The DC photon production rate is important only when the envelope is pair loaded, and produces photons at a rate ofṅ where g DC (1 + 13.91θ) −1 and we assume a Wien spectral distribution. In pair dominated plasmas, the DC rate dominates over free-free at temperatures θ < 0.1 since it requires high photon densities with respect to the lepton density (see Svensson 1984). When DC is the dominant photon production process, the expression for x m at z + 1 is θ 5/4 e 1/2θ (λ 3 n + ) 1/2 .
(9) Typical values for regions dominated by DC of θ = 0.08, n p = 10 15 cm −3 and z + = 10 also give Λ = log(θ/x DC m ) 12. Pair production and annihilation: Under the conditions that prevail in stellar envelopes, the main mechanism for pair production is photon-photon interaction (e.g., Svensson 1982Svensson , 1984. Two photons of energies E 1 and E 2 in their centre of momentum frame can produce an electron-positron pair if √ E 1 E 2 ≥ m e c 2 . Nevertheless, since the radiation in the downstream forms a spectral distribution that is close to Wien (see Appendix A), there are enough 'pair-producing' photons at hν ∼ m e c 2 beyond the Wien peak even though k B T < m e c 2 . The shocked plasma is required to be in a state of pair equilibrium, namely, a steady state exists between pair production and annihilation. Pairs are produced by energetic photons created in local emission and scattering processes. Given a Wien spectral distribution, photons create pairs at a rate oḟ The reverse process of pair annihilation at nonrelativistic temperatures (θ 1) occurs at a rate oḟ This reaction releases two photons at an energy of m e c 2 . However, these photons are not included in the photon balance equation since the net production rate of photons from pair annihilation and photon-photon (γγ)-pair production is zero. Steady state between pair production and annihilation implieṡ Svensson (1982Svensson ( , 1984 find that there exists a critical temperature, which is dependent on the optical depth, above which pair annihilation is not able to balance pair production, and equilibrium cannot be achieved. However, the reason for this limit is a high temperature (1 < θ) correction to the pair annihilation cross section, which reduces the annihilation rate. At the temperature range relevant to this work a steady state solution always exists. Energy balance: The downstream gas is heated by the shock wave and the energy is distributed among all plasma constituents and the photons. Pairs are thermally coupled to the protons and the radiation, and the following energy conservation equation holds where is the internal energy density. Wien equilibrium: Wien equilibrium (WE) implies that the photon chemical potential satisfies µ γ 1 and can be achieved through detailed balance for Compton scattering, and γγ-pair production and annihilation. For a Wien spectral density, a very simple relation between n γ , n + and θ can be obtained from equations (10), (11) and (12): where K 2 (x) is the modified Bessel function of the second kind. For non-relativistic temperatures (θ < 1), n γ /n + 1, while this ratio approaches unity when θ 1.

THE INITIAL CONDITIONS AFTER SHOCK PASSAGE
In the following, we find the initial conditions in the envelope immediately after shock passage, as dictated by the shock jump conditions and by the model described in Section 2. It is convenient to treat the stellar envelope as a sequence of successive shells, inside each the hydrodynamic and radiative properties, such as the density, velocity, and energy, as well as the photon density and temperature, are considered uniform. The depth inside the medium is characterised by the Lagrangian mass coordinate, m, defined to be the integrated mass from the edge of the medium (m = 0) and increasing inwards up to the total ejecta mass M ej at the base of the envelope. In the pre-shocked envelope, each shell has a 'pair-unloaded' scattering optical depth of where σ T is the Thomson cross section and d is the width of a shell, comparable to the distance from the base of the shell to the edge of the star. We denote the properties of the shell for which τ T = 1 with the subscript 0 and refer to it as the 'pair-unloaded breakout shell', which would have been the shell from which the shock broke out in the absence of pairs. This definition implies that τ T = m/m 0 . For high enough shock velocities, pairs are produced in the downstream and the optical depth of each fluid element increases by a factor 1 + 2z + . We define the 'pair-loaded' Compton optical depth as where g KN (θ) (1 + 5θ) −1 is the frequency averaged Klein-Nishina correction assuming Wien distribution and θ ≤ 1 (Svensson 1984).
The conditions in the immediate downstream of the shock are calculated using the self-similar hydrodynamic solution obtained by Sari (2006) for a planar converging shock wave. The pre-and post-shocked properties are denoted by the subscripts 1 and i , respectively. The proton number density of the undisturbed envelope as a function of m, following Eq (1) is respectively, where we accounted only for the photon contribution in Eq (13) since n γ n + , n − , n p . The exponent on the left hand side of both expressions implies a weak dependence of θ i on m and γ i,0 (and therefore on the shock Lorentz factor). While in shallower, hotter shells photon production is dominated by free-free emission, in more massive shells, n γ increases relative to n + and n − , such that deep enough DC photon production rate dominates over free-free. In Figure 1 we plot θ i (m) for three values of γ i,0 , setting Λ i = 10. The transition between free-free and DC is visible as a break in the curves. The dependence of θ i on m is evidently weak; over 6 orders of magnitude in mass, the temperature changes only by a factor of ∼ 3, corresponding to a numerical fit of overplotted in Figure 1 as dotted lines. It is evident that the fit to θ i describes the solution well for a wide range of γ i,0 . When the medium is 'pair loaded' (z + 1), the pair plasma acts as a thermostat and prevents the downstream temperature from rising significantly above ∼ 100 keV even when the shock is ultra-relativistic. This effect is attributed to the exponential sensitivity of the pair production rate to the temperature of the plasma (eq 10); even a slight increase in the temperature is followed by a copious production of pairs, which in turn generate photons at a rate proportional to n + n − by freefree emission (or by double-Compton emission, in which case the rate is proportional to n − n γ ). The energy is then distributed among all plasma constituents and the photons, and the temperature can increase only mildly. We use the numerical fit in Eq (24) throughout this work instead of considering a constant temperature. In addition, due to the non-relativistic temperatures that characterize the plasma, we neglect relativistic KN effects.
The results of the steady state calculation are valid if the system is able to reach equilibrium within a dynamical time. We find that t eq /t dyn ∼ 1/τ tot , where t eq = n + /ṅ A = n + /ṅ + is the time scale to reach equilibrium. In opaque shells τ tot > 1, and equilibrium is typically achieved. . The trend of the temperature profiles with γi,0 may seem counter-intuitive, with the higher Lorentz factors resulting in lower temperatures at a given mass coordinate. In FS22 we show that faster shock waves create more pairs and photons, which reduce the plasma temperature. Nevertheless, the breakout temperature itself increases with γi,0, since the shock accelerates further and emerges from shallower shells.
We apply the self-similar solution obtained by Pan & Sari (2006) for the hydrodynamics of a freely-expanding ejecta after shock breakout, for the initial expansion phase. Planar expansion governs the dynamics until the spherical time, t s R * /c, where t is the time measured in the upstream frame. The solution assumes that ρc 2 , and is therefore valid as long as the fluid is hot. The evolution of the proton density, the internal energy and the Lorentz factor of a fluid element, respectively, obey: where t is the time measured in the rest frame of the fluid. After a fluid element has been shocked, it expands and accelerates as its internal energy is converted to bulk kinetic energy. The acceleration ceases once ∼ ρc 2 , which implies a final Lorentz factor of where the prefactor is calculated for n = 3 (Pan & Sari 2009). Pan & Sari (2009) also found the hydrodynamic solution of the flow during the cold planar phase. In terms of the rest frame time, the evolution of the energy and number densities are the same as in Eq (25a)-(25b), while the Lorentz factor remains constant. The total photon number in a relativistically expanding plasma is approximately constant in time, i.e., the number of new photons generated by free-free or DC emission is a decreasing function of time (this is true during both planar and spherical phases). All photons are therefore effectively produced at t i , implying that the evolution of the temperature and photon energy is adiabatic and the shape of the spectrum is conserved. Therefore, if a shell had a Wien spectral distribution at t i , it is maintained during the entire planar evolution. The total photon density and the temperature evolve in time according to where the time evolution of x m is similar to that of θ, meaning that Λ ≡ log(θ/x m ) keeps its initial value. Steady state between pair production and annihilation is maintained also during the expansion phase. Using equations (14) and (27a)-(27b), we find that the pair fraction drops exponentially with θ and therefore with time: The exponential dependence of the positron density on time implies that pairs quickly annihilate, significantly reducing the optical depth of pair-dominated shells within just a few dynamical times.

Spherical expansion, t s < t
At t > t s , where t s = R * /c, the expansion becomes spherical and the radius of the ejecta increases like R ct . In Appendix B, we derive the spherical hydrodynamic solution for a relativistically expanding flow using the generalized Riemann invariant (Oren & Sari 2009). We divide our discussion below to hot and cold spherical dynamics.

Hot Spherical Dynamics
We start with the evolution of the flow where ρc 2 , which applies to shells that have not had time to cool before t s . The fluid's Lorentz factor, energy density and number density satisfy written in terms of the lab frame time due to a nontrivial conversion between rest frame and lab frame time 1 . The temporal evolution of γ (Eq 29a) suggests that as long as a fluid element is hot, its lab frame width, ∆ , remains approximately constant: where ∆ (t s ) = ct s γ 2 s is the width of the shell at t s and γ s is its Lorentz factor at that time. A fluid element does most of its expansion until t s , where during the hot spherical phase it can only roughly double its width. Since shells maintain a constant width, their dynamical time corresponds to the time it takes the density to change: t dyn r/c. The fact that the width of hot shells remains constant, limits the ability of photons to cross them. The distance between the shell's external boundary and a photon emitted at the internal boundary is ∼ ∆ s celeration phase. 2 This will not have any effect on the escaping radiation from τ tot = 1. However, the acceleration of the flow continues only as long as radiation is coupled to the electrons and the force exerted on an electron by the photons is sufficient to accelerate it to the bulk Lorentz factor of the radiation field (the Lorentz factor of the frame in which the radiation is isotropic). Therefore, work done on a single electron during the dynamical time r/c needs to satisfy γm e c 2 ≤ σ T c 2γ 2 r c . This inequality imposes a lower limit on the Lagrangian mass that can be accelerated to the required Lorentz factor. Nevertheless, in Appendix C we find that shells reach their terminal Lorentz factor before electrons and photons decouple, in which case neither the dynamics nor the emitted radiation are affected.

Cold Spherical Dynamics
Once a shell has exhausted most of its internal energy, it stops accelerating. The transition to the cold spherical phase implies that the width of fluid elements starts increasing with time: where γ f is the terminal Lorentz factor acquired by a fluid element through spherical acceleration. As shown in Appendix B, the evolution of and n in terms of lab frame time remains the same as in the hot spherical phase, given by Eq (29a)-(29c). Using Riemann invariants, we show in Appendix B that γ f is equal to 3 where γ i, * is the initial Lorentz factor of the shell that reaches its final Lorentz factor at t s , and is given by Eq (B29). Similarly to the relativistic planar phase, thermal coupling between electrons and photons cannot increase since the number of photons remains constant, and the evolution of the photon density and temperature obeys Equations (29a) and (33b) imply that during the hot spherical phase, the observed (lab frame) temperature of a fluid element remains constant in time, while decreasing as t −1 in the cold spherical phase.

Planar Phase Emission
The observed emission originates in the shell from which photons can effectively escape over a dynamical time, which in relativistic flows means that its optical depth satisfies τ tot = 1 (although, we shall see that in some cases this statement needs to be refined). We call this shell the luminosity shell and denote its properties with the subscript tr . The shell from which the shock breaks out of the envelope is denoted as the 'breakout shell', and is the source of the first photons that are emitted from the explosion. The breakout shell satisfies where β d is the velocity in the immediate downstream in the shock frame. From Eq (16), we see that a shell of mass m becomes transparent to photons when its pair fraction reduces to neglectiong Klein-Nishina effects. Since n + drops exponentially with time (Eq 28), the pair loaded optical depth decreases rapidly, while the pair-unloaded optical depth remains constant in time. Therefore, the optical depth can change only due to pair annihilation (and to a change in θ through KN effects, although this contribution is negligible since θ 1), such that when z + drops below 1, the optical depth remains constant in time until the onset of the spherical phase. As a result, the deepest shell that contributes to the planar phase emission is the unloaded breakout shell (however, see Faran & Sari 2019).
In order to find the temperature of each shell as it becomes optically thin, θ tr , we use Equations (14), (20), (27a), and (34) in the limit m m 0 , 1 z + and θ i 1: The explicit dependence of θ tr on m cancels out, and only exits through x m,i and θ i . Since the ratio θ i /x m,i and θ i are weak functions of m, the rest frame temperature of the photons is almost uniform. We find that a shell becomes transparent at t tr (m) ∼ 5 t i (m), i.e., after ∼ 2 multiplications of the dynamical time, so that θ tr /θ i ∼ 5 −1/3 0.6. We adopt this result to account for the time shells become transparent. Using equations (24) and (35), one finds that θ tr ranges between 0.12 and 0.08, over 2 orders of magnitude in mass. Nevertheless, while the escaping photon energy in the rest frame of the fluid is roughly constant, the observed energy is not, due to Lorentz boost (for shells that cooled during the planar phase, γ f ∝ m −0.48 ).
Shells cool rapidly from the bottom towards the edge of the envelope, where the 'cooling shell' satisfies = ρc 2 and evolves as m c (t) ∝ t −10.2 . Naively, the outermost shell that has reached its final Lorentz factor by the end of the planar phase is located at m c,pl = 0.09 m 0 (n 0 σ T R * ) −1.74 γ 8.25 i,0 . Since n 0 σ T R * 1, a high Lorentz factor is required to keep the unloaded breakout shell hot at the end of the planar phase. Moreover, acceleration is also limited by the time a shell becomes transparent; once photons escape, radiation can no longer provide the pressure required for acceleration. Therefore, if a shell becomes transparent before reaching γ f predicted by Eq (26), its Lorentz factor only increase by a factor of ∼ 2.5 before it becomes transparent. Although shells release more of their internal energy in this case, the energy in the observer frame is lower than it could have been had acceleration continued, due to a smaller Lorentz boost.
The condition that the unloaded breakout shell reaches its terminal Lorentz factor before becoming transparent sets an upper limit on the value of γ i,0 , of γ i,0 1.96 −1/ √ 3 5 1/3 1.2. This result is independent of the physical parameters of the system.
In the observer frame, the arrival time of photons is measured in terms of t obs -the time difference between the detection of the first photon that escaped the ejecta, and a photon that reached the observer at time t . The relation between the observed and lab frame times is t obs = t /(2γ 2 ), where γ corresponds to the Lorentz factor of the shell from which the observed photon originated. Since the unloaded breakout shell is the deepest shell that can be exposed during the planar phase, its properties define the observed spherical time: where γ 0,tr is the Lorentz factor of the unloaded breakout shell when it becomes optically thin, which is equal to γ f defined in Eq (26) if it is cold, or to ∼ 2.5γ i,0 if it becomes transparent before reaching γ f . The coordinate of the luminosity shell is determined by the condition t obs 5 t i /γ tr , which gives where t obs 0 is the observed time at which the unloaded breakout shell becomes transparent and t obs c is the observed time at which m tr = m c : The coordinate of the shell satisfying the above condition is equal to m c,tr 0.002 m 0 γ 5.75 i,0 . The result that all pair loaded shells become transparent at ∼ 5 t i , implies that the final Lorentz factor of this shell is

3.
During the planar phase, the observed signal from different shells is mixed due to light travel time and beaming effects. The luminosity and typical photon energy of a single shell of mass m is respectively, where t obs φ = R * c (1 − cos φ) is the difference in arrival times of photons emitted at angles φ and 0 relative to the line of sight, and we applied the ultra-relativistic approximation of β 1 − 1 2γ 2 . L obs (m) and ν (m) are therefore effectively constant on a timescale of R * /(2cγ 2 tr ), where most of the energy originates from inside a beaming cone of opening angle 1/γ tr . At timescales t obs > R * /c γ 2 tr , the observed luminosity and spectra of each shell are governed by high latitude emission from angles φ > 1/γ tr , and their time evolution satisfies L obs (m) ∝ t −2 obs and θ obs (m) ∝ t −1 obs , as seen from equations (39)-(40) (see also Kumar & Panaitescu 2000). The above derivation assumes that the Lorentz factor of the shell does not increase once photons start leaking out, and that its radius remains constant. The observed luminosity at t obs is the sum over the contribution from all transparent shells, and is governed by the most massive transparent shell.
Equations (37) and (39) give the time evolution of the planar phase luminosity. If the unloaded breakout shell ends its acceleration before it becomes transparent, we refer to the planar phase as 'cold'. The luminosity in this case evolves as where t obs c,2 = R * /(2cγ 2 c,f ), γ c,f is the terminal Lorentz factor of the shell located at m c,tr , γ i,c is its initial Lorentz factor and E i,c is its initial energy. At t obs > t obs c the luminosity originating from τ tot = 1 starts decreasing, so that the main contribution to the luminosity is still coming from m c,tr , and the luminosity is therefore constant at t obs c < t obs < t obs c,2 . Afterwards, the luminosity decreases as it is governed by more internal shells that enter their spherical phase at t obs . We note that at t obs c < t obs < t obs s the observed emission is not governed by emission from τ tot = 1. Following the above discussion, the evolution of the observed temperature is If the unloaded breakout shell has not exhausted its internal energy before it is exposed, the planar phase is referred to as 'hot'. In this case, the unloaded breakout shell governs the luminosity and temperature during t obs 0 < t obs < t obs s , where by t obs 0 is the time it becomes transparent, which again results in constant luminosity and temperature phases. The evolution of the luminosity and temperature in the hot planar phase is: and where E i,0 γ i,0 m p c 2 R 2 * /r 2 e is the initial energy of the unloaded breakout shell. A schematic evolution of the luminosity and temperature in the hot and cold scenarios is shown in Figures 2-3.
Each shell contributes to the observed spectrum of νF obs ν a Wien shaped spectral density with a peak photon energy of 4γ tr θ tr . The observed spectrum is calculated by taking the characteristic peak photon energy of each transparent shell weighed by its relative contribution to the luminosity of the pulse. In the cold planar phase (where the unloaded breakout shell cools before t obs 0 ), the spectrum at t c,2 < t obs obs < t obs s peaks at the temperature of the shell entering its spherical phase at t obs , and has an exponential cutoff at higher frequencies.
Below the peak, contribution to the spectrum comes from all exposed shells, and at ν < ν 0 mainly from the the unloaded breakout shell, where ν 0 is its peak photon energy: We note that if the flux is integrated over the duration of the planar phase, the spectrum peaks at ν 0 . If the unloaded breakout shell is hot throughout the planar phase, it governs the spectrum at and below the peak, located at x obs 0 ∼ 6 θ i,0 γ i,0 . The fact that shells stop contributing to the luminosity at t obs ∼ R * /(2cγ 2 tr ) introduces a high frequency cutoff that decreases with time as ν ct ∝ t −0.70 obs . The shape of the spectrum in this case at t obs Both expressions for νF obs ν above are written for t obs 0 < t obs < t obs s . Schematic plots of the instantaneous (not time integrated) spectral densities are shown in Figure  4.
At the end of the planar phase, the observed signal is dominated by high latitude emission from the unloaded breakout shell (equations 39-40), until emission from spherically expanding shells becomes dominant. In principle, after the pair unloaded breakout shell has become transparent, a fraction of the energy is able to escape from deeper shells given many multiplications of the dynamical time prior to the onset of the spherical phase. This is expected to introduce logarithmic corrections to the luminosity and temperature (Faran & Sari 2019). A handle on the importance of the logarithmic corrections is given by log ts t0 = 6 Mej 5M 1/4 R * 5R −1/2 , and can be non-negligible if 1 log(t s /t 0 ). Nevertheless, we do not address these corrections in our analysis.

Relativistic Phase
During spherical expansion, τ tot ∝ t −2 and radiation escapes from shells satisfying m 0 < m. At this point, the envelope does not contain any more pairs since they effectively vanished at t obs 0 . The coordinate that satisfies τ T = 1 is Shells that become transparent at t obs s are still accelerating if γ i,0 3. In this case, the transition to the cold spherical phase occurs when m tr intersects m c , which now decreases as m c ∝ t −8.25 . The lab frame time at which m c = m tr is and the observed time is The hot spherical phase, if it exists, is extremely short. Therefore, after the high-latitude emission phase ends, radiation originates from shells that already cooled during the spherical or planar phase. If the spherical phase stars cold, all shells have cooled during the planar phase, and the luminosity is Since the number of photons in each optically thick shell remains constant, the rest frame temperature of fluid elements evolves adiabatically as θ ∝ t −1 ∝ t −1 . The observed temperature is therefore If the spherical phase starts hot, the luminosity shell first probes regions that have cooled during the spherical phase, for which γ f is given by Eq (32). However, as it   propagates deeper into the stellar ejecta, photons start leaking out of shells that have already cooled during the planar phase, for which γ f is given by Eq (26). We denote the time when m tr = m c (t s ) as t obs c,pl : t obs c,pl = 0.02 The observed luminosity and temperature in the hot case obey Figure 4. The instantaneous observed spectrum of the breakout pulse, at t obs 0 < t obs < t obs s . Left: the case of a hot planar phase; the spectrum peaks at the photon energy corresponding to the temperature of the unloaded breakout shell. Since effectively no shells located at m > m0 can contribute to the observed luminosity, the spectrum follows a Wien spectral density below the peak. The high frequency flux above the peak originates in hot shells located at m < m0, where the high frequency cutoff corresponds to the peak photon energy of the shell that stops contributing to the luminosity at t obs . Right: the case of a cold planar phase, at times t obs > t obs 0 , t obs c,2 ; the spectrum peaks at a frequency ν p , which corresponds to the temperature (Tp) of the shell entering its spherical phase at t obs , and shifts to lower frequencies with time. Below the peak the spectrum is governed by emission from shells located at mtr ≤ m ≤ m0. , t obs c,pl < t obs < t obs z+,i , where γ f is given by Eq (32) in the first line, and by Eq (26) in the second line, and t obs z+,i is the observed time at which the luminosity shell reaches regions that were not pair loaded at t i . In shells that were never rich in pairs, the temperature decreases rapidly with m until reaching thermal equilibrium. An estimate for the mass of the shell that satisfies z + = 1 at t i can be obtained using Eq (21), since in the internal parts of the envelope photon production is dominated by DC: This coordinate (with respect to m 0 ) is insensitive to the density of the envelope and to the shock Lorentz factor. Assuming that this shell cooled during the planar phase, it is exposed at t obs z+,i | rel 800 given that this shell is relativistic.

Newtonian Phase
Since the Lorentz factor of the flow decreases with mass, at some point the observed dynamics become Newtonian. If γ i,0 β i,0 > 1, this transition occurs during the spherical phase. The shell that satisfies γ f β f ∼ 1 is located at m NW = m 0 γ 5.75 i,0 . The transition to the Newtonian phase happens when the luminosity shell reaches m NW , at In the above expressions for m NW and t NW we assumed that the ultra-relativistic dynamics hold down to the point where γ f β f ∼ 1. However, the ultra-relativistic solution is not expected to be accurate at Lorentz factors lower than ∼ 2, and therefore the above expressions are only approximate. Newtonian evolution implies that the luminosity shell satisfies τ T = c/v(m) and evolves as m tr ∝ t 1.75 obs . If m NW > m(z + = 1), then the luminosity and temperature at t obs > t obs NW obey the Newtonian evolution studied in various previous works (e.g., Nakar & Sari 2010;Rabinak & Waxman 2011;Faran & Sari 2019). If, however, m NW < m(z + = 1), the initial temperature at m NW < m < m(z + = 1) is regulated by pairs, and the observed temperature decreases like where θ obs NW is the observed temperature at t obs NW and t obs = t = t. Since pairs do not exist in the envelope deeper than ∼ 400 m 0 , this regime exist only if γ i,0 3. The time when shells that were never pair loaded are exposed in this case is The luminosity evolves as L ∝ t −0.35 obs (e.g., Nakar & Sari 2010), regardless of whether the probed shells used to be pair loaded or not.

APPLICATIONS
Given a powerlaw density index n and a pre-explosion stellar radius, R * , the problem depends only on the physical properties of the unloaded breakout shell: γ i,0 and n 0 . We use Tan et al. (2001) to infer those values for given ejecta mass M ej and the progenitor radius R * along with the explosion energy E exp , assuming n = 3. The shock wave obeys Newtonian dynamics in the interiors of the star and accelerates to relativistic velocities at the outer envelope. In this case, the number density and velocity of the unloaded breakout shell satisfy where M x is the ejecta mass in units of x M , R x is the pre-explosion stellar radius in units of x R and E x is defined by E = 10 x erg. A v is a coefficient that depends on the propagation of the non relativistic shock wave in the internal parts of the stellar envelope (and hence on the internal density profile; see equation 4 in Tan et al. 2001), and is typically close to unity. We keep the scaling of A v since the observables are often sensitive to its value. We note that in the hydrodynamic solution leading to Eq (61) it was assumed that the gravitational binding energy of the star can be neglected. Plugging equations (60)-(61) into equations (36), (38), (41), (42) and (59) where L obs p is the peak luminosity, E c is the rest frame internal energy of m c,tr at t obs c , θ obs p corresponds to the observed peak energy of the non-integrated spectrum, and θ obs p,int corresponds to the observed peak energy of the time-integrated spectrum. If the unloaded breakout shell remains hot throughout the planar phase, which requires an extreme explosion energy or a compact progenitor, the relevant observables are: where E 0 is the rest frame internal energy of the unloaded breakout shell at t obs 0 and L obs p is the luminosity at that time, which is also the peak luminosity.

Closure relation for relativistic breakout
Given that the planar phase γ-ray signal can be distinguished from that of the subsequent spherical evolution, the validity of our model for relativistic shock breakout can be observationally challenged. Nakar & Sari (2012) showed that there exists a closure relation between 3 observables (the duration of the planar phase pulse, the peak photon energy and the total pulse energy) and 2 physical parameters of the system (the initial stellar radius and the initial Lorentz factor of the unloaded breakout shell). Assuming that the unloaded breakout shell reaches its final velocity before becoming transparent, the duration, temperature and total energy of the γ-ray pulse are respectively. Equations (64a)-(64c) produce the following closure relation between the 3 observed parameters where we used θ i,0 = 0.15 for the initial temperature of the unloaded breakout shell. We note that in the cold planar phase, 4 θ obs 0 is the photon energy corresponding to the peak of the frequency integrated spectrum, νF obs ν . While the scaling laws in Eq (65) agree with Nakar & Sari (2012), our somewhat different coefficient is based on a more detailed examination of the microphysics.

low-luminosity GRBs
Low-luminosity GRBs (llGRBs) are a subclass of long GRBs (LGRBs) that show several predominantly distinct observational features: their γ-ray isotropic equivalent energies are 3 − 4 orders of magnitude lower than regular LGRBs, their spectra are softer and lack a high energy power-law tail, and their light curves are nonvariable (e.g., Woosley & Bloom 2006;Hjorth & Bloom 2012;Cano et al. 2017). These differences suggest that another type of physical mechanism is responsible for γ-ray generation in llGRBs. Nevertheless, both classes are found to be associated with broad-line (BL) type Ic SNe, which points towards a common explosion mechanism, taking place in different environments. Bromberg et al. (2011) showed that many llGRBs have pulse durations that are inconsistent with the jet breakout time predicted by the Collapsar model. They conclude that the physical processes that cause the γ-ray emission in llGRBs must be different to those in LGRBs, and in-voked relativistic shock breakout from the stellar material as one of the possible mechanism for generating the observed γ-ray emission. Despite being 10 − 100 times more common than cosmological GRBs, the detection rate of llGRBs is low due to the small volume from which they can be detected. As a consequence, only a handful of llGRBs have been discovered. The small sample size of detected llGRBs makes it difficult to establish a theory that explains the observed properties of llGRBS and their physical connection to LGRBs and BL type Ic SNe. Therefore, it has not yet been determined whether the γ-ray emission in llGRBs arises from the same mechanism as LGRBs or whether they originate from relativistic shock breakout Tan et al. 2001;Waxman et al. 2007;Bromberg et al. 2011;Nakar & Sari 2012;Matzner et al. 2013;Barniol Duran et al. 2015). The closure relation for relativistic shock breakout can serve as a test to the validity of our model for these events. We apply Eq (65) to a sample of seven llGRBs compiled from the literature. For this analysis we assume that the γ-ray burst duration corresponds to the duration of the planar phase, while if γ-rays are also emitted during the spherical phase, Eq (65) underestimates the observed pulse duration. The results are summarized in Table 1.
GRB980425/SN1998bw : This event served as the first evidence for the association of llGRBs with BL type Ic SNe (Galama et al. 1998). Its isotropic equivalent energy of E iso γ ∼ 10 48 erg and ejecta energy of 2 − 5 × 10 52 erg (Iwamoto et al. 1998) hinted at the existence of a relativistic shock wave Tan et al. 2001). Its observed duration T 90,γ = 23.3 ± 1.4 s and its peak energy at obs p = 150 − 200 keV, makes it a clear outlier of the Amati relation between E iso and obs p (Amati 2006; Galama et al. 1998;Bloom et al. 1998;Kaneko et al. 2007).
The reported γ-ray spectrum in Kaneko et al. (2007) is integrated over a time interval of ∼ 5 seconds. Since t obs L obs γ ∝ t 0.37 obs , a spectrum integrated over the entire planar phase is expected to peak at ν 0 and to drop like ν −0.64 at higher frequencies.
For a Wien spectral distribution, the peak of the integrated spectrum is at hν = 4k B T , which implies that the observed temperature is ∼ 50 keV. Such a moderate temperature suggests that the shock is only mildly relativistic before breakout, and our closure relation is only approximate. The closure relation predicts a duration of ∼ 93 s using θ i,0 ∼ 0.15, which is in agreement with the observed T 90,γ , reinforcing a shock breakout origin. We estimate that γβ f,0 ∼ 1 according to Eq (64b), so that the initial Lorentz factor was γβ i,0 ∼ 0.8. The inferred progenitor radius is ∼ 3 × 10 12 cm (Eq 64a), and the explosion energy is ∼ 2 × 10 53 erg. Since γ i,0 < 3, the unloaded breakout shell is cold when it becomes optically thin, and the spectrum is expected to obey Eq (45).
GRB 031203/SN2003lw : The burst emitted a total γ-ray energy of Eγ, iso ∼ 8 × 10 49 erg, over a timescale of T 90,γ = 36 s (Sazonov et al. 2004;Kaneko et al. 2007;Cano et al. 2017). Since the peak of the γ-ray distribution is not clearly inferred from the INTEGRAL observations, we adopt the maximal observed photon energy as a lower limit for the peak energy of the emission. The spectra presented in Sazonov et al. (2004) and Kaneko et al. (2007) are integrated over a duration of 22 s and 46 s, respectively, and from both a lower limit of obs p 300 keV can be put on the observed photon energy, implying a temperature higher than ∼ 75 keV. Since the integration time is similar to the duration of the burst, the peak of the spectrum is expected to correspond to the temperature of the unloaded breakout shell. The closure relation predicts ∆t γ ∼ 280 s for the observed parameters, which is of the same order of magnitude as the observed pulse duration. The closure relation is exactly satisfied for a peak energy of ∼ 650 keV.
GRB 060218/SN2006aj : GRB 060218 displayed several unique features that are difficult to explain by a standard GRB theory: a long lasting γ-ray emission, soft and bright X-ray afterglow and a prominent thermal component in the X-ray and optical bands at early times (Campana et al. 2006;Kaneko et al. 2007). Relativistic shock breakout was deployed by several authors to explain the observed emission (e.g., Campana et al. 2006;Waxman et al. 2007;Barniol Duran et al. 2015, for a discussion on alternative models see Irwin & Chevalier 2016.). The peak energy of the spectrum is very low: obs p ∼ 40 keV, corresponding to a temperature of 10 keV. This temperature is too low to suggest the presence of pairs in the unloaded breakout shell, and therefore the closure relation is not expected to be satisfied. It is however possible that GRB 060218 was a result of a sub relativistic shock breakout.
GRB 080517 : The γ-ray energy released in this burst was E γ,iso = (1.03 ± 0.21) × 10 49 erg within T 90,γ = 65 ± 27 s (Stanway et al. 2015). Only a lower limit can be placed on the a peak photon energy, obs p > 55 keV, which does not allow us to test the validity of the shock breakout model through the closure relation.
GRB 100316D/SN2010bh: This event resembles GRB 060218 in its long duration (T 90,γ > 1300s) and low peak energy, obs p = 30 − 40 keV (Starling et al. 2011). Due to the low peak energy, this event was most likely not a result of a relativistic shock breakout, although we again cannot rule out a shock breakout of a sub-relativistic nature.
GRB 171205A/SN2017iuk : The peak photon energy detected in this event was relatively high, with obs p = 125 +141 −37 keV (D'Elia et al. 2018;Suzuki et al. 2019), making it a good candidate for originating from a relativistic shock breakout. The total γ-ray energy measured was E γ,iso = 2.18 +0.63 −0.50 × 10 49 and was spread over T 90,γ = 190.5 ± 33.9 s. The spectrum shown in D' Elia et al. (2018) was integrated in time over ∼ 144 s, similar to the burst duration, and therefore the peak photon energy corresponds to the temperature of the unloaded breakout shell. For these parameters, Eq (65) predicts a duration of ∼ 10 3 s, consistent with the observed pulse duration, supporting a shock breakout origin for this event.
GRB 190829A/SN2019oyw : This GRB event had two peaks, separated by a quiescent phase -the first pulse was short and hard and is an outlier of the Amati relation, with obs p = 120 +110 −37 keV, E γ,iso = 3.2 × 10 49 erg and T 90,γ = 6 s. The second burst was soft, more energetic and satisfies the Amati relation, with obs p = 10.9 keV, E γ,iso = 1.9 × 10 50 erg, and T 90,γ = 10 s (Lesage et al. 2019;Chand et al. 2020). We treat the first peak as a candidate for a relativistic shock breakout, but find that the closure relation is not satisfied for a peak energy of obs p = 120 keV, which predicts a burst duration of 800 seconds. Chand et al. (2020) concluded that this energy satisfies the closure relation in Nakar & Sari (2012), since they wrongly treated obs p as the photon temperature, while obs p ∼ 4kT p . We note that since the closure relation is sensitive to the photon energy, taking the upper limit for obs p 330 keV brings the predicted pulse duration to ∼ 50 s, closer to the observed one. The association of this burst with a relativistic shock breakout is therefore inconclusive.
To summarize, within the sample of seven known ll-GRBs, we find that relativistic shock breakout as the origin of the observed emission is consistent with 3 of them (GRB980425, GRB031203 and GRB 171205A), is inconclusive for two (GRB 080517 and GRB 190829A) and is inconsistent for the rest (GRB060218 and GRB100316D), which could result from sub-relativistic shock breakouts.

White Dwarfs
Type Ia SN, which are explosions in a WD, carry a typical energy of E ∼ 10 51 erg, ejecting a total mass of M ej ∼ 1.4 M (Woosley & Weaver 1986). Taking a typical radius of R * ∼ 2 × 10 8 cm, this explosion would yield a mildly relativistic shock wave with (γβ) i,0 ∼ 1−2. Indeed, velocities as high as 40, 000 km s −1 were mea-  sured in e.g., SN2009ig (Foley et al. 2012), SN1991T and SN1990N (Jeffery et al. 1992). Given these parameters, our model predicts that a total energy of ∼ 10 40 erg to be carried away by ∼ 1 MeV photons during the planar phase; the peak luminosity of the γ-ray flare to be ∼ 10 44 erg s −1 ; and it will be spread over a duration of ∼ 10 −5 s. Other types of explosions (such as type .Ia and type Iax SNe) eject only a fraction of the WD. Known examples are SN2005E with M ej 0.3M and E 4 × 10 50 erg (Perets et al. 2010), SN2010X with M ej 0.16M and E 1.7 × 10 50 erg (Kasliwal et al. 2010), and SN2002bj with M ej 0.2M and E ∼ 10 50 erg (Poznanski et al. 2010). The observed characteristics of the γ-ray pulse are similar to the case in which the entire envelope is ejected.

Neutron stars
Neutron stars, as far as we know, do not have a generic mechanism of explosion. Here, we nevertheless predict the outcome of a sudden release of a fiducial energy of 4×10 51 erg. In such an explosion, the gravitational binding energy cannot be neglected relative to the energy of the explosion, therefore the estimate for (γβ) i,0 in Eq (61) is not valid. Instead, as a test case we use the numerical results presented in section 2.6 of Tan et al. (2001) to estimate (γβ) i,0 . For an explosion in which 0.017M carry away 4 × 10 51 erg, the most external 10 −5 M move at (γβ) f ∼ 6, corresponding to (γβ) i ∼ 1.5, (using Eq 26). For a NS with R * = 10 6 cm, we find m 0 ∼ 10 −20 M and n 0 ∼ 8×10 22 cm −3 . Hence, the shock breaks out of a very thin layer in the atmosphere of the NS, where the pre-shocked material is cold (T < 10 6 K) and neutron free. The atmospheric composition of NSs is uncertain. However, due to immense gravitational fields at their surface, heavy elements tend to sink into deeper layers, which motivates us to assume a pure hydrogen composition for simplicity (however, we note that accretion or strong magnetic fields can enrich the atmosphere in heavy elements). If the atmosphere is composed of heavier elements, other opacity sources like bound-bound and bound-free absorption should be taken into account, and the free-free emission rate would increase by a factor Z 2 where Z is the atomic number, affecting the post shock temperature and pair density. The initial Lorentz factor of the unloaded breakout shell for the above parameters, assuming that at the edge of the star gravity no longer affects the dynamics, is γ i,0 ∼ 700. Due to the high velocities, the timescales are extremely short, and the planar phase only lasts ∼ 10 −11 s. The observed luminosity is ∼ 10 51 erg s −1 and the total observed energy released is ∼ 10 41 erg. The peak observed photon energy is ∼ 0.2 GeV, and as a result the γ-ray flash will continue beyond the planar phase. The entire γ-ray flash could be observed by the Fermi satellite, which can detect photons in the range 10 keV-300 GeV.
Given the high densities and post shock temperature, one needs to verify that the propagation of a shock wave in the NS envelope is not impeded by production and then the escape of neutrinos. If cooling by neutrinos is efficient and the medium is optically thin to them, the shock may die out before breaking out of the star. The main neutrino production mechanisms we consider are electron capture p + e − → n + ν, electron-neutrino bremsstrahlung e − +e − → e − +e − +ν +ν, and electronpositron pair annihilation e − + e + → ν +ν. The cross section for electron-proton (photon) bremsstrahlung is several orders of magnitude larger than those of electron capture and electron-neutrino bremsstrahlung. Assuming that the energy carried by each photon and neu-trino produced by those processes is approximately the same, the energy lost to neutrinos is negligible. Now, if electron-positron pairs exist in the medium, pair annihilation into a νν pair competes with pair annihilation into photons, but becomes more important only when γ e 10 5 , where γ e is the thermal Lorentz factor of the electrons. However, the electrons do not reach this temperature if the shock Lorentz factor is less than 10 5 . The above arguments contradict the claim made by Yalinewich & Sari (2017), that shock waves cannot accelerate to high Lorentz factors in the atmospheres of NSs due to vigorous neutrino production and escape.

SUMMARY AND DISCUSSION
We calculated the observed properties of the emission following the emergence of a relativistic shock wave from a stellar edge. The essential principles of our steady state model are as follows: (1) equilibrium between electron-positron pair production and annihilation, (2) photon production by free-free or double-Compton mechanisms, neglecting absorption, (3) the downstream radiation field attains a Wien spectral distribution. The first and last conditions imply that the plasma is in a state of Wien equilibrium. Given a density power-law index n, our model depends only on three physical parameters: the pre-shock proton number density of the unloaded breakout shell n 0 , its initial Lorentz factor γ i,0 , and the stellar radius R * (or alternatively R * , M ej and E exp ). Given these parameters, we calculate the post-shock state of the envelope and analytically compute its temperature and pair density profiles as a function of time. We then deduce the luminosity and spectrum of the escaping emission as the envelope becomes transparent. The main findings of our work are listed below.
1. We show that the initial temperature of the plasma, immediately after shock passage and before substantial expansion of the ejecta, depends very weakly on both the density and the shock Lorentz factor. We also show that the initial temperature profile in pair loaded shells is relatively shallow, where θ i ∝ m −0.07 , ranging typically between ∼ 0.2 in the breakout shell to ∼ 0.07 deeper inside the envelope.
2. At the beginning of the planar phase the envelope is pair loaded and opaque. Adiabatic cooling quickly decreases the optical depth through pair annihilation, and photons escape freely from the shell satisfying τ tot = 1. Owing to the exponential dependence of pair density on the temperature, shells become optically thin after roughly two multiplications of their dynamical time, re-sulting in only a modest decrease in the initial rest frame temperature prior to the release of energy.
3. The most internal shell that contributes to the planar phase emission is the unloaded breakout shell, whose pair unloaded optical depth is unity, and hence becomes transparent once all pairs disappear from the envelope. This shell dominates the time integrated energy released during the planar phase, since the shock deposits most of its energy in massive shells.
4. Due to relativistic beaming and light travel time effects, high latitude emission coming from external shells is mixed with low latitude emission of more internal regions, where each shell releases its energy on a timescale of order R * /c 2γ 2 tr . During the very early planar phase, the luminosity increases as L obs ∝ t 0.51 obs , while the temperature decreases as T obs ∝ t −0.41 obs .
5. The planar phase has a very short observed duration of t obs s = R * /c 2γ 2 tr,0 , typically less than a few seconds. Planar phase emission manifests as a flash of energetic γ-ray photons, with a time integrated νF obs ν spectrum peaking at ∼ 200 γ tr,0 keV, dominated by the energy deposited in the unloaded breakout shell. These characteristics form a closure relation between the three observables: ∆t γ , E obs γ and θ obs p , and provides a test for the shock breakout model. 6. If γ i,0 1.2, the unloaded breakout shell exhausts its thermal energy and reaches its terminal Lorentz factor before the spherical phase and before becoming optically thin. If, however, the shock wave propagates in the external density profile of an especially compact star (e.g., a NS), the unloaded breakout shell may obtain higher Lorentz factors, and the acceleration of the envelope continues during the spherical phase if γ i,0 3. When 1.2 γ i,0 3, shells that are internal to the unloaded breakout shell continue to accelerate and reach γ f between the time the latter is exposed and the beginning of the spherical phase.
7. The initial existence of pairs at shock breakout continues to affect the temperature of the plasma and the observed emission even after their annihilation. Since we obtain the pair density profile in the envelope, we are able to predict the time at which pairs no longer affect the observed temperature, denoted t obs z+,i . Afterwards, the temperature decrease quickly, while the luminosity is not affected.
The observational signature of a relativistic shock breakout is different from its Newtonian counterpart. Since relativistic shock waves enhance the optical depth through pair production, they are able to propagate further along the stellar edge, and accelerate to increasingly high Lorentz factors before breakout. In addition, shocked fluid elements can accelerate significantly after shock breakout while converting thermal energy to bulk kinetic energy. On the other hand, in Newtonian flows the post-shock thermal and kinetic energy contents are comparable, and the velocity can only increase by a factor of ∼ √ 2. In addition, the high Lorentz factor of the flow shortens the time scales over which photons arrive at the observer. The emission therefore appears as a short γ-ray pulse.
Several differences exist between this work and that of Nakar & Sari (2012). One major difference comes from their assumption that the plasma is initially heated by the shock to a temperature of 200 keV, and releases its energy once T ∼ 50 keV. This assumption means that prior to the release of internal energy, the rest frame time has increased by a factor of ∼ 60, which results in more significant adiabatic losses. In contrast, we find that shells become transparent only after two multiplications of the dynamical time and compute the temperature of the emitted radiation more accurately, using the initial post-shock temperature profiles. The pair density profile, which is also computed in regions where double-Compton is dominant over free-free emission, allows us to better estimate the time at which pairs stop affecting the observed spectrum. In addition, Nakar & Sari (2012) limit their work to cases in which the acceleration of the unloaded breakout shell ends during the planar phase. We allow for arbitrarily high shock Lorenz factors, so that our model is adequate to describe shock breakout from compact objects such as NSs, in which spherical acceleration can take place.
We update the closure relation for relativistic shock breakout that was introduced by Nakar & Sari (2012) and apply it to γ-ray observations from llGRBs. Among the seven events that we examine, three are consistent with our model for relativistic shock breakout and show evidence for relativistic ejecta. The rest of the cases are inconclusive, and cannot be confirmed nor ruled out as having a shock breakout origin, since the temperature inferred from their γ-ray spectra is less than 50 keV. It is possible that these bursts are nonetheless a result of sub-relativistic shock breakouts, which are expected to have a typical radiation temperature lower than 50 keV. We apply our model to shock breakout from WDs following a SN explosion. A typical type Ia SN explosion is expected to produce mildly relativistic ejecta, with (γβ) i,0 ∼ 1 − 2, and release a total energy of 10 40 erg in ∼ 1 MeV γ ray photons. Indeed, some measurements of type Ia SN ejecta velocities of v ∼ 40, 000 km s −1 support this finding.
The only γ-ray emission detected from a binary neutron star merger, which was associated with GW170817, is thought to have been produced in a relativistic shock breakout (e.g., Kasliwal et al. 2010;Gottlieb et al. 2018;Bromberg et al. 2018;Beloborodov et al. 2020;Lundman & Beloborodov 2021). The first electromagnetic signal from the event arrived as a short flash of energetic γ-ray photons, 1.7 seconds post merger. A plausible source for this radiation is the breakout of a relativistic shock wave from the merger ejecta, driven by a highly pressurized bubble known as the 'cocoon' . However, the conditions in BNS merger outflows are very different from those at a stellar edge, and are expected to affect the observed signal. The heavy composition, rich in r-process elements, increases the opacity and the photon emissivity, which in turn highly affect the pair fraction. In addition, the shock wave in these systems is propagating into an ejecta that was previously shocked, and might be moving at relativistic velocities, so that the hydrodynamic solution applied in this work does not describe the BNS shocked ejecta. Therefore, some modifications should be made to our model in order to make it applicable to the outflows of BNS mergers, and will be implemented in future work.
The authors thank Ehud Nakar and Tsvi Piran for helpful discussions. This work was supported by an advanced ERC grant TReX and an ISF grant.

A. WIEN SPECTRUM
In a work in preparation, we compute the fraction of soft photons produces by free-free and double Compton emission that can be upscattered to the Wien peak in the breakout shell, denoted f B and f DC , respectively. The breakout shell satisfies τ bo = 1/β d 3, where β d is the velocity of the flow in the immediate downstream in the shock frame. For that, we solve the following equation, in tandem with the equations described in Section 2: where f B and f DC are functions of τ tot , θ and x m (see S84): f B = 2 y 2 1 − (y 1 + y 2 1 )exp(−1/y 1 ) and f DC = y 1 1 − exp(−1/y 1 ) , where y 1 = τ 2 tot (1 + 4θ + 16θ 2 ) ln θ/x m (A4) is the modified Compton y parameter, which marks the transition between saturated Comptonization (y 1 1, f B , f DC ∼ 1), for which a Wien distribution is obtained, and moderate Comptonization (y 1 < 1, f B , f DC 1), where only a moderate fraction of the photons upscatter to x = 3θ. When y 1 1, the spectrum receives the form of Wien spectral density per unit frequency x: n W γ,x = 1 2 n γ θ −1 x θ 2 e −x/θ .
In Figure 5, we show the solution for f B as a function of the shock Lorentz factor at the breakout shell, where free-free emission dominates photon production. Already at the breakout shell the radiation achieves a spectrum that is very close to Wien. At higher optical depths, which are of interest in this work, photons are even more Comptonized due to the strong dependence of f B on τ tot , and therefore the assumption of a Wien spectrum applied in this work in deeper regions of the envelope is justified.

B. RELATIVISTIC SPHERICAL HYDRODYNAMICS
In this section we obtain the hydrodynamic behaviour of a fluid element experiencing spherical expansion, and find the terminal Lorentz factor that it can accelerate to given its initial Lorentz factor. B.1. Are shells expanding?
We first check whether fluid elements change their width during spherical acceleration, or whether they keep an effectively constant width. The former is true if the Lorentz factor evolves slower than γ ∝ t 0.5 . The lab frame width and number density of a fluid element in the two cases are and n ∝ 1 respectively, where ∆ s is the initial width of a shell at the beginning of the spherical phase. The time evolution of the fluid's number density, Lorentz factor and the pressure in the rest frame is written using the unknown power laws η γ , η n and η p : where η p = γ ad η n and where γ ad is the adiabatic index of the fluid. The generalized Riemann invariant (Oren & Sari 2009) states that γ 2 ± √ 3 2 t 4 1+ √ 3 = const. Therefore, we have another relation between η p and η γ : B.1.1. Option I: ∆ = ct γ 2 We now examine the case in which fluid elements significantly increase their width while accelerating. From equations (B9) and (B10), we have where in the second equality we substituted γ ad = 4/3. Using equations (B6), (B8a) and (B11) we find that which is in contradiction with our first assumption that ∆ s ct γ 2 .
B.1.2. Option II: ∆ = ∆ s In the same way as before, we have: where again we substituted γ ad = 4/3 in the second equality. Checking for consistency with our initial assumption: where C is a constant. We thus conclude that during the spherical phase, shells maintain their initial width, and the following holds: η γ = 1, η p = −4, η n = −3. We note that the same result was obtained by Piran (1999).

B.2. Spherical acceleration and the terminal Lorentz factor
Here we find the final Lorentz factor a fluid element obtains after it exhausts its internal energy. We define the following parameter µ ≡ nmpc 2 , which satisfies µ 1 as long as the fluid is hot. The relations between n and µ and between and µ for γ ad = 4/3 are where γ i, * is the initial Lorentz factor of the shell that reaches its terminal Lorentz factor at t s , and for n = 3 it is equal to γ i, * = 1.6 (n 0 σ T R * ) 0.30 γ −0.44 After elements have converted all of their internal energy to bulk acceleration, they enter the cold spherical phase. During this phase, the Lorentz factor is constant, and therefore η γ = 0. This implies that ∆ ∝ t and shells increase their width. The time evolution is the rest frame remains the same as in the hot phase.

C. WORK EXERTED ON AN ELECTRON BY THE RADIATION FIELD
The work done on an electron by a radiation field, assumed to move in a specific direction, is the heating rate multiplied by the interaction time: General physical variables: t: rest frame time since shock breakout.  x m : the photon energy below which the photon spectrum is a Planckian, in units of the electron rest energy.
τ tot : the pair-loaded electron scattering optical depth. m c,tr : the mass of the first shell that is exposed cold during the planar phase.
t i : the initial dynamical time of a shell after shock breakout. t s , t s , t obs s : the transition time to the spherical phase in the rest frame, the lab frame, and the observed frame, respectively. t obs c : the observed time after which the escaping planar phase radiation originates from cold shells.
t obs c,2 : the observed time at which the first shell that was exposed cold during the planar phase stops being the main luminosity source.
t obs c,s : the observed time after which the escaping spherical phase radiation originates from cold shells.
t obs c,pl : the observed time after which spherical phase radiation originates in shells that have cooled during the planar phase.
γ f : the final Lorentz factor of a shell after it has exhausted its internal energy.
t obs z+,i : the observed time after which exposed shells were never pair loaded.
t obs NW : the observed time when the dynamics of exposed shells become Newtonian.