The physical origins of gas in the circumgalactic medium using observationally-motivated TNG50 mocks

The gas in the circumgalactic medium (CGM) of galaxies is being probed by absorbers in the spectrum of background objects in observations, yet the physical properties of the medium remain unconstrained. We use the cosmological hydrodynamical simulation TNG50 to statistically trace the origins of HI Ly-$\alpha$ absorbers around galaxies at $z = 0.5$ with stellar masses ranging from 10$^8$ to 10$^{11}$ M$_\odot$. By including all gas with a line of sight velocity within $\pm 500$ \kms\ of the central, we mimic observational studies of the CGM to quantitatively assess the impact of other galaxy haloes and overdense gas in the IGM that intersect sightlines. We find that 75 per cent of HI absorbers with column densities log(NHI) $>16.0$ trace the central galaxy within $\pm150$ (80) \kms\ of $M_* = 10^{10} (10^8)$ M$_\odot$ central galaxies. The impact of satellites to the total absorber fraction is most significant at impact parameters $0.5 R_{\rm vir}<b<R_{\rm vir}$ and satellites with masses below typical detection limits ($M_*<10^8$ M$_\odot$) account for 10 (40) per cent of absorbers that intersect any satellite bound to $10^{10}$ and $10^{11}$ $(10^9)$ M$_\odot$ centrals. After confirming outflows are more dominant along the minor axis, we additionally show that at least 20 per cent of absorbers are found without strong radial motions, highlighting that absorbers can also trace quasi-static gas. The metallicity of absorbers also depends on the azimuthal angle, but this signal is largely driven by enriched inflowing and quasi-static gas. Our work shows that determining the stellar mass of galaxies at $z_{\rm abs}$ is essential to constrain the physical origin of the gas traced in absorption, which in turn is key to characterising the kinematics and distribution of gas and metals in the CGM.


INTRODUCTION
The discovery of extragalactic absorption lines (e.g.Lynds & Stockton 1966;Burbidge et al. 1966;Stockton & Lynds 1966) shortly followed the discovery of the first quasar/quasi-stellar object (QSO) 3C 273 (Schmidt 1963).At the time, it was suggested that the absorption arose from discrete clouds of gas found in galaxies located along the line of sight (LOS) towards the background source (Bahcall & Salpeter 1965).Almost six decades on, the study of absorbers has evolved significantly but fundamental questions remain unanswered.One such question concerns the origin of absorbers; while absorption lines are commonly associated with galaxies near the line-of-sight (Bahcall & Spitzer 1969;Bergeron 1986), what is their spatial distribution, kinematic behaviour and origin of the gas being traced in and around galaxies?
The distribution of gas in and around galaxies remains in a constant state of flux.Like a galactic bank account, reservoirs of gas ★ E-mail: simonw358@gmail.comare depleted by constant withdrawals in the form of star formation.More sudden ejections of gas in the form of stellar-wind-driven and AGN-driven outflows further reduce the amount of gas available for star formation but also enrich the surrounding galaxy halo (Veilleux et al. 2005).Deposits in the form of accreting gas from dark matter filaments (Kereš et al. 2005(Kereš et al. , 2009;;Nelson et al. 2013), condensed material from galactic fountains (Fraternali & Binney 2008;Marinacci et al. 2010;Fraternali 2017) and 'clumpy' accretion in the form of satellites (Mihos & Hernquist 1994;Hernquist & Mihos 1995;Ramón-Fox & Aceves 2020) replenish the gas supply.These processes take place simultaneously in a delicate balance and affect the stellar properties of galaxies.The study of the circumgalactic medium (CGM), the region where inflows and outflows leave their signatures, is of paramount importance to understanding how galaxies form and evolve.
Intervening quasar absorbers have long been found at the same redshift of galaxies and intersecting gaseous haloes around galaxies (Bahcall & Spitzer 1969;Bergeron 1986).The circumgalactic medium that extends from the interstellar medium (ISM) to the in-tergalactic medium (IGM) can be traced by absorption lines towards background QSOs.Some surveys study the CGM by preselecting galaxies (using a property such as mass or luminosity) that are located near quasar sightlines and then searching for and analysing absorption lines in the QSO spectrum (e.g.Chen et al. 2010;Tumlinson et al. 2011;Werk et al. 2016;Heckman et al. 2017;Johnson et al. 2017;Berg et al. 2018;Muzahid et al. 2018;Pointon et al. 2019).Alternatively, one can identify absorption lines towards a distant background source, typically of a certain species such as H i or Mg ii, and then search for galaxies at the absorber redshift (e.g.Steidel & Hamilton 1992;Schroetter et al. 2016;Hamanowicz et al. 2020;Lofthouse et al. 2020;Muzahid et al. 2020;Nielsen et al. 2020;Péroux et al. 2022;Banerjee et al. 2023;Berg et al. 2023).Finally, surveys can target fields with a UV-bright QSO without a pre-selection on absorption lines or galaxies (e.g.Prochaska et al. 2011Prochaska et al. , 2019;;Burchett et al. 2019;Chen et al. 2020;Muzahid et al. 2021).Despite the differing sample selections, surveys of absorption lines and their associated galaxies have benefited from the advent of integral field spectroscopy (IFS).The ability to simultaneously obtain imaging and spectroscopy has led to a proliferation of galaxyabsorber pairs (e.g.> 100 for Mg ii; Schroetter et al. 2019;Dutta et al. 2020).
It is then inevitable that absorption lines in QSO spectra will intersect gas associated with processes such as inflows and outflows or structures like satellites and filaments (Lehner et al. 2013(Lehner et al. , 2019(Lehner et al. , 2022;;Berg et al. 2023).However, disentangling the relationship between absorber and galaxy and understanding the origin of the absorber becomes difficult for many reasons.First and foremost, we are unable to directly measure the distance between absorber and galaxy in the direction along the line of sight.The only indirect measure of distance is the line of sight velocity difference between the galaxy and absorber (Δ LOS ).However, this is determined by a combination of the Hubble flow and peculiar velocity of the gas cloud.Several studies using simulations show that selecting absorbers in velocity space can select for gas beyond several times the virial radius (Rahmati et al. 2015;Ho et al. 2020Ho et al. , 2021)).Identifying the origin of an absorber becomes further complicated in studies where galaxy overdensities are found associated with absorbers (e.g.Gauthier 2013;Bielby et al. 2017;Manuwal et al. 2019;Hamanowicz et al. 2020).Typically, the galaxy found at closest impact parameter to the QSO sightline is selected as the absorber host, but other methods have also been used (Berg et al. 2023).Finally, the inherent sensitivity limit in observations means that a population of low-mass and/or quiescent galaxies will remain undetected, particularly at cosmological redshifts.We can infer the existence of these galaxies from studies that do not detect any object near high column density absorbers that are expected to arise from the galaxy disk (e.g.Fumagalli et al. 2015;Weng et al. 2023a).The combination of these factors means that assigning an origin to absorbers is challenging but few works have attempted to quantify these effects and how they vary with properties such as species and column density.
Intervening absorption lines are expected to probe gas flows into and out of galaxies.However, distinguishing between outflows and inflows is challenging because of the line of sight velocity degeneracy between the two gas flows.Gas infalling onto a galaxy from behind and gas outflowing towards the observer will both be blueshifted with respect to the systemic redshift of the galaxy.Likewise, redshifted absorbers can originate from inflows in front of the galaxy or outflows ejecting gas away from the observer.This degeneracy is not present in down-the-barrel studies where inflows (outflows) are identified by redshifted (blueshifted) absorption against the background stellar continuum (e.g.Martin 2005;Veilleux et al. 2005;Rubin et al. 2014;Heckman et al. 2017).To overcome this uncertainty in transverse absorption-line studies, one must rely on other assumptions.
One possible way to distinguish outflowing absorbers is to measure the azimuthal angle (Φ) between the absorber and a galaxy's major axis.In both observations and simulations of gas outflows that originate in the galaxy centre, galactic winds commonly form an expanding biconical shape perpendicular to the galaxy disk as this is the path of least resistance (e.g.Bordoloi et al. 2011;Lan et al. 2014;Nelson et al. 2019).Hence, one could assume that outflowing absorbers can be identiifed by their alignment with the minor axis and inflowing absorbers with the major axis as the accreting gas corotates with the galaxy (Rahmani et al. 2018b;Schroetter et al. 2019;Zabl et al. 2021).Perhaps further evidence of this major-minor axis dichotomy can be found in the bimodal distribution of azimuthal angles for absorbers relative to their galaxy hosts (Bouché et al. 2012;Kacprzak et al. 2012;Bordoloi et al. 2014;Schroetter et al. 2019).It should follow then that metal-enriched gas will be preferentially found near the minor axis.Indeed, various simulations predict an azimuthal angle dependence in metallicity profiles (Péroux et al. 2020;van de Voort et al. 2021), as well as density, temperature (Truong et al. 2021;Yang et al. 2023) and magnetic field strengths (Ramesh et al. 2023a), in line with some observational studies (Cameron et al. 2021;Zhang & Zaritsky 2022;Heesen et al. 2023), although other observations find little to no evidence for such angular anisotropies (Péroux et al. 2016;Kacprzak et al. 2019;Pointon et al. 2019;Huang et al. 2021;Wendt et al. 2021).
We also expect outflowing gas to be metal-enriched as heavy elements from the ISM are ejected into the CGM and IGM via feedback processes (Oppenheimer & Davé 2006;Muratov et al. 2017;Nelson et al. 2019;Mitchell & Schaye 2022).Studies of high-velocity clouds (HVCs) in the Milky Way use a combination of kinematics and metallicity to distinguish between inflows and outflows, and also calculate the mass rates of both processes (e.g.Wakker et al. 1999;Fox et al. 2004Fox et al. , 2016Fox et al. , 2019;;Ramesh et al. 2023c).Beyond the local Universe, some studies of H i absorbers find a multimodal gas-phase metallicity distribution (Lehner et al. 2013(Lehner et al. , 2022)).The separate populations have been proposed to trace outflows (metal-rich), inflows (metal-poor) and gas in the IGM (pristine) (Berg et al. 2023).However, simulations do not find such large metallicity contrasts between inflows and outflows, particularly at lower redshift where galactic winds are more efficiently recycled (Hafen et al. 2017).
In this work, we study the origins of absorbers using the cosmological magnetohydrodynamical simulation TNG50.We explore how the line of sight velocity difference between galaxy and absorber compares with the physical distance.Then, we quantify the contributions of satellite galaxies and gas in the intergalactic medium to the fraction of absorbers with varying column densities.We also test the fidelity of azimuthal angle and metallicity assumptions when identifying gas flows in the CGM.Finally, we compare our results to studies of Ly- absorbers at redshift  ≲ 1 such as the MUSE-ALMA Haloes survey (Péroux et al. 2022) and the COS CGM Compendium (Lehner et al. 2018).We adopt a cosmology consistent with Planck Collaboration et al. (2016) and halo masses, circular velocities and radii are defined at 200 times the critical density of the Universe (e.g. vir =  200c ), consistent with TNG50.
With a box size of ∼50 comoving Mpc (cMpc) and 2160 3 resolution elements, the TNG50 simulation has a baryonic (dark matter) mass resolution of 8.5 × 10 4 M ⊙ (4.5 × 10 5 M ⊙ ).The relatively large volume combined with the high spatial resolution are optimal for the study of structures in the circumgalactic medium of galaxies.
In the TNG simulations, galaxy stellar mass growth is regulated by supernovae (SN) and supermassive black holes (SMBH) feedback.The SN and SMBH feedback models in TNG use an isotropic energy injection.Hence, any directionality is a natural result of subsequent hydrodynamical and gravitational interactions.The model for stellar feedback uses a kinetic wind approach where star-forming gas is stochastically ejected from galaxies by Type II supernovae (Springel & Hernquist 2003).Galactic winds are isotropic and the ejected wind particles are decoupled from surrounding gas in the star-forming environment until the density or time reaches a threshold, at which point they hydrodynamically recouple and deposit their mass, momentum, and energy (see Pillepich et al. 2018a, for details).The TNG stellar feedback model produces high mass loading galactic-scale outflows which are highly directional and metal-enriched (Nelson et al. 2019;Péroux et al. 2020;Ramesh et al. 2023b).
In TNG, supermassive black holes are seeded in haloes exceeding a total mass of ∼ 7 × 10 10  ⊙ .SMBHs then grow by merging with other black holes and accreting gas at the Eddington-limited Bondi rate.The mode in which the active galactic nucleus (AGN) ejects energy into its surroundings is dictated by this accretion rate.At low-accretion rates relative to the Eddington limit, kinetic energy is stochastically injected into neighbouring cells after enough energy is accumulated.On the other hand, thermal energy heats the surrounding gas at high-accretion rates proportional to the accreted mass.The thermal feedback mode typically dominates for SMBH masses ≲ 10 8 M ⊙ , and the kinetic mode for high-mass black holes (Weinberger et al. 2017).Feedback from SMBHs in the TNG model is the physical mechanism of galaxy quenching, ejecting gas from halo centers (Truong et al. 2020) out to the scale of the closure radius (Ayromlou et al. 2022), while heating gaseous haloes and thus preventing future cooling of the CGM (Zinger et al. 2020).

TNG50 Galaxy sample
We identify haloes and subhaloes in the simulation using the subfind algorithm (Springel et al. 2001).The central subhalo is defined as the one found at the gravitational potential minimum of a friendsof-friends halo (FoF; Davis et al. 1985) and the associated baryonic component is termed the central galaxy.Baryonic components of all other subhaloes associated with the FoF halo are dubbed satellites.
We focus on galaxies at  = 0.5 with stellar masses ( * ) ranging from log( * / ⊙ ) = 8.0 to 11.0 in order to match the properties of galaxies from the MUSE-ALMA Haloes survey (Péroux et al. 2022;Karki et al. 2023).The survey targets 32 high column density (log[ (H i)/cm −2 ] > 18.0) H i absorbers and finds 79 galaxies within ±500 km s −1 of the absorbers at impact parameters ranging from 5 to 250 kpc (Weng et al. 2023a).
We consider galaxies that are the central galaxies of their halo and measure their stellar masses within twice the stellar half mass radius.For the four stellar mass bins centred around [10 8.0 , 10 9.0 , 10 10.0 , 10 11.0 ] M ⊙ , we select [100,100,50,20] galaxies at random within bins of ±0.3 dex.We choose the number of central galaxies in each mass bin such that the number of 'sightlines' passing within the virial radius of the galaxies in each bin is approximately equal.The physical extent of the mocks along the plane perpendicular to the projection is the minimum of [400 pkpc, 2 vir ].The limit of 400 pkpc is set by the physical scales covered in a single VLT/MUSE (Bacon et al. 2010) pointing at  ≈ 0.5.

Mock absorption columns
The TNG simulations track the global neutral hydrogen content of gas cells.In order to split the gas between atomic or molecular hydrogen fractions individually, we adopt the molecular hydrogen fraction model of Gnedin & Kravtsov (2011) to estimate the H 2 fraction (following Popping et al. 2019).We then obtain the H i mass by subtracting the H 2 gas mass from the total neutral hydrogen content.The masses of all metallic ions including Mg ii, C iv and O vi ions are computed in post-processing using v17.00 of the cloudy (Ferland et al. 2017) code, assuming collisional and photoionization equilibrium in the presence of the meta-galactic UV background (UVB) from the 2011 update of Faucher-Giguère et al. ( 2009) (following Nelson et al. 2020Nelson et al. , 2021)).
Our separation of galaxies into centrals versus satellites allows us to flag each gas cell based on whether it is gravitationally bound to the central, a satellite of the central or another FoF halo along the line of sight.Gas cells not bound to any halo (largely gas in the intergalactic medium) are also flagged.We henceforth refer to this family of flags as the set of (gravitational) origin labels.
Additionally, we separately categorise each gas cell as outflowing, inflowing or quasi-static using the cell's radial velocity (  ) with respect to the central galaxy.Hence, to be classified by one of these three flags, it is a pre-requisite that the gas cell is gravitationally bound to the central subhalo (designated as 'central' in the origin labels).We calculate the radial velocity of each gas cell using the scalar product of the gas cell position relative to the galaxy centre with the velocity in the frame of reference of the subhalo excluding the Hubble flow.A radial velocity cutoff of 20 km s −1 is used to identify inflowing and outflowing cells, that is, cells with   > 20 km s −1 are outflowing and cells with   < −20 km s −1 are inflowing.Cells found at velocities −20 <   < 20 km s −1 are considered to be in quasi-hydrostatic equilibrium and encompasses gas that is static or rotationally-dominated.We also include satellite galaxies in this set of flags so all gas cells within the central subhalo are included.Henceforth, this set of flags are the gas flow labels.We consider other choices of the radial velocity boundary and the implications in section 5.
We show a cartoon depicting the two sets of labels (origin and gas flow) in Figure 1.Within the central galaxy's halo, they may trace gas accretion (bluish purple), outflows (orange) or satellite galaxies (green).However, absorbers may also intersect other galaxy haloes in front of or behind the central galaxy and these haloes are depicted in yellow.Finally, there is the chance that absorbers trace overdense gas in filamentary structures (purple).The various, intermixed possibilities highlight that relating the gas observed in absorption with its physical origin requires a statistical approach.
To determine the column density of the H i and other ions, we project the gas along the line of sight around each galaxy onto a large grid with pixel size 1 × 1 pkpc 2 , through a line of sight depth of ±500 km s −1 relative to the systemic velocity of the galaxy.We test pixel sizes with side length 0.5, 1 and 2 pkpc, finding only Figure 1.A cartoon view of intervening absorption lines towards background quasars intersecting galaxy haloes.Absorbers can have various origins in the circum-and intergalactic media.They trace gas flows such as outflows (orange) and accretion (dark blue) as well as satellites (green).There is also the possibility of the sightline intersecting other galaxy haloes along the line of sight (yellow) or filaments in the intergalactic medium (purple).The gas can be found at a large range of impact parameters and velocities with respect to any given galaxy and the diversity of possible origins mean that connecting absorbers with their host galaxies requires a statistical approach.We use the TNG50 simulation to quantify the contribution of the various physical origins presented, and how these contributions vary as a function of observable including the impact parameter, line of sight velocity, metallicity and azimuthal angle.marginal differences in our forthcoming results.This is consistent with Szakacs et al. (2022), where the H 2 and H i column density distribution functions in TNG100 are found to differ only at column densities log[ (H i)/cm −2 ] > 22 when comparing pixel sizes with side length 150 pc and 1 kpc.These regions are limited to the centre of galaxies that comprise a small gas covering fraction when compared to the CGM.Hence, we adopt a 1 pkpc 2 pixel to match the median CGM resolution of ≈ 1 pkpc in TNG50 at  vir > 0.1 which increases for larger radii.The ±500 km s −1 line of sight depth includes the contribution from the Hubble flow and we choose ±500 km s −1 to be consistent with surveys of absorber-galaxy pairs (e.g.Dutta et al. 2020;Weng et al. 2023a).We use the standard cubic-spline deposition method (following Nelson et al. 2016) to spatially distribute the masses of each gas component.Every pixel in this map corresponds to a single, observable 'sightline'.For each pixel, we calculate the mass contribution from cells belonging to the origin and gas flow flags mentioned earlier: [IGM, central, satellite and other halo] (origin) and [inflow, quasi-static, outflow and satellite] (gas flow).We assign a flag to each pixel identifying which component contributes the most mass for that given sightline and then we determine the gas column density using the chosen flag only.The orientations of the central galaxies are random as we use three projections of a given halo that correspond to the fixed -, -and -axes of the simulation volume.
In addition to the column density, we calculate other quantities measurable in observations such as the mass-weighted (using H i) metallicity of the gas, line of sight velocity difference between absorber and central galaxy (Δ LOS ), two-dimensional projected dis-tance from the galaxy centre (impact parameter, ) and azimuthal angle between the galaxy's major axis and absorber (Φ).We also include mass-weighted quantities such as the gas temperature, distance along the projection axis ( LOS ) and distance from the galaxy centre (3D distance) which are not directly measurable in observations.These calculations are determined using only the cells that belong to a given flag.Ultimately, we generate a catalogue of absorbers with the properties discussed above that are labelled by two sets of flags that inform us of the origin and gas flow.
In Figure 2, we display four randomly selected galaxies in the sample that span the entire range of stellar masses from roughly 10 8.0 to 10 11.0 M ⊙ .The left column of plots are H i column density maps where the subhalo identification, stellar mass and physical scale are also given.The central and rightmost plots separately colour each pixel by the dominant mass contribution for that sightline using the origin and gas flow flags.We keep the colour schemes for the two sets of flags consistent throughout the remainder of this work.The dashed white circle marks the virial radius of the central galaxy.From the first and second columns, we find that the dense H i gas typically arises from the centre of centrals, satellites or other haloes, while lower log  (H i)sightlines trace the intergalactic medium.Moreover, we see that satellites and other coincident galaxy haloes can dominate the projected H i mass for a sightline even at small impact parameters from the central galaxy (most prominently seen in the second and third rows).Using the gas flow flags, we show that gas in the CGM has a rich structure in radial velocity.For the central galaxies depicted at larger inclinations (second and third rows), outflows appear to be preferentially directed along the minor axes.Gas accretion can be seen directed along the major axes but can arise from the central galaxy stripping gas from another galaxy (second row) or the accretion of gas clouds that co-rotate with the disk (bottom row).These velocity structures are washed out when the galaxy appears more face-on (top row), where much of the gas is quasi-static.
We note that there are subtleties in the categorisation of pixels using the origin and gas flow depicted in Figures 1 and 2. First, we separate gas inflows from satellites that may be accreting onto galaxies.Components of accreting satellites that have been stripped and are infalling onto the central galaxy will be considered 'inflows', whereas gas that is still more tightly bound to the satellite will be labelled as 'satellite'.Similarly, large-scale streams from the IGM, as seen in the rightmost panels for 10 8 and 10 11 M ⊙ central galaxies, will be considered inflows only if they are gravitationally bound to the central galaxy.In the middle column, yellow and purple dominates the regions beyond the virial radius because other haloes and the intergalactic medium contribute the most H i for these sightlines.As we do not consider the second halo term and IGM in the rightmost column, the black pixels correspond to regions where none of the four gas flow labels [inflow, quasi-static, outflow and satellite] meet a column density threshold of log[ (H i)/cm −2 ] > 13.0 (see Figure 2).It is also for this reason that the central galaxy and satellites appear more extended in the right column of that same figure (e.g.satellites in the top left corner of the bottom two rows).Pixels previously assigned to the 'IGM' or 'other halo' origin labels may change into the most dominant of the four gas flow labels, assuming the column density threshold is met.

WHERE IS THE GAS ALONG THE LINE OF SIGHT?
In observational studies of absorber-galaxy systems, the impact parameter and line of sight velocity are two reliably-determined measurables that inform us on the true distance between absorbers and galaxies, and, by extension, determine how absorbers are related to surrounding galaxies.While the impact parameter is a measure of the physical distance in the plane of the sky, the velocity difference (Δ LOS ) does not directly correlate with the distance along the line of sight ( LOS ).An absorber's line of sight velocity is a combination of the gas flow being traced, viewing angle of the galaxy and the Hubble flow.Hence, it is important to evaluate the position of the absorbers with Δ LOS within 300 to 1000 km s −1 of the galaxy systemic redshift (typical values used in recent surveys: Schroetter et al. 2016;Péroux et al. 2022;Galbiati et al. 2023) may be beyond the virial radius.In this section, we examine the relation between Δ LOS and line of sight distance, and how the relation evolves as a function of the gas origin and motion (e.g.absorbers tracing the IGM, accretion and outflows).Additionally, we estimate the ranges in Δ LOS where the majority of the CGM gas mass lies.
In Figure 3, we show the relationship between the line of sight distance and line of sight velocity for absorbers associated with a stacked sample of central galaxies with stellar mass log( * / ⊙ ) = 10.0 at  = 0.5.This particular figure is limited to partial Lyman limit systems (pLLS; 16.0 < log[ (H i)/cm −2 ] < 17.2) associated with 10 10 M ⊙ central galaxies.Because this choice is arbitrary, we discuss the effects of changing column density and stellar mass.We separate absorbers by their respective origin or gas flow.The top-left panel includes all absorbers associated to the central galaxy.The panels labelled as 'Inflow' and 'Outflow' in the top row are decompositions of the top-left plot (we have not included 'quasi-static' gas with radial velocities |  | < 20 km s −1 ).We display the properties of absorbers that trace gas in satellites, the intergalactic medium or another halo along the line of sight in the bottom row respectively from left to right.The colour of each hexbin is the median impact parameter of all absorbers found in the bin.
For gas associated with the central galaxy and its satellites, we find a wide array of line of sight distances for any given line of sight velocity, with values varying by up to ∼ 500 pkpc at fixed Δ LOS .One cause for this is the degeneracy between the physical location of the absorbing gas and its kinematics.Redshifted absorbers can trace gas accreting onto the galaxy from behind or gas ejected towards the observer.Similarly, blueshifted absorption lines can probe outflowing gas expelled away from the observer or gas infalling onto the galaxy from in front.This is evident from the black horizontal bars that display the average  LOS associated with absorbers in 40 bins with width ∼ 10km s −1 in Figure 3. Gas at negative line of sight velocities trace both inflowing (outflowing) gas at positive (negative) distances down the sightline.For centrals, the black line is almost horizontal at  LOS = 0 kpc and there is roughly 50 kpc of scatter in  LOS at all Δ LOS .In general, inflows are indistinguishable from outflows by the velocity of the absorber relative to the galaxy alone (Tumlinson et al. 2017) and we require other diagnostics to break the degeneracy (see Section 5).
We also find absorbers associated with satellite galaxies, the intergalactic medium and other galaxy haloes.In particular, Figure 3 shows that partial Lyman-limit systems with |Δ LOS| < 500 km s −1 can trace gas in the IGM or intersect other haloes that are located more than several pMpc along the line of sight.While these absorbers are typically found at larger impact parameters, we still find that gas in the IGM and other haloes can mimic CGM gas of the central galaxy.We quantify the relative frequency of these absorbers in Section 4. The black horizontal bars indicating the median line of sight velocity for gas tracing satellites is similar to absorbers tracing accretion, highlighting that satellites are infalling onto the central and their average motion resembles gas accretion.In contrast, the almost linear relationship between  LOS and Δ LOS for gas in the IGM and other haloes is caused by the Hubble flow dominating at larger scales.We note that the range in LOS distances of the 'IGM' and 'Other Halo' panels is not the same as the other four.
Nevertheless, it is clear from the inflow-outflow degeneracy combined with the contribution of absorbers from satellites, the IGM and other haloes that the line of sight velocity difference between absorber and galaxy is not a direct indicator of actual distance.By extension, a small velocity separation (e.g.|Δ LOS | < 500 km s −1 ) does not imply an absorber is associated with a given galaxy.This result is in line with the findings of previous works using the EAGLE simulations (Schaye et al. 2015;Crain et al. 2015) to analyse H i around massive galaxies (M 200 ≳ 10 12 M ⊙ ) at  ∼ 2−3 (Rahmati et al. 2015), and Mg ii and O vi around stellar mass 10 9 to 10 11 M ⊙ galaxies at  ≈ 0.3 (Ho et al. 2020(Ho et al. , 2021)).More recently, the FOGGIE simluations, find that structures of varying temperatures, metallicities and densities in the CGM that span > 100 kpc can be tightly constrained in velocity space (Peeples et al. 2019).We similarly show here that the velocity restrictions we apply in observations lead to a larger LOS path length compared to the virial radius of galaxies.In addition, when multiple absorption components are separated in velocity (from tens to hundreds of km s −1 ) down a single sightline in observations, our results emphasise that even these smaller velocity differences can lead to different spatial locations.Studies find discrepancies larger than 2 dex in metallicity for distinct absorption components (e.g.Zahedy et al. 2019;Lehner et al. 2022) and we suggest that these separate components may arise from different physical origins such as the intergalactic medium.
We are able to give a simple prescription for an appropriate line of  sight velocity limit that encompasses most of the H i gas belonging to the CGM of the central using the distribution of absorbers in velocity space.Using a kernel density estimator with contour levels of [0.25, 0.50, 0.75] in Figure 3, we find that 75 per cent of LLS absorbers associated with the central are found within ±150 km s −1 of galaxies with stellar mass 10 10 M ⊙ .In addition, we find that our prescription of ±150 km s −1 varies marginally for absorbers of H i column densities larger than 10 17.2 atoms cm −2 .However, this value is strongly dependent on the stellar (and more importantly, the halo) mass and decreases to ±70 (120) km s −1 for  * ≈ 10 8 (10 9 ) M ⊙ galaxies and is ±250 km s −1 for the  * ≈ 10 11 M ⊙ galaxies in our sample.Fundamentally, the increasing virial velocities for more massive haloes drives the variation in  LOS values.However, this relation is not linear, with Δ LOS >  200 (halo circular velocity) for smaller haloes, and vice versa, for larger haloes.We also find these values are roughly consistent with the findings of Peeples et al. (2019), where the strongest absorption is confined to be within ±200 km s −1 of a  * ≈ 10 10 M ⊙ galaxy at  = 2.We refrain from a more direct comparison with FOGGIE because their cosmological zoom simulations are at a different redshift and do not include contributions from the IGM or other haloes.These Δ LOS estimates serve as useful indicators of whether an H i absorber is within the halo of a nearby galaxy.

THE PHYSICAL ORIGIN OF ABSORBERS
While the limits in Δ LOS provided in the previous section are practically useful for observational studies of absorber-galaxy systems, it is also important to quantify the likelihood of absorbers originating from the central galaxy as opposed to satellites, other galaxy haloes along the line of sight or the intergalactic medium.Here, we explore how the fraction of sightlines that trace gas outside the central subhalo changes as a function of impact parameter and H i column density, two observables that are readily available.In addition, we specifically study the contribution of lower mass satellites that are below the current sensitivity limit of many observations ( * ≲ 10 8 M ⊙ ).

What fraction of H i arise from the central halo?
We have shown that the combination of gas peculiar velocities and the Hubble flow lead to absorbers of various origins masquerading as belonging to the central galaxy.Here, we quantify the fractional contribution of the various gas origins as a function of the impact parameter.We use the impact parameter in particular because typically, the galaxy at lowest impact parameter is considered to be associated with the absorber in observational surveys (e.g.Langan et al. 2023;Weng et al. 2023a).Likewise, we consider all gas within ±500 km s −1 of the central galaxy to mimic a typical line of sight velocity cut in observations (Dutta et al. 2020(Dutta et al. , 2021;;Hamanowicz et al. 2020;Galbiati et al. 2023;Weng et al. 2023a).
In Figure 4, we show the fraction of absorbers that trace gas in the central (blue), a satellite of the central (green), another galaxy halo along the line of sight (yellow) and gas in the intergalactic medium (purple).We express the fraction as a function of impact parameter (normalized by the virial radius in the top -axis) for each of the four origins.The twelve panels span four stellar mass bins in ascending order from left to right and three H i column density ranges: LLS (top; 17.2 < log[ (H i)/cm −2 ] < 19.0), sub-DLAs (centre; 19.0 < log[ (H i)/cm −2 ] < 20.3) and DLAs (bottom; log[ (H i)/cm −2 ] > 20.3).We use bins of size 10 (20) kpc to calculate the fractions for the LLS and sub-DLA (DLA) column densities.
We find that these fractions are strongly dependent on the stellar mass of the central galaxy.Absorbers associated with more massive central galaxies dominate out to larger physical impact parameters, but this is caused by more massive galaxies having a larger virial radius (see normalized / vir on the top -axis).Indeed, the slopes of the central curves when viewed as a function of the normalized impact parameter are almost identical across our four stellar mass bins.Moreover, for stellar masses log( * / ⊙ ) ≤ 10.0, we often find a peak in the contribution from satellites before the 'other halo' term begins dominating.This is caused by the fact that satellites are limited to being gravitationally bound to the central.It is only for the 10 11 M ⊙ central galaxies where the virial radius is larger than the mocks (as seen in Figure 2) that the contributions from satellite galaxies have not peaked.We note again that these size restrictions for the most massive galaxies in the plane perpendicular to projection are physically motivated by the scales covered by the field of view of VLT/MUSE at  ∼ 0.5 which is the median redshift of the MUSE-ALMA Haloes survey (Péroux et al. 2022).Ultimately, the general trend we find, which is roughly independent of the mass and column density, is that the central galaxy dominates the covering fraction up to  ≈ 0.5 vir , followed by satellite galaxies until the virial radius and then other galaxy haloes beyond  vir .
There are also differences between the H i column density bins (increasing column density from top to bottom rows).Figure 4 reveals a steeper decline in absorbers associated with centrals for higher H i column densities, as these densities drop rapidly in the CGM towards larger impact parameters (e.g Ramesh et al. 2023b).This is accompanied by a greater fractional contribution of satellites and other haloes at these impact parameters, as a result of sightlines intersecting the dense ISM of these objects.The curves are more irregular because strong absorbers are rarer, even with larger bin sizes.We also see that the contribution from gas in the intergalactic medium (purple) is minor for column densities log[ (H i)/cm −2 ] ≥ 19.0, but increases in prevalence at lower N H i and larger impact parameters, as expected since this gas is predominantly not H i as a result of ionization by the UV background.
This becomes clearer in Figure 5 where we plot the trend of H i column density as a function of the impact parameter for the four stellar mass bins.The solid coloured line in the primary panel is the median  H i value at a given impact parameter for  * = 10 11 M ⊙ central galaxies.The faded grey curves represent the  H i - for the lower stellar mass bins which are shown and coloured in the secondary panels.Grey vertical lines mark the impact parameters where the median column density drops below the DLA, sub-DLA, LLS and pLLS thresholds.The coloured area is proportional to the fractional contribution (right -axis) of the four origin flags for each range in column density.For instance, DLAs found towards our  * = 10 11 M ⊙ central galaxies (primary panel) can be attributed 75 per cent of the time to the central, 15 per cent to satellites and the remainder to other galaxy haloes.This calculation is made using DLAs found across all impact parameters, as opposed to Figure 4 where the fractions are given as a function of .The black dashed vertical lines mark 0.15, 0.5 and 1 times the virial radius to mark the inner and outer boundaries of the CGM.
In all panels of Figure 5, we find an increase in the incidence of absorbers tracing the intergalactic medium as we move to larger impact parameters (and thus lower median H i column densities).This highlights that weaker absorbers have a high likelihood of originating from the IGM, with more than 30 per cent of log  (H i)< 10 16 atoms cm −2 absorbers tracing gas outside of haloes.We also see a larger fraction of absorbers belong to the central across all column densities for the more massive haloes.Crucially, we note that this signal is caused by our restrictions in the mock size perpendicular to the plane of projection which is intended to mimic observational surveys that have fixed observed size.The less massive central galaxies will have a larger portion of their maps outside the virial radius and hence, have a higher incidence of absorbers arising from other haloes or the intergalactic medium.
We also see in Figure 5 that the median H i column density is larger at all impact parameters ≳ 10 kpc for the more massive central galaxy.At smaller impact parameters, this trend does not hold because of the supermassive black hole at the centre of the most massive galaxies ejecting gas via the kinetic feedback mode (Zinger et al. 2020).In addition, we find a scatter in  H i up to 3 dex across the range of impact parameters.This scatter can be attributed to the intrinsic inhomogeneity of gas in the circumgalactic medium, but our results also emphasise that we may be intersecting gas clouds outside galaxy haloes in the IGM.Despite the various potential contributions from satellites, interloping haloes or the intergalactic medium, the trend of decreasing H i column density with impact parameter remains clear (Lehner et al. 2013;Nelson et al. 2020;van de Voort et al. 2021;Berg et al. 2023;Weng et al. 2023a).

What fraction of absorbers intersect low-mass satellites?
The Milky Way halo contains tens of satellite galaxies (McConnachie 2012) and we expect absorption lines to occasionally intersect these smaller haloes found in the CGM of more massive galaxies.The probability of sightlines intersecting satellites, particularly faint ones, is of interest to observers as strong absorbers occasionally do not have galaxy counterparts down to some magnitude ( ≈ 25 mag) and/or star-formation rate (SFR) limit (  ≈ 0.1) (e.g.Fumagalli et al. 2015;Berg et al. 2023;Weng et al. 2023a).Here, we estimate the gas mass contribution from low-mass satellite galaxies in the TNG50 simulation.This is motivated by the shallower completeness expected for galaxies below some stellar mass limit in observational surveys.
For a given TNG50 mock with satellites and other haloes, each gas cell is assigned a subhalo ID.We calculate the subhalo ID that dominates the HI mass for each pixel in our 2D projection down the line of sight of the mock.By crossmatching this list of IDs with sightlines that have been assigned a 'satellite' or 'other halo' flag, we then compute the fractional contribution of galaxies with varying stellar masses to the total number of sightlines that are dominated by gas in satellites or a secondary halo along the sightline.This is depicted in Figure 6 where the four colours correspond to the four stellar mass bins in our sample.We show the cumulative contribution from satellites (left) and other haloes (right) with stellar masses ( satellite ) that begin at 10 −4 times the mass of the central galaxy ( central ).The shaded region reflects the scatter when considering 3 (DLAs).The central galaxy dominates at impact parameters up to ≈ 0.5  vir , though this limit decreases for higher column densities.At roughly 0.5 vir <  <  vir , satellite galaxies dominate the fraction of absorbers and beyond the virial radius, other haloes along the line of sight contribute most to the absorber count.There is only a marginal contribution from the intergalactic medium at these H i column densities.These results highlight that knowledge of the stellar mass of galaxies associated with quasar absorbers is key to relate the gas probed in absorption with its origin.
different column density bins, from 13.0 For  * = 10 10 and 10 11 M ⊙ central galaxies,  * < 10 8 M ⊙ satellite galaxies only contribute roughly ten per cent to the total number of absorbers that intersect any satellite (see dashed vertical and horizontal lines on the left plot).This fraction increases to ≈40 per cent of sightlines for a central galaxy mass of 10 9 M ⊙ .For other haloes along the line of sight, the contribution from  * < 10 8 M ⊙ galaxies remains roughly constant at 25 per cent (right).There is a larger scatter of roughly 0.2 between the different column density bins, but the upper and lower bounds are not driven by any particular column density.This effect highlights that even low-mass galaxies in the CGM of massive galaxies and along the line of sight contribute to absorption and might remain undetected in observational surveys of absorbers, particularly at high redshift.
There are occasional cases in observational studies of galaxy counterparts to absorbers where no galaxy is detected near the QSO sightline down to some limit in stellar mass or star-formation rate (Fumagalli et al. 2015;Berg et al. 2023;Weng et al. 2023a).At  > 2 in surveys of Ly- emitters (LAEs) associated with H i absorbers, there are also systems where LAEs are found at impact parameters > 50 kpc from DLAs (Mackenzie et al. 2019;Lofthouse et al. 2023).Given that the H i is not expected to extend out to such large distances from simulations (Stern et al. 2021), the more plausible explanation is that we are tracing low-mass satellite galaxies near the QSO sightline.Figure 4 suggests that satellite galaxies at  = 0.5 are responsible for up to 50 per cent of absorbers at impact parameters within the virial radius of the central but particularly at 0.5 <  vir < 1.0.We then see in Figure 6 that  * ≤ 10 8 M ⊙ satellites make up ≈10 (40) per cent of the total number of sightlines that trace satellites gravitationally bound to central galaxies with stellar masses 10 10 and 10 11 (10 9 ) M ⊙ .Hence, strong H i absorbers without a nearby galaxy counterpart may simply be associated with objects below the sensitivity limit (typically 10 8 M ⊙ at  = 0.5 for a one hour MUSE exposure).Such objects require deeper observations or larger telescopes such as the Extremely Large Telescope (ELT), Giant Magellan Telescope (GMT) or the Thirty Meter Telescope (TMT).The median H i column density of absorbers versus given impact parameter for galaxies with stellar masses covering log(  * / ⊙ ) = 8.0 to 11.0 at  = 0.5.We show the  H i - relation in the primary panel for  * = 10 11 M ⊙ central galaxies with the coloured line.The faded grey lines represent the same relation but for the lower stellar mass bins found in the secondary panels.The vertical dashed grey lines mark the impact parameters where the median log  (H i) transitions from damped Ly- absorbers to partial Lyman-limit systems for log(  * / ⊙ ) = 11.0 galaxies.The last impact parameter bin covers column densities 13.0 < log[  (H i)/cm −2 ] < 16.0 (Ly- forest).The coloured area in each bin is proportional to the fraction of absorbers (with log  (H i)consistent with the respective bin) that belong to the categories of IGM, central, satellite and other halo.For example, the first bin that covers DLAs shows that most log[  (H i)/cm −2 ] > 20.3 absorbers will arise from the  * = 10 11 M ⊙ central galaxy, with small contributions from satellites and other haloes along the line of sight.At lower column densities, the fraction of sightlines that begin to trace gas in the intergalactic medium increases and then the IGM dominates for absorbers at Ly- forest column densities.Similar to Figure 4, we find that the contribution of satellites, other haloes and the IGM increases with the impact parameter.Additionally, we notice that higher mass central galaxies account for a larger fraction of dense H i absorbers (log[  (H i)/cm −2 ] > 17.2) but at lower  H i , the central fractions remain consistent across the four stellar mass bins.Black dashed vertical lines mark impact parameters that are 0.15, 0.5 and 1 times the virial radius.Despite the various potential contributions from satellites, interloping haloes or the intergalactic medium, the trend of decreasing H i column density with impact parameter remains clear.

GAS FLOWS IN THE CGM
As depicted in Figure 1 and 2, disentangling inflowing from outflowing gas in observations of the circumgalactic medium is not straightforward.Two commonly used indicators to observationally infer whether the gas is inflowing or outflowing are the azimuthal angle (Φ) and metallicity ().In this section, we characterise how the inflowing to outflowing gas fraction changes as a function of Φ and study the origins of the metallicity anistropy between the major and minor axes of galaxies.

Using the azimuthal angle to identify gas flows
In transverse absorption-line studies, the 2D projected azimuthal angle is often advocated as an indicator to distinguish outflows from inflows (e.g.Bouché et al. 2012;Kacprzak et al. 2012;Schroetter et al. 2016Schroetter et al. , 2019;;Weng et al. 2023b) where accretion is assumed to align with the major axis (Φ = 0 • ) and outflows with the minor axis (Φ = 90 • ).To mimic observations, we create 2D images of galaxies in TNG50 using the stellar density.These images are fully idealised mocks that neglect observational effects such as noise, instrumental response and seeing and the effects of dust attenuation and scattering (Bottrell et al. 2023).We run statmorph (Rodriguez-Gomez et al. 2019), an algorithm utilised to determine the morphology of sources, on the mock images to model the galaxy profile and return the position angle (PA) and axis ratio, /.From here, we generate the azimuthal angles for each pixel in the galaxy projection, excluding the pixels within 5 kpc of the galaxy centre as Φ values are unreliable at small distances.For the figures in this section, we select only galaxies with / values below the median of the sample.This is to exclude We performed this calculation using five column density bins, from Ly- forest column densities (13.0 ≤ log[  (H i)/cm −2 ] ≤ 16.0) to DLAs.The shaded region between the solid lines for each stellar mass bin reflects the maximum discrepancy (typically ∼0.1) in the fraction found between the five column density bins.We use stellar mass bins of size log(  * / ⊙ ) = 0.2.On the left, we find that galaxies with masses  * < 10 8 M ⊙ , which are possibly missed in current observational surveys, comprise 10 per cent of sightlines that intersect satellites for central galaxies with stellar masses 10 10 and 10 11 M ⊙ .This value increases to 40 per cent for 10 9 M ⊙ central galaxies.On the right, secondary haloes belonging to galaxies with  * < 10 8 M ⊙ contribute to 25 per cent of sightlines that intersect another halo across all central masses.The dashed vertical and horizontal lines help guide the eye to the numbers given above.We emphasise here that low-mass galaxies account for a significant portion of the H i covering fraction.
galaxies that may be at lower inclinations (more face-on) where the measured position angle is no longer reliable.We adopt this rather simple approach to measure the PA and / because our goal is not to test the accuracy of azimuthal angle measurements in observations but rather, to provide a first-order approximation for what observers might measure.
We show the fraction of absorbers that belong to one of the four gas flow flags as a function of the azimuthal angle in Figure 7.The shaded background conveys the fraction of absorbers belonging to the four categories using bins of ten degrees in azimuthal angle.The solid white line depicts the fraction of outflows to inflows, also as a function of the azimuthal angle where the horizontal dashed line marks an equal ratio.In the primary panel, we consider Lyman-limit systems found at an impact parameter of 50 to 100 kpc from 10 9 M ⊙ central galaxies.This cut in column density enables us to maximise the signal as higher  H i systems are much rarer tracers of gas flows.In the bottom panels, we consider smaller impact parameters (left), lower column densities (middle) and larger stellar masses (right).
We see a clear trend in the primary plot where the outflow to inflow ratio increases towards larger azimuthal angles.While similar signals have been detected before in simulations (Nelson et al. 2019;Mitchell et al. 2020), previous studies calculate the azimuthal angle of pixels in a frame where the galaxy is viewed directly edge on.The method used in this paper, based on observational practices, only loosely constrains the inclination of the galaxy considering axial ratios that are below the median value.This is a reassuring confirmation of observational practices where one uses Φ to distinguish gas flows (Schroetter et al. 2016;Zabl et al. 2019).Additionally, we also account here for the contribution from satellite galaxies and gas in quasi-hydrostatic equilibrium.Still, we confirm that the ratio of outflows to inflows is ≈0.5 near the major axis, rising to a peak of ≈2 at the minor axis in the primary panel.
In the main panel, we have considered a particular subset of absorbers (LLS at impact parameters 50 to 100 kpc) associated with  * = 10 9 M ⊙ central galaxies.When varying the impact parameter, H i column density and central stellar mass, we obtain more varied results.Looking at the bottom left panel of Figure 7 where we consider only absorbers within the inner 50 kpc of the galaxy, we still find an increasing outflow to inflow ratio, but the proportion of inflows dominates at all azimuthal angles.A similar signal is found when considering typical Ly- forest column densities (13.0 < log[ (H i)/cm −2 ] < 16.0, bottom middle) and stellar mass (bottom right), namely, inflows dominate in number even near the minor axis.The influence of impact parameter and stellar mass are particularly significant, with only half the gas flows at the minor axis attributed to outflows.In particular, we find that accretion dominates sightlines passing through central galaxies belonging to the  * ≈ 10 10 and 10 11 M ⊙ bins.Current observational studies, which are more sensitive to massive galaxies, find signatures of outflows more common than inflows (Martin et al. 2012;Rubin et al. 2012;Péroux et al. 2017;Rahmani et al. 2018a;Zabl et al. 2019;Weng et al. 2023b) and we discuss the possible reasons for this in Section 7.
Looking specifically at the fraction of gas in quasi-hydrostatic equilibrium, we find little evolution with azimuthal angle.The bottom left panel of Figure 7 shows that the fraction does not vary at We use a consistent radial velocity cutoff of ±20 km s −1 to label inflows and outflows and consider only central galaxies with a major-to-minor axis ratio less than the median value for the sample.Using bins in Φ of 10 • , we colour each bin by the fraction of absorbers belonging to categories seen in the colour bar (left -axis).We find a significant contribution from gas that is in quasi-hydrostatic equilibrium (purple) at all azimuthal angles.The solid white line represents the fraction of outflowing to inflowing absorbers (right -axis) and the horizontal dashed line depicts an equal ratio.There is an increase in this ratio as we move from the major axis to the minor axis.This is most prominent in the primary panel where we consider LLS absorbers found at an impact parameter of 50 to 100 kpc from central galaxies of stellar mass ∼10 9 M ⊙ .However, accounting only for absorbers at 0 to 50 kpc (bottom left) or absorbers around ∼10 10 M ⊙ central galaxies (bottom right) produces a minor difference of ≈0.2 in the outflow to inflow ratio between the major and minor axes.While there is a clear increase in the outflow to inflow ratio towards larger Φ at lower H i column densities (bottom middle), this ratio never exceeds unity.
lower impact parameters and only mildly increases for lower column densities (bottom middle).Due to an increasing fraction of inflowing absorbers, there is much less gas in quasi-hydrostatic equilibrium for  * = 10 10 M ⊙ central galaxies (bottom right).Curiously, we find a tentative signal of an increasing satellite LLS fraction at 50 <  < 100 kpc as we move towards the minor axis for both  * = 10 9 and 10 10 M ⊙ central galaxies.For these stellar masses where outflows are typically starburst-driven, the gas density is expected to be greater along the minor axis.Hence, there should be stronger ram pressure stripping, leading to more quiescent and less gas-rich satellites near Φ = 90 • in the CGM.We find instead that satellites along the minor axis are more gas-rich, reminiscent of the anisotropic galaxy quenching found in galaxy clusters (Martín-Navarro et al. 2021;Ando et al. 2023).A possible cause for this is if satellite galaxies along the major axis have been accreted at earlier times and hence, more likely to be quenched (Karp et al. 2023).At this stage, the origins of this anistropic LLS fraction from satellites remain ambiguous.
In Figure 7, we also find that 40 to 60 per cent of gas at all azimuthal angles arises from gas that is in quasi-hydrostatic equilibrium or in satellites.The contribution from satellites is most prominent in the primary panel which is consistent with our findings in Figure 4 where satellites dominate around 0.5-1 vir .At smaller impact parameters and lower column densities, their contribution diminishes.The contribution from quasi-static gas is significant for impact parameters up to 200 kpc, all central galaxy stellar masses and H i column densities tested in this study.While the ratio of outflowing to inflowing sightlines increases with larger azimuthal angles, this value ignores the contribution from gas moving at slower radial speeds.These results show that a fraction of absorbers in galaxy haloes may be associated with gas that is static or rotating.The latter has been observed in 60 per cent of Ly- absorbers at  ≲ 0.03 (French & Wakker 2020) and recent simulations show that rotational support is significant in the CGM (Lochhaas et al. 2023).In this work, we have set an arbitrary restriction on the radial velocity (±20 km s −1 ) to distinguish between inflows, quasi-static gas and outflows.Hence, the fraction of gas that is rotating without loss of angular momentum (quasi-static) compared to co-rotating inflows depends on the radial velocity boundary.Any increase in magnitude of the   cutoff used naturally leads to an increase in the fraction of gas in hydro-static equilibrium.Likewise, setting all negative (positive) radial velocities to be counted as inflows (outflows) leads to no absorbers being labelled as quasi-static.The median metallicity of all absorbers is plotted in white.We use a radial velocity cutoff of ±20 km s −1 and only consider central galaxies with a major-to-minor axis ratio less than the median value for the sample.The shaded regions reflects the 0.5 uncertainty in the metallicity for only the inflowing and outflowing absorbers.Absorbers associated with quasi-static gas and satellites do not have their errors plotted for clarity.In the primary panel, we adopt the same impact parameter (50 to 100 kpc), column density (LLS) and stellar mass bins ( central ≈ 10 9 M ⊙ ) as in Figure 8.For the secondary panels, we also make the same variations from the fiducial parameters.The positive gradient of the white dashed line in all panels shows that the median metallicity of absorbers increases towards the minor axis regardless of physical origin, although the effect diminishes for more massive central galaxies.When we separate the absorbers into the four gas flow flags and plot their metallicities (coloured lines), we discover that the inflowing and quasi-static gas also increase in  at larger Φ.These absorbers then drive the trend in median metallicity as they are typically more abundant than outflowing absorbers.
However, we find that unless the   cutoff is > 150 km s −1 , the ratio of inflows to outflows remains similar; there is just a proportional increase in the quasi-static absorber fraction.At high radial velocities, we only expect to find outflows and hence, the fraction of inflows to outflows decreases dramatically.Therefore, we caution that interpreting H i absorbers as inflowing or outflowing using their projected azimuthal angle relative to the major axis should include further consideration of other properties such as , log  (H i) and  * .

The metallicity of gas flows
Another absorber property used to differentiate outflows from inflows is the gas phase metallicity (Fox et al. 2016(Fox et al. , 2019;;Ramesh et al. 2023c).In Figure 8, we plot the metallicity as a function of the azimuthal angle.The four coloured lines correspond to the four gas flow origin flags and the dashed white line is the median metallicity of all absorbers in a given azimuthal angle bin with size 10 • .The shaded regions indicate the 0.5 uncertainty in the metallicity for only outflows and inflows.We adopt the same fiducial parameters (LLS found 50 to 100 kpc from  * = 10 9 M ⊙ central galaxies) in the primary panel as Figure 7 and the same changes in the secondary panels.
For almost all azimuthal angles and choices of ,  H i and central galaxy stellar mass, the metallicity (with respect to solar) of outflows is consistently 0.2 to 0.5 dex larger than inflows.The few exceptions occur for absorbers at azimuthal angles Φ < 30 • found towards  * = 10 10 M ⊙ central galaxies (bottom right) where the accreting gas is roughly equal in metallicity to the outflowing gas, perhaps due to recycling.We also find that absorbers are more metal-rich around more massive central galaxies, while the impact parameter and H i column density change the normalisation by < 0.1 dex.It is for this same reason that the metallicity of satellites is typically lower than the median value; as satellites are usually less massive, their average metallicities are also going to be lower.
Similar to the findings of Péroux et al. (2020); van de Voort et al. ( 2021), we find a positive gradient in the median metallicity of absorbers as a function of azimuthal angle.The magnitude of the difference in  between the minor and major axes is typically of order 0.2 dex, but does diminish with increasing central stellar mass.More curiously, we find that the driver of this metallicity difference is only partly caused by an increase in the fraction of absorbers tracing metal-enriched outflows.In general, gas that is inflowing or in quasi-hydrostatic equilibrium also increases in metallicity towards the minor axis, hinting that the pollution of metals into the circumgalactic medium near the minor axis also results in metal-enriched accretion in the form of recycled gas (Fraternali 2017;Muratov et al. 2017).As the fraction of quasi-static and inflowing gas typically dominates the outflow fraction (bottom panels in Figure 7), the increase in median metallicity of these types of absorbers contribute more significantly to the median metallicity of the CGM.We discuss the metallicity distribution of inflowing and outflowing gas in more detail in Section 6.

Determining the host galaxy of absorbers
With the proliferation of IFS surveys targeting absorbers, there are an increasing number of cases where multiple galaxies are found within some velocity cutoff with respect to the absorber (e.g.Dutta et al. 2020;Hamanowicz et al. 2020;Berg et al. 2023;Weng et al. 2023a).This points to a more complex relationship between galaxies and absorbers, and one that may only be captured by larger statistical studies.At the same time, it is also critical to relate the properties of the CGM with galaxy properties in individual cases to understand how galaxies evolve (e.g.Tumlinson et al. 2013;Burchett et al. 2016;Werk et al. 2016;Langan et al. 2023).However, the fidelity of our current methods used to associate galaxies with absorbers remains ambiguous.We have shown already in Figures 3 to 6 the importance of considering other haloes along the line of sight and  * < 10 8 M ⊙ satellites.The predominant method of assuming the galaxy at lowest impact parameter to the QSO sightline is the host neglects both these considerations.Here, we analyse the potential host galaxy of absorbers using the results of these simulations and prescribe a more reliable method for associating absorbers to galaxies.
In Figure 9, we show the most likely origin flag of an absorber found at some impact parameter and line of sight velocity difference to the central galaxy.The likelihood changes significantly as a function of stellar mass and the three panels represent stellar masses  * = [10 9 , 10 10 , 10 11 ]M ⊙ from left to right.We also impose a H i column density limit of log  (H i) > 18.0; both the stellar mass and column density restrictions are intended to match the MUSE-ALMA Haloes sample (black stars).At lower column densities, there is an increasing contribution from the intergalactic medium, replacing the contribution from other haloes and satellites.However, the extent of the central galaxy (blue) remains similar as a function of Δ and , even when considering all absorbers with log[ (H i)/cm −2 ] > 13.0.If we look at the distribution of absorbers around galaxies from the COS-Halos survey (Tumlinson et al. 2013;Werk et al. 2013Werk et al. , 2014Werk et al. , 2016;;Peeples et al. 2014), we find that the centroids of the total H i absorption profile are predominantly within the region dominated by the central galaxy after matching stellar masses.However, the centroids of individual H i components are occasionally found at large velocities from the galaxy systemic redshift and are more likely associated with other haloes or the IGM (if at lower column density).The line of sight velocity difference between absorber and galaxy remains an important consideration and we suggest that when associating galaxies with absorbers, both Δ and  are considered (e.g.Berg et al. 2023).
While we have coloured each hexbin by a given flag, we emphasise that this is inherently probabilistic and there is much uncertainty, particularly at the boundaries between the central and satellites or other haloes.Though Figure 9 is a useful observational diagnostic for determining the potential origins of H i absorbers by moving beyond just using the impact parameter, it underscores that absorbers may not have a single well-defined origin and the need for statistical studies involving larger samples.This point is implicitly made by works studying absorbers arising from the intragroup medium where absorbers are not associated with a single galaxy (Gauthier 2013;Nielsen et al. 2018;Klitsch et al. 2018;Péroux et al. 2019;Dutta et al. 2021Dutta et al. , 2023;;Qu et al. 2023).
Thus far, we have adopted a galaxy-centric approach, that is, we study how the properties of H i absorbers vary as we move from a selected central galaxy.Many of the current IFS absorber studies are centred on a background source which is arbitrarily positioned in the sky with respect to foreground galaxies (e.g.Schroetter et al. 2016;Chen et al. 2020;Hamanowicz et al. 2020;Lofthouse et al. 2020;Muzahid et al. 2020;Nielsen et al. 2020;Muzahid et al. 2021;Berg et al. 2023), including the MUSE-ALMA Haloes survey (Péroux et al. 2022).To produce results that can be directly used to better understand observations of this type, we select a random pixel within a 200 kpc square centred on the central that has a column density log[ (H i)/cm −2 ] > 18.0.This becomes the location of our absorber and we calculate the impact parameter of the remaining pixels in the field with respect to the absorber.We can then determine the fraction of absorbers belonging to the four origin flags in a similar manner to Figure 4.For each mock, we repeat this process five times for each projection direction, leading to 15 iterations in total for each central subhalo.
The results are shown in Figure 10.Using a randomly-selected absorber, we plot how the fraction of pixels tracing the central, satellites, other haloes and the IGM surrounding the absorber changes as a function of impact parameter.The dashed lines corresponding to the four origins show this variation with  and the coloured background elucidates the relative fractions within each 10 kpc impact parameter bin.To make an appropriate comparison with the MUSE-ALMA Haloes survey, we re-analyzed this observational data and mimicked the definitions of centrals, satellites and other haloes used in TNG50.We derive the halo mass and virial radius using the stellar-to-halo mass relation (Rodríguez-Puebla et al. 2017).We define the central galaxy as the most massive galaxy in the MUSE field of view and hence, other galaxies associated with the absorber are described as satellites (other haloes) if they are inside (outside)  vir of the central (Karki et al. 2023).While satellites can still be bound beyond  vir , we choose to adopt this simpler definition for this exercise.Then, we apply a column density cutoff of log[ (H i)/cm −2 ] > 18.0 and only consider  * = 10 9 to 10 11 M ⊙ central galaxies to match the MUSE-ALMA Haloes survey.The impact parameter of these various galaxies in the data are plotted using stars with a filled colour corresponding to their origin.For clarity, we plot central galaxies in the top row, followed by satellites and other haloes as we move down.
The relative abundances of central, satellite and other halo galaxies as a function of impact parameter from the MUSE-ALMA Haloes survey is broadly consistent with the predictions from TNG50.This highlights that the most massive halo is not necessarily the host galaxy of the absorber and that satellites and other haloes can be significant contributors to the H i gas down any line of sight.A larger sample size, particularly for the 10 9 M ⊙ central galaxies, is required to make more quantitative comparisons.We note that the excess of satellites at low impact parameters for the 10 11 M ⊙ central galaxies is caused by the DLA towards Q1130−1449 being associated with more than 10 galaxies (Péroux et al. 2019;Chen et al. 2019).The In the top row, we show the fraction of log[  (H i)/cm −2 ] > 18.0 absorbers belonging to the central galaxy given its impact parameter (-axis) and line of sight velocity difference (-axis).In the bottom row, we show the regions where satellites, other haloes and the IGM dominate (note the differing axis ranges).Hexbins are shaded by the colour corresponding to the most likely origin in the bottom row; we emphasise that the origin is probabilistic which we demonstrate in the top row.We use four likelihood bins [  > 0.75, 0.5 <  ≤ 0.75, 0.25 <  ≤ 0.5, 0 <  ≤ 0.25] to colour each hexbin by the corresponding probability ( ) that the central galaxy hosts the absorber at some impact parameter and velocity.There are three plots for the stellar mass bins: 10 9 (left) 10 10 (centre) and 10 11 (right) M ⊙ .It is clear that the central galaxy's stellar mass drives the coverage of H i in Δ- space.This figure represents a step forward from assuming the galaxy at lowest impact parameter is the host of the absorber by taking into account both  and Δ and can be used to guide observers when selecting counterparts to absorbers.At the same time, we emphasise that the contamination from origins such as satellites and other haloes are significant.For current and future surveys of H i absorbers, we consider different log  (H i)bins in Figure A1.right plot of Figure 10 also highlights that gas ejected from AGN that is no longer gravitationally bound may contribute significantly to the covering fraction around massive haloes.While this signal may be enhanced by the kinetic feedback mode of AGN in the IllustrisTNG model pushing large quantities of cool gas into the CGM, it highlights the potential for absorbers to be unbound to any galaxy which is ignored in most observational studies (see Berg et al. 2023, for an exception).

Metallicity distribution of H i absorbers
We now move to statistical studies on absorber metallicities and their possible origins in and around galaxies.The distribution of pLLS and LLS absorber metallicities at  ≲ 1 appears to be bimodal from observations (Lehner et al. 2013(Lehner et al. , 2019;;Wotta et al. 2016Wotta et al. , 2019;;Berg et al. 2023).In Lehner et al. (2013), the authors find tentative evidence for a metallicity bimodality using absorbers with column densities 16.2 ≲ log[ (H i)/cm −2 ] ≲ 18.5 at  ≲ 1.In a larger sample, Wotta et al. (2016Wotta et al. ( , 2019) ) find that the bimodality is driven by pLLS absorbers where the metallicity peaks at [X/H] = −1.7 and −0.4.This bimodality is purported to arise from lowmetallicity absorbers tracing gas accretion or overdense regions of the Universe (Berg et al. 2023), while more metal-rich absorbers are associated with the CGM of galaxies.However, a study of  * galaxies from the COS-Halos Survey finds a unimodal metallicity distribution centred on [X/H] ≈ −0.5 (Prochaska et al. 2017) and argues that lowmetallicity absorbers are not necessarily freshly accreted gas.As our TNG50 sightlines are centred on central galaxies with specific halo masses, we do not attempt to reproduce the number counts in these observations (see Hafen et al. 2017;Rahmati & Oppenheimer 2018), but rather investigate whether a bimodality exists in the normalized sense using the various absorber origins. .The fractional pixel origins (-axis) given its impact parameter (-axis) from a randomly-selected log[  (H i)/cm −2 ] > 18.0 absorber.There are three plots for the stellar mass bins: 10 9 (left) 10 10 (centre) and 10 11 (right) M ⊙ .The dashed lines show how the fraction of pixels tracing the central, satellites, other haloes and the IGM vary as a function of impact parameter.Using bins of 10 kpc in , we also highlight their relative fractions using the coloured background.Data points from the MUSE-ALMA Haloes survey are plotted as stars and diamonds (for the galaxy nearest the absorber) using the publicly available catalogue from Weng et al. (2023a).We find a rough agreement between the abundances of central, satellite and other halo galaxies and the predictions from TNG50.The excess of satellite galaxies at low impact parameters for the 10 11 M ⊙ (right) plot arises from a large galaxy group consisting of > 10 galaxies found towards Q1130−1449 (Péroux et al. 2019;Chen et al. 2019).
In Figure 11, we display the metallicity distributions of absorbers separated by their origin in TNG50.We first separate absorbers by whether they trace inflows or outflows in the top panels and then, absorbers tracing the IGM from absorbers tracing the central galaxy in the bottom panels.All distributions are normalized to have equal peak heights and do not reflect the actual incidence of absorbers.While outflowing gas is typically more metal-rich than inflowing gas, we find only a ∼0.2 dex different in their metallicity distribution peaks for the fiducial parameters of 16.0 < log[ (H i)/cm −2 ] < 19.0 and  cen = 10 9 M ⊙ .This difference increases to ∼0.4 dex if we only consider 13.0 < log[ (H i)/cm −2 ] < 16.0 absorbers (top right), but almost disappears when considering  * = 10 11 central galaxies (top centre).Regardless, any difference we find is minor when compared to observations where the difference in [X/H] is 1.3 dex.The strong overlap in metallicities is in part caused by efficient wind recycling, where previous metal-enriched outflows later become inflows (Anglés-Alcázar et al. 2017).We choose to not include absorbers that are in quasi-hydrostatic equilibrium or associated with satellites in this sample for clarity but note that their presence further dilutes any signal of bimodality (as seen in the unimodal 'central' distributions in the bottom panels).These results are consistent with previous simulated metallicity distributions (Hafen et al. 2017;Rahmati & Oppenheimer 2018) and in tension with some observations (Fumagalli et al. 2016;Wotta et al. 2019).
In the bottom panels of Figure 11, we compare the metallicity distributions of gas tracing the intergalactic medium with gas bound to the central galaxy.Curiously, we find absorbers with 16.0 < log[ (H i)/cm −2 ] < 19.0 and metallicities [X/H] > 0.1 that trace gas in the IGM.When we compare these values with the gas bound to a  * = 10 9 M ⊙ central galaxy (bottom left), we find the IGM gas is metal-enriched with respect to the galaxy.These metal-enriched IGM absorbers arise from the expelled material of more massive haloes found along the sightline, as feedback processes drive metal enriched gas to large distances from the central regions of galaxies (e.g.Madau et al. 2001;Scannapieco et al. 2002;Cen & Chisari 2011;Maio et al. 2011;Ayromlou et al. 2022).This is why we see an alignment in metallicity distributions between the peak IGM component and the  * = 10 11 M ⊙ central galaxy sample in the bottom middle panel.When we select for H i column densities log[ (H i)/cm −2 ] < 16.0, we see a 3 dex discrepancy between the distribution peaks, with IGM absorbers found at lower  as expected.
Whether the metallicity distribution of partial Lyman-limit systems is unimodal or bimodal at  = 0.5 is tied directly to the incidence of absorbers belonging to the various origins (e.g.IGM and central).We reiterate that any direct comparison with observational studies is difficult as our sightlines are inherently found near galaxies.However, we do find that in the TNG50 simulation, the metallicity is not a perfect discriminator of gas that is accreting or outflowing (consistent with the findings of Hafen et al. 2017;Rahmati & Oppenheimer 2018).Moreover, the peak of the metallicity distribution for absorbers associated with 10 10 and 10 11 M ⊙ central galaxies is consistent with both the metal-rich peak from the bimodal distribution of Wotta et al. (2016) ([X/H] ≈ −0.4) and the peak of the unimodal distribution ([X/H] ≈ −0.5) in Prochaska et al. (2017).While the peaks align, Prochaska et al. (2017) finds a spread in metallicities around  * galaxies that is roughly twice as large as predicted in TNG50.In Figure 11, we observe that the increased spread towards lower [X/H] may arise from less-massive satellite or secondary halo galaxies that are typically lower metallicity from the mass-metallicity relation (Lequeux et al. 1979).We note that satellite galaxies have not been shown for clarity, but their metallicity distribution also extends to smaller [X/H] values.The lower incidence of super-solar metallicities ([X/H] > 0.5) may be caused by the limited CGM resolution in TNG50 (∼ 1 pkpc beyond 0.1 vir ), although we note that Wotta et al. (2016Wotta et al. ( , 2019) ) find an upper limit in [X/H] of roughly 0.5.Ultimately, our results suggest that inferring the origin of gas from metallicity requires caution.For random sightlines towards UV-bright QSOs (e.g.Lehner et al. 2018), we find that gas expelled from massive haloes into the intergalactic medium are a source of metal-enriched absorbers.Likewise, the large spread in [X/H] values around  * galaxies may imply that absorbers are perhaps associated with lower-mass satellites that have lower metallicity.The normalized distribution of absorber gas phase metallicities.We adopt H i column densities 16.0 < log[  (H i)/cm −2 ] < 19.0 to match observational samples and a central stellar mass of  * = 10 9 M ⊙ as the fiducial parameters (left panels).The vertical dashed lines indicate the peaks of the bimodal metallicity distribution found in observations.In the top (bottom) panels, we separate sightlines probing inflows (the central) from outflows (the IGM and other haloes) and display the distribution of metallicities for the separate populations.The histograms have been normalized such that the peaks of each distribution are at unity.An exception is for 'other halo' galaxies in the bottom row which have been normalized by the peak of the central galaxy metallicity distribution for clarity.There is a ≈0.2 dex difference in metallicity between inflows and outflows for the fiducial parameters.At higher stellar masses (lower column densities), this difference diminishes (increases) in magnitude.We find gas in the IGM spans a broad range of metallicities, from metal-poor to metal-rich, due to significant environmental enrichment from nearby galaxies ejecting metals beyond their haloes.Similarly, gas belonging to other haloes along the line of sight will be of varying stellar masses and hence, have a significant range of metallicites.

The CGM of star-forming and quiescent galaxies
The analysis in this work focuses on the CGM properties of galaxies with varying stellar masses at  = 0.5, coinciding with the  * range and redshift of galaxies in MUSE-ALMA Haloes.At any given stellar mass bin, there are galaxies above, below and on the SFR- * main sequence.Here, we discuss how the CGM properties of galaxies with similar stellar mass depend on the star-formation rate.The central galaxies in this work are randomly selected from TNG50 and enforced to have stellar masses within 0.3 dex of  * = [10 8.0 , 10 9.0 , 10 10.0 , 10 11.0 ] M ⊙ .In total, there are [100, 100, 50, 20] galaxies within each bin, and we further categorise the galaxies as star-forming or quiescent.The distinction is made somewhat arbitrarily; we consider galaxies with SFRs in the lowest quartile of each bin as quiescent, and the remainder are star-forming.We also tested separating star-forming and quiescent galaxies using the median SFR but found little variation in the results presented below.
We find marginal differences in the results presented in this paper after separating star-forming and quiescent galaxies.The fraction of sightlines with H i as a function of impact parameter for the various origins (Figure 4) are within the uncertainties for both groups.Likewise, there are marginal differences in the fraction of inflows, quasi-static gas, outflows and satellites as a function of azimuthal angle between star-forming and quiescent galaxies (Figure 7).These results highlight that the stellar mass (because it is tied to halo mass) is the key driver of the amount, distribution and extent of the H i in the circumgalactic medium.Additionally, it is unclear in observations whether the cool gas content in the CGM of star-forming and quiescent galaxies differ.From studies of luminous red galaxies, the cool gas mass in the CGM of passive galaxies appears comparable to star-forming galaxies (Chen et al. 2018;Zahedy et al. 2019).As H i is almost ubiquitous in galaxy haloes (e.g.Tumlinson et al. 2013;Werk et al. 2013Werk et al. , 2014)), Ly- is not the ideal absorption line to trace differences between the circumgalactic media of star-forming and passive galaxies.Instead, it appears that the O vi covering fraction is significantly larger around star-forming galaxies (Werk et al. 2013;Tchernyshyov et al. 2023).To understand the different CGM properties of star-forming and quiescent galaxies in simulations, we require a more systematic study across all stellar masses rather than isolated bins in this work.The simplistic method of separating star-forming and passive galaxies used might weaken any potential differences in their CGM properties.However, we note that our results are consistent with observations and highlight that stellar (halo) mass drives the H i amount, extent and distribution around galaxies.

The incidence of inflows in observations and simulations
The incidence of inflowing gas observed in both tranverse absorption line and down-the-barrel observational studies is inferred to be ≈10 per cent (Kacprzak et al. 2010;Martin et al. 2012;Rubin et al. 2012;Ho et al. 2017;Zabl et al. 2019;Weng et al. 2023b).Comparatively, our TNG50 results indicate a minimum inflow fraction of ≈20 per cent which rapidly increases for higher stellar masses (Figure 7).We emphasise that observational studies of gas flows using absorption-lines towards background sources provide only fragmentary information about the physical origin of the observed gas and perhaps our assumptions on whether the gas traced is inflowing or outflowing require reassessment (see Section 5).Moreover, when we collapse the mock into a 2D projection, there is almost always both inflowing and outflowing gas in each sightline.This conflicts with assumptions made in most transverse absorption-line studies, where an entire absorption system is typically assigned to a single gas flow (e.g.Schroetter et al. 2019;Zabl et al. 2019;Weng et al. 2023b).In reality, the absorption could be produced by a combination of the two processes (see Nielsen et al. 2022, for an example) and current observational methods do not capture this adequately.This may be one cause of the disparity in inflow incidences between observations and simulations.Despite these observational and modelling challenges, the incidence of sightlines tracing inflowing gas remains an important and potentially constraining quantity to measure.

The number of clouds along each sightline
For the characterization of different origins, and measurements of absorber properties per sightline, we assume that each sightline is dominated by a single cloud of gas belonging to one of the flags.In reality, there is the chance of intersecting multiple clouds which we commonly find in absorption line observations.If there are multiple clouds along the line of sight found at different velocities, then the measurement of properties such as the line of sight distance or metallicity may be averaged out.However, Ramesh & Nelson (2023) shows that the typical number of clouds intersected with log[ (H i)/cm −2 ] > 16.0 along a sightline is approximately two near the centre of Milky Way-like galaxies at  = 0, decreasing to a single cloud towards the virial radius for TNG50.Hence, at this resolution in the CGM, it is likely we are only intersecting a single cloud.In the event there are multiple clouds, we typically find that a single cloud dominates the H i mass.

Extension to different gas phases
Thus far, we have analysed H i absorbers in this study.Other common metal absorption lines used in studies of absorber counterparts include Mg ii, C iv and O vi.In the top row of Figure 12, we show column density maps of each ion for the same  * ≈ 10 10 M ⊙ galaxy displayed in Figure 2.While the H i and Mg ii absorbers are densest at the centre of galaxies, the C iv and O vi absorbers that trace hotter gas phases are more diffuse and extended (Ho et al. 2021;Nelson et al. 2023).Following the previous analysis for H i, we designate each pixel by the identical set of origin and gas flow flags using the aggregate Mg ii, C iv or O vi mass along each sightline.Looking at the second row of Figure 12, we find that the more massive central galaxy dominates most sightlines over satellite and other halo galaxies for C iv and O vi.This is caused by smaller haloes not reaching the virial temperatures (≈ 10 5.5 K) required to form O vi.The structure of outflows in the bottom row also differs between the ions.A visual inspection shows that ions tracing the hotter phases of gas have a larger proportion of sightlines dominated by outflows.This is in line with the earlier discussion of the high incidence of H i inflows; because the outflowing gas is hotter, it is more likely to reach the temperatures required to produce C iv and O vi.We present here only some preliminary insights into how different absorber species have varying origins.A complete analysis will be released in an upcoming work.

CONCLUSIONS
We analyse the physical origins of H i absorbers in and around central galaxies with stellar masses 10 8 to 10 11 M ⊙ at  = 0.5 using the TNG50 simulation.We consider all gas cells within ± 500 km s −1 of the central galaxy and categorise all cells based on whether they are gravitationally bound to the central galaxy, a satellite of the central or another halo.Additionally, we also consider gas that is unbound and in the intergalactic medium.These four flags [IGM, central, satellite, other halo] form the origin labels.We also derive a second set of gas flow labels: [inflows, quasi-hydrostatic, satellites and outflows].We then connect absorber properties such as impact parameter, line of sight velocity difference, line of sight distance, metallicity, azimuthal angle and column density with their origin or gas flow.Our major findings are summarised here.
• The line of sight velocity difference is a poor indicator of the physical distance between the absorber and galaxy, particularly if the absorber traces gas in the intergalactic medium or another halo near the sightline (Figure 3).Hence, studies that find large metallicity, temperature or density discrepancies between individual components (Zahedy et al. 2019;Nielsen et al. 2022;Sameer et al. 2022) may be tracing gas arising from different origins or separated by large physical distances.log[ (H i)/cm −2 ] < 19.0 H i absorbers with velocity separations |Δ LOS | < 20 km s −1 can trace gas that is several Mpc away.However, we find that 75 per cent of H i absorbers with column densities log[ (H i)/cm −2 ] > 16.0 can be found within ±150 km s −1 of  * = 10 10 M ⊙ central galaxies.This value decreases to 70 and 120 km s −1 for 10 8 and 10 9 M ⊙ galaxies, respectively and increases to 250 km s −1 for 10 11 M ⊙ galaxies.
• The fraction of absorbers that are associated with the central galaxy decreases with impact parameter (Figure 4).This decline is steepest for higher H i column densities and lower stellar masses.From impact parameters  > 0.5 vir , satellite and other halo galaxies begin to dominate the fraction of absorbers.Contributions from the intergalactic medium are marginal, particularly for higher  * central galaxies and larger  H i .However, we see in Figure 5 that > 80 per cent of absorbers with column densities 13.0 < log[ (H i)/cm −2 ] < 16.0 trace gas in the IGM.
• Satellite galaxies with stellar mass  * < 10 8 M ⊙ can contribute ∼40 per cent of the total sightlines that intersect satellites of a 10 9 M ⊙ central galaxy.This fraction reduces to ∼10 per cent for 10 10 and 10 11 M ⊙ centrals.For secondary haloes down the line of sight, We see that the extent, distribution and origin of absorbers depend significantly on the tracer used.The C iv and O vi maps are dominated by the massive central galaxy, while we find more contributions from satellites and other haloes in the H i and Mg ii maps.More of the gas is found to be outflowing in the higher-ionization tracers than in the H i or Mg ii, where the latter is particularly marginal in extent.
25 per cent of absorbers are attributed to  * < 10 8 M ⊙ galaxies.These findings are a possible explanation of H i absorbers that do not have detected galaxy counterparts near the background source in observational studies.
• After modelling the azimuthal angle of absorbers in a similar manner to observers, we find that the relative incidence of outflows compared to inflows increases as we move towards the minor axis.This signal is strongly dependent on the impact parameter and central galaxy stellar mass; at smaller  and larger  * , inflows begin to dominate at all azimuthal angles.The larger incidence in simulations may be attributed to the singular classification of absorbers as either outflowing or inflowing; in TNG50, there is typically both inflowing and outflowing gas found along each sightline.
• The median metallicity of absorbers increases towards the minor axis, consistent with the findings of previous theoretical studies (Péroux et al. 2020;van de Voort et al. 2021) and observations (Wendt et al. 2021).When decomposing the signal into individual gas flows, we find that the increasing incidence of outflows does not drive the increasing metallicity, but rather both inflows and outflows increase in  towards larger azimuthal angles.
• We find that analysing absorber-galaxy systems from the MUSE-ALMA haloes survey using the position of absorbers with respect to galaxies in Δ- space is useful to statistically associate the gas with its surrounding galaxies.Instead of assuming the galaxy nearest the absorber is the host galaxy of the gas, we suggest these Δ- diagrams (Figure 9) are a useful diagnostic that takes into account both the line of sight velocity difference and impact parameter.
• In Figure 10, we show a direct comparison between the distribution of galaxies around absorbers in MUSE-ALMA Haloes and TNG50.The results are broadly consistent and highlight that observers may need to consider absorbers not bound to any galaxy as a plausible source of gas being probed, particularly around larger haloes.
• There is a marginal (≲ 0.5 dex) difference in the peaks of the inflowing and outflowing gas metallicity distributions.The difference decreases for larger central galaxy stellar masses and increases for lower H i column densities but never reaches the large differences seen in observational studies.In line with previous simulations (Hafen et al. 2017;Rahmati & Oppenheimer 2018), we find that the observed bimodal metallicity distribution is not seen as strongly even after accounting for the various physical origins of the gas.
We expect to expand this study to other common ions in absorption-line studies such as Mg ii, C iv and O vi and to higher redshifts where more recent surveys are searching for galaxy coun-terparts to absorbers (e.g.Díaz et al. 2021;Bordoloi et al. 2023).Upcoming surveys with instruments such as the Dark Energy Spectroscopic Instrument (DESI; DESI Collaboration et al. 2016a,b), WEAVE (Dalton et al. 2016) and 4MOST (de Jong et al. 2012, 2019;Peroux et al. 2023) will produce millions of absorber-galaxy pairs and their results require a statistical interpretation.With the rapid proliferation of studies of galaxies surrounding absorbers of varying species and redshifts, it becomes more important than ever to interpret the results of these observational studies using simulations.

Figure 2 .
Figure2.A visualisation of  = 0.5 galaxy haloes in the TNG50 sample of galaxies.In the left column, we show the projected H i column density maps of four galaxies belonging to different stellar mass bins from top to bottom.The plots are also accompanied by the Subhalo index and a bar indicating the physical scale of the image.The central and rightmost columns are the same galaxy shown in the left column but pixels are now coloured by the flag that dominates the H i mass in projection.The black pixels in the right column signify that none of the gas flow labels meet the column density threshold of log[  (H i)/cm −2 ] > 13.0 in those regions.The colours used directly correspond to the labels used in Figure1.We show the virial radius of these haloes with the dashed white circle.

Figure 3 .
Figure 3.A comparison of the line of sight distance with the line of sight velocity for mock absorbers in TNG50 at  = 0.5.Positive (negative) line of sight distances are behind (in front of) the central galaxy away from (towards) the observer.Similarly, positive (negative) line of sight velocities are directed away from (towards) the observer.We consider H i absorbers with column densities 16.0 < log[  (H i)/cm −2 ] < 17.2 (partial Lyman-limit systems) associated with log(  * / ⊙ ) ≈ 10.0 central galaxies.Absorbers are separated by their origin or gas flow which are given in the top right corner of each plot.Each hexbin is coloured by the median impact parameter of all absorbers found within that hexbin.We plot the mean  LOS in 40 bins with width ∼10 km s −1 for the 'Central', 'Inflow', 'Outflow' and 'Satellite' panels as a thick black line and the shaded region represents the standard deviation.In general, close separations in line of sight velocity can correspond to significant separations in line of sight distance, even when an absorber is tracing the central galaxy.Using a kernel density estimator, the white contours on the top row show where the absorbers are concentrated with contour levels of [0.25, 0.50, 0.75] times the total number of absorbers.We find that 75 per cent of the H i mass traced by pLLS is enclosed within |Δ | < 150 km s −1 of the 10 10 M ⊙ central galaxies.This Δ limit varies between 70 and 250 km s −1 for the stellar mass range in our sample but does not change significantly with column density.

Figure 4 .
Figure 4.The fraction of H i absorbers that arise from gas in the IGM, central, satellites or other haloes as a function of the impact parameter (normalized by  vir in the top axis) at  = 0.5.A vertical dashed black line indicates the virial radius.Here, we consider four stellar mass bins ranging from log(  * / ⊙ ) = 8.0 to 11.0 in one dex intervals and three column density ranges: 17.2 < log[  (H i)/cm −2 ] < 19.0 (LLS), 19.0 < log[  (H i)/cm −2 ] < 20.3 (sub-DLAs) and bottom; log[  (H i)/cm −2 ] > 20.3 (DLAs).The central galaxy dominates at impact parameters up to ≈ 0.5  vir , though this limit decreases for higher column densities.At roughly 0.5 vir <  <  vir , satellite galaxies dominate the fraction of absorbers and beyond the virial radius, other haloes along the line of sight contribute most to the absorber count.There is only a marginal contribution from the intergalactic medium at these H i column densities.These results highlight that knowledge of the stellar mass of galaxies associated with quasar absorbers is key to relate the gas probed in absorption with its origin.
Figure5.The median H i column density of absorbers versus given impact parameter for galaxies with stellar masses covering log(  * / ⊙ ) = 8.0 to 11.0 at  = 0.5.We show the  H i - relation in the primary panel for  * = 10 11 M ⊙ central galaxies with the coloured line.The faded grey lines represent the same relation but for the lower stellar mass bins found in the secondary panels.The vertical dashed grey lines mark the impact parameters where the median log  (H i) transitions from damped Ly- absorbers to partial Lyman-limit systems for log(  * / ⊙ ) = 11.0 galaxies.The last impact parameter bin covers column densities 13.0 < log[  (H i)/cm −2 ] < 16.0 (Ly- forest).The coloured area in each bin is proportional to the fraction of absorbers (with log  (H i)consistent with the respective bin) that belong to the categories of IGM, central, satellite and other halo.For example, the first bin that covers DLAs shows that most log[  (H i)/cm −2 ] > 20.3 absorbers will arise from the  * = 10 11 M ⊙ central galaxy, with small contributions from satellites and other haloes along the line of sight.At lower column densities, the fraction of sightlines that begin to trace gas in the intergalactic medium increases and then the IGM dominates for absorbers at Ly- forest column densities.Similar to Figure4, we find that the contribution of satellites, other haloes and the IGM increases with the impact parameter.Additionally, we notice that higher mass central galaxies account for a larger fraction of dense H i absorbers (log[  (H i)/cm −2 ] > 17.2) but at lower  H i , the central fractions remain consistent across the four stellar mass bins.Black dashed vertical lines mark impact parameters that are 0.15, 0.5 and 1 times the virial radius.Despite the various potential contributions from satellites, interloping haloes or the intergalactic medium, the trend of decreasing H i column density with impact parameter remains clear.

Figure 6 .
Figure6.The contribution of satellites (left) and other haloes (right) with varying masses to the fraction of sightlines that intersect satellites.The four colours correspond to the four stellar mass bins for the central galaxy.We performed this calculation using five column density bins, from Ly- forest column densities (13.0 ≤ log[  (H i)/cm −2 ] ≤ 16.0) to DLAs.The shaded region between the solid lines for each stellar mass bin reflects the maximum discrepancy (typically ∼0.1) in the fraction found between the five column density bins.We use stellar mass bins of size log(  * / ⊙ ) = 0.2.On the left, we find that galaxies with

Figure 7 .
Figure7.The fraction of absorbers intersecting gas originating from one of the four gas flow flags as a function of the azimuthal angle.We use a consistent radial velocity cutoff of ±20 km s −1 to label inflows and outflows and consider only central galaxies with a major-to-minor axis ratio less than the median value for the sample.Using bins in Φ of 10 • , we colour each bin by the fraction of absorbers belonging to categories seen in the colour bar (left -axis).We find a significant contribution from gas that is in quasi-hydrostatic equilibrium (purple) at all azimuthal angles.The solid white line represents the fraction of outflowing to inflowing absorbers (right -axis) and the horizontal dashed line depicts an equal ratio.There is an increase in this ratio as we move from the major axis to the minor axis.This is most prominent in the primary panel where we consider LLS absorbers found at an impact parameter of 50 to 100 kpc from central galaxies of stellar mass ∼10 9 M ⊙ .However, accounting only for absorbers at 0 to 50 kpc (bottom left) or absorbers around ∼10 10 M ⊙ central galaxies (bottom right) produces a minor difference of ≈0.2 in the outflow to inflow ratio between the major and minor axes.While there is a clear increase in the outflow to inflow ratio towards larger Φ at lower H i column densities (bottom middle), this ratio never exceeds unity.

Figure 8 .
Figure8.The metallicity with respect to solar of absorbers belonging to the four gas flow categories as a function of the azimuthal angle are plotted as solid lines.The median metallicity of all absorbers is plotted in white.We use a radial velocity cutoff of ±20 km s −1 and only consider central galaxies with a major-to-minor axis ratio less than the median value for the sample.The shaded regions reflects the 0.5 uncertainty in the metallicity for only the inflowing and outflowing absorbers.Absorbers associated with quasi-static gas and satellites do not have their errors plotted for clarity.In the primary panel, we adopt the same impact parameter (50 to 100 kpc), column density (LLS) and stellar mass bins ( central ≈ 10 9 M ⊙ ) as in Figure8.For the secondary panels, we also make the same variations from the fiducial parameters.The positive gradient of the white dashed line in all panels shows that the median metallicity of absorbers increases towards the minor axis regardless of physical origin, although the effect diminishes for more massive central galaxies.When we separate the absorbers into the four gas flow flags and plot their metallicities (coloured lines), we discover that the inflowing and quasi-static gas also increase in  at larger Φ.These absorbers then drive the trend in median metallicity as they are typically more abundant than outflowing absorbers.
Figure 9.In the top row, we show the fraction of log[  (H i)/cm −2 ] > 18.0 absorbers belonging to the central galaxy given its impact parameter (-axis) and line of sight velocity difference (-axis).In the bottom row, we show the regions where satellites, other haloes and the IGM dominate (note the differing axis ranges).Hexbins are shaded by the colour corresponding to the most likely origin in the bottom row; we emphasise that the origin is probabilistic which we demonstrate in the top row.We use four likelihood bins [  > 0.75, 0.5 <  ≤ 0.75, 0.25 <  ≤ 0.5, 0 <  ≤ 0.25] to colour each hexbin by the corresponding probability ( ) that the central galaxy hosts the absorber at some impact parameter and velocity.There are three plots for the stellar mass bins: 10 9 (left) 10 10 (centre) and 10 11 (right) M ⊙ .It is clear that the central galaxy's stellar mass drives the coverage of H i in Δ- space.This figure represents a step forward from assuming the galaxy at lowest impact parameter is the host of the absorber by taking into account both  and Δ and can be used to guide observers when selecting counterparts to absorbers.At the same time, we emphasise that the contamination from origins such as satellites and other haloes are significant.For current and future surveys of H i absorbers, we consider different log  (H i)bins in FigureA1.
Figure10.The fractional pixel origins (-axis) given its impact parameter (-axis) from a randomly-selected log[  (H i)/cm −2 ] > 18.0 absorber.There are three plots for the stellar mass bins: 10 9 (left) 10 10 (centre) and 10 11 (right) M ⊙ .The dashed lines show how the fraction of pixels tracing the central, satellites, other haloes and the IGM vary as a function of impact parameter.Using bins of 10 kpc in , we also highlight their relative fractions using the coloured background.Data points from the MUSE-ALMA Haloes survey are plotted as stars and diamonds (for the galaxy nearest the absorber) using the publicly available catalogue fromWeng et al. (2023a).We find a rough agreement between the abundances of central, satellite and other halo galaxies and the predictions from TNG50.The excess of satellite galaxies at low impact parameters for the 10 11 M ⊙ (right) plot arises from a large galaxy group consisting of > 10 galaxies found towards Q1130−1449(Péroux et al. 2019;Chen et al. 2019).
Figure11.The normalized distribution of absorber gas phase metallicities.We adopt H i column densities 16.0 < log[  (H i)/cm −2 ] < 19.0 to match observational samples and a central stellar mass of  * = 10 9 M ⊙ as the fiducial parameters (left panels).The vertical dashed lines indicate the peaks of the bimodal metallicity distribution found in observations.In the top (bottom) panels, we separate sightlines probing inflows (the central) from outflows (the IGM and other haloes) and display the distribution of metallicities for the separate populations.The histograms have been normalized such that the peaks of each distribution are at unity.An exception is for 'other halo' galaxies in the bottom row which have been normalized by the peak of the central galaxy metallicity distribution for clarity.There is a ≈0.2 dex difference in metallicity between inflows and outflows for the fiducial parameters.At higher stellar masses (lower column densities), this difference diminishes (increases) in magnitude.We find gas in the IGM spans a broad range of metallicities, from metal-poor to metal-rich, due to significant environmental enrichment from nearby galaxies ejecting metals beyond their haloes.Similarly, gas belonging to other haloes along the line of sight will be of varying stellar masses and hence, have a significant range of metallicites.

Figure 12 .
Figure12.A visualisation of a 10 10.2 M ⊙ central galaxy (subhalo ID 455488) in TNG50.In the top row, we show the H i, Mg ii, C iv and O vi column density maps respectively from left to right.The middle and bottom rows colour the pixels by the flag that dominates the H i or ion mass in projection.The dashed white circle outlines the virial radius of the galaxy.We see that the extent, distribution and origin of absorbers depend significantly on the tracer used.The C iv and O vi maps are dominated by the massive central galaxy, while we find more contributions from satellites and other haloes in the H i and Mg ii maps.More of the gas is found to be outflowing in the higher-ionization tracers than in the H i or Mg ii, where the latter is particularly marginal in extent.