Large-scale Structures in COSMOS2020: Evolution of Star Formation Activity in Different Environments at 0.4 < z < 4

To study the role of environment in galaxy evolution, we reconstruct the underlying density field of galaxies based on COSMOS2020 (The Farmer catalog) and provide the density catalog for a magnitude-limited (K s < 24.5) sample of ∼210,000 galaxies at 0.4 < z < 5 within the COSMOS field. The environmental densities are calculated using a weighted kernel density estimation approach with the choice of a von Mises–Fisher kernel, an analog of the Gaussian kernel for periodic data. Additionally, we make corrections for the edge effect and masked regions in the field. We utilize physical properties extracted by LePhare to investigate the connection between star formation activity and the environmental density of galaxies in six mass-complete subsamples at different cosmic epochs within 0.4 < z < 4. Our findings confirm a strong anticorrelation between star formation rate (SFR)/specific SFR (sSFR) and environmental density out to z ∼ 1.1. At 1.1 < z < 2, there is no significant correlation between SFR/sSFR and density. At 2 < z < 4, we observe a reversal of the SFR/sSFR–density relation such that both SFR and sSFR increase by a factor of ∼10 with increasing density contrast, δ, from −0.4 to 5. This observed reversal at higher redshifts supports the scenario where an increased availability of gas supply, along with tidal interactions and a generally higher star formation efficiency in dense environments, could potentially enhance star formation activity in galaxies located in rich environments at z > 2.

1. INTRODUCTION Galaxies in the universe are distributed in a weblike structure known as "Cosmic Web" (Bond et al. 1996).The study of these large-scale structures (hereafter LSS), which comprise galaxy clusters, sparsely populated voids, filamentary threads, and planar walls, is a cornerstone in our understanding of the evolution of galaxies and dark matter, which are strongly connected.
The identification of LSS and the study of matter distribution within the cosmic web is still challenging due to the diverse shape and size of LSS components, which often confines such studies to local-universe spectroscopic surveys (York et al. 2000;Colless et al. 2001), simulations (Cautun et al. 2014;Vogelsberger et al. 2014;Libeskind et al. 2018), and analytical methods (Bardeen et al. 1986;Bond et al. 1996;Sousbie 2011;AnsariFard et al. 2022).However, with the advent of wide and deep photometric surveys using ground and space telescopes, such as The Cosmic Evolution Survey (COSMOS), we are now able to identify and study these structures and their impact on the galaxy evolution in the high-redshift universe.Several studies have confirmed and investigated LSS in the COSMOS field, including the following examples: identification of 247 X-ray groups at 0.08 < z < 1.53 (Gozaliasl et al. 2019), study of a large filamentary structure, known as COS-MOS wall, at z ∼ 0.73 (Iovino et al. 2016), spectroscopic confirmation/investigation of a large scale structure at z ∼ 2.1 (Hung et al. 2016), a protocluster at z ∼ 2.23 (Darvish et al. 2020), study of complex-shaped overdensities at z ∼ 2.45 using photometric and spectroscopic observations (Cucciati et al. 2018), an asymmetric filamentary structure at z ∼ 2.47 (Casey et al. 2015), a concentrated group of massive galaxies with extended X-ray emission at z ∼ 2.506 (Wang et al. 2016), a protocluster of massive quiescent galaxies at z ∼ 2.77 (Ito et al. 2023), massive protoclusters at z ∼ 3.3 (Forrest et al. 2023), z ∼ 3.366 (McConachie et al. 2022), z ∼ 4.57 (Lemaux et al. 2018), a dense group with a spectroscopically confirmed quiescent galaxy at its center at z ∼ 4.53 (Kakimoto et al. 2023), and z ∼ 5.3 (Capak et al. 2011), and discovery of a massive, dusty starburst galaxy in a protocluster at z ∼ 5.7 (Pavesi et al. 2018).Additionally, overdensities in 3D Lyα forest tomography are studied as alternative tracers of LSS (e.g., CLAM-ATO, Lee et al. 2016 andLATIS, Newman et al. 2020 surveys) and the evolution of previously identified protoclusters over ∼ 11 Gyr is studied through constrained simulations in (Ata et al. 2022).
Alongside the identification of LSS in spectroscopic and photometric samples, there has been a notable increase in the study of galaxy properties across different environments in recent decades.This includes several studies focusing on the evolution of morphology (Mandelbaum et al. 2006;Capak et al. 2007;Bamford et al. 2009), gas content (Catinella et al. 2013), star formation activity (Scoville et al. 2013;Darvish et al. 2016;Chartab et al. 2020), and quenching mechanisms (Peng et al. 2010;Poggianti et al. 2017;Zheng et al. 2024) in different environments.
Studies show that in the local universe, early-type passive galaxies are typically found in denser environments, such as galaxy clusters, while late-type star-forming galaxies are mainly located in less-dense regions, known as field (Dressler 1980;Balogh et al. 2004;Kauffmann et al. 2004;Peng et al. 2010;Woo et al. 2012;Baldry et al. 2006).This is partly because in addition to internal processes, such as gas outflows due to supernova explosions, stellar and active galactic nuclei (AGN) feedback (Dekel & Silk 1986;Dalla Vecchia & Schaye 2008;Fabian 2012;Bremer et al. 2018), galaxies in denser environments have experienced an enhanced level of "environmental quenching" mechanisms such as ram pressure stripping (Gunn & Gott 1972;Moore et al. 1999;Brown et al. 2017;Barsanti et al. 2018), strangulation or starvation (Moore et al. 1999;Peng et al. 2015), galaxy harassment (Moore et al. 1996;Farouki & Shapiro 1981).
At higher redshifts (out to z ∼ 1.4), (Capak et al. 2007) investigated the density-morphology relations, finding that galaxies are transformed from late (spiral and irregular) to early-type galaxies more rapidly in dense regions compared to sparse regions.
While these trends are well-established in the lower redshifts, they remain a matter of ongoing debate at intermediate and higher redshifts (z ≳ 1).(Patel et al. 2009) reports a negative correlation between star formation activity and environmental density at z ∼ 0.83, the same as the local universe.Using a large sample of galaxies in 5 CANDELS fields (GOODSN, GOODS-S, EGS, UDS, and COSMOS), (Chartab et al. 2020) further extended this observation to as high as z ∼ 3.5.There are also studies that find no significant correlation between SFR and environment beyond redshift z ∼ 1 (Grützbauch et al. 2011;Scoville et al. 2013;Darvish et al. 2016).Conversely, there are indications that the low redshift trends between SFR and environmental density begin to diminish, or even reverse, around z ∼ 1 − 2. This potential reversal has been observed in several studies that examine galaxies within individual structures and compare their star formation activity with counterparts in field environments.For example, the reversal of this trend at z ∼ 0.8 − 1 was reported using a sample of galaxies in GOODS field by (Elbaz, D. et al. 2007) and a sample drawn from SDSS and DEEP2 redshift survey by (Cooper et al. 2008).Utilizing a large sample of spectroscopically confirmed galaxies, (Lemaux et al. 2022) reported a monotonic increase in SFR with increasing galaxy overdensity in the early universe (2 < z < 5).However, some studies attribute the observed reversal to cosmic variance, AGN contamination, and various dynamical ranges of environments used in different studies (Sobral et al. 2011;Scoville et al. 2013;Darvish et al. 2016).In any case, the discrepancy between high redshift results is due to the limited availability of observational data at higher redshifts, a lack of complete samples of statistically significant size, and uncertainties in the extracted physical parameters for fainter objects.This weakens the statistical reliability of the observed trends at higher redshifts and makes the interpretation of these observations more challenging.Thus, more studies are needed to reliably identify the LSS at higher redshifts and investigate the role of the environment in the star formation activity of galaxies in the early universe.
COSMOS data spans a large area of (∼ 2 deg 2 ) which enables us to investigate these correlations in a variety of environments with potentially lower impacts of cosmic variance on the results.It is important to note that COSMOS does not appear to have many massive structures at (z ≲ 2), and the dynamic range of overdensities at low redshifts is fairly small when compared to the other local-universe surveys (SDSS, York et al. 2000) or those that specifically target fields that contain massive LSS at z ∼ 1 (e.g., EdisCS, White et al. 2005;GOGREEN, Balogh et al. 2017;ORELSE, Lubin et al. 2009).Nonetheless, the latest release of the COSMOS catalog, COSMOS2020, with its deeper optical, infrared, and near-infrared data compared to previous releases, offers an opportunity to extend studies of LSS and its impact on galaxy evolution to higher redshifts.Since its publication, COSMOS2020 catalog has been used in several extragalactic studies (e.g., Ito et al. 2022, Shuntov et al. 2022, Davidzon et al. 2022, Kauffmann et al. 2022, Gould et al. 2023, Toni et al. 2023).
To start our analysis, we first need to clarify what we mean by "environmental density".Numerous methods have been used in the literature to estimate the density field associated with a given distribution of galaxies.A comprehensive review and comparison between these methods including "weighted Kernel Density Estimation (wKDE)", "weighted K-Nearest Neighbor", "weighted Voronoi Tesselation", and "weighted Delaunay Triangulation" is provided by (Darvish et al. 2015).Examining the performance of all these methods on simulated data, (Darvish et al. 2015) conclude that the weighted Kernel Density (wKDE) and Voronoi tesselation best reproduce the underlying density field in simulated data and result in a lower mean squared error (MSE) when applied on simulated data.According to (Darvish et al. 2015), wKDE is suitable for weighted data and less affected by the shot noise, which becomes important in sparse distributions, and possible random clustering of foreground and background sources.
In this study, we adopt wKDE method with the choice of von Mises-Fisher kernel function to estimate the underlying density field at different redshifts using COS-MOS2020 catalog.We produce density maps within the 0.4 < z < 6 range which can be used to identify LSS and release a publicly available catalog of measured den-sities for 210621 galaxies brighter than K s < 24.5 at 0.4 < z < 5 in the COSMOS field.We implement corrections to mitigate edge effects and masked sources in the vicinity of bright stars to improve the quality of density estimation.Eventually, we investigate the relation between estimated environmental density and the star formation activity (SFR/sSFR) at different redshift intervals to study the evolution of this relation with cosmic time.
The paper is organized as follows: In Section 2, we introduce the properties of data and selection criteria we used in this study.In Section 3, we describe the method used to construct density maps and the environmental density catalog, and we present and discuss our results in Section 4. We summarize our findings in Section 5.
Throughout this work, we assume a flat ΛCDM cosmology with H 0 = 70 km s −1 Mpc −1 , Ω m0 = 0.3, and Ω Λ0 = 0.7.All magnitudes are expressed in the AB system and the physical parameters are measured assuming a Chabrier initial mass function.
2. DATA COSMOS2020 consists of ∼ 1.7 million sources for which source detection and multiwavelength photometry (X-ray to radio-imaging) are performed across ∼ 2 deg 2 of the equatorial COSMOS field (Weaver et al. 2022).In addition to the previous release of this catalog (COSMOS2015, Laigle et al. 2016), COSMOS2020 consists of new ultra-deep optical data from the Hyper Supreme-Cam (HSC), Subaru Strategic Program (SSP), and new Visible Infrared Survey Telescope for Astronomy (VISTA) data from DR4 reaching more than one magnitude deeper in the K s band over the full area.Deep u ⋆ -and new u-band imaging from the Canada-France-Hawaii Telescope program CLAUDS (Sawicki et al. 2019) provides us with a deep coverage over a greater area than COSMOS2015.
In COSMOS2020, around 966000 sources are measured with all available broadband data utilizing two photometry tools 1) traditional aperture photometry (Laigle et al. 2016), the "CLASSIC " catalog, and 2) a new profile-fitting photometric tool, "The Farmer" (Weaver et al. 2023a, Weaver et al. 2023b), each of which includes photometric redshifts (hereafter photo-z) and other physical parameters computed by EASY (Brammer et al. 2008) and LePhare 1 (Ilbert et al. 2006;Arnouts et al. 2002).Both The Farmer and CLASSIC photometries are corrected for dust extinction using the (Schlafly & Finkbeiner 2011) dust map.In this study, we use photo-zs and other physical parameters derived by the combination of The Farmer photometric measurements and LePhare SED fitting code.
The Farmer is a profile-fitting photometry package that combines a library of smooth parametric models from The Tractor (Lang et al. 2016) with a decision tree that aims to determine the best-fit model in harmony with neighboring (blended) sources.The resulting photometric measurements are naturally total, without the need for aperture corrections, and more reliable in deep extragalactic fields with more crowded regions (Weaver et al. 2022).According to (Weaver et al. 2023), The Farmer is particularly effective at de-blending sources in low-resolution images like IRAC.In contrast, aperture photometry (the CLASSIC catalog) may underestimate the total flux of the sources and does not simultaneously model blended objects.Overall, the photo-z quality is similar between the two catalogs but, as noted by (Weaver et al. 2022), the Farmer demonstrates superior performance at fainter magnitudes (i ≳ 24) which predominantly correspond to high-redshift sources.With our choice of magnitude cut 24.5 (AB) on K s band, our magnitude limited sample remains complete down to ∼ 24.9 (AB) in i-band and ∼ 32% of sources fall within the range of 24 ≲ i ≲ 24.9, where Farmer demonstrates superior performance compared to the CLASSIC catalog.Better performance at fainter magnitudes and its more effective modeling of blended sources in densely populated regions led us to choose The Farmer catalog for this study.However, the drawback of this choice is that Farmer fails to model sources in the vicinity of bright sources, excluding ∼ 18% of sources in masked regions.Two catalogs are compared in full detail in (Weaver et al. 2022).
For the physical parameters, we use the results extracted by LePhare (Arnouts et al. 2002;Ilbert et al. 2006) which uses the same configuration outlined in (Ilbert et al. 2013) to fit both galaxy and stellar templates to the observed photometry.As the first step, photo-zs are estimated following the method outlines in (Laigle et al. 2016), then the physical properties such as absolute magnitudes, star formation rates (SFR/sSFR), and stellar mass are computed with the same configuration as COSMOS2015: LePhare fits a template library generated by (Bruzual & Charlot 2003) models to the observed photometry after fixing the redshift of each target to the estimated photo-z in the first step.Further details are discussed in (Laigle et al. 2016;Weaver et al. 2022).
The catalog contains photometric measurements in 44 bands (including U-band, Optical, Near-infrared, Midinfrared, X-ray, UV, and HST data), area flags, object type, and physical parameters such as SFR, sSFR, and stellar mass.Throughout this work, we use the median values of the photo-z probability distribution function (zPDF) and the marginalized likelihood of other physical parameters such as stellar mass, SFR, and sSFR, as reported in COSMOS2020.We limit our study to a sub-sample of 211431 galaxies with the following selection criteria: • Photo-z range of 0.4 < z < 6: although we report environmental densities for sources out to z ∼ 5 and the primary focus of our star formation activity-environment analysis is on sources within 0.4 < z < 4, we considered a buffer range (4 < z < 6) at the high redshift end of our primary redshift range to capture the full (zPDF) of sources whose zPDFs extend tails beyond z = 4. Since zPDFs are narrower for low-redshift sources, there is no need for such a buffer range at the lower end of our redshift range.Because of the sparsity of sources and a bias toward brighter sources, the reliability of the reconstructed density fields significantly diminishes beyond z ∼ 4.5 − 5.
• We filter out sources with large uncertainties in their photo-z measurements (∆z > 2).∆z is the 68% confidence interval on estimated photo-z.These sources do not effectively contribute to the density field.The relative median redshift uncertainty of the filtered sample is ∆z/(1 + z) ≲ 0.02 throughout the entire redshift range.
Figure 2. Top: the effective number of galaxies ( g w g s ) in each slice, for different thresholds on weight: 0.1, 0.05, 0.01, 0.001.The black curve shows the full sample without a threshold on weights.Middle: the effective number of galaxies in each redshift slice divided by the effective number of galaxies in all slices.Bottom: the size of the thresholded sample divided by the size of the unthresholded sample in each redshift slice.This fraction shows the degree to which thresholding lessens the computational time in the density estimate stage.
• An area of ∼ 1.7 deg 2 enclosed within 1.604 < δ < 2.817 and 149.398 < α < 150.787.This is the largest region containing robust NIR imaging equating to a spatially homogeneous selection function and NIR coverage.
• LePhare separates galaxies from stars and AGNs by combining morphological and SED criteria.We use a pure sample of "galaxies" (as identified by LePhare) that are not in the "bright star" masks.
• Magnitude cut of value 24.5 (AB) mag on Ultra-Vista K s , as the photo-z uncertainties increase significantly for fainter sources.
Figure 1 shows the spatial distribution of the resulting sample across the field.Red circles show ∼ 7600 masked regions that contain sources in the vicinity of bright stars (Coupon et al. 2017).

DENSITY FIELD ESTIMATION
We calculate the environmental densities adopting the same approach introduced in Chartab et al. ( 2020) with minor modifications detailed in the following sections.Although we refer the reader to Chartab et al. (2020) for more comprehensive details, we summarize the key steps of the method in the following section for clarity, and to contextualize the modifications we implemented.

Weighted Kernel Density Estimation
wKDE is a non-parametric method used for density reconstruction based on the spatial distribution of data points (Parzen 1962;A. Guillamón & Ruiz 1998;Gisbert 2003;Darvish et al. 2015), and is especially effective in handling weighted data.To reconstruct the density field utilizing wKDE, we implement the following procedure: 1) dividing the sample into redshift slices (Section 3.2), 2) calculating weights for all galaxies in each redshift slice (Section 3.3), 3) applying corrections to improve the density estimation around the masked regions (Section 3.4), 4) find the optimum bandwidth in each redshift slice and an adaptive bandwidth for each source (Section 3.5), 5) applying corrections for the "edge effect" that impacts the estimated density map near the edges of the field (Section 3.6).
In this scheme, the surface density for the ith galaxy in the sth redshift slice and at position (X i ) is defined as: where, K(X i ; X g ), is the Kernel function of our choice calculated between two sources at X i and X g and w s g is the probability of galaxy g being at sth redshift slice normalized to the sum of its weights in all redshift slices.In this work, we adopt the "von Mises-Fisher" kernel function, which is the analog of the Gaussian kernel function for circular/periodic data (here R.A and Dec. coordinates) (Bai et al. 1988;García-Portugués et al. 2013;Taylor 2008;Chartab et al. 2020).The "von Mises-Fisher" kernel is a simplified, isotropic form of a more general 5-parameter kernel function known as "Kent" distribution (Kent 1982).While the "von Mises-Fisher" kernel effectively reduces to the Gaussian kernel in small fields, its use is particularly advantageous for providing greater accuracy in future wide-field surveys: Where ψ is the angular distance between X i and X g which can be calculated using their coordinates and b is the bandwidth of this kernel which determines the extent to which the source at position X g contributes to the environmental density of the source at position X i .Details of finding the optimum value of b are explained in Section 3.5.Eventually, We calculate the environmental density for the ith galaxy in our sample, σ(G i ), as a weighted sum of the surface density across all redshift slices (Chartab et al. 2020): Where w s i is the weight associated with the galaxy i at sth slice.

Redshift Slices
To reconstruct the density field at different redshifts we have two options to deal with the uncertainties of photo-zs.One is to adopt wide enough, overlapping redshift slices to consider the contribution of galaxies that have large uncertainties on their photo-z and those that are close to the boundaries of each slice.In this approach, the width of slices is chosen based on the redshift uncertainties.For instance, the median of the photo-z uncertainties can be considered as the width of the redshift slices (Darvish et al. 2015;Scoville et al. 2013).
An alternative approach, which is used in this work, is to assign a weight to each galaxy at each redshift slice to incorporate their contribution at all redshifts according to their photo-z PDF (Chartab et al. 2020).In this approach, we no longer need to have overlapping slices.We divide our redshift range into slices with a constant comoving width.For that, we need to choose a physically reasonable length scale as the comoving width of redshift slices.This comoving length should be larger than the typical size of structures of our interest (e.g.galaxy clusters), account for the uncertainties in photo-z measurements, and the uncertainty in the redshift direction caused by the peculiar velocity of galaxies in the line of sight, known as redshift space distortion (RSD).Due to RSD, an internal velocity dispersion of ∆v for a galaxy cluster at redshift z can be translated to a comoving distortion of value ∆χ along the line of sight: This length scale, due to the RSD effect, peaks at z = (2Ω Λ0 /Ω m0 ) 1/3 − 1 ≈ 0.65: a massive galaxy cluster with internal velocity dispersion ∆v ≈ 1500 km s −1 will be extended ≈ 18 h −1 Mpc in comoving space, at this redshift.
Another constraint in redshift binning is the uncertainty of photo-z measurements.In our sample, a choice of ∆χ = 35 h −1 Mpc results in relative median uncertainty of value ∆z/(1 + z) < 0.02 in all redshift slices, while it satisfies the minimum required width needed to account for the RSD effect and it is bigger than the typical size of LSS components up to z max ∼ 6 (Muldrew et al. 2015;Chiang et al. 2017;Fard et al. 2019;Zhu et al. 2021).
One can translate this comoving width, ∆χ, into width of the redshift slices ∆z: With the choice of ∆χ = 35 h −1 Mpc, we will have 135 redshift slices ranging from z = 0.4 to z = 6, with slice widths varying from 0.014 (at redshift 0.4) to 0.117 (at redshift 5.936).

Weight Calculation
Once we determined the redshift slices we can calculate the weight of a galaxy g in the redshift slice s, denoted as w g s , which is the probability of galaxy g being in the redshift slice s.For simplicity, we use a Gaussian probability distribution to calculate these weights for most of the galaxies in the sample that have a single solution for their photo-z.We put the center of the Gaussian PDF on the estimated photo-z, with a standard deviation calculated using the 68% confidence in- terval of photo-z.Hence, w g s can be calculated as where z g is the estimated photo-z and integration domain is over sth redshift interval.This is the contribution of galaxy g to the density field of sth redshift slice (Equation 1).For sources that have two peaks in their photo-z, a Gaussian PDF is not a good approximation.The fraction of these sources has a monotonically increasing relation with the selected magnitude-cut on the sample.With our choice of magnitude cut (K s = 24.5),less than 7% of sources in our sample would have a second solution with P > 5% for their photo-z.For these sources, we use their actual photo-z PDF to calculate weights.
Theoretically, all galaxies with a Gaussian probability distribution have non-zero weights in all redshift slices.To reduce the computational time in the density estimation step, we only keep galaxies that have large enough weights, above a weight threshold of value w th = 0.05, in a redshift slice.Figure 2 shows the effect of different choices of w th on the sample.The upper panel shows the effective number of galaxies, the summation of all weights in a redshift slice, as a function of redshift.The black curve represents the original sample (without threshold on weights) which is plotted as a reference.A higher threshold decreases the effective number of galaxies in all redshifts.The middle panel shows the effective number of galaxies in each redshift slice divided by the effective number of galaxies in all slices.The lower panel shows the fraction of sources in the sample that enter the next step, or the factor by which the threshold on weights reduces the computation time.The choice of w th = 0.05 significantly shrinks the sample size in all redshift slices while minimally affecting the distribution of galaxies across the whole redshift range.
The upper panel in Figure 3 shows the distribution of galaxies as a function of redshift.The dark blue histogram represents the number of galaxies that have measured photo-z within a redshift slice and the light blue histogram shows the distribution of galaxies that have weights above w th = 0.05 in each redshift slice.Vertical red lines between two panels show the centers of 135 redshift slices.The bottom panel in Figure 3 shows the uncertainty of photo-zs (half of the 68% confidence interval of calculated photo-z) as a function of redshift.The red dashed line shows the median of redshift uncertainties in each redshift slice.

Masked Regions
COSMOS2020 flags objects that are in the regions covered/affected by bright stars in the HSC survey (FLAG HSC), and by bright stars in the legacy Supreme-cam data (FLAG SUPCAM).These objects are affected by the fluxes of nearby stars or other artifacts.(Coupon et al. 2017) provide bright star masks from the HSC-SSP PDR2 which is used to flag objects in the vicinity of these sources (red circles in Figure 1).Moreover, artifacts in the Supreme-Cam images are masked using the same mask as in COSMOS2015 (Weaver et al. 2022).Approximately 18% of sources are located within these masked regions, where measurements (photometry and SED fitting) are not reliable (Weaver et al. 2022).Therefore, these sources are not included in our analysis.
Exclusion of these flagged sources leads the density estimator to underestimate the densities around masked regions.To account for this error, in each redshift slice, we populate the masked regions with a uniform distri-bution of "artificial" sources that meet the following two criteria: • The number density of the "artificial" sources is equal to the average number density of galaxies (actual data) in the field, excluding the masked area: Where A field represents the total area of the field and A masked refers to the total masked area.
• We choose an identical weight for all these artificial sources such that they do not change the average weight of actual galaxies in a redshift slice: where N s g is the number of actual galaxies in the sth redshift slice.
Figure 4 presents a comparison between the constructed density field before and after performing corrections for masked regions at z = 2.93.For easier comparison, some of the largest masks are plotted as white dashed circles.As we can see, the constructed density field around these masked regions will be affected by the lack of sources in these regions if we do not implement corrections.

Bandwidth Selection
The next step is to choose a bandwidth representing the scale to which the kernel smooths the field, termed "global bandwidth".An optimum bandwidth should be chosen based on the number density of sources in each zslice and the extent to which they are clustered: a larger bandwidth results in an over-smoothed field and consequently less information about fine structures while a small bandwidth results in an under-smoothed field with high variance and uncorrelated small scale structures.Selection of the optimum bandwidth is a challenging part of the wKDE.Several methods have been suggested to find the optimum bandwidth.It can be motivated by the physical size of structures of interest in the study.For instance, (Darvish et al. 2015) adopt a constant global bandwidth of physical length h = 0.5 Mpc for all redshifts, which corresponds to the characteristic size, R 200 , for X-ray clusters and groups in the COSMOS field.(Chartab et al. 2020) employ the leave-one-out Likelihood Cross-Validation (LCV) method (Hall 1982) to find the optimum global bandwidth for each z-slice.
As we perform the analysis in a broad redshift range (0.4 < z < 6), adopting a constant physical size for the kernel bandwidth will be an oversimplification and leads us to an unfair estimation of the density field: a fixed bandwidth that performs well at lower redshifts is not our best choice at higher redshifts where the source distribution is more sparse.Therefore, we need to consider the varying number of sources in each redshift slice to set the appropriate bandwidths.We use the LCV method (Hall 1982;Chartab et al. 2020) to find the most likely bandwidth in each z-slice, b s , given the distribution of sources with specified weights.The method involves a grid search on a range of bandwidths, calculating the likelihood of each candidate bandwidth, and finding the bandwidth that yields the highest likelihood value as the optimal bandwidth.The outcome of this method, b s , is data-driven, without any presumption on the bandwidth size, and asymptotically minimizes an integrated squared error in the estimated density: where N is the total number of sources in the field and σ −k (X k ) is the calculated density at position X k leaving the k th data point out of the sample (if we do not remove the k th data point, the optimal b would be zero).
Next, we determine a local adaptive bandwidth for each point, b i , adjusting it according to the clustering level in the surrounding area.In regions with higher clustering, a smaller bandwidth is used for better resolution of smaller structures.Adaptive bandwidth prevents over-smoothing in dense areas and accommodates broader correlations in sparse regions.We calculate b i as (Abramson 1982;Darvish et al. 2015;Chartab et al. 2020): where g is the geometrical mean of the estimated surface density, σ(X i ), for all sources in the field: Where α is a constant sensitivity parameter ranging from 0 to 1 and can be determined through simulation.
We choose α = 0.5, as it has minimal impact on the outcome.

Edge Correction
The wKDE algorithm is effective in areas away from the edges of the field.However, it tends to underestimate density near the edges.This affects only a minor portion of our sources, given the wide area of the COS-MOS field.In this section, we implement a correction to address this error.Several methods have been developed to mitigate the edge effect, e.g., the reflection method (Schuster 1985), the boundary kernel method (Müller 1991), the transformation method (Marron & Ruppert 1994), and renormalization method (Jones, M. C. 1993).In this study, we adopt the re-normalization method: the expectation value of the density field at point X 0 , up to the first order, is where σ s True (X 0 ) is the true value of the density field at position X 0 and the integration domain is over the whole field with area S. A reasonable choice for the correction of the edge effect is (Chartab et al. 2020) where n(X 0 ) is defined as follows: The correction factor, n, ranges from 1 for a point far from the edges to ∼ 4 right at one of the corners.

Density Map Construction
Figure 5 illustrates the complete process of constructing density maps in a redshift slice.Here we summarize the process: 1. Top-Left.We calculate the weight for all galaxies in a redshift slice, either assuming a Gaussian zPDF or by using the actual redshift PDF for those that have two solutions for their photo-z with P > 5%.
2. Top-Middle.We populate the masked regions with artificial sources of uniform distribution and combine them with the actual galaxies (Top-Right).
3. Bottom-Left.We find the optimum global bandwidth in each redshift slice, b(s), using the leave-one-out Likelihood cross-validation method (Equation 9) and then calculate the adaptive bandwidth (Equation 10) at the position of each galaxy.
4. Bottom-Middle.We calculate the correction factor for all sources to compensate for the edge ef- fect using the global bandwidth calculated in step 3.
5. Bottom-Right.The last step is to construct the over-density maps and calculate the densities for all sources.Over-densities are calculated using the background surface density, σ median , defined as the median of the reconstructed surface density field in each redshift slice.
With our choice of kernel bandwidth (calculated from LCV), σ median , is almost constant at all redshifts.The choice of the median value to define background density minimizes bias resulting from outliers.
Comoving density, ρ comoving , is defined as the number of galaxies in 1 Mpc 3 of comoving space.We calculate the comoving density as ρ comoving = (1 + δ)ρ, where ρ is the average number density of galaxies in sth redshift slice: Where V s is the comoving volume associated with the sth redshift slice and g w g s is the effective number of galaxies in the selected redshift slice.
Table 1 presents a portion of the full density catalog, including COSMOS ID, photo-z, R.A., and Dec. (from COSMOS catalog); and the measured density contrast, comoving, physical density, and star-forming/quiescent flag (explained in Section 4.2).The full electronic density catalog is published in its entirety.

RESULTS & DISCUSSION
In this section, we present the results of density estimation and utilize them to study the environmental dependence of star formation activity.Our analysis involves two distinct galaxy groups: an overall sample encompassing both star-forming and quiescent galaxies, and a sample of only star-forming galaxies.Additionally, we explore the redshift evolution of this relation by dividing the entire sample into six cosmic epochs (redshift intervals).

Large Scale Structures (Density Maps)
We release overdensity maps along with the spatial distribution of weighted sources for 135 z-slices spanning 0.4 < z < 6.The full set of maps is available in animated format.Four examples of overdensity maps along with previously studied/confirmed structures in the same redshift are shown in Figure 6.Panel A) shows the filamentary structure at z ∼ 0.73 known as "COSMOS Wall" along with its galaxy groups studied in (Iovino et al. 2016) and X-ray groups from (George et al. 2011).Panel B) depicts an elongated structure at z ∼ 0.92 and X-ray galaxy groups at the same redshift from (Gozaliasl et al. 2019).Panel C) shows the stacked overdensity field over 2.452 < z < 2.671.This is an interval that includes many massive groups and confirmed sources, some of which are shown in the plot: confirmed members of PCL1002 are shown by black crosses (Casey et al. 2015), 7 massive density peaks in "Hyperion" massive protocluster by red circles (Cucciati et al. 2018), and spectroscopy confirmations from zCOSMOS-deep catalog by black dots (Lilly et al. 2007, Lilly et al. 2009, andKhostovan et al. In preparation).The very distant and massive protocluster PCL J1001+0220 studied in (Lemaux et al. 2018;Staab et al. 2024) is shown in panel (D).In all panels, contours are placed at overdensity level (1 + δ) ∼ 2.

Environmental Dependence of SFR and its Redshift Evolution
To study the redshift evolution of SFR/sSFR-density, we divide our sample into mass-complete sub-samples in 6 redshift intervals.The choice of magnitude cut K s ∼ 24.5 and other selection criteria introduced in Section 2, result in a magnitude-limited sample that is distinct from the original COSMOS2020 catalog.In a  (Iovino et al. 2016) (black boxes) and X-ray groups from (George et al. 2011) (magenta stars); B) an elongated structure at z ∼ 0.925 (can also be found in Darvish et al. 2015; their Figure 2) along with X-ray galaxy groups within this redshift range from (Gozaliasl et al. 2019) shown by magenta stars; C) overdensity map stacked over the range z ∼ 2.452 − 2.671 along with confirmed members of PCL1002 (Casey et al. 2015) (black crosses), and 7 density peaks in "Hyperion" proto-supercluster at z ∼ 2.47 (Cucciati et al. 2018) (red circles).Spectroscopic confirmations from zCOSMOS public catalog (Lilly et al. 2007, Lilly et al. 2009, andKhostovan et al.In preparation) are shown with black dots.D) a very distant and massive protocluster, known as "Taralay" (PCl J1001+0220), at z ∼ 4.57 studied in (Lemaux et al. 2018;Staab et al. 2024).Contours are placed at overdensity (1 + δ) = 2 in all overdensity maps.magnitude-limited sample, the minimum stellar mass we have observations for depends on both redshift and stellar mass-to-light ratio.To obtain mass-complete subsamples in each redshift interval, we follow the method outlined in (Pozzetti et al. 2010;Ilbert et al. 2013).We first re-scale the stellar mass of galaxies to a limiting mass, M lim , which is the mass that a galaxy would have at its redshift if we shift its apparent magnitude to the limiting magnitude of the survey or, in our case, the magnitude-cut K s ∼ 24.5.All types of galaxies above this mass limit are considered to be brighter than the magnitude cut, and potentially observable.The mass re-scaling relation is log(M lim /M ⊙ ) = log(M/M ⊙ ) + 0.4(K s − K s,cut ), where M is the estimated stellar mass of the galaxies reported by The Farmer-LePhare combination.A constant stellar mass-to-light ratio is presumed in this relation.(Pozzetti et al. 2010).Properties of these mass-complete samples are summarized in the first three columns of table 2. Orange dots are completeness limits calculated in redshift bins of width 0.1 and the dashed orange line is the corresponding polynomial fitting function in (1 + z).The blue curve is the mass-completeness limit of the original catalog introduced in (Weaver et al. 2022), plotted as a reference.
At each redshift interval, the final completeness limit M comp , corresponds to the mass below which 95% of the galaxies' re-scaled masses are populated.This is to ensure that for any subset of galaxies with masses above this limit, not more than 5% of them could be missed in the lower mass regime.In each interval, less massive (fainter) galaxies that appear at the low redshift end, might be absent at the high redshift end, introducing biases toward more massive galaxies.To minimize this bias, in each redshift interval, we calculate the completeness limit at the high redshift end of the interval.Figure 7 shows the distribution of stellar masses versus redshift in our sample.The blue solid line is the mass-completeness fitting function introduced in (Weaver et al. 2022) for the whole COSMOS2020 catalog plotted here as a reference.Red boxes show the areas that encompass galaxies in the 6 mass-complete bins.Orange dots show the completeness limit we calculated in redshift bins of width 0.1 and the dashed orange line shows the corresponding polynomial fitting function in (1 + z).
This selection of redshift intervals ensures a substantial number of galaxies in each group.The properties of the resulting sub-samples, including redshift range, mass-completeness limit, and sample sizes are given in the first three columns of Table 2.While we have constructed the density maps for the full redshift range 0.4 < z < 6, and we report environmental densities out to z ∼ 5, we limit the analysis in this part to sources within the range 0.4 < z < 4. At 4 < z < 6, the number of sources in mass-complete samples becomes sufficiently low (< 300) to make any statistical conclusion unreliable.
In total, our mass-complete sub-samples include 97,247 galaxies extending up to z ∼ 4. We then use the rest-frame color-color (NUV-r vs. r-J) diagram to identify quiescent galaxies in each bin using the classification criteria introduced by (Ilbert et al. 2013): galaxies with a rest-frame color NUV-r > 3.1 and NUV-r > 3(r-J)+1 are flagged as quiescent.Figure 8 shows the population of star-forming and quiescent galaxies in each redshift interval all colored by their SFR.
Figure 9 presents the SFR and sSFR as a function of environmental density for two samples: 1) the overall sample (columns 1 & 3), and 2) the star-forming sample (columns 2 & 4).Colorbars correspond to the population in pixels.At lower redshifts (0.4 < z ≲ 1.5), a significant population of sources is found in high-density environments (log(1 + δ) ∼ 1).Conversely, at higher redshifts (1.5 ≲ z < 4), sources are mostly populated in low/intermediate densities (log(1 + δ) ≲ 0.6).In addition, we observed a population of low-SFR/sSFR sources at intermediate densities (−0.2 ≲ log(1 + δ) ≲ 0.8) in columns 1 and 3 (the overall samples).Notably, at z ≲ 1.5, most of these sources vanish in columns 2 and 4, where we exclude quiescent galaxies from our sample.This is attributed to the fact that, among galaxies in low/intermediate density environments, those with low SFR/sSFR are mainly quiescent galaxies.However, this trend lessens at higher redshifts (1.5 < z < 4): there is still a considerable population of "passive" galaxies at low/intermediate densities (−0.2 ≲ log(1 + δ) ≲ 0.8), even after excluding quiescent galaxies.When interpreting these findings, it is crucial to consider the class imbalance between star-forming and quiescent galaxies at all redshift intervals (Figure 8) and biases toward bright/massive objects at higher redshifts.Furthermore, it should be noted that the COSMOS field, particularly at lower redshifts (z ≲ 2), does not have substantial overdensities compared to other low-redshift surveys or those that are designed to target massive LSS (e.g., SDSS, York et al. 2000, EdisCS, White et al. 2005;GOGREEN, Balogh et al. 2017;ORELSE, Lubin et al. 2009).As a result, some severe environmental effects, may not be observed within the range of environments we have here (−0.2 ≲ log(1 + δ) ≲ 1.1).
To better understand these trends, we present the corresponding binned statistics in Figure 10.Average SFR and sSFR are calculated in bins of density, with error Figure 8. NUV-r vs. r-J color-color diagrams and the criteria used to identify quiescent and star-forming galaxies (solid lines) in the 6 mass-complete samples chosen within 0.4 < z < 4. Galaxies in the regions defined as NUV-r > 3.1 and NUV-r > 3(r-J)+1 are identified as quiescent (Ilbert et al. 2013).
bars indicating the standard error of mean values.For both overall and star-forming samples, the SFR-density and sSFR-density trends are almost the same.A considerable difference between SFR-density and sSFR-density dependence is that the average SFR of galaxies increases with increasing redshift, while the average sSFR does not change significantly at different redshifts.The notable decrease in SFR from higher to lower redshifts is related to the decline in the global star formation density of the universe after z ∼ 2 − 3 (Sobral et al. 2012;Khostovan et al. 2015).The observed trends for the overall and star-forming samples are discussed in the following sections.

Overall Sample (Star-Forming and Quiescent)
The upper panels in Figure 10 show the average SFR/sSFR as a function of redshift for the "overall" sample.Since z ∼ 4 to the lowest redshift, the average SFR declines by 1.1 dex in low-density environments (δ ∼ −0.5), while in higher-density environments (δ ∼ 5), the SFR decline is approximately 2.8 dex.The redshift evolution of the sSFR-density relation across the same redshift range is slightly different: at high-density environments (δ ∼ 3), there is a significant decline in average sSFR of about 3 dex, whereas in low-density environments, the sSFR remains almost unchanged.
Out to z ∼ 1.1, we see a clear anti-correlation between SFR/sSFR and overdensity.In the lowest redshift bin (0.4 < z < 0.8), SFR decreases by a factor of ∼ 150 as the density increases from δ ∼ −0.5 to δ ∼ 10, and in the redshift bin 0.8 < z < 1.1, the SFR decreases by a factor of ∼ 10 across the same range of density.This observed anti-correlation at lower redshifts (z ≲ 1) is well established and in full agreement with many previous studies (e.g., Patel et al. 2009;Scoville et al. 2013;Darvish et al. 2016;Tomczak et al. 2019;Old et al. 2020;Chartab et al. 2020).
At 1.1 < z < 2, SFR/sSFR-overdensity correlation weakens such that star formation becomes almost independent of the environment.This observation aligns with findings by (Scoville et al. 2013) for z ≳ 1 (their Figures 15 and 16) and (Darvish et al. 2016) (Figure 1) for 1.1 < z < 3.1, utilizing earlier photometric data from the COSMOS field (Ilbert et al. 2009;McCracken et al. 2012;Ilbert et al. 2013).Conversely, some other studies confirm the persistence of the anti-correlation between SFR-density out to z ∼ 2 (Grützbauch et al. 2011;Fossati et al. 2017;Ji et al. 2018) with (Chartab et al. 2020) reporting an anti-correlation persisting to even higher redshifts (up to z ∼ 3.5).We interpret this Figure 9. Two columns on the left show SFR vs. environmental density in 6 redshift intervals (column 1: the overall sample; column 2: the star-forming sample).Two columns on the right show sSFR vs. environmental density in 6 redshift intervals (column 3: the overall sample; column 4: the star-forming sample).Colorbars correspond to the population in each pixel and the contours are placed at 3 equally spaced levels between the minimum and maximum population per pixel in each plot and pixels with counts fewer than 5 are set to zero.
weakening of correlations as a transitional phase leading to the reversal of trends at higher redshifts.
At 2 < z < 4, we observe the reversal of the SFR/sSFR-density relation.For both overall and starforming samples, at 2 < z < 3 and 3 < z < 4, SFR increases by a factor of ∼ 10 as the density increases from −0.4 to 5. The reversal of SFR-density trends at higher redshifts (z ≳ 1) has been reported in several studies (Elbaz, D. et al. 2007;Cooper et al. 2008;Santos et al. 2015;Welikala et al. 2016).Using a large sample of star-forming Hα emitters at z ∼ 0.84, (Sobral et al. 2011) reported an increase in SFR of star-forming galaxies at low/intermediate densities, followed by a de-cline of SFR in the dense environment and clusters.(Sobral et al. 2011) argued that this might be the reason for inconsistencies at z ∼ 1, as some studies only reach intermediate/group environments, while others only focus on rich clusters.Using a set of spectroscopic observations (Lemaux et al. 2022) report a positive correlation between the average SFR and galaxy overdensity at (2 < z < 5) across the environmental density range of −0.2 ≲ log(1 + δ) ≲ 1. (Lemaux et al. 2022) showed that the reversal of SFR-overdensity trends persists even when the effect of stellar mass was taken into account.
As we can see, the main controversy centers on trends at higher redshifts (z ≳ 1).This is partly because, the observed trends are sensitive to larger uncertainties in photo-zs at higher redshifts, and redshift binning, which affect the distribution of galaxies in each mass-complete bin.Moreover, some studies attributed the observation of reversal to the effect of cosmic variance in small fields, the small dynamical range of environments (e.g., lack of extremely dense structures in COSMOS field) (Sobral et al. 2011;Scoville et al. 2013;Darvish et al. 2016) or AGN contamination (Popesso et al. 2011).In addition, different selection functions, especially in studies reliant on spectroscopic samples, introduce further biases (e.g., toward massive clusters or bright sources).Finally, the way the environment is defined/calculated and the statistical interpretation of the results might be another source of inconsistencies between high redshift results.All these factors become more important when interpreting the results in the transition epoch, which occurs between 1 < z < 2 according to our findings.A quantitative analysis of these correlations, provided in Section 4.3, sheds more light on our interpretation of these trends.
In addition to the environment, it is shown that stellar mass is another important factor in star formation activity of galaxies (Peng et al. 2010;Sobral et al. 2014;Shivaei et al. 2015;Tomczak et al. 2019;Lemaux et al. 2019).For instance, (Darvish et al. 2016) find that at a given overdensity, the median SFR for star-forming galaxies is higher for more massive systems out to z ∼ 3 and (Chartab et al. 2020) report that the SFR of Massive galaxies (M ≳ 10 11 M ⊙ ) is inversely correlated at all redshifts and SFR of galaxies with lower stellar mass is almost independent of the environment at 1.2 ≲ z ≲ 3.5.Among studies that observe reversal of SFR-density trends, (Lemaux et al. 2022) suggest that high mass galaxies in the denser environments are responsible for this reversal at higher redshifts.We defer a comprehensive analysis of the SFR, stellar Mass, and overdensity relation to our subsequent study (in preparation).However, the correlation between sSFR and overdensity suggests the direct impact of environmental density on the star formation activity of galaxies.
Despite the ongoing debate around the reversal of the star formation-density trends at higher redshifts, this observation can be attributed to factors such as greater availability of gas supply, tidal interactions, and in general higher star-formation efficiency in high-density environments (Wang et al. 2018;Lemaux et al. 2022), potentially leading to enhanced star formation rates at the initial stages of galaxy evolution (z > 2) for galaxies in rich environments.

Star-Forming Sample
The bottom panels in Figure 10 show the average SFR (bottom left) and average sSFR (bottom right) as a function of overdensity for a sample of star-forming galaxies.At lower redshifts z ≲ 1.1 both SFR and sSFR are almost independent of environment.Therefore, the SFR-overdensity trends observed at z ∼ 1 in the overall sample are due to the quiescent galaxies that are populated in denser environments.At 1.1 < z < 2, both SFR-overdensity and sSFR-overdensity show no significant correlation and trends do not have a monotonic behavior, unlike the lower redshift trends.At our highest redshift bins 2 < z < 4, we see a positive correlation in both SFR-overdensity and sSFR-overdensity: SFR increases by a factor of ∼ 8 as overdensity increases from −0.5 to 4.5.This is a similar behavior to the overall sample, meaning that removing quiescent galaxies does not change the trends at 2 < z < 4.This implies a scenario in which a set of processes in high-density environments initially enhance the star formation rate at early epochs (z ≳ 2).Several processes might contribute to the elevated star formation activity observed in denser environments.These include increased levels of gas accretion, higher merger rates, and the impact of largescale structures (e.g., tidal effects and galaxy-galaxy interactions).A detailed discussion of these mechanisms can be found in (Lemaux et al. 2022) and references mentioned in their study.In this scenario, the initial enhancement in star formation activity is followed by quenching mechanisms taking effect at z ≲ 2, resulting in anti-correlations between SFR and overdensity observed at lower redshifts.Both quenching mechanisms, environmental quenching (e.g., ram pressure stripping, galaxy-galaxy interactions, galaxy harassment) and stellar mass quenching (e.g., gas outflows and AGN feedback), are shown to be more efficient in denser environments (Darvish et al. 2016).Despite these conclusions, we should note that there is an interconnection between massive galaxies and very dense environments causing a degeneracy between stellar mass and environmental density.In other words, the direct role of the environment, regardless of its impact on stellar mass, needs further investigation which is deferred to our future work (Khosravaninezhad et al. in prep).The observed trends between SFR/sSFR and overdensity are discussed quantitatively in the following section.

Correlation Coefficients
To quantify our findings in star formation and density relation, we calculated the "Spearman" correlation coefficient for the reported trends in both overall and star-forming samples.Spearman coefficients determine the degree to which a monotonic function can describe the relationship between two variables (Spearman 1904).
Table 2 summarizes the properties of mass-complete samples at 6 redshift intervals, along with the Spearman correlation coefficients.Starred coefficients are those that have a P −value> 5% and all P −values larger than 0.001 are reported in the table.All other P -values associated with the reported coefficients in Table 2 are less than 0.001, suggesting the statistical significance of these trends.For the overall sample, the SFR-density and the sSFR-density relations have generally the same behavior: a negative correlation between SFR/sSFR and density out to z ∼ 2 (except the 1.1 < z < 1.5 bin which has a large P -value= 0.28), which weakens by increasing redshift and is followed by a positive correlation at higher redshifts (z ≳ 2).For the star-forming sample of galaxies, the correlations are generally weaker compared to the overall sample out to z ∼ 2: all coefficients have an absolute value less than 0.03 with large P −values in several redshift bins, suggesting that the reported correlation coefficients are not statistically significant.At the highest redshift bins (2 < z < 4), we see that removing quiescent galaxies does not change the strength and significance of observed trends and we can see a positive relation between SFR/sSFR and density for both overall and star-forming sample.

SUMMARY
We use a magnitude-limited (K s < 24.5) sample of galaxies in the COSMOS2020 catalog to reconstruct density maps across 0.4 < z < 6.We choose 135 redshift slices of constant comoving width 35 h −1 Mpc and assign weights to galaxies in all redshift slices using their zPDF.We calculate densities adopting the weighted Kernel Density Estimation method, with the choice of von Mises-Fisher kernel, and implement corrections for "edge effect" and masked regions to improve our estimation of the density field.
We release a publicly available catalog of calculated environmental densities for ∼ 200 k galaxies, along with an animated version of density maps out to z ∼ 6 which can be used to identify LSS.To explore the relation between the star formation activity of galaxies (SFR/sSFR) and environmental density and the evolution of this relation over cosmic time, we provide binned statistics for mass-complete sub-samples within six redshift intervals (details in Table 2).Our findings are summarized as follows: 1.In the overall sample, we observe a negative correlation between SFR/sSFR and overdensity at z ≲ 1.1.This correlation diminishes at 1.1 < z < 2, and a reversal of trends is noted beyond z ∼ 2, indicating that galaxies in denser environments exhibit higher star formation activity during the early stages of their evolution.
2. In the star-forming sample, out to z ∼ 2, we observe a relatively weak positive (negative) correlation between SFR (sSFR) and overdensity.Beyond z ∼ 2, we observe a positive correlation between SFR/sSFR and overdensity, with the same strength as observed in the overall sample.
3. At a fixed overdensity, in both overall and starforming samples, SFR increases as we go to higher redshifts.While we see a similar behavior between sSFR-overdensity at the high-density end of the overall sample, the median sSFR does not change significantly with redshift at lower densities.In the star-forming sample, the average sSFR shows no significant variation with redshift at a given overdensity.
4. We analyze the strength of these correlations using the Spearman correlation coefficient, the results of which are presented in table 2. The calculated coefficients substantiate the observed trends in Figure 10.For the overall sample, we report a negative correlation coefficient between SFR/sSFR and environmental density, diminishing as we go to 1, the median SFR and sSFR decrease with increasing overdensity.At 1.1 < z < 2, the SFR and sSFR become almost independent of the environment for both overall and star-forming samples.At higher redshifts (2 < z < 4) there is a positive correlation between star formation activity and the environment for both overall and star-forming samples.
higher redshifts.This is followed by a shift to a positive correlation at z ≳ 2, with the transitional phase occurring between 1.1 ≲ z ≲ 2.
5. For the star-forming sample, the coefficients are weaker than those in the overall sample out to z ∼ 2 and relatively larger P −values indicate that the observed trends cannot be confidently explained by monotonic relations, particularly at 1.1 < z < 2. At z > 2 the strength of the observed trends mirrors that of the overall sample, suggesting that excluding the quiescent population does not alter the trends within our highest redshift bins.
The consistent trends noted in the sSFR-overdensity relation indicate that the mass-normalized star formation activity of galaxies has been affected by their environments since the early phases of galaxy evolution.
Increased levels of gas accretion, higher merger rates, and tidal interactions are among the possible environmental processes that enhance star formation activity at early epochs.At lower redshifts, ram pressure stripping, galaxy-galaxy interactions, and suppression of cool gas accretion can be named among the environmental processes that possibly suppress the star formation rate in denser environments.However, it is important to acknowledge that the direct contribution of stellar mass in the evolution of star formation activity needs to be more precisely accounted for.Our ongoing study, building upon this work, is dedicated to a comprehensive analysis of how stellar mass contributes to the trends observed here.This includes assessing the efficiencies of both environmental and mass quenching mechanisms in different environments, and its evolution as a function of redshift.
The accuracy of density estimation methods is heavily dependent on the quality of estimated redshift PDFs.In addition, our statistical conclusions about SFR/sSFRdensity relation are limited to the accuracy of SED fitting outputs.Therefore, further improvements in photometry techniques can significantly improve the quality of zPDFs and consequently, SED-derived parameters.Moreover, the accuracy of properties derived from SEDfitting depends on various factors including the dust content of the galaxies.For instance, extremely dusty starforming galaxies might have their SFR underestimated if their dust obscuration is not adequately accounted for in the SED models.At higher redshifts, particularly around z ∼ 2 − 3, where the contribution of dusty star-forming galaxies to the overall SFR budget is significant, this bias could potentially impact the observed SFR-density relations.
To have a more accurate understanding of the SFRenvironment relation at high redshifts, particularly beyond z > 2, we still need to acquire deeper observations in larger contiguous fields to improve the completeness of our samples and minimize the effect of cosmic variance.In the near future, the detection of large samples of structures in wide-area surveys such as Euclid, and The Hawaii Two-0 Survey (Zalesky et al. in preparation) is expected to provide further insights into this topic.In a following paper (in preparation), we will study the evolution of star formation activity of galaxies across different components of LSS (field, cluster, filament).We anticipate that with the advent of wide-area surveys in the near future, studies focusing on the influence of large scale structures will become increasingly feasible and relevant.

ACKNOWLEDGMENTS
We are grateful to the anonymous referee for their helpful comments that greatly improved the quality of this work.Some of the data used in this study were obtained at the W.M. Keck Observatory, which is operated as a scientific partnership among the California Institute of Technology, the University of California, and the National Aeronautics and Space Administration

Figure 1 .
Figure 1.Spatial distribution of sources selected based on criteria outlined in Section 2. Red circles show bright star masks from the HSC-SSP PDR2 (∼ 7600 regions) provided by (Coupon et al. 2017) which are used to mask objects in the vicinity of bright stars.

Figure 3 .
Figure 3. Top: shows the distribution of galaxies across 0.4 < z < 6.The dark blue histogram represents the count of galaxies that have photo-z measurement within a redshift slice and the light blue histogram shows the distribution of galaxies that have weights above w th = 0.05 in each redshift slice.Redshift slice centers are shown as vertical red lines between two panels.Bottom: shows the photo-z uncertainty (half of the 68% confidence interval of photo-z) as a function of redshift.The dashed red line depicts the median of the photo-z uncertainties in each redshift slice.

Figure 4 .
Figure 4. Reconstructed density map at z = 2.93.The left panel shows the reconstructed density map without correction for masked regions.The right panel presents the same density map after applying corrections for masked regions by populating them with uniformly distributed artificial sources.This results in a smoother density field, particularly around large masked areas.For easier comparison, some of the largest masks are plotted with white dashed circles.

Figure 5 .
Figure 5.This figure shows the steps taken in the construction of the density map for a redshift slice centered at z = 1.881.Upper left: distribution of sources that have weights above w th .Upper middle: uniformly distributed artificial sources populated in the masked regions.Upper right: actual galaxies combined with artificial points.Sources in all upper panels are colored by weight.Lower left: actual/artificial sources colored by adaptive bandwidth.Lower middle: the combination of actual/artificial sources colored by the edge correction factor.Lower right: final density map.Contours are placed at 1 + δ = 1.5 and 2.5.

Figure 7 .
Figure7.Stellar mass distribution of sources in the sample across the whole redshift range.Red boxes show the boundaries of 6 mass-completeness samples chosen following the method outlined in(Pozzetti et al. 2010).Properties of these mass-complete samples are summarized in the first three columns of table 2. Orange dots are completeness limits calculated in redshift bins of width 0.1 and the dashed orange line is the corresponding polynomial fitting function in (1 + z).The blue curve is the mass-completeness limit of the original catalog introduced in(Weaver et al. 2022), plotted as a reference.

Figure 10 .
Figure10.Average SFR (left) and sSFR (right) are plotted versus overdensity for the overall (top) and star-forming samples (bottom) in each redshift interval.Out to z ∼ 1.1, the median SFR and sSFR decrease with increasing overdensity.At 1.1 < z < 2, the SFR and sSFR become almost independent of the environment for both overall and star-forming samples.At higher redshifts (2 < z < 4) there is a positive correlation between star formation activity and the environment for both overall and star-forming samples.
. The Observatory was made possible by the generous financial support of the W.M. Keck Foundation.The authors wish to acknowledge the profound cultural role of the Maunakea's summit within the indigenous Hawaiian community.This work is based on data products from observations made with ESO Telescopes at the La Silla Paranal Observatory under ESO program ID 179.A-2005 and on data products produced by CALET and the Cambridge Astronomy Survey Unit on behalf of the UltraVISTA consortium.This work is based in part on observations made with the NASA/ESA Hubble Space Telescope, obtained from the Data Archive at the Space Telescope Science Institute, which is operated by the Association of Universities for Research in Astronomy, Inc., under NASA contract NAS 5-26555.This research has also made use of the zCOSMOS database, operated at CeSAM/LAM, Marseille, France.ST was partially supported by the NSF award 2206813 during this work.APPENDIX A. DENSITY MAPS The full set of density maps for 135 redshift slices spanning 0.4 < z < 6 in the COSMOS field can be found in animation format in the HTML version of this paper.As an example, a single frame of this 9-second animation is shown in Figure 11.Each frame illustrates the distribution of sources, colored by weight, in the top panel.The reconstructed density map for the same redshift slice is shown in the bottom panel.Due to the varying dynamical ranges of environments at each redshift and for better contrast, density maps are clipped and normalized to 1+δ = 8.When the actual maximum value exceeds 1 + δ = 8, this value is specifically indicated in parentheses on the colorbar label.Contours are paced at the 0.35 level of the normalized overdensity.

Figure 11 .
Figure 11.A single frame of the animated density maps which can be found in the HTML version of this article.The top panel shows the spatial distribution of galaxies in the 78th (out of 135) redshift slice with width ∆z ∼ 0.037 and centered at z ∼ 2.158.Both actual and artificial sources are shown in the top panel and are colored by weight (see Section 3.3).The bottom panel shows the corresponding density map for the same redshift slice.The density field is clipped and normalized to 1 + δ = 8.When the actual maximum density in a slice exceeds 1 + δ = 8, it is indicated in parentheses in the colorbar label.Contours are placed at the ∼ 0.35 level of the normalized overdensity in both panels.The animation shows the results for 135 redshift slices, spanning 0.4 < z < 6.

Table 1 .
Density field measurements for sources in COSMOS2020 catalog.Note-This table is published in its entirety in the machine-readable format.

Table 2 .
Properties of mass-complete samples and correlation coefficients ⋆ P > 5%