11institutetext: Departamento de Física de la Tierra y Astrofísica,
Universidad Complutense de Madrid, Pl. Ciencias, 1, Madrid, 28040, Madrid,
Spain 22institutetext: Instituto de Física de Partículas y del Cosmos,
Universidad Complutense de Madrid, Pl. Ciencias, 1, Madrid, 28040, Madrid,
Spain 33institutetext: Lund Observatory, Division of Astrophysics, Department
of Physics, Lund University, Box 43, SE-221 00 Lund, Sweden 44institutetext:
Instituto de Astronomía, Universidad Nacional Autónoma de México, Circuito
Exterior s/n, Ciudad de México, 04510, Ciudad de México, México

# Measuring the physical imprints of gas flows in galaxies I: Accretion rate
histories

A. Camps-Fariña , 1122<EMAIL_ADDRESS>P. Sánchez-Blázquez 1122 S. Roca-Fàbrega
112233 S. F. Sánchez 44

###### Abstract

Context.  Galaxies are expected to accrete pristine gas from their
surroundings to sustain their star formation over cosmic timescales. This
mechanism is well established in models and simulations, but evidence from
observations is mostly indirect. These gas inflows leave distinct traces in
the chemical composition of newborn stars and alter the distribution of
stellar abundances compared to what would be expected from a closed-box model
of chemical evolution.

Aims. The goal of this work is to measure the amount of pristine gas that
galaxies accrete during their lifetime, using information on the ages and
abundances of their stellar populations and a chemical evolution model. We
also aim to determine the efficiency of star formation over time.

Methods. We derived star formation histories and metallicity histories for a
sample of 8523 galaxies from the MaNGA survey. We use the former to predict
the evolution of the metallicity in a closed-box scenario, and estimate for
each epoch the gas accretion rate required to match these predictions with the
measured stellar metallicity.

Results. Using only chemical parameters, we find that the history of gas
accretion depends on the mass of galaxies. More massive galaxies accrete more
gas and at higher redshifts than less massive galaxies, which accrete their
gas over longer periods. We also find that galaxies with a higher star
formation rate at $z=0$ have a more persistent accretion history for a given
mass. We characterize the individual accretion histories in terms of two
parameters: the total accreted gas mass and the $\tau$80 of the accretion
history, a measure of when most of the accretion occurred. As expected, there
is a strong correlation between the integrated star formation history and the
total accreted gas mass, such that more massive galaxies accreted more gas
during their lifetime. Currently star-forming galaxies lie above this
correlation, so they tend to accrete more gas than average. The relationship
between $\tau$80, the current stellar mass, and the current specific star
formation rate is split such that star-forming galaxies (as now observed) may
be found in a population with persistent gas accretion regardless of their
stellar mass. The star formation efficiency shows similar correlations: early-
type galaxies and higher-mass galaxies had a higher efficiency in the past,
and it declined such that they are less efficient in the present. Our analysis
of individual galaxies shows that compactness affects the peak star formation
efficiency that galaxies reach, and that the slope of the efficiency history
of galaxies with current star formation is flat.

Conclusions. We show throughout the article that we can obtain information
about the processes that regulate the chemical composition of the interstellar
medium during the lifetime of a galaxy from the properties of stellar
populations. Our results support the hypothesis that a steady and substantial
supply of pristine gas is required for persistent star formation in galaxies.
Once they lose access to this gas supply, star formation comes to a halt.

###### Key Words.:

galaxy evolution – chemical abundances – star formation

##  1 Introduction

In the standard Lambda cold dark matter (LCDM) paradigm, pristine gas inflows
are a natural expectation and serve as the foundation for galaxy growth (e.g.,
Finlator & Davé, 2008; Schaye et al., 2010; Fraternali & Tomassetti, 2012;
Lilly et al., 2013; Ceverino et al., 2016; Mollá et al., 2016; Rodríguez-
Puebla et al., 2016). However, direct observations of these inflows have
remained elusive due to the difficulty in detecting accreted gas (e.g.,
Sancisi et al., 2008; Fraternali & Binney, 2008; Sánchez Almeida et al., 2014;
Sánchez Almeida, 2017; Cimatti et al., 2019). Furthermore, the accretion of
gas and its observable consequences, such as higher star formation rates
(SFRs) and lower metallicity, occur at different times, making concurrent
observations challenging. Giavalisco et al. (2011) detected large amounts of
pristine gas associated with a cluster of galaxies undergoing an ongoing
infall process. Martin et al. (2012) and Rubin et al. (2012) also found
evidence of cold gas around star-forming galaxies using Fe and Mg absorption
lines, although the low covering fractions of the gas suggest that there is
not enough to fuel their star formation. In the Milky Way, the estimated rate
of HI gas accretion derived from detected HI clouds is around 0.1-0.4 M, which
is insufficient to account for the current SFR (Putman et al., 2012).

Observational evidence of gas accretion in galaxies is largely indirect. For
example, the Schmidt-Kennicutt relation has shown that galaxies at all
redshifts cannot maintain their current SFR for more than 0.5-2 Gyr without
replenishment by gas (e.g., Schmidt, 1959; Kennicutt, 1983, 1998; Colombo et
al., 2018, 2020; Sánchez et al., 2021b; Genzel et al., 2010; Daddi et al.,
2010; Tacconi et al., 2013; Kennicutt, 1983; Dekel & Birnboim, 2006; Dekel et
al., 2009; Fraternali & Tomassetti, 2012; Lilly et al., 2013; Davis & Bureau,
2016). Additionally, the gas fraction decreases with redshift at a much lower
rate than the stellar density (Prochaska et al., 2005; Rao et al., 2006; Lah
et al., 2007).

The study of chemical abundances also provides indirect evidence of gas
accretion, as gas accreted from the cosmic web is believed to be mostly
unenriched by metals (van de Voort & Schaye, 2012). This could explain the low
gas metallicities in some star-forming regions in local and high-redshift
galaxies (e.g., Bresolin et al., 2012; Ceverino et al., 2016) or the strong
gas-phase metallicity gradients observed in some high-redshift galaxies (e.g.,
Cresci et al., 2010).

Models of chemical evolution in the Milky Way have shown that the narrow
metallicity distribution of long-lived stars in the solar neighborhood can
only be reproduced with a continuous inflow of relatively low-metallicity gas
(Larson, 1972; Fenner & Gibson, 2003; Chiappini, 2009), known as the G-dwarf
problem (Searle & Sargent, 1972; Tinsley, 1980; Nordström et al., 2004;
Caimmi, 2008). These studies predict an exponential decrease in the infall
rate with time, with a current value of 0.4 M⊙ yr-1. Although such predictions
are useful for constraining both cosmological models and subgrid recipes used
in numerical simulations, it is important to note that the Milky Way is just
one galaxy, and differences in gas accretion rates as a function of mass,
morphology, and the environment may exist.

For this study, we adopted a similar approach to estimate the gas accretion
rates over time for a sample of 8523 galaxies from the MANGA survey.
Specifically, we used the star formation histories and stellar age-metallicity
relation to calculate the mass of metal-poor gas required over time to dilute
the amount of metals predicted by a chemical evolution model (e.g., Roca-
Fàbrega et al., 2021; Lilly et al., 2013). We explored the differences between
galaxies as a function of various parameters.

The paper is structured into the following sections: Sec. 2 describes the
sample and the observational data employed for this study, while Sec. 3
explains the methodology used to derive the star formation and chemical
evolution histories (SFHs and ChEHs hereafter), as well as measuring gas
accretion. Sec. 4 presents the results on the gas accretion and star formation
efficiency (SFE) histories, as well as the trends with stellar mass,
morphology, and the current star formation. Finally, Sec. 5 discusses the
results and outlines possible improvements, while Sec. 6 provides a summary of
the findings.

##  2 Data

The MaNGA survey (Bundy et al., 2015) consists of integral field unit (IFU)
spectroscopic observations of a luminosity-selected sample of 104 local
galaxies ($\langle\mathrm{z}\rangle\sim 0.03$). The spectra were taken at the
2.5 m Sloan Telescope at Apache Point Observatory (Gunn et al., 2006) with the
BOSS spectrographs (Smee et al., 2013) with fiber bundles of different sizes
depending on the galaxy (Drory et al., 2015). Additional fibers and fiber
bundles are used for flux calibration and sky subtraction (Yan et al., 2016).

The observations were reduced and calibrated using the Data Reduction Pipeline
(DRP, Law et al., 2016) after which the data cubes are produced, which are the
central distributed data product of the project. These have a spatial
resolution of about 2.5”/FWHM and a typical spectral resolution of R $\sim$
2000 over a wavelength range between 3600 AA and 10300 AA .

Figure 1: Distribution of the sample in stellar mass.

The full sample in the final data release DR17 (Abdurro’uf et al., 2022)
consists of over 10,000 galaxies, which we refined to the working sample by
removing those that showed a poor spectrophotometric fit in the quality
control of the reduction and analysis. The procedure to identify galaxies with
poor fitting is described in detail in sec. 4.5 of (Sánchez et al., 2022), the
first step is an automatic procedure to flag galaxies with anomalous
determinations of parameters such as redshift or mass compared to the NASA-
Sloan Atlas (NSA)111http://nsatlas.org/ catalog. This is followed by human
inspection of the central spectrum of each galaxy and its fitted model as well
as maps of mock photometry, line emission, ages and metallicities, diagnostic
diagrams such as BPT (Baldwin et al., 1981) and WHAN (Cid Fernandes et al.,
2011), and the kinematic properties. The ChEH and mass assembly history (MAH)
measured at different galactocentric radii are also checked. Galaxies which
fail on the inspection are flagged and do not pass the quality check.

Following Camps-Fariña et al. (2022), we also removed galaxies with an
inclination greater than 70º or those whose line emission is characteristic of
the presence of an AGN, resulting in a working sample of 9087 galaxies. We
measure the metallicity at the effective radius, which is difficult to
determine in highly inclined galaxies, while AGN can have wide emission lines
that interfere when fitting the stellar component of the spectra. The sample
covers a stellar mass range between log M $\sim 8.5-12$ M⊙ and includes all
morphological types. In Fig. 1 we show how the galaxies in the sample are
distributed according to their stellar mass.

##  3 Analysis

###  3.1 pyPipe3D

We used the SFHs and ChEH derived in (Camps-Fariña et al., 2022) using the
methodology of Camps-Fariña et al. (2021b). The metallicity value for each age
is measured at the effective radius after averaging the values azimuthally in
the projected plane of the galaxy. This value has been shown to serve as a
robust proxy for the global properties of a galaxy (González Delgado et al.,
2014; Sánchez, 2020). Below we give a brief description of the method, but
refer to (Camps-Fariña et al., 2022) for more details.

SFHs and ChEHs were derived with pyPipe3D (Sánchez, 2006; Sánchez et al.,
2016a, b; Lacerda et al., 2022) using the MaStar-sLOG stellar population
template library (Sánchez et al., 2022). PyPipe3D is a full spectrum fitting
code that can handle both the emission and absorption components of the galaxy
spectra and analyze them separately. The stellar component is analyzed with
spectral fitting techniques that obtain the linear combination of simple
stellar population (SSP) templates that best reproduce the observed spectrum.
The coefficients represent the light fraction contribution of each SSP and can
be used to obtain the SFH and ChEH. The fitting procedure is nonparametric,
that is, we do not impose priors such as a functional shape of the SFH, which
is measured based only on the amount of stellar mass that is assigned to each
age. The advantage of this methodology is that we are not limiting the shape
of the measured histories but on the other hand we have more free parameters
than with a parametric approach.

The emission lines of the spectra are fitted by Gaussian functions after the
stellar continuum and absorption spectra are subtracted, which allows us to
correct their emission for the absorption of the stellar component. The
redshift, velocity dispersion and dust attenuation of the spectra are
determined first by performing a fit with a limited set of SSP templates and
are then used as inputs when performing the second fitting with the full set
of templates. The redshift and velocity dispersion are used to shift and
broaden the templates before using them to fit the spectra. This two-step
procedure has been shown to improve the quality of the spectral fitting (e.g.,
Sánchez-Blázquez et al., 2011; Sánchez et al., 2016a, b; Lacerda et al.,
2022), mitigating existing degeneracies between line-broadening and
metallicity.

Light fractions are converted into mass fractions using predicted mass to
light ratio (M/L) values. The mass fractions can be used to derive the SFH
using the fraction of stellar mass that is lost during stellar evolution after
each burst of star formation. The ChEH is measured by averaging the
metallicity of the populations measured at each age weighed by the
corresponding fractions of light. The metallicity in stellar atmospheres
reflects the metallicity of the gas clouds in which they originated. By
quantifying the metallicity of stellar populations of different ages, we can
obtain a measure of the metallicity evolution within the ISM.

The MaNGA Pipe3D VAC catalog222https://www.sdss4.org/dr17/manga/manga-
data/manga-pipe3d-value-added-catalog/ contains a large number of parameters
of the MaNGA sample derived using PyPipe3D analysis. In this article, we used
the following parameters from this catalog: Stellar mass, current SFR from
H$\alpha$ emission, EW${}_{\mathrm{H_{\alpha}}}$, and the effective radius
($\mathrm{R_{e}}$). The first two parameters are used to calculate the
specific star formation rate (sSFR), and the EW${}_{\mathrm{H_{\alpha}}}$ is
used to determine the star formation status (SFS) of the galaxies according to
the prescription of Lacerda et al. (2020). Star forming galaxies (SFG) are
defined as those with EWHα (Re) $>$ 10Å and retired galaxies (RG) are defined
as those with EWHα (Re) $<$ 3Å, whereas Green Valley galaxies (GVG) are
defined as those with EWHα (Re) between the two aforementioned values.

Morphology was determined using a machine learning algorithm (see Sánchez et
al., 2022) trained with 6000 galaxies with visual classification by (Vázquez-
Mata et al., 2022). We classified the galaxies into E, S0, Sa, Sb, Sc and Sd-
Irr morphological bins following the same definition as in Camps-Fariña et al.
(2022).

###  3.2 Galaxy chemical evolution model

Figure 2: Diagram of the model considered for the relation between the ChEH,
the SFH and the gas accretion history. The change in the metallicity of the
gas over a time interval (t1 to t2) is the result of the metal input from the
stellar populations created by the SFH up to that point and the dilution due
to the accreted pristine gas. The model does not consider other mechanisms
such as outflows or mergers whose effects of dilution or over-enrichment will
therefore be conflated with the balance of gas accretion.

We obtained the evolution of the metal content in a galaxy for a given SFH
using the chemical evolution code presented in Roca-Fàbrega et al. (2021). The
code’s inputs, aside from the SFH, are the gas accretion history, initial gas
mass, and an initial mass function (IMF). The code follows the evolution of
the gas-phase chemical abundances of different elements, including Fe-peak and
the alpha elements, using the yields by (Kobayashi et al., 2011; Stockinger et
al., 2020) for SNII, (Chiappini et al., 1997; Greggio, 2010; Hillman et al.,
2015) for SNIa, (Hernanz, 2005; Izzo et al., 2015) for novae and (Ventura et
al., 2013, 2020) for AGB stars.

We have modified the code to input the SFHs and stellar metallicities to
derive the amount of low metallicity gas accretion needed to reproduce the
latter. We assume that the accreted gas has an iron abundance of [Fe/H] =
$-$1.5, a value based on measurements of damped Lyman-$\alpha$ absorbers at
z$\sim$5 (Poudel et al., 2020). We chose a Salpeter IMF (Salpeter, 1955) for
consistency with the SSP templates. The impact of the IMF on the results is
mentioned in Sec. 5.3. The metallicity value of the ISM is initialized to the
stellar metallicity derived for the oldest age bin we considered ($\sim 12.7$
Gyr), which tends to be substantially higher than the primordial values as
stellar population analysis cannot resolve the SFH at its initial burst due to
a loss of age resolution among other reasons (see Sec. 5.2).

In order to study the robustness of using the oldest determination of the
abundance as the initial value is we can compare our results to the abundance
of the oldest populations detected in the Milky Way. In figure 8 of Minchev et
al. (2018) the average [Fe/H] at $\sim$12.5 Gyr is -0.45, while averaging the
abundance for the oldest age for galaxies with log M⋆ = 10-11 M⊙ gives a value
of -0.32. This is not too large of a discrepancy even before we take into
account that Minchev et al. (2018) only measures stars at or farther than 3
kpc, which is higher than the value of Re for the Milky Way at $\sim$2.5 kpc
(van den Bergh, 1999). The effect of measuring only stars farther than the Re
would lower the abundance compared to our measurements at Re and even so there
is no guarantee that the Milky Way should precisely match the average value of
galaxies of this stellar mass range. As such, we consider that initializing
the ISM at the oldest value is valid and produces reasonable accretion
histories.

The initial gas mass is assumed to match the stellar mass at the initial time,
an approximation based on a study of the HI content at high redshift by which
M${}_{\mathrm{HI}}\sim\mathrm{M_{*}}$ at the redshift values we can reasonably
resolve (z$\sim$2-3) (Heintz et al., 2022). In Fig. 2 we show a schematic
representation of the considered model.

The matching of iron abundance with the history of chemical enrichment
obtained with spectral population fitting is due to the fact that the
metallicity values of the templates used in stellar population synthesis are
primarily related to iron abundance, which has the greatest influence on
stellar spectra, and therefore is how the templates are labeled (e.g., Sánchez
et al., 2021a).

We have a set of input parameters for each galaxy in our sample, as well as
those resulting from averaging the SFH and ChEH of each galaxy in stellar
mass, morphology, and the current SFR bins. The averaging procedure was
developed to prevent the nonuniform redshift coverage in the MaNGA sample from
affecting the averaged histories. The full procedure can be found in Camps-
Fariña et al. (2022). The averaged SFHs and ChEHs are more reliable due to
their higher statistical significance and allow for a more accurate
determination of accretion rates representative of galaxies within a given
group. The individual histories, on the other hand, allow us to identify more
detailed trends. In Sec. 4 we show the gas accretion histories resulting from
both types of input. What we show as ”averaged gas accretion histories”
corresponds to the gas accretion that results from using averaged ChEHs and
SFHs, rather than averaging the individual gas accretion histories.

We use $\tau$80, defined as the time (in Gyr) required for a galaxy to accrete
80% of its gas, to parameterize the shape of the gas accretion history. Low
values indicate that galaxies accreted most of their gas at an early time,
while high values represent persistent gas accretion over cosmic times.

Figure 3: Set of ChEH (top) and SFH (bottom) corresponding to the averaged
histories of all galaxies in our sample. In the top panel, the solid line
corresponds to out measured ChEH and the dashed line to the predicted
enrichment history in the absence of dilution from pristine gas accretion.

As an example of the histories we used as input, and to show the importance of
having a mechanism for metal dilution, we show in Fig. 3 the ChEH and SFH
resulting from averaging all the individual histories of the galaxies in our
sample, as well as the predicted ChEH without dilution. The amount of metals
in the gas increases steadily with time until it reaches a plateau, while the
SFR decreases in general.

Some galaxies (about 5% of the sample) clearly show unphysical gas accretion
rate histories and were therefore removed from the sample. The affected
galaxies are generally those with low stellar mass and bright emission lines.
Lower mass galaxies tend to have poorer signal-to-noise ratios, and bright
emission lines (especially if they are broad) can interfere with the spectral
fitting procedure that produces our ChEHs and SFHs. This affected $\sim$5% of
the objects, leaving 8523 objects in the sample.

##  4 Results

###  4.1 Averaged gas accretion histories

Figure 4: Absolute ($\mathrm{\dot{M}_{acc}}$) and relative
($\mathrm{\dot{M}_{acc}/M_{\star}}$) accretion rate histories (left and right
panel respectively) as a function of the look-back time for the galaxies in
our sample segregated by their current stellar mass (colors). In both panels
the shaded areas correspond to the uncertainties derived from the error of the
average value in the ChEHs and SFHs. This is not representative of the scatter
of the distribution within each bin, which is indicated in the left side of
the left panel.

In Fig. 4 we show the average accretion histories in different stellar mass
ranges. For each mass bin, we estimated an uncertainty in the mean accretion
history by propagating the errors in the mean SFH and ChEH, and we estimated
the scatter by propagating the standard deviation of each ChEH and SFH.

It can be seen that the total gas accreted by galaxies throughout cosmic time
increases with stellar mass but is very similar when this value is normalized
to the stellar mass at $z=0$. The first statement is obviously expected, but
the novelty is that we have only used the difference between stellar
metallicity measured from the spectra and that expected in a closed-box
chemical evolution model to derive this result, without adding any mass-
related constrain. Furthermore, while more massive galaxies accrete more gas
relative to their mass at early times, this trend reverses at $z=0$.

In the lowest mass bins, we also find epochs where the measured stellar
metallicity is higher than predicted by the chemical evolution code, which
results in a negative value for the accretion rate. These can be simply due to
imprecise measurements, especially as they appear to occur for the mass bins
with lower accretion rate, but they can also indicate a larger importance of
outflows in low mass galaxies, where more metal poor gas is selectively lost.
A loss of metal-poor gas results in the average metallicity of the galaxy
rising compared to a closed box evolution as the higher metallicity gas
remains instead.

Figure 5: Accretion rate histories for different morphology (left panel) and
SFS (right panel) bins at a fixed mass bin of $10^{10.5-11}$ M⊙. In the bottom
right corner of each panel, we show the $\tau$80 of the accretion histories,
defined in Sec. 3.2. In both panels the shaded areas correspond to the
uncertainties derived from the error of the average value in the ChEHs and
SFHs.

In Fig. 5 we show the average mass accretion rates of galaxies in the
intermediate stellar mass range $10^{10.5-11}$ M⊙, separated in bins of
morphological type and SFS. It can be seen that the accretion rate for all
morphological types increases at early times, reaches a maximum, and then
decrease almost continuously, reaching their minimum values at $z=0$. The
decrease starts at 7, 4 and 2 Gyr ago for E-S0, Sa and Sb types respectively,
which is reflected in the different $\tau$80 values. This progression should
be at least partially related to the fact that later morphological types are
more likely to be star-forming and, indeed, it can be seen in the figure that
SFG and GVG have an accretion rate history very similar to Sb galaxies, while
the evolution of the mass accretion rate in RG follows that of E and S0s.

The similarity between the accretion histories of SFG and GVG is particularly
interesting. The most recent peak of accretion at $\sim 10^{9.3}$ yr ($\sim$2
Gyr) is lower for GVG but otherwise both bins have had accretion episodes
throughout cosmic time. 1 Gyr ago, the accretion rate for GVG fell to the
values of RG separating from SFG. This similarity is in very good agreement
with what we would expect as GVG are galaxies that are just now becoming
retired, meaning that their accretion history up until this point should be
similar to that of SFG, as is observed.

Kereš et al. (2005) and van de Voort & Schaye (2012) use hydrodynamic
cosmological simulations to estimate the gas accretion rates of galaxies by
tracking the kinematics of the gas around them from the cosmic web. For Milky
Way-like halos they predict accretion rates which peak at around 10-30 M⊙ yr-1
at z$\sim$ 2-3 and drop to about 1-3 M⊙ yr-1 in the present. For similar
stellar masses we obtained an average accretion rate a factor of 2-6 lower at
the peak ($\sim$ 4.8 M⊙ yr-1) at the peak, but a very good agreement in the
local universe (1.2 M⊙ yr-1). Given the agreement on the recent value it is
possible that the discrepancy in the peak value is due to us not being able to
observe the peak of the accretion within the LBT range that we can reliably
resolve. Alternatively, the simulations might overestimate the early accretion
rate as a result of the subgrid physics recipes used or due to resolution
issues. The choice of 1 Gyr ago for the recent value instead of the most
recent measurement is due the fact that the accretion rates measured for the
most recent times (relative to when the light was emitted) are likely to be
underestimated simply due to the delay between the infall of the gas, it
becoming well-mixed to the ISM and finally stars being born whose metallicity
has been affected by the accretion.

Stellar population analyzes are especially suited for drawing conclusions by
measuring the quantities in relative terms rather than for absolute values,
such as findings on which objects or areas of a galaxy are younger or have
higher abundances than others. The reason for this is that the values of the
properties can change depending on the templates used for the fitting (e.g.,
see Cid Fernandes et al., 2014). For example, Muzzin et al. (2009) uses three
stellar population models to perform SED fitting, finding a 25-50% variation
for the stellar mass and SFR. Combined with the substantial simplifications in
the model (whose impact is discussed in Sec. 5.3) we consider the discrepancy
with the aforementioned simulations to be fairly reasonable, especially as the
difference between the two hydro-dynamical estimates of the accretion rate
themselves is a factor of 3, which is higher than the factor between our
results and the closest of the estimates. Additionally, we do not have
independent measurements of the abundance of the primordial gas that is
accreted, and we assume it does not change its abundance over time. If the
accreted gas has a different abundance than the one we assume, this would
conversely apply a scaling factor to the accretion rates we measured. Future
work on the chemical evolution model should improve the accuracy of the
estimates.

Another important point to consider is the fact that our measurements are akin
to an ”effective” gas accretion rate. As stated above, in order for the
accreted gas to be measured using our method it not only has to be accreted
into the galaxy, but it must also reach the loci of future star formation
before a star formation burst is triggered. The aforementioned studies measure
the accretion rate of the gas from its kinematic infall, not considering how
much of this gas will eventually condense into H2 and form stars. Galactic
winds with high mass-loading factors in particular can also remove a
substantial portion of the accreted gas before it has a chance to form stars
(e.g., Veilleux et al., 2005; Shen et al., 2012; Genzel et al., 2014; López-
Cobá et al., 2019, 2020; Concas et al., 2022). This removal is dependent on
the mass of the galaxy and is thus not simply a general scaling factor in our
results.

###  4.2 Star formation efficiency

Figure 6: SFE histories for different bins of galaxies. In each panel the
X-axis is the look-back time in log and the Y-axis the SFR divided by the
total amount of gas present at each time as predicted by the model. In the top
left panel, we show the galaxies divided into stellar mass bins, in the top
right panel we show one mass bin (1010.5-11 M⊙) divided into current SFS bins,
in the bottom left panel we show the same mass bin divided into four
morphology bins (E-Sb) and in the bottom right panel we show a different mass
bin (1010.5-11 M⊙) divided into the Sb, Sc and Sd morphology bins.

Given that we now have the accretion histories as well as the SFHs of the
galaxies in each bin, it is trivial to compute the SFE histories (SFEHs) as
well. Unlike the accretion rate, the SFE is inversely proportional to the
total gas mass present in the galaxy at each time. As a result, it is more
affected by the choice of the initial gas mass. In Appendix A we show how
changing the value of the initial gas mass has a much higher effect on the
SFEH than on the accretion rate history.

Another important point to consider is which phase of the ISM the gas mass we
are measuring with our gas mass parameter. The gas accretion we measured is
derived from matching the abundance of the ISM to the stellar populations, so
whether it is HI, HII or H2 depends on which phase the mixing occurs. Given
that the evidence for accretion of gas is observed in HI and that the dense
clouds that form stars are made up of H2 we generally expect our measurement
of the gas mass to refer primarily to HI or to the total sum of gas. It is
also important to keep in mind that even if the gas is accreted and mixed in
the HI phase this does not guarantee that several Gyr after accretion it will
still be in HI form, the fact that stars are formed out of it (a prerequisite
to be measured in our methodology) means that at least a portion of it was
converted into H2. We removed the amount of stellar mass formed from the
amount of gas, but this is only a lower bound to the amount of gas converted
into H2. There is also some amount of gas which will be ionized by the stellar
populations into HII, so in general our gas mass estimates correspond to
somewhere between the total mass of HI and the total gas mass in a galaxy.

In Fig. 6 we show the averaged SFE of galaxies in bins of stellar mass, SFR
and morphology. The two morphology panels (bottom ones) use two different mass
bins so that the late-type galaxies can also be shown while maintaining good
statistical representation in each bin, with the Sb bin serving as a bridge
between the two panels.

It can be seen that the peak of the SFE occurs at higher redshift for more
massive galaxies. It is also clear that the decline of the efficiency after
the peak is steeper for massive galaxies. This leads to the current
segregation such that less massive galaxies are more efficient at forming
stars in the present day. At LBT$\sim 10^{9.4}$ yr the trend with stellar mass
has inverted and less massive galaxies have higher SFE. The two less massive
bins have similar SFE histories though they still show the same trend of more
massive galaxies being more efficient in the past and less so in the present.

At a given stellar mass, the SFE decline after the peak depends on the current
star formation status. RG dropped earlier in SFE compared to GVG and SFG.
After LBT$\sim 10^{9.4}$ yr the three bins show a fairly flat histories but
SFG consistently maintain a higher SFE compared to GVG and RG.

Regarding morphology similar results can be seen, likely affected by the
correlation between morphology and SFS, with the earlier type galaxies in the
E-Sb range showing an earlier peak of SFE which declines more than the rest
which produces an inversion in the M⋆-SFE correlation. The lower mass, late
type galaxies in the bottom right panel appear to follow the trend of the less
massive galaxies in the top left panel, with similar SFEHs but in this case
the earlier type galaxies are more efficient at all times. These galaxies as
well as the low mass ones on the top left panel show a divergence at the
earliest times toward high SFE values, likely pointing to the fact that our
prescription for the initial gas mass underestimates the value for these
galaxies and that even at the earliest ages that we can resolve the gas
fraction for late-type and lower mass galaxies is higher than for more
massive, earlier type galaxies.

One could interpret the fact that the inversion in SFE is barely detected for
Sb and Sc and not at all for Sd in the bottom right panel as a difference in
timing rather than in the physics involved. For lower mass Sb and Sc galaxies
it could be that the drop in their average SFE, observed around LBT$\sim
10^{9.3}$ yr for higher mass galaxies, has not yet occurred. Indeed, for Sb
galaxies in this panel the most recent values show their SFE dropping slightly
below Sc.

In order to compare our values for the SFE with observations we need to
consider the gas phases. We proceed under the assumption that the gas is
accreted as HI but part of it is converted into H2 and HII according to the
ratios which are currently observed. Calette et al. (2018) put the H2 to HI
ratio for galaxies with log M⋆ $\sim 10.5$ M⊙ (the bin we use for the
comparison) at about 0.4 dex for late type galaxies, while the ratio of HII to
HI is estimated as 0.1 in Kado-Fong et al. (2020). As such, we can use these
ratios to obtain estimations for each gas phase in terms of our measured gas
mass as:

  * •

MHI $\sim$ 0.67 Mgas

  * •

M${}_{\mathrm{H_{2}}}$ $\sim$ 0.26 Mgas

Our measured SFE for SFG galaxies of $10^{10-10.5}$ and $10^{10.5-11}$ M⊙, is
$\sim$0.05 Gyr-1 1 Gyr prior to observation, which can be converted under our
assumptions to:

  * •

SFEHI $\sim$ 0.08 Gyr-1 ; $\tau_{\mathrm{dep}}\sim 12.5$ Gyr

  * •

SFE${}_{\mathrm{H_{2}}}$ $\sim$ 0.19 Gyr-1 ; $\tau_{\mathrm{dep}}\sim 5.2$ Gyr

Leroy et al. (2008) find a value of 0.5 Gyr-1 averaging measurements of the
SFE in local galaxies of log M⋆ $\sim 10.1-10.9$ M⊙ in the SINGS survey using
molecular gas and Colombo et al. (2018) similarly computes the molecular gas
depletion time for EDGE-CALIFA galaxies finding a typical value of $\sim
10^{9.5}$ yr (except for E galaxies) which corresponds to $\sim 0.3$ Gyr-1.
Regarding studies on SFEHI, Parkash et al. (2018) and Chowdhury et al. (2022)
find depletion times of 3-6 Gyr which correspond to 0.15-0.33 Gyr-1. For both
phases our estimations of the SFE are a factor of 2-6 times lower than
observational values which is expected given that we do not consider the
effect of outflows on the amount of gas within the galaxy. Outflows could be
responsible for expelling substantial amounts of gas, thus lowering the
remaining mass causing us to underestimate the SFE, especially at later times.
A removal of around 20-80% of the total amount of accreted gas via outflows
over the lifetime of these galaxies would give a reasonable match with the
results and this is actually a relatively low value compared to the expected
mass loading factors in galaxies from simulations (Mitchell et al., 2020) and
observations (Chisholm et al., 2017) with $\mathrm{\dot{M}_{out}/\dot{M}}\geq
1$.

###  4.3 Individual gas accretion histories

From this point on we used the individual accretion histories of the 8523
galaxies in the cleaned sample instead of the averages used in previous
sections. As we are dealing with many objects, instead of the accretion
histories, we focus on two quantities that parameterize them: (i) the total
accreted gas mass and (ii) the $\tau$80 of the accretion history. Negative
values of the accretion rate were set to zero prior to calculating these two
parameters. These negative values appear sometimes in the accretion histories
and can arise due to method inaccuracies, or they could be due to effects that
produce an over-enrichment of the ISM such as outflows of low-metallicity gas
(thus raising the average metallicity).

The code tries to match the abundance of the gas by adding material of lower
abundance and therefore the main assumption that is expected to hold true is
that the measured abundances are equal or lower than if no gas was accreted. A
higher value of the abundance than expected would therefore give a negative
numerical value to match the observed value. As with any measurement, there
are errors associated with the determination of the abundances and it is
therefore expected that in some cases the aforementioned main assumption fails
to hold true purely due to uncertainty fluctuations. This is more likely for
lower mass (and consequently brightness) galaxies which also tend to have
lower abundances in general, thus increasing the errors and lowering the
values at the same time. Stellar population synthesis is also affected by an
intrinsic degeneracy between age and metallicity such that an increase in age
and in metallicity produce similar changes in the template spectra. The
effects it has on the accretion rate histories are discussed in Sec. 5.2.
While there is significant value in checking for the existence of galaxies
whose over-enrichment is physical in nature, for the purposes of this article
we are focusing on dilution effects and negative values make the measurement
of two aforementioned parameters ambiguous.

Figure 7: Results for the gas accretion histories obtained using the chemical
and star formation history of each galaxy. In the left panel, we show the
relation between the integrated SFHs and the accreted gas masses and in the
right panel we show the relation between the current stellar masses and the
$\tau$80s of the accretion histories. In both panels the color corresponds to
the current sSFR values and the contours enclose 35%, 65% and 95% of the
distribution. The thick points correspond to the median values within 0.5 dex
wide mass bins separated into two sSFR ranges with the error bars marking the
25th and 75th percentiles. In the right panel, the log sSFR ¿ -2 Gyr-1
averaged values do not include the cloud of points located below 8 Gyr in
$\tau$80.

In the left panel of Fig. 7, we show the relation between the total amount of
stellar mass formed in a galaxy ($\int$SFH), the total mass of the gas it
accreted, and its current sSFR. It is important to note that due to the fact
that we do not resolve the earliest times in the SFH combined with mass loss
due to aging stellar populations, the integrated SFH is not the same value as
the current stellar mass. The former is the result of integrating the SFH
derived from the stellar populations while the latter is measured from its
current luminosity and applying the appropriate M/L in the V band (see Sánchez
et al., 2022).

There is a clear, very tight, correlation between the amount of stellar mass a
galaxy produces and the amount of gas it needs to accrete in order to match
the observed chemical content. There is also a secondary correlation with the
sSFR such that galaxies which are currently still forming stars accrete more
gas compared to others of similar stellar mass. This result is especially
remarkable as the sSFR is determined from emission lines and is therefore only
a measurement of the current star formation of galaxies. The correlation
provides a clear link between a galaxy’s past history of accretion and its
current star formation properties.

The gray dashed line shows the 1:1 relation between the two quantities, with
practically all galaxies located above the line and the bulk of the
distribution lying just above and parallel to it. The absence of galaxies
which have accreted less gas than they have consumed to form stars is in very
good agreement with the hypothesis that star formation is fueled by gas
accretion. The reality of this process, however, is much more complex once we
account for the different phases of matter (HI, H2, HII), the infall, mixing
and star formation timescales and the effects of outflows on the balance
between accreted gas and stellar mass formed. The fact that galaxies lie above
rather than centered on the 1:1 line is probably the result of a combination
of these factors. For example, the presence of metal-rich outflows would
simultaneously dilute the gas in the absence of accretion, making us
overestimate the amount of gas in the galaxy, and also remove material
available to form stars, moving a galaxy up and left in the relation making it
seem like an outlier with very low SFE.

The fact that star-forming galaxies can lie at an order of magnitude or more
above the relation is likely partly explained by feedback removing or heating
gas so it is not available for star formation. Another hint to the effect of
outflows could be that for lower $\int$SFH galaxies ($\sim 10^{9}$ M⊙) in the
left panel of Fig. 7 the relation curves slightly upward. In these galaxies
outflows are expected to be more efficient due to lower escape velocities so
there should be, on average, a larger difference between the amount of gas
accreted and the amount that is left for star formation after outflows remove
a portion.

The efficiency of the conversion of accreted gas, which is mostly atomic, into
molecular gas also plays a role in this, though typical recipes for the
conversion cannot be applied directly. Since we measured the accreted gas
using the information on the chemistry of the stars, the gas we are measuring
has at the very least mixed with the gas that ends up forming the stars, the
phase of matter (HI, HII, H2) in which the mixing occurs affects how much of
the measured accreted gas mass contributes to fueling star formation in the
galaxy and therefore the actual SFE.

In the left panel, the binned data points for the two ranges of sSFR (red and
blue dots) show a convergence such that they become more similar for higher
stellar masses, which could also be the result of stellar feedback outflows
becoming more efficient at lower stellar masses. They also show that the bulk
of the galaxies lies close to the 1:1 line and that the galaxies that accrete
very high amounts of gas relative to their stellar mass are a minority.

Other than how much gas is accreted over a galaxy’s lifetime it is also
important to understand how this accretion is distributed over its lifetime.
In the right panel of Fig. 7, we show the correlation between the $\tau$80
parameter of the accretion history and their current stellar mass and sSFR.
The larger cloud of points in the figure shows a correlation between the three
parameters such that currently star-forming galaxies lie in a fairly compact
sequence of high $\tau$80 for all stellar mass values whereas retired galaxies
appear to be centered at higher masses but also at significantly lower
$\tau$80 values. This distribution is reminiscent of the star formation main
sequence, and it shows that galaxies that are currently star-forming have
overall a persistent gas accretion or have had a significant recent accretion
event, while galaxies whose accretion has declined tend to be retired
nowadays.

There is another cloud of points at low mass and low $\tau$80 which also has
high value of the sSFR, suggesting the existence of galaxies which are still
star-forming but have not required recent accretion to dilute their gas
compared to earlier epochs. Since in the left panel star-forming galaxies
consistently accrete more gas without showing a separate cloud of points it is
possible that these galaxies are still accreting enough gas to sustain star
formation, but they had an unusually high accretion rate in the past, shifting
the $\tau$80 to lower values.

The binned data points show the offset between galaxies as a result of sSFR as
well as a lack of correlation of $\tau$80 with stellar mass beyond a slight
decrease at higher masses for low sSFR galaxies. An important thing to note is
that the calculation of the high sSFR data points does not include the
secondary cloud of low $\tau$80 points which have been masked prior to their
calculation so that they show the trend of what we consider to be the main
distribution.

As a whole, Fig. 7 shows that for a galaxy to still be forming stars today it
needs: (i) higher amounts of accreted gas and (ii) for the accretion to not
have stopped or heavily declined in the recent past. This is compelling
evidence for the scenario in which persistent star formation in galaxies
occurs primarily as a result of ongoing accretion of pristine gas.

####  4.3.1 Star formation efficiency

Figure 8: Results for the SFE histories obtained using the chemical and SFH of
each galaxy. In the upper left panel, we show the relation between stellar
masses and median SFEs and in the upper right panel the relation between
stellar masses and the slope of the SFE histories. In both of these panels the
color corresponds to the sSFRs. In the bottom left panel, we show the relation
between the stellar masses and the effective radii with the median SFEs shown
in color. The blue line corresponds to a cubic fit to the M⋆-Re relation. In
the bottom right panel, we show the relation between the ratio of Re to the
value of the cubic fit shown in the left panel and the median SFE, with the
slope of the SFE histories shown in color. The contours in each panel enclose
35%, 65% and 95% of the distribution respectively. The thicker points shown in
each panel correspond to the median values of the Y-axis quantity within 0.5
dex wide bins in the physical quantity of the X-axis selected as indicated in
the legend for each color, with the error bars marking the 25th and 75th
percentiles.

Much like for the accretion histories, we need to parameterize the individual
SFE histories in order to be able to study them. The SFE is an intensive
quantity, meaning that it does not scale with volume or mass like the SFR. If
we ”double” a galaxy by making it have twice as much material of each type,
the resulting galaxy will have double the mass and SFR, but the SFE will stay
the same because both SFR and gas mass double, canceling each other’s
increase. Because of this, the parameters used in the previous section to
characterize the accretion rate are no longer relevant for the SFE because the
cumulative sum of the SFEH does not have a physical meaning. As a result we
have characterized the SFE histories using the median SFE value over time,
$\langle$SFE$\rangle_{\mathrm{med}}$, and the slope of a linear fit of the
history, $\beta_{\mathrm{SFEH}}$. In order to avoid the effect of early LBT
divergences due to the underestimation of the initial gas mass seen in Fig. 6
we removed the earliest 2 Gyr of each SFE history prior to calculating the
parameters.

In the top panels of Fig. 8, we show the relation between
$\langle$SFE$\rangle_{\mathrm{med}}$, $\beta_{\mathrm{SFEH}}$ and the current
stellar mass and sSFR of the galaxies in our sample. Similarly to the results
observed in Fig. 6 we find that higher mass galaxies have, in general, a
higher $\langle$SFE$\rangle_{\mathrm{med}}$ but a steeper decline over cosmic
time. The $\langle$SFE$\rangle_{\mathrm{med}}$ vs M⋆ relation has a very large
dispersion which increases for higher masses, but average trends can still be
discerned, which generally coincide with those found for the averaged
histories.

Currently star-forming and retired galaxies appear to have different
distributions within the full sample: The most star-forming galaxies appear to
cluster at low $\langle$SFE$\rangle_{\mathrm{med}}$ with no correlation with
M⋆, but calculating the median $\langle$SFE$\rangle_{\mathrm{med}}$ within
mass bins and the two sSFR groups shows the underlying correlation. While
below $10^{10.5}$ M⊙ the trend for star-forming galaxies is fairly flat,
similar to what can be seen in the top left panel of Fig. 6, it steepens for
higher masses. For galaxies with lower sSFR the relation is practically flat
regardless of stellar mass, producing a convergence between the two sSFR
groups at high stellar masses.

The top right panel shows how star-forming galaxies are tightly clustered
around a value of 0 for $\beta_{\mathrm{SFEH}}$ which means that, on average
over their lifetimes, they maintain a similar SFE value. Lower sSFR galaxies,
on the other hand, have negative slopes on average, indicating a decline in
SFE over time. The median slope decreases for higher stellar masses indicating
that for these galaxies the decline in SFE is steeper. The apparent conclusion
is that galaxies which used to form stars at a very high efficiency in the
past end up becoming retired in current times, which could be evidence for
stellar feedback-based quenching mechanisms but also for other mechanisms that
are indirectly related to high SFE. Merger-triggered star-bursts, especially
followed by an AGN, would also fit the picture as would morphological
quenching of early disk galaxies.

The physical size of galaxies is a parameter that is expected to correlate
with their SFE such that smaller galaxies are more efficient at forming stars
than larger ones (e.g., Young, 1999). In the bottom panels of Fig. 8, we check
whether this applies to our SFE histories. In the left panel, we show the
M⋆-Re relation colored by the median SFE of the galaxies with a cubic fit
between M⋆ and Re. Below $\sim 10^{11.5}$ M⊙ the distribution appears to be
skewed with $\langle$SFE$\rangle_{\mathrm{med}}$ such that more efficient
galaxies lie below the average Re and conversely less efficient ones lie
above. This trend is confirmed by dividing the sample into high and low-
efficiency groups and calculating the median within stellar mass bins.
Galaxies with very high (low) $\langle$SFE$\rangle_{\mathrm{med}}$ follow a
trend that is parallel to the full sample cubic fit but lies below (above) the
fit such that they are smaller (larger) than galaxies of the same stellar
mass.

In the bottom right panel, we try to find a more robust determination of this
correlation and also to tie it to $\beta_{\mathrm{SFEH}}$. We calculated the
ratio between the values of Re we measured and those predicted by fit for
their stellar mass, thus removing the dependence on M⋆, and plotted this ratio
versus the $\langle$SFE$\rangle_{\mathrm{med}}$ with the
$\beta_{\mathrm{SFEH}}$ as the color.

Despite the width of the distribution, the binned data points show a weak
trend such that galaxies become less efficient the bigger they are relative to
their average M⋆. It is particularly interesting that the relation plateaus
below a ratio of 1 but declines quickly above this value. The leftmost bin
does drop again but we might be affected by that bin having less galaxies.

Compared to those shown in Young (1999) our correlations are much weaker, a
result that is likely to be affected (other than by the lower precision of our
measurements) by the fact that we account for the correlation between the
effective radius of the galaxies and their stellar mass but they do not,
showing the correlation between radius and SFE. As such the correlation they
find might be affected by both parameters correlating separately with stellar
mass. We are also considering the median SFE over their lifetimes rather than
the current measurements.

####  4.3.2 Matching the remaining gas to observations

Figure 9: Comparison between our predicted remaining amount of gas and
measurements of the current HI gas mass from the HI-MaNGA survey (Stark et
al., 2021). The dashed line shows the 1:1 relation and the solid lines two
different fits to the data, either a linear one or one offset from the 1:1
ratio. The color corresponds to the current sSFR of the galaxies.

The validity of our measurements of the SFE depends on how accurate our
estimation of the remaining gas in the galaxies is, whose main caveat is the
fact that we do not consider outflows. As such, we expect our gas mass values
to be overestimated by a certain factor, which in turn means that our SFE
values are underestimated, as shown in Sec. 4.2 for the comparisons to
literature values.

The HI-MaNGA (Masters et al., 2019) survey is a follow-up program for MaNGA
which aims to provide information on the neutral gas for galaxies in the MaNGA
sample. In the second data release (Stark et al., 2021), they provide HI data
for 3818 galaxies of which 1809 have a HI gas mass determination. The
intersection with our refined sample is 1371 objects. In Fig. 9 we compare the
predicted current amount of gas, obtained by subtracting the total stellar
mass formed from the total accreted gas mass and the initial gas mass, to the
measurements of HI gas mass in the galaxies. The 1:1 relation is located as an
upper envelope of the distribution, mostly parallel to the centermost contour
where more objects are present. The galaxies with higher predicted gas mass,
which are generally also the most massive in stellar mass, show a
significantly lower ratio of measured-to-predicted gas mass, consistent with
predictions of the outflow rate due to AGN (e.g., Mitchell et al., 2020).

We show two fits to the data, one linear and one allowing only an offset to
the 1:1 relation. The linear fit was performed using orthogonal distance
regression (ODR) to ensure that the slope of the relation follows the overall
direction of the distribution, as it minimizes perpendicular distance to the
regression rather than distance in the Y-axis. The fitted offset shows on
average a 66% loss of the accreted gas, either by being expelled in outflows
or converted into other phases of matter such as molecular and ionized gas.
The linear fit has a shallower slope as a result of the under-prediction of
gas mass at low masses and over-prediction at high masses. While the shape of
the distribution at the outermost contours favors the linear fit, the central
parts appear to follow the offset distribution better, seen in the center-most
contour. Overall, the linear fit is better as seen in the reduced chi-square
values but the offset one is not much worse.

The over-prediction of gas mass for high stellar mass galaxies fits well with
the expectations from simulations. Simulations predict that above log
M${}_{\star}\sim 10.5$ M⊙ AGN feedback becomes efficient (e.g., Dekel &
Birnboim, 2006; Mitchell et al., 2020), which would increase the effect of
outflows removing gas. A relative increase in outflow efficiency above these
masses would produce the observed widening of the gap between the measured gas
mass and the one predicted in the absence of outflows. While the X-axis in
Fig. 9 does not represent stellar mass directly, more massive galaxies will,
on average, have more total gas mass so it serves as a proxy. The other end of
the relation, which shows that low-mass galaxies can have higher measured gas
masses compared to our predictions in the absence of outflows, could be the
result of underestimating the initial gas mass for these objects. In Sec. 4.2
we proposed this underestimation as a way to explain the sharp upturn of the
SFEH at the earliest ages and it would also explain why we measured lower
amounts of gas compared to observations.

Knowing the ratio between the gas masses we predict and those that are
measured, we can use the fitted functions to correct the SFE values in our
galaxies. In Sec. 4.2 we compared our results for the log M = 10.5-11 M⊙ bin
with literature values, finding that our SFE values are too low in general.
Fig. 9 shows that we are, in general, overestimating the amount of gas in the
galaxies, so after correcting our measured gas masses using the fitted
functions we find HI depletion times of 2.9 Gyr (linear) and 4.1 Gyr (offset)
while for H2 the depletion times become 1.2 Gyr (linear) and 1.7 Gyr (offset).
The literature values for HI are 3-6 Gyr and for H2 it is $\sim$2 Gyr.

Both versions of the SFE now fit very well with the results from the
literature but this is to be expected as our ”correction” effectively
transforms our gas masses into the average values of the HI-MaNGA survey whose
gas masses have been validated against other works in the literature. The main
result of this section is the fact that our gas mass estimations are
reasonable given the approximations in the model and the fact that the trends,
such as more massive galaxies having lost more gas to outflows, make sense
given the physics we have implemented in the model.

##  5 Discussion

The results shown here provide a consistent argument for the role that gas
accretion of pristine gas has on regulating star formation in galaxies and the
effect that it has in their evolution. The most important aspect of this study
is perhaps the evidence that gas flows in galaxies leave imprints in the
stellar populations that can be recovered using spectral population fitting
techniques and relatively simple models. The potential for this type of study
is evidenced by the fact that we are able to predict the current star
formation state of a galaxy given only its past chemical and star formation
histories derived by stellar population synthesis.

###  5.1 Clues to the origin of the mass-metallicity relation

The mass-metallicity relation (MZR) is one of the key sources of information
regarding how the different evolutionary mechanisms in galaxies interact with
one another. Reproducing the shape and values of the MZR has been one of the
main ways to test and constrain theoretical models in galaxy evolution (e.g.,
Tremonti et al., 2004; Kewley & Ellison, 2008; Erb et al., 2006; Torrey et
al., 2019; Camps-Fariña et al., 2021b, 2022)

In a closed box model (Tinsley & Cameron, 1974) there is no exchange of
material out of the system and the metallicity and stellar mass advance in
lockstep as the metal injection is proportional to the stellar mass formed.
The predicted mass-metallicity relation is too shallow compared to the
measurements which fit with lower mass galaxies having lower effective yields
(Tremonti et al., 2004). The most invoked mechanisms to increase the slope of
the MZR are metal-rich outflows and gas accretion as a means to directly
reduce the average metallicity of the ISM (e.g., Larson, 1974; Tremonti et
al., 2004; Dalcanton et al., 2004; Finlator & Davé, 2008; Zhu et al., 2017;
Barrera-Ballesteros et al., 2018). There are a number of works, however, which
argue that the observed MZR cannot be reproduced solely with accretion
(Dalcanton, 2007) and outflows (Brooks et al., 2007; Calura et al., 2009),
requiring an additional correlation between the stellar mass and the SFE such
that less massive galaxies are less efficient in forming stars. As a result,
the amount of metals injected per unit mass of gas would be lower, producing
the slope of the MZR.

This hypothesis, however, clashes with observations that low-mass galaxies in
the Local Universe tend to have higher SFE than massive ones. On the other
hand, our results show that in the past massive galaxies were more efficient
at forming stars than low-mass ones, and it is only in recent times that low-
mass galaxies became more efficient only because they are more likely to still
be forming stars. This is seen in the values of the median SFE and the slope
of the SFEH. Since we also show the effects that gas accretion (and possibly
outflows too) has on diluting the ISM over the lifetime of the galaxies our
results support a hybrid scenario for the MZR slope to arise from the
combination of accretion, outflows as well as a higher SFE for massive
galaxies in the past when the bulk of the star formation and therefore metal
yields occurred. Other mechanisms such as IMF variation (Köppen et al., 2007)
with redshift or metallicity as well as mergers (Yates et al., 2012) are not
discarded by our results due to not being part of the model.

###  5.2 Caveats and precision of stellar population synthesis

Due to the nature of stellar evolution, the spectrum of a single stellar
population changes much more in the time period shortly after being formed
compared to when it is of advanced age, due to how the most massive stars die
earlier. Because of this, the resolving power for the age of the stellar
populations becomes lower as the age increases, which corresponds to lower
reliability and resolution of the derived histories at high LBT.

Additionally, stellar population synthesis techniques are well-known to have
degeneracies in determining the properties of the populations (e.g., Walcher
et al., 2011), the most important of which is the age-metallicity degeneracy
by which an increase in age and an increase in metal abundance have similar
effects on the spectra of the templates. As a result, when fitting the
populations, the code can obtain a good fit with either (i) the templates of
the correct age and metallicity, (ii) templates that are younger but more
metallic than the correct ones or (iii) templates that are older but less
metallic than the correct ones.

In our testing we have determined that this degeneracy typically produces a
positive secondary correlation between SFR and [Z/H] above $\sim$3-5 Gyr in
age (see Camps-Fariña et al. in prep.). There are two ways to explain why this
is the result: (i) in the LBT range we can resolve, SFHs tend to be decreasing
in time and, as such, if the age is underestimated the SFR values are higher
than those of the appropriate age. A bias to younger ages is compensated in
the degeneracy by using higher abundance templates, thus producing a positive
SFR-[Z/H] correlation. Alternatively, we can consider (ii) that the errors in
assigning fractions of light to the ages associated with the templates
produces an uncertainty in the stellar mass at different LBT. Due to how both
the MZR and SFMS have positive correlations with M⋆ an overestimation of M⋆
means that galaxy is located below both the MZR and SFMS and, conversely, an
underestimation of M⋆ means the galaxy has higher SFR and [Z/H] than it should
for its mass. In either case the result is that the degeneracy produces a
positive SFR-[Z/H] correlation.

This is relatively fortunate for the purposes of this work, as the effect of a
positive correlation between these parameters will tend to cancel each other
to a certain extent. The accretion rate we measure depends mostly on the
difference between the expected abundance produced by the yields from the SFR
and the measured [Z/H]. If the SFR is increased due to the degeneracy the
expected abundance will also increase proportionally. As the [Z/H] will also
increase due to the degeneracy, in this case the gap between expected and
measured [Z/H] is affected much less than the values of the SFR and [Z/H]
themselved, mitigating the effect that the age-metallicity has on the gas
accretion rates.

Another way the histories are model dependent is in the choice of templates
used to fit the spectra. The range of metallicities that we can measure is
directly related to the values that are present in the template grid. The
choice of templates is a key aspect of stellar population synthesis as
populating the parameter space too much can give rise to significant artifacts
at high LBTs if the spectra are too similar to one another (see Discussion
section and Appendix B of (Camps-Fariña et al., 2022)). In the case of
templates composed from observed stars, which are more reliable as they do not
depend on stellar atmosphere models, finding stars that cover the desired
parameter space can also be difficult.

The dependence of the metallicity values on the templates is one of the main
reasons that great care should be taken when analyzing our accretion histories
as quantitative measurements. The method is capable of finding differences
between galaxies even with a relatively narrow range of metallicity values in
the templates (see appendices B and C in Camps-Fariña et al. (2022)) so the
trends are reliable, but a global change to the scaling of the accretion rates
can arise if the range of the metallicity in the templates is too narrow. The
library employed for this study has a decently wide range of metallicity
values with good coverage of low values at Z = 0.0001-0.04.

Overall, we expect a loss of detail in the accretion rates relative to the
true ones (i.e., short accretion episodes) due to these effects and the
intrinsic capabilities of the method as to how accurately the populations can
be recovered. Ibarra-Medel et al. (2019) assessed these effects by taking
galaxies from the EAGLE (Schaye et al., 2015) simulations and producing mock
observations which were then analyzed with Pipe3D, the predecessor to the code
we employed. As the ”true” SFHs are available from the simulations they can be
compared to the ones recovered by the fitting, showing how the histories are
similar but the recovered ones lose detail on the individual bursts of star
formation (see also Sarmiento et al., 2023; Corcho-Caballero et al., 2023).

###  5.3 Validity of the physics in the model

Other than the imprecision intrinsic to the stellar population synthesis
method, we are also affected by the significant simplifications of the
physical characteristics of the systems we modelled and the processes
involved. One of the roughest simplifications is the fact that we are
effectively considering each galaxy to be a single homogeneous gas cloud into
which pristine gas is instantly deposited, on demand. In the case of the
averaged histories, we are assuming that this single cloud acts as the average
of the galaxies in each bin considered.

In order for this approximation to be valid we expect (i) the averaged
histories to be a good proxy for those of an ”average galaxy” representative
of the bin, and (ii) for the individual histories to be representative of the
variety of environments within each galaxy. We are further expecting that the
processes that dilute the ISM scale somewhat linearly with other properties
such as the stellar mass, SFR and abundance. As an example, consider a galaxy
where the chemical enrichment in the central parts is determined solely by the
input from stars (closed box) and in the outer parts there is instead
significant accretion diluting the content. Our model is valid if the average
ChEH combined with the integrated SFH is capable of recovering the entirety of
the accretion, which only occurs in the outskirts. In practice we expect this
to hold true in principle, provided that we can observe the histories with
reasonable precision at each time and cover most of the area of the galaxies.
We intend to explore how well this scenario represents the data in future
work.

Simulations predict that the bulk of the accretion occurs at the outskirts of
the galaxies, so we expect the presence of internal flows to distribute the
accreted gas throughout the galaxy. Genzel et al. (2023) report observations
on the noncircular motions of CO in galaxies at z$\sim$2, which they use to
detect gas which moves inward in the galaxies from its kinematics. Averaging
the properties of the galaxies in their table 2 we obtain the following
values: log M⋆ = 10.95 M⊙, Re = 5.8 kpc, fgas = 0.52, vr = 74 km s-1.

If we assume that half the mass of molecular gas is contained within 1 Re and
apply it to the expression for the total rate of inflow they give:
$\dot{M}=\beta\cdot M_{\mathrm{gas}}(R_{\mathrm{e}})\cdot
v_{r}/R_{\mathrm{e}}$, where $\beta$ is estimated as 0.2 in Genzel et al.
(2023), we obtain an inflow rate of 52 M⊙ yr-1 at Re. This is substantially
higher than our corresponding peak accretion rate at this mass range, 5-12 M⊙
yr-1 but we have no information about the abundance of the gas as it arrives
at 1 Re from the outskirts. If the difference in abundance between the gas at
the outskirts and at 1 Re is much lower than the difference between the latter
and value for the accreted gas, we use then it is possible for the dilution
effects to be equivalent. Instead of low amounts of very metal poor gas we can
match the measured abundance with large amounts of gas with only slightly
lower metallicity than the one at 1 Re. The value of the abundance gradient
required for the effect of the inflows from Genzel et al. (2023) to match the
dilution caused by the gas accretion we measured is -0.02 dex/kpc for radii
larger than 1 Re.

As such, if the abundance gradient is similar to the inferred value of -0.02
dex kpc-1, we can consider the massive inflows measured in Genzel et al.
(2023) to represent the inward transport of gas accreted at the outskirts
which afterward dilutes the ISM in the entire galaxy. In this scenario either
(i) the gas is quickly mixed once it reaches the galaxy and begins to move
inward, (ii) the gas ”drags” local clouds inward without mixing with them via
destabilizing their orbits or (iii) we are underestimating the abundance of
the accreted gas in the first place, lowering our estimations for the
accretion rate. The abundance gradient of galaxies at high redshift is poorly
constrained, but it is generally expected to be rather flat and our inferred
value is very similar to the reported values (e.g., Swinbank et al., 2012;
Wuyts et al., 2016; Jafariyazani et al., 2020).

Another caveat is that the single cloud which represents the ISM is not
divided into the different phases of matter HI, HII and H2, despite their
importance in determining the SFH. Regarding the measurement of the accretion
histories themselves, this is not critical, and the only question is in the
efficiency of the accreted gas to become available for star formation. As we
are measuring the accreted gas from its resulting stellar populations, we are
intrinsically assuming that 100% of the accreted gas at least mixes with the
gas that will be used to form stars. Any gas which does not reach locations
where stars will eventually be formed over the galaxy’s lifetime is not
observed and therefore our measured accretion histories are lower bounds
compared to total the amount of gas that enters the galaxy. The SFE histories,
on the other hand, are strongly affected by this, as they are typically
measured using the amount (or density) of H2 and are therefore very sensitive
to the ratios between phases. In our results this can be seen as we need a
conversion factor of 10, consistent with observed HI to H2 ratios, to obtain
reasonable values.

The effect of not considering the different phases of matter on the accretion
rates therefore depends on which phase the gas mixes in. Consider two edge
cases: (i) if the gas efficiently mixes in the HI phase followed by
condensation into H2 then our estimates for the gas accretion rate are
unaffected by not considering different phases, but (ii) if the gas quickly
condenses into H2 and it is only then that the mixing occurs we need to
correct by the ratio between MHI and MH2. Following Calette et al. (2018) this
ratio should be between 0.1 and 1 so at most it could increase the accretion
rate one order of magnitude in the most extreme case of a galaxy in which the
accreted gas immediately condenses into H2 and simultaneously has a very small
fraction of MH2 compared to MHI. This combination is highly unlikely as it
requires vastly different condensation timescales for accreted gas and that
which is present in the galaxy.

The internal timescales that apply to the journey that the accreted gas
travels from the halo until it becomes a star are not considered in the model.
Therefore, the accretion histories are expected to be shifted in time by a
certain factor. Unless there are significant changes to the physics of the ISM
over cosmic time, we can expect this factor to be fairly constant over time,
therefore only changing the specific values in the X-axis in the figures,
which are already strongly dependent on the choice of isochrones for the
stellar population templates. At a minimum, we expect that the delay includes
the free-fall time of the cloud from the halo to the galaxy interior, and the
timescales for mixing, condensation to H2 and SFR burst.

Another very important simplification is the fact that we do not discriminate
between the different effects that can produce the observed ”missing metals”
in the newer stellar populations. The effect of outflows has been mentioned in
the results section to account for some of the observed properties, as their
contribution to the gas balance and exchange can significantly alter the
results. Depending on the mass-loading factor and the abundance of the ISM at
the location where the outflows occur these can either contribute to the
dilution, have no effect on the abundance or even produce an over-enrichment
compared to the entire galaxy. For example, the centers of galaxies tend to be
more metallic than other areas of galaxies, so an AGN outflow with a high
mass-loading factor will remove gas that is more metallic than average, thus
lowering the average abundance in the galaxy (e.g., Camps-Fariña et al.,
2021a). With our method we would conflate the observed drop in expected
metallicity to an episode of gas accretion.

Should the metallicity of the gas in an outflow be the same as the average in
the galaxy we would not detect anything and if the outflow occurs at the
outskirts the gas could be significantly lower in abundance compared to the
average in the galaxy, thus raising its average metallicity. In either of
these three cases, we would be overestimating the amount of gas present in the
galaxy leading to an underestimation of the SFE. Most of our results could be
recalculated in terms of outflows rather than gas accretion, the assumption of
the gas exchange in galaxies being dominated by outflows was explored in Zhu
et al. (2017) which presents a leaky-box model where outflows are the primary
dilution mechanism managing to reproduce observed resolved properties of MaNGA
galaxies.

In Fig. 9 we showed the difference between predicted and measured HI gas mass,
and we can use this information to find the mass-loading factor by dividing
the difference in gas mass by the integrated SFH. The median mass-loading
factor we obtained is 0.96, which is significantly smaller than typical
inferred values of 2-3 (e.g., Bouché et al., 2012; Zaragoza-Cardiel et al.,
2019). One possible explanation is that the measurements of these studies are
biased to concentrated or more violent episodes of star formation while our
measurements are averaged over long times and include slower star formation,
bringing the average mass-loading factor down. Alternatively, we are
underestimating the amount of gas that is accreted to the galaxies, which
would increase the mass-loading factor we measured. The most interesting
option, however, would be that our measurements are roughly correct and the
difference between the values corresponds to the effect of gas that reenters
the galaxy after being expelled. Given that we measured the mass-loading
factor from the cumulative effects of gas accretion and outflows the time
delay to re-accrete the expelled gas is intrinsically included in our
calculations. Assuming our measurements are accurate it means that, on average
and for the subsample of HI-MaNGA, only about 30-50% of the gas initially
expelled does not fall back into the galaxy after an outflow.

Mergers and interactions between galaxies are also a mechanism that we are not
considering, and which can significantly affect both the gas flows within a
galaxy and strip it of part of its gas content. Instabilities due to
interactions can funnel gas from the outskirts to the center of galaxies and,
since the gas at the outskirts tends to have lower abundances, this can mimic
an accretion of pristine gas from the halo in our results and probably account
for part of the accretion we measured.

The choice of the IMF is a complex topic for the results. We use a Salpeter
IMF for consistency with the stellar population synthesis performed on the IFU
data. However, our implementation of the SNIa injection (which dominates the
Fe yields) is scaled to currently measured rates in the Milky Way and
therefore does not explicitly depend on the IMF. Compared to Salpeter
(Salpeter, 1955), bottom-light IMFs such as Chabrier (Chabrier, 2003) or
Kroupa (Kroupa et al., 1993; Kroupa, 2001) are typically considered to be a
better representation of the true distribution of stars. The difference
between these and Salpeter is typically a 60% factor in stellar mass or SFR
owing to the difference in mass to light (M/L) ratios corresponding to each
age (Kennicutt & Evans, 2012). Changing the IMF in our results would reduce
the gas accretion rate by a factor between 0 and 60% as the higher SFR of a
Salpeter IMF is balanced by its lower ratio of stars above 1 M⊙. Given main
sequence lifetimes, at the present time no stars below 0.9 M⊙ should have left
the main sequence and as such the difference in Fe injection between IMFs lies
primarily in the amount of stars they predict between 1-8 M⊙ (these are the
ones which can produce SNIa). Salpeter IMFs predict higher stellar masses as a
result of their higher fraction of stars below 1 M⊙, and as such their
fraction of stars between 1-8 M⊙ is lower than for Chabrier or Kroupa IMFs.

Additionally, the validity of a universal IMF shape across cosmic time is
highly debated with dissenting results on whether the IMF is top-heavy at high
redshift (e.g., Hayward et al., 2013; Eales et al., 2023). In conclusion, the
IMF remains a source of uncertainty in the results though its impact in our
case is limited due to the fact that our methodology only considers stars with
masses above the value at which commonly used IMFs differ.

##  6 Conclusions

We have applied a model for the enrichment of the ISM to measurements of SFHs
and ChEHs from the MaNGA sample of galaxies. We find that we are able to
extract information about the dilution processes that take place in galaxies.
We find several trends in gas accretion and evolution of SFE that are in
fairly good agreement with expectations from theoretical models as well as
good agreement with recent measurements. Some of the most important results
are:

  1. 1.

We find a good agreement with expected trends for gas accretion in galaxies as
a function of their mass, with more massive galaxies having higher peak
accretion and a steeper decrease over time.

  2. 2.

Controlling for the current stellar mass, galaxies show different accretion
histories depending on whether they are forming stars or not. GVG only
separate the shape of their average accretion history from SFG in the last
Gyr, showing that in general galaxies stop forming stars once they lose access
to pristine gas.

  3. 3.

The individual accretion histories confirm many of these trends and show a
tight correlation between the integrated SFH and the total accreted gas mass.
Currently, star-forming galaxies lie above or in the upper envelope of this
relation.

  4. 4.

The relation between the shape of the accretion history and the current
stellar masses and sSFR values indicates that galaxies currently undergoing
star formation have persistent gas accretion over cosmic time.

  5. 5.

We used the amount of gas predicted to be in the galaxies at each time to
calculate their SFE histories. We find that more massive galaxies are
currently less efficient, but were more efficient in the past. There is a
trend that galaxies with a high median SFE have a steeper decline in SFE over
their lifetime.

  6. 6.

Galaxies that are currently star-forming tend to have lower SFE at earlier
times but persistent SFE over cosmic time.

  7. 7.

More compact galaxies are more efficient at forming stars over their
lifetimes.

###### Acknowledgements.

ACF thanks J. Sánchez Almeida and C. Dalla Vecchia for useful discussion on
the results. ACF and PSB acknowledge financial support by the Spanish Ministry
of Science and Innovation through the research grant PID2019-107427-GB-31. SRF
acknowledges financial support from MINECO under grant number
AYA2017-90589-REDT, RTI2018-096188-B-I00, and S2018/NMT-429. SFS acknowledges
funding from PAPIIT-DGAPA-AG100622 (UNAM) project. Funding for the Sloan
Digital Sky Survey IV has been provided by the Alfred P. Sloan Foundation, the
U.S. Department of Energy Office of Science, and the Participating
Institutions. SDSS acknowledges support and resources from the Center for
High-Performance Computing at the University of Utah. The SDSS web site is
www.sdss.org. SDSS is managed by the Astrophysical Research Consortium for the
Participating Institutions of the SDSS Collaboration including the Brazilian
Participation Group, the Carnegie Institution for Science, Carnegie Mellon
University, Center for Astrophysics $|$ Harvard & Smithsonian (CfA), the
Chilean Participation Group, the French Participation Group, Instituto de
Astrofísica de Canarias, The Johns Hopkins University, Kavli Institute for the
Physics and Mathematics of the Universe (IPMU) / University of Tokyo, the
Korean Participation Group, Lawrence Berkeley National Laboratory, Leibniz
Institut für Astrophysik Potsdam (AIP), Max-Planck-Institut für Astronomie
(MPIA Heidelberg), Max-Planck-Institut für Astrophysik (MPA Garching), Max-
Planck-Institut für Extraterrestrische Physik (MPE), National Astronomical
Observatories of China, New Mexico State University, New York University,
University of Notre Dame, Observatório Nacional / MCTI, The Ohio State
University, Pennsylvania State University, Shanghai Astronomical Observatory,
United Kingdom Participation Group, Universidad Nacional Autónoma de México,
University of Arizona, University of Colorado Boulder, University of Oxford,
University of Portsmouth, University of Utah, University of Virginia,
University of Washington, University of Wisconsin, Vanderbilt University, and
Yale University.

## References

  * Abdurro’uf et al. (2022) Abdurro’uf, Accetta, K., Aerts, C., et al. 2022, ApJS, 259, 35
  * Baldwin et al. (1981) Baldwin, J. A., Phillips, M. M., & Terlevich, R. 1981, PASP, 93, 5
  * Barrera-Ballesteros et al. (2018) Barrera-Ballesteros, J. K., Heckman, T., Sánchez, S. F., et al. 2018, ApJ, 852, 74
  * Bouché et al. (2012) Bouché, N., Hohensee, W., Vargas, R., et al. 2012, MNRAS, 426, 801
  * Bresolin et al. (2012) Bresolin, F., Kennicutt, R. C., & Ryan-Weber, E. 2012, ApJ, 750, 122
  * Brooks et al. (2007) Brooks, A. M., Governato, F., Booth, C. M., et al. 2007, ApJL, 655, L17
  * Bundy et al. (2015) Bundy, K., Bershady, M. A., Law, D. R., et al. 2015, ApJ, 798, 7
  * Caimmi (2008) Caimmi, R. 2008, NewA, 13, 314
  * Calette et al. (2018) Calette, A. R., Avila-Reese, V., Rodríguez-Puebla, A., Hernández-Toledo, H., & Papastergis, E. 2018, RMxAA, 54, 443
  * Calura et al. (2009) Calura, F., Pipino, A., Chiappini, C., Matteucci, F., & Maiolino, R. 2009, A&A, 504, 373
  * Camps-Fariña et al. (2021a) Camps-Fariña, A., Sánchez, S. F., Carigi, L., et al. 2021a, ApJL, 922, L20
  * Camps-Fariña et al. (2021b) Camps-Fariña, A., Sanchez, S. F., Lacerda, E. A. D., et al. 2021b, MNRAS, 504, 3478
  * Camps-Fariña et al. (2022) Camps-Fariña, A., Sánchez, S. F., Mejía-Narváez, A., et al. 2022, ApJ, 933, 44
  * Ceverino et al. (2016) Ceverino, D., Sánchez Almeida, J., Muñoz Tuñón, C., et al. 2016, MNRAS, 457, 2605
  * Chabrier (2003) Chabrier, G. 2003, PASP, 115, 763
  * Chiappini (2009) Chiappini, C. 2009, in The Galaxy Disk in Cosmological Context, ed. J. Andersen, Nordströara, B. m, & J. Bland-Hawthorn, Vol. 254, 191–196
  * Chiappini et al. (1997) Chiappini, C., Matteucci, F., & Gratton, R. 1997, ApJ, 477, 765
  * Chisholm et al. (2017) Chisholm, J., Orlitová, I., Schaerer, D., et al. 2017, A&A, 605, A67
  * Chowdhury et al. (2022) Chowdhury, A., Kanekar, N., & Chengalur, J. N. 2022, ApJL, 941, L6
  * Cid Fernandes et al. (2014) Cid Fernandes, R., González Delgado, R. M., García Benito, R., et al. 2014, A&A, 561, A130
  * Cid Fernandes et al. (2011) Cid Fernandes, R., Stasińska, G., Mateus, A., & Vale Asari, N. 2011, MNRAS, 413, 1687
  * Cimatti et al. (2019) Cimatti, A., Fraternali, F., & Nipoti, C. 2019, Introduction to Galaxy Formation and Evolution: From Primordial Gas to Present-Day Galaxies
  * Colombo et al. (2018) Colombo, D., Kalinova, V., Utomo, D., et al. 2018, MNRAS, 475, 1791
  * Colombo et al. (2020) Colombo, D., Sanchez, S. F., Bolatto, A. D., et al. 2020, A&A, 644, A97
  * Concas et al. (2022) Concas, A., Maiolino, R., Curti, M., et al. 2022, MNRAS, 513, 2535
  * Corcho-Caballero et al. (2023) Corcho-Caballero, P., Ascasibar, Y., Sánchez, S. F., & López-Sánchez, Á. R. 2023, MNRAS, 520, 193
  * Cresci et al. (2010) Cresci, G., Mannucci, F., Maiolino, R., et al. 2010, Natur, 467, 811
  * Daddi et al. (2010) Daddi, E., Bournaud, F., Walter, F., et al. 2010, ApJ, 713, 686
  * Dalcanton (2007) Dalcanton, J. J. 2007, ApJ, 658, 941
  * Dalcanton et al. (2004) Dalcanton, J. J., Yoachim, P., & Bernstein, R. A. 2004, ApJ, 608, 189
  * Davis & Bureau (2016) Davis, T. A. & Bureau, M. 2016, MNRAS, 457, 272
  * Dekel & Birnboim (2006) Dekel, A. & Birnboim, Y. 2006, MNRAS, 368, 2
  * Dekel et al. (2009) Dekel, A., Birnboim, Y., Engel, G., et al. 2009, Natur, 457, 451
  * Drory et al. (2015) Drory, N., MacDonald, N., Bershady, M. A., et al. 2015, AJ, 149, 77
  * Eales et al. (2023) Eales, S., Gomez, H., Dunne, L., Dye, S., & Smith, M. W. L. 2023, arXiv, arXiv:2303.07376
  * Erb et al. (2006) Erb, D. K., Shapley, A. E., Pettini, M., et al. 2006, ApJ, 644, 813
  * Fenner & Gibson (2003) Fenner, Y. & Gibson, B. K. 2003, PASA, 20, 189
  * Finlator & Davé (2008) Finlator, K. & Davé, R. 2008, MNRAS, 385, 2181
  * Fraternali & Binney (2008) Fraternali, F. & Binney, J. J. 2008, MNRAS, 386, 935
  * Fraternali & Tomassetti (2012) Fraternali, F. & Tomassetti, M. 2012, MNRAS, 426, 2166
  * Genzel et al. (2014) Genzel, R., Förster Schreiber, N. M., Rosario, D., et al. 2014, ApJ, 796, 7
  * Genzel et al. (2023) Genzel, R., Jolly, J. B., Liu, D., et al. 2023, arXiv, arXiv:2305.02959
  * Genzel et al. (2010) Genzel, R., Tacconi, L. J., Gracia-Carpio, J., et al. 2010, MNRAS, 407, 2091
  * Giavalisco et al. (2011) Giavalisco, M., Vanzella, E., Salimbeni, S., et al. 2011, ApJ, 743, 95
  * González Delgado et al. (2014) González Delgado, R. M., Cid Fernandes, R., García-Benito, R., et al. 2014, ApJL, 791, L16
  * Greggio (2010) Greggio, L. 2010, MNRAS, 406, 22
  * Gunn et al. (2006) Gunn, J. E., Siegmund, W. A., Mannery, E. J., et al. 2006, AJ, 131, 2332
  * Hayward et al. (2013) Hayward, C. C., Narayanan, D., Kereš, D., et al. 2013, MNRAS, 428, 2529
  * Heintz et al. (2022) Heintz, K. E., Oesch, P. A., Aravena, M., et al. 2022, ApJL, 934, L27
  * Hernanz (2005) Hernanz, M. 2005, in Astronomical Society of the Pacific Conference Series, Vol. 330, The Astrophysics of Cataclysmic Variables and Related Objects, ed. J. M. Hameury & J. P. Lasota, 265
  * Hillman et al. (2015) Hillman, Y., Prialnik, D., Kovetz, A., & Shara, M. M. 2015, MNRAS, 446, 1924
  * Ibarra-Medel et al. (2019) Ibarra-Medel, H. J., Avila-Reese, V., Sánchez, S. F., González-Samaniego, A., & Rodríguez-Puebla, A. 2019, MNRAS, 483, 4525
  * Izzo et al. (2015) Izzo, L., Della Valle, M., Mason, E., et al. 2015, ApJL, 808, L14
  * Jafariyazani et al. (2020) Jafariyazani, M., Newman, A. B., Mobasher, B., et al. 2020, ApJL, 897, L42
  * Kado-Fong et al. (2020) Kado-Fong, E., Kim, J.-G., Ostriker, E. C., & Kim, C.-G. 2020, ApJ, 897, 143
  * Kennicutt (1983) Kennicutt, R. C., J. 1983, ApJ, 272, 54
  * Kennicutt (1998) Kennicutt, Robert C., J. 1998, ApJ, 498, 541
  * Kennicutt & Evans (2012) Kennicutt, R. C. & Evans, N. J. 2012, ARA&A, 50, 531
  * Kereš et al. (2005) Kereš, D., Katz, N., Weinberg, D. H., & Davé, R. 2005, MNRAS, 363, 2
  * Kewley & Ellison (2008) Kewley, L. J. & Ellison, S. L. 2008, ApJ, 681, 1183
  * Kobayashi et al. (2011) Kobayashi, C., Karakas, A. I., & Umeda, H. 2011, MNRAS, 414, 3231
  * Köppen et al. (2007) Köppen, J., Weidner, C., & Kroupa, P. 2007, MNRAS, 375, 673
  * Kroupa (2001) Kroupa, P. 2001, MNRAS, 322, 231
  * Kroupa et al. (1993) Kroupa, P., Tout, C. A., & Gilmore, G. 1993, MNRAS, 262, 545
  * Lacerda et al. (2020) Lacerda, E. A. D., Sánchez, S. F., Cid Fernandes, R., et al. 2020, MNRAS, 492, 3073
  * Lacerda et al. (2022) Lacerda, E. A. D., Sánchez, S. F., Mejía-Narváez, A., et al. 2022, NewA, 97, 101895
  * Lah et al. (2007) Lah, P., Chengalur, J. N., Briggs, F. H., et al. 2007, MNRAS, 376, 1357
  * Larson (1972) Larson, R. B. 1972, NPhS, 236, 7
  * Larson (1974) Larson, R. B. 1974, MNRAS, 169, 229
  * Law et al. (2016) Law, D. R., Cherinka, B., Yan, R., et al. 2016, AJ, 152, 83
  * Leroy et al. (2008) Leroy, A. K., Walter, F., Brinks, E., et al. 2008, AJ, 136, 2782
  * Lilly et al. (2013) Lilly, S. J., Carollo, C. M., Pipino, A., Renzini, A., & Peng, Y. 2013, ApJ, 772, 119
  * López-Cobá et al. (2020) López-Cobá, C., Sánchez, S. F., Anderson, J. P., et al. 2020, AJ, 159, 167
  * López-Cobá et al. (2019) López-Cobá, C., Sánchez, S. F., Bland-Hawthorn, J., et al. 2019, MNRAS, 482, 4032
  * Martin et al. (2012) Martin, C. L., Shapley, A. E., Coil, A. L., et al. 2012, ApJ, 760, 127
  * Masters et al. (2019) Masters, K. L., Stark, D. V., Pace, Z. J., et al. 2019, MNRAS, 488, 3396
  * Minchev et al. (2018) Minchev, I., Anders, F., Recio-Blanco, A., et al. 2018, MNRAS, 481, 1645
  * Mitchell et al. (2020) Mitchell, P. D., Schaye, J., Bower, R. G., & Crain, R. A. 2020, MNRAS, 494, 3971
  * Mollá et al. (2016) Mollá, M., Díaz, Á. I., Gibson, B. K., Cavichia, O., & López-Sánchez, Á.-R. 2016, MNRAS, 462, 1329
  * Muzzin et al. (2009) Muzzin, A., Marchesini, D., van Dokkum, P. G., et al. 2009, ApJ, 701, 1839
  * Nordström et al. (2004) Nordström, B., Mayor, M., Andersen, J., et al. 2004, A&A, 418, 989
  * Parkash et al. (2018) Parkash, V., Brown, M. J. I., Jarrett, T. H., & Bonne, N. J. 2018, ApJ, 864, 40
  * Poudel et al. (2020) Poudel, S., Kulkarni, V. P., Cashman, F. H., et al. 2020, MNRAS, 491, 1008
  * Prochaska et al. (2005) Prochaska, J. X., Herbert-Fort, S., & Wolfe, A. M. 2005, ApJ, 635, 123
  * Putman et al. (2012) Putman, M. E., Peek, J. E. G., & Joung, M. R. 2012, ARA&A, 50, 491
  * Rao et al. (2006) Rao, S. M., Turnshek, D. A., & Nestor, D. B. 2006, ApJ, 636, 610
  * Roca-Fàbrega et al. (2021) Roca-Fàbrega, S., Llorente de Andrés, F., Chavero, C., Cifuentes, C., & de la Reza, R. 2021, A&A, 656, A64
  * Rodríguez-Puebla et al. (2016) Rodríguez-Puebla, A., Primack, J. R., Behroozi, P., & Faber, S. M. 2016, MNRAS, 455, 2592
  * Rubin et al. (2012) Rubin, K. H. R., Prochaska, J. X., Koo, D. C., & Phillips, A. C. 2012, ApJL, 747, L26
  * Salpeter (1955) Salpeter, E. E. 1955, ApJ, 121, 161
  * Sánchez (2006) Sánchez, S. F. 2006, AN, 327, 850
  * Sánchez (2020) Sánchez, S. F. 2020, ARA&A, 58, 99
  * Sánchez et al. (2021a) Sánchez, S. F., Barrera-Ballesteros, J. K., Colombo, D., et al. 2021a, MNRAS, 503, 1615
  * Sánchez et al. (2022) Sánchez, S. F., Barrera-Ballesteros, J. K., Lacerda, E., et al. 2022, ApJS, 262, 36
  * Sánchez et al. (2021b) Sánchez, S. F., Espinosa-Ponce, C., Carigi, L., et al. 2021b, A&A, 652, L10
  * Sánchez et al. (2016a) Sánchez, S. F., Pérez, E., Sánchez-Blázquez, P., et al. 2016a, RMxAA, 52, 171
  * Sánchez et al. (2016b) Sánchez, S. F., Pérez, E., Sánchez-Blázquez, P., et al. 2016b, RMxAA, 52, 21
  * Sánchez Almeida (2017) Sánchez Almeida, J. 2017, in Astrophysics and Space Science Library, Vol. 430, Gas Accretion onto Galaxies, ed. A. Fox & R. Davé, 67
  * Sánchez Almeida et al. (2014) Sánchez Almeida, J., Elmegreen, B. G., Muñoz-Tuñón, C., & Elmegreen, D. M. 2014, A&ARv, 22, 71
  * Sánchez-Blázquez et al. (2011) Sánchez-Blázquez, P., Ocvirk, P., Gibson, B. K., Pérez, I., & Peletier, R. F. 2011, MNRAS, 415, 709
  * Sancisi et al. (2008) Sancisi, R., Fraternali, F., Oosterloo, T., & van der Hulst, T. 2008, A&ARv, 15, 189
  * Sarmiento et al. (2023) Sarmiento, R., Huertas-Company, M., Knapen, J. H., et al. 2023, A&A, 673, A23
  * Schaye et al. (2015) Schaye, J., Crain, R. A., Bower, R. G., et al. 2015, MNRAS, 446, 521
  * Schaye et al. (2010) Schaye, J., Dalla Vecchia, C., Booth, C. M., et al. 2010, MNRAS, 402, 1536
  * Schmidt (1959) Schmidt, M. 1959, ApJ, 129, 243
  * Searle & Sargent (1972) Searle, L. & Sargent, W. L. W. 1972, ApJ, 173, 25
  * Shen et al. (2012) Shen, S., Madau, P., Aguirre, A., et al. 2012, ApJ, 760, 50
  * Smee et al. (2013) Smee, S. A., Gunn, J. E., Uomoto, A., et al. 2013, AJ, 146, 32
  * Stark et al. (2021) Stark, D. V., Masters, K. L., Avila-Reese, V., et al. 2021, MNRAS, 503, 1345
  * Stockinger et al. (2020) Stockinger, G., Janka, H. T., Kresse, D., et al. 2020, MNRAS, 496, 2039
  * Swinbank et al. (2012) Swinbank, A. M., Sobral, D., Smail, I., et al. 2012, MNRAS, 426, 935
  * Tacconi et al. (2013) Tacconi, L. J., Neri, R., Genzel, R., et al. 2013, ApJ, 768, 74
  * Tinsley (1980) Tinsley, B. M. 1980, FCPh, 5, 287
  * Tinsley & Cameron (1974) Tinsley, B. M. & Cameron, A. G. W. 1974, Ap&SS, 31, 31
  * Torrey et al. (2019) Torrey, P., Vogelsberger, M., Marinacci, F., et al. 2019, MNRAS, 484, 5587
  * Tremonti et al. (2004) Tremonti, C. A., Heckman, T. M., Kauffmann, G., et al. 2004, ApJ, 613, 898
  * van de Voort & Schaye (2012) van de Voort, F. & Schaye, J. 2012, MNRAS, 423, 2991
  * van den Bergh (1999) van den Bergh, S. 1999, A&ARv, 9, 273
  * Vázquez-Mata et al. (2022) Vázquez-Mata, J. A., Hernández-Toledo, H. M., Avila-Reese, V., et al. 2022, MNRAS, 512, 2222
  * Veilleux et al. (2005) Veilleux, S., Cecil, G., & Bland-Hawthorn, J. 2005, ARA&A, 43, 769
  * Ventura et al. (2020) Ventura, P., Dell’Agli, F., Lugaro, M., et al. 2020, A&A, 641, A103
  * Ventura et al. (2013) Ventura, P., Di Criscienzo, M., Carini, R., & D’Antona, F. 2013, MNRAS, 431, 3642
  * Walcher et al. (2011) Walcher, J., Groves, B., Budavári, T., & Dale, D. 2011, Ap&SS, 331, 1
  * Wuyts et al. (2016) Wuyts, E., Wisnioski, E., Fossati, M., et al. 2016, ApJ, 827, 74
  * Yan et al. (2016) Yan, R., Tremonti, C., Bershady, M. A., et al. 2016, AJ, 151, 8
  * Yates et al. (2012) Yates, R. M., Kauffmann, G., & Guo, Q. 2012, MNRAS, 422, 215
  * Young (1999) Young, J. S. 1999, ApJL, 514, L87
  * Zaragoza-Cardiel et al. (2019) Zaragoza-Cardiel, J., Fritz, J., Aretxaga, I., et al. 2019, MNRAS, 487, L61
  * Zhu et al. (2017) Zhu, G. B., Barrera-Ballesteros, J. K., Heckman, T. M., et al. 2017, MNRAS, 468, 4494

##  Appendix A The effect of the initial gas conditions

Figure 10: Accretion rate (left panel) and SFE (right panel) corresponding to
the averaged ChEHs and SFHs of a single stellar mass bin, $10^{11-12}$, using
three different values of the initial gas mass. The values are the initial
stellar mass, which is used in the main article, and 10% and 10 times this
value.

The only parameter of the model for which we have no observable constraints is
the initial gas mass of the cloud. We reasonably assume from observational
data that it is similar to the stellar mass measured at the earliest time, but
we need to assess how sensitive the results are to this parameter. In Fig. 10
we compare the accretion rates and SFE histories obtained using the initial
stellar mass with two values separated by an order of magnitude, that is, 10%
and ten times this value.

The accretion rate history appears to change very little when the initial gas
mass is lower than our specification, but its shape changes greatly when it is
much higher. This is likely due to some sort of ”metallicity inertia” such
that too large an initial gas mass cannot be sufficiently enriched by the
stellar populations, requiring a large negative value, which then requires a
similarly large gas mass to dilute it when the abundance is too high. As a
result, the values of the accretion rate diverge and fluctuate over time.

In contrast, the course of the SFE is much more strongly influenced by the
value of the initial gas mass, especially at the earliest times when the value
of the initial gas mass dominates the available gas in the galaxy. The
presence of a sharp upturn of the SFE at earlier times can be seen as an
indicator that the initial gas mass is underestimated.

Figure 11: Accretion rate (left panel) and SFE (right panel) corresponding to
the averaged ChEHs and SFHs of a single stellar mass bin, $10^{11-12}$, using
three different values of the iron abundance for the initial gas mass. The
values are the measured value for the oldest population as well as half and
1.5 times this value.

The initial gas cloud is also defined by its abundance, the value of which
strongly affects the initial accretion rate of the galaxy. We do have a
measurement of its value, but unlike the gas mass, the abundance of the oldest
population we detected is also the most unreliable data point we have due to
the low light content of the high age populations. To assess how critical the
precision of this value is in Fig. 11, we show how the shape of the accretion
rate and SFE changed when we changed the iron abundance of the initial gas.

The accretion rate is minimally affected, except for the very earliest time
when the abundance of ISM is ”corrected” by a fast positive or negative
accretion to match the measurements. The effect on the SFE is higher because
the gas mass difference is maintained over time and affects the SFE values.
Since we do not observe the divergence at the earliest times in the SFE, we
expect our approach to be consistent.