Formation of compact galaxies in the Extreme-Horizon simulation

We present the Extreme-Horizon (EH) cosmological simulation: EH models galaxy formation with stellar and AGN feedback and uses a very high resolution in the intergalactic and circumgalactic medium. The high resolution in low-density regions results in smaller-size massive galaxies at redshift $z=2$, in better agreement with observations compared to other simulations. This results from the improved modeling of cold gas flows accreting onto galaxies. Besides, the EH simulation forms a population of particularly compact galaxies with stellar masses of $10^{10-11}$\,M$_\sun$ that are reminiscent of observed ultracompact galaxies at $z\simeq2$. These objects form mainly through repeated major mergers of low-mass progenitors, independently of baryonic feedback mechanisms. This formation process can be missed in simulations using a too low resolution in low-density intergalactic regions.


Introduction
Early-type galaxies (ETGs) at redshift z > 1.5 are much more compact than nearby ones (Daddi et al. 2005). At stellar masses about 10 11 M , they typically have half-mass radii of 0.7-3 kpc, about three times smaller than nearby ellipticals with similar masses (van der Wel et al. 2014). Compact radii come along with steep luminosity profiles and high Sersic indices (van Dokkum & Brammer 2010;Carollo et al. 2013). Star-forming galaxies (SFGs) also decrease in size with increasing redshift (e.g., Kriek et al. 2009;Dutton et al. 2011). Besides, the CANDELS survey has discovered a population of very compact SFGs at z∼2: the so-called "blue nuggets" (Barro et al. 2013;Williams et al. 2014) have stellar masses of 10 10−11 M with unusually small effective radii around 2 kpc and sometimes even below 1 kpc. Compact SFGs have high comoving densities, about 10 −4 Mpc −3 for stellar masses above 10 10 M , and 10 −5 Mpc −3 above 10 11 M (Wang et al. 2019). In addition, SFGs at z 2 often have very compact gas and star formation distributions (Elbaz et al. 2018).
Many processes have been proposed to explain the formation of compact galaxies, ranging from early formation in a compact Universe (Lilly & Carollo 2016) to the compaction of initiallyextended galaxies (Zolotov et al. 2015) through processes that may include galaxy mergers, disk instabilities (Bournaud et al. 2007a;Dekel & Burkert 2014), triaxial haloes (Tomassetti et al. 2016), accretion of counter-rotating gas (Danovich et al. 2015) or gas return from a low-angular momentum fountain (Elmegreen et al. 2014).
The Extreme-Horizon (EH) cosmological simulation, presented in Sect. 2, models galaxy-formation processes with the same approach as Horizon-AGN (HAGN, Dubois et al. 2014, hereafter D14) and a substantially increased resolution in the intergalactic and circumgalactic medium (IGM and CGM). The properties of massive galaxies in EH and the origin of their compactness are studied in Sect. 3 and 4.

The Extreme-Horizon simulation
The EH simulation is performed with the adaptive mesh refinement code RAMSES (Teyssier 2002) using the physical models from HAGN (D14). The spatial resolution in the CGM and IGM is largely increased compared to HAGN, while the resolution inside galaxies is identical, at the expense of a smaller box size of 50 Mpc h −1 . The control simulation of the same box with a resolution similar to HAGN is called Standard-Horizon (SH). EH and SH share initial conditions realized with mpgrafic (Prunet et al. 2008). These use a ΛCDM cosmology with matter density Ω m = 0.272, dark energy density Ω Λ = 0.728, matter power spectrum amplitude σ 8 = 0.81, baryon density Ω b = 0.0455, Hubble constant H 0 = 70.4 km s −1 Mpc −1 , and scalar spectral index n s = 0.967, based on the WMAP-7 cosmology (Komatsu et al. 2011). EH was performed on 25,000 cores of the AMD-Rome partition of the Joliot Curie supercomputer at TGCC and partly used the Hercule parallel I/O library (Bressand et al. 2012;Strafella & Chapon 2020).

Resolution strategy
SH uses a 512 3 coarse grid, with a minimal resolution of 100 kpc h −1 as in HAGN. Cells are refined up to a resolution of 1 kpc in a quasi-Lagrangian manner: any cell is refined if the dark matter (DM) mass and/or baryonic mass exceed eight times the initial DM mass or baryonic mass in coarse cells. This resolution strategy matches that of HAGN (Table 2). EH uses a 1024 3 coarse grid and a more aggressive refinement strategy: the whole volume is resolved with a twice higher resolution and most of the mass is resolved with a four times higher resolution in 1-D, yielding an improvement of 8 to 64 for the 3-D resolution. This improvement continues until the highest resolution of 1 kpc is reached: the critical densities to activate refinements are listed in Table 2, which also indicates the volume fraction at various resolution levels. Such aggressive approach for grid refinement can better model the early collapse of structures (O'Shea et al. 2005). Appendix A illustrates the resolution achieved in representative regions of the CGM and IGM in EH and SH. The resolution in EH haloes is typically of 6 kpc while 25 kpc for SH. However, galaxies themselves are treated at the very same resolution in EH and SH: any gas denser than 0.1 cm −3 is resolved at the highest level in SH, as is also the case for 90% of the stellar mass.

Baryonic physics
Like in HAGN (D14), reionization takes place after redshift 10 due to heating from a uniform UV background from Haardt & Madau (1996). H and He cooling are implemented as well as metal cooling following the Sutherland & Dopita (1993) model.
Star formation occurs in cells with an hydrogen number density larger than ρ 0 = 0.1H/cm 3 . The star formation rate density iṡ ρ * = * ρ/t ff where t ff is the local gas free-fall time and * = 0.02 is the star formation efficiency (Kennicutt 1998). Mass, energy and metals are released by stellar winds, type Ia and type II supernovae assuming a Salpeter Initial Mass Function.
Black holes (BH) are represented by sink particles with an initial mass of 10 5 M . They accrete gas through an Eddington-limited Bondi-Hoyle-Lyttleton model. Boosted accretion episodes are included when the gas density overcomes a density threshold to mitigate resolution effects, the boosting being calibrated to produce realistic BH masses. The AGN feedback comes in two modes (Dubois et al. 2012): the quasar mode injects thermal energy and the radio mode injects mass, momentum and kinetic energy in the surrounding medium. We refer the reader to D14, the analysis of Dubois et al. (2016) and Dubois et al. (2012) for the detailed parameterization of these models.

Galaxies in the EH simulation
We detect galaxies with more than 50 stellar particles (about 10 8 M ) using AdaptaHOP (Aubert et al. 2004). 37,698 galaxies are detected in EH at z ∼ 2 and 20,314 in SH, with stellar mass functions at various redshifts shown in Fig. 1. While the mass functions above 10 10 M are quite similar in both simulations, EH forms twice as many galaxies as SH with stellar M * ≤ 5 × 10 9 M . We rule out any detection bias as stellar particles have similar masses in EH and SH, and attribute this difference to the increased resolution in low-density regions. Fitting the z = 2 mass function with a power-law of the form Φ(M * ) ∝ M β * in the 10 9 ≤ log(M * /M ) ≤ 10 9.5 range yields β = −0.68 for EH and −0.34 for SH. Observations indicate a slope −1.0 ≤ β ≤ −0.5 in this mass range (Santini et al. 2012;Tomczak et al. 2014), showing that low-mass galaxy formation is substantially under-resolved or delayed in SH. We build samples of galaxies with M * ≥ 5 × 10 10 M . Ongoing major mergers identified through the presence of a companion with more than 20% of the stellar mass within 20 kpc and/or a double nucleus, are rejected, yielding a sample of massive galaxies displayed in Appendix B for each simulation. We then study the mass distribution of the selected galaxies, taking into account non-sphericity. Stellar density maps are computed with a 500 pc pixel size. Pixels below 50 M pc −2 , typically corresponding to a surface brightness µ i ≥ 28 mag arcsec −2 , are blanked out. Ellipse-fitting of iso-density contours is performed using the technique from Krajnović et al. (2006). Satellite galaxies are removed as follows: the circular region centered on the luminosity peak of the companion and extending up to the saddle of the luminosity profile between the main galaxy and the companion is ignored in the ellipse-fitting procedure, and replaced with the density profile modeled on other regions. Satellites with a mass below 5% of the main galaxy are ignored to avoid removing sub-structures of the main galaxy. Three perpendicular projections are analyzed for each galaxy, and the median results are kept for both the stellar mass M * and the half-mass radius R e , the latter being defined as the semi-major axis of the isophote-fitting ellipse containing 50% of the stellar mass. The removal of satellite galaxies and low-density outskirts yields final stellar masses slightly below the initial estimates, down to M * 3 − 4× 10 10 M . Stellar masses and radii are shown at z = 2 in Fig. 2. 83% of the galaxies in our sample are on the Main Sequence of star formation (MS, Elbaz et al. (2011)), so that we compare their size to the model from Dutton et al. (2011), known to provide a good fit to MS galaxies at z = 2 1 . SH galaxies are larger than both EH galaxies and observed MS galaxies. EH galaxies generally lie around the observed relation, and a small fraction have significantly smaller sizes. We define the compactness C as the ratio between the radius expected from the Dutton et al. (2011) model and the actual radius. The compactness distribution for EH (Fig. 3) peaks at around C 1 but exhibits a distinct tail for C > 1.3. We thus define two massive galaxy populations in EH: 10 ultra-compact (UC) galaxies with C > 1.3 and 50 non ultra-compact (NUC) ones. Fig. 2. Stellar half-mass radius R e versus stellar mass M * for massive galaxies at z = 2 in EH and SH. The displayed model from Dutton et al. (2011) provides a good fit to SFGs at z=2. UC galaxies lie below the black dashed line while NUC galaxies are above. We identify EH galaxies above and below the Main Sequence of star formation (MS) with stars and triangles, respectively, following the definition of the MS from Schreiber et al. (2017).
Hence, massive galaxies in EH are globally more compact than in SH, and EH contains a population of UC outliers. The larger sizes in SH do not just correspond to extended stellar haloes: the difference remains when we vary the surface density threshold in mock images, and Sersic indices are on average similar in EH and SH. The size difference is not expected to arise from internal processes such as instabilities and/or feedback, as galactic scales and feedback are treated with the very same resolution in EH and SH. Two key differences could contribute: EH Fig. 3. Compactness distributions for the EH and SH massive galaxies at z = 2.

Galaxy samples
Mean difference in L in EH vs. SH 13% lower EH-NUC vs. SH 10% lower EH vs. SH at M * < 10 11 M 12% lower EH-UC vs. EH-NUC at M * < 10 11 M 3% lower Table 2. Mean difference in the specific angular momentum of inflowing gas L in between several samples of massive galaxies. models gas flows in the CGM at a much higher resolution, and low-mass galaxies are under-resolved in SH.

Diffuse accretion and angular momentum supply
A substantial part of the angular momentum of galaxies is supplied by cold gas inflows (Ocvirk et al. 2008;Pichon et al. 2011;Danovich et al. 2015;Tillson et al. 2015) which are better resolved in EH. Higher resolution could also better probe metal mixing in the IGM and subsequent cooling (Scannapieco et al. 2006). To probe these potential effects, we focus on inflowing gas in the vicinity of massive galaxies using the following criteria, which typically select inflowing gas according to other simulations (e.g., Goerdt et al. 2015): a galactocentric radius between 3 R e and 50 kpc, a density below 0.1 cm −3 to exclude satellites, a velocity vector pointing inwards w.r.t. the galaxy center, a temperature below 10 5.5 K.
For each resolution element following these criteria, we compute the gas mass m and angular momentum l w.r.t the galaxy center (in norm, l = l ), sum-up the total angular momentum L = Σ l and mass M = Σ m for inflowing gas, and compute the specific momentum of inflowing gas L in = L/M around each galaxy. Differences in L in for various galaxy samples are listed in Table 2, showing that L in around massive galaxies is substantially lower in EH than in SH, but is almost similar around EH-UC and EH-NUC galaxies.
We can estimate the potential impact on galaxy sizes under two extreme assumptions. On the one hand, if the circular velocity remains unchanged, dominated by a non-contracting DM halo, then galactic radii should follow R ∝ L in . On the other hand, if the dark matter halo contracts in the same proportions as the baryons, the rotation velocity V and radius R follow V 2 ∝ 1/R at fixed mass, so that R ∝ L 2 in . Hence the 10% difference in L in between EH-NUC and SH could result in a 10-20% size difference: this can account for the smaller sizes of massive galaxies in EH compared to SH. On the other hand, the population of UC galaxies does not result Fig. 4. Compactness C as a function of the ratio between the stellar mass at z = 2, M * (z = 2), and the mass of the main progenitor at z = 3 M * , pr1 (z = 3) (left panel) and as a function of the ratios between the mass of the three most massive progenitors (first and second, M * , pr2 on the middle panel and first and third, M * , pr3 , on the right panel) for EH (blue) and SH (red) galaxies. The shaded areas define regions of galaxies that would grow through major mergers of low-mass galaxies but would end-up NUC: no SH galaxy and only one EH galaxy are in the three areas at the same time.
from diffuse gas accretion as it could only impact sizes by a few percent compared to NUC galaxies. Angular momentum is built up by tidal torques that only depend on very large-scale structures expected to be well resolved even in SH (Fall & Efstathiou 1980). Yet, angular momentum can be lost when cold inflowing streams interact with hot gas haloes and outflows in the CGM. Idealized simulations of cold streams interacting with hot haloes (Mandelker et al. 2020) indicate that instabilities can decrease the velocity of cold streams by up to a few tens of percent in favorable cases, which can explain the loss of angular momentum at the EH resolution compared to SH 2 .

Major mergers of low-mass progenitors
Another driver of compaction could be the numerous low-mass galaxies in EH that are missing in SH. We identify the progenitors of z = 2 UC and NUC galaxies by tracking their stellar particles, and analyze their progenitors at z = 3 and z = 4 with the same technique as our z = 2 sample. Figure. 4 shows the compactness as a function of the mass ratios between each z = 2 galaxy and its main z = 3 progenitor and between the main z = 3 progenitor and the second and third most massive progenitors. UC galaxies have (1) a main z = 3 progenitor that never exceeds 10% of the z = 2 mass, (2) a second and (3) third most massive progenitors almost as massive as the main progenitor, with mass ratios lower than 3:1 (generally lower than 2:1) for the second most massive, and generally below 4:1 for the third most massive. This pinpoints a correlation between these parameters, showing that the formation of EH-UC galaxies involves repeated 3 major mergers between low-mass progenitors. These mergers occur rapidly between z = 3 and z = 2 with 80% of UC galaxies that assemble 90% of their stellar mass in this redshift range. Conversely, 70% of galaxies that have assembled 90% of their stellar mass between z = 3 and z = 2 end up as UC galaxies.
In contrast, EH-NUC and SH galaxies most often have one dominant progenitor undergoing only minor mergers, and very rarely meet the three criteria depicted above for UC formation at the same time. There is actually no SH galaxy and only one EH-NUC galaxy that lies in the three shaded areas in Fig. 4 at the same time. This strengthens our argument that these specific types of accretion histories essentially always produce UC galaxies. The only exception among EH-NUC galaxies has an extended spiral disk morphology, and has the second highest total angular momentum L in inflowing gas over the whole EH sample so that accretion of diffuse gas compensates for the compacting effects of the merger history in this extreme object. It is expected from idealized simulations of repeated mergers with various mass ratios that mergers histories involving mostly major mergers with relatively similar masses produce more concentrated end-products for the same total merged mass (at least in terms of Sersic indices, Bournaud et al. 2007b, Fig. 4). 45% and 47% of the stars found in EH-NUC and SH galaxies at z = 2 are already formed at z = 3, respectively, compared to only 36% for EH-UC galaxies: UC galaxies arise from low-mass progenitors and hence form their stars later on.
We also note that the distributions of progenitor masses are fairly identical for EH-NUC and SH galaxies (Fig. 4) indicating that the smaller sizes of EH-NUC galaxies doe not result from different merger histories but rather from the modeling of diffuse gas infall (Sect. 3.3).

Discussion
In order to match the resolution of SH and HAGN in galaxies, the EH simulation is limited to kpc-scale resolution, so the real compactness of UC galaxies could be under-estimated as they are as compact as the resolution limit allows. Zoom-in simulations will be required to make robust assessment of their size distribution. Nevertheless, the population of UC galaxies in EH is tightly associated with specific formation histories dominated by major mergers of low-mass progenitors, compared to larger galaxies in the simulation.
To further probe the effect of feedback in compact galaxy formation, we used the Horizon-AGN suite of simulations from Chabanier et al. (2020). These simulations are run with extreme feedback parameters leading to barely realistic variations of the black hole-to-stellar mass ratio, yet the average galaxy size at fixed stellar mass changes by less than 10%, confirming that feedback is not a key driver of the formation of UC galaxies in EH.
We have analyzed so far the compactness of galaxies independently from their star formation activity. As expected for galaxies in the 10 10 -10 11 M stellar mass range at z = 2, both NUC and UC galaxies are mainly star-forming galaxies on the MS. There is nevertheless a clear trend for compact galaxies to have relatively low specific star formation rates (sSFR, Fig. 5). The majority of UC galaxies lie on the low-sSFR end of the MS, as observed for blue nuggets (Barro et al. 2017). The relatively low sSFRs of UCs, as well as a tentative excess of galaxies below the MS among UCs compared to NUCs, are consistent with the idea that these objects are undergoing quenching through gas exhaustion and/or feedback (Tacchella et al. 2016).
The number of UC galaxies in EH (10 objects in (50 Mpc/h) 3 ) is consistent with the number density of compact SFGs (see Introduction). The EH volume is too small to firmly probe the formation of massive compact ETGs at z=2, as statistically about one such object is expected in this volume, but the excess of low-mass progenitors in EH is already present at z=4 (Fig. 1) and could explain the early formation of such compact ETGs. There is indeed one galaxy in EH with M * =1.2× 10 11 M and compactness C=1.29 (almost UC in our definition), with a low SSFR=0.23 Gyr −1 (a factor 7 below the MS), a low gas fraction of 11% (within 3R e ), and a Sersic index of 3.6 at z=2. This galaxy continues to quench into a compact ETG by redshift z 1.8, with SSFR=0.13 Gyr −1 , M * =1.7× 10 11 M , and R e =4.0 kpc at z 1.8, thus lying close to the mass-size relation of ETGs at z = 1.75 from van der Wel et al. (2014). This candidate compact ETG does also form through major mergers of low-mass progenitors: its two main progenitors at z=4 contain 11 and 8% of its stellar mass, respectively.
We also examined the environment of UC and NUC galaxies in EH by studying the large-scale structure with the persistent skeleton approach (Sousbie 2011). UC galaxies are found in relatively dense environments, but not in the very densest filaments and nodes (see Appendix C). This strengthens our previous findings on the merger history of UC galaxies, as objects in the densest regions of the main filaments are expected to form their main progenitor early-on and subsequently grow by minor mergers and diffuse accretion.

Conclusion
In this Letter, we introduced the EH cosmological hydrodynamical simulation, based on the physical model of HAGN, with a substantial increase in the spatial resolution in the IGM and CGM while galactic scales are treated at the same resolution. The SH simulation of the same volume uses a lower resolution in the CGM and IGM, more typical in cosmological simulations.
The comparison of the mass-size relation of massive galaxies in EH and SH highlights the importance of modeling diffuse gas flows at high-enough resolution in the IGM and CGM, as this tends to reduce the angular momentum supply onto massive galaxies. In addition, the EH simulation produces a population of ultracompact (UC) galaxies. These form rapidly by repeated major mergers of low-mass progenitors, which can be missed in simulations using a modest resolution in low-density regions. A pleasant outcome of our analysis is that issues in galaxy formation simulations could indeed be solved by accurately resolving structure formation without calling upon feedback or novel subgrid models. Resolution (kpc)  Distance to the closest filament d fil (in box size units) of the 8σ sparse skeleton for all EH massive galaxies as a function of their compactness. Bottom panel Density in the closest filament ρ fil (obtained by DTFE from a mass-weighted Delaunay tessellation of the galaxy catalogue) of the 3σ dense skeleton for all EH massive galaxies as a function of their compactness. For UC galaxies, exclusion zones are clearly visible at small distance to the filaments and in the very low and very high density regions, compared to the NUC.