{'fraction_non_alphanumeric': 0.03649696918316307, 'fraction_numerical': 0.022529778305285915, 'mean_word_length': 4.153795740032769, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Alignments of dark matter halos with large-scale tidal fields: mass and redshift dependence

Large scale tidal field estimated directly from the distribution of dark matter halos is used to investigate how halo shapes and spin vectors are aligned with the cosmic web. The major, intermediate and minor axes of halos are aligned with the corresponding tidal axes, and halo spin axes tend to be parallel with the intermediate axes and perpendicular to the major axes of tidal field. The strengths of these alignments generally increase with halo mass and redshift, but the dependencies are only through the peak height, {\nu}. The scaling relations of the alignment strengths with the value of {\nu} indicate that the alignment strengths remain roughly constant when the structures within which the halos reside are still in quasi-linear regime, but decreases as nonlinear evolution becomes more important. We also calculate the alignments in projection so that our results can be compared directly with observations. Finally, we investigate the alignments of tidal tensors on large scales, and use the results to understand alignments of halo pairs separated at various distances. Our results suggest coherent structure of the tidal field is the underlying reason for the alignments of halos and galaxies seen in numerical simulations and in observations.


Introduction
It has been known for a while that galaxies and galaxy systems have preferred orientations in the cosmic web. For galaxies, their major axes are found to have a tendency to align with the large scale structure and with other galaxies (Brown et al. 2002;Okumura et al. 2009;Faltenbacher et -2al. 2009;Zhang et al. 2013). The spin axes of disk galaxies tend to lie in sheet-like structures (Navarro et al. 2004;Trujillo et al. 2006;Tempel et al. 2013) and to align with the intermediate axis of the large scale tidal field (Lee & Erdogdu 2007;Zhang et al. 2015). For galaxy systems, the major axes of galaxy clusters tend to point to neighboring clusters, based on both optical and X-ray observations (Binggeli 1982;McMillan et al. 1989;Plionis et al. 1994). These alignments are important not only for understanding the formation and assembly of galaxies and galaxy systems in the cosmic density field, but also for interpreting weak gravitational lensing results, because they may contaminate lensing signals based on shear-shear correlations of background sources (e.g. Croft & Metzler 2000).
Most of the theoretical investigations so far have attempted to understand the observed alignments through the links between galaxies and dark matter halos extracted from cosmological Nbody simulations. In earlier analysis, a common practice is to assume that the spin axes of disk galaxies and the principal axes of elliptical galaxies are directly aligned with those of their host halos (e.g. Heavens et al. 2000;Jing 2002). The resultant alignments are, however, much stronger than in observations, indicating that galaxies may not be perfectly aligned with their host halos (e.g. Heymans et al. 2004;Okumura et al. 2009). More recently, galaxies identified in hydrodynamical simulations have been used to study galaxy alignments (e.g. Dubois et al. 2014;Codis et al. 2015;Velliscig et al. 2015), and the results obtained are similar to those in observations, indicating that baryonic processes may play an important role in producing the observed alignments. Using cosmological simulations, these investigations automatically take into account the coherent nature of the cosmic web within which halos are embedded, and so galaxy alignments on large scales may be produced by the alignments of halos with their local environments together with the coherent structures on large scales (e.g. Dekel et al. 1984;Splinter et al. 1997;Faltenbacher et al. 2002;Hopkins et al. 2005;Schneider et al. 2012). For instance, Lee et al. (2008) measured halo eigenvector-direction correlation function to quantify halo alignments on large scales, and found a significant signals up to scales of ∼ 50 Mpc. Using the eigenvectors of the tidal tensor to represent the direction of large scale structures, Hahn et al. (2007a,b) found that halos have major axes preferentially parallel with the directions of the filaments in which the halos are embedded and perpendicular to the normals of the sheets (see also Forero-Romero et al. 2014). The spin vectors of halos tend to be perpendicular to (parallel with) the filament and sheet for massive (low-mass) halos (e.g. Aragon-Calvo et al. 2007;Hahn et al. 2007a,b;Zhang et al. 2009).
In order to understand these alignment results, Wang et al. (2011) studied the alignments of halo spin and orientation with large scale tidal field, which is thought to be the driving force for structure formation (Bond et al. 1996). They found that the major and minor axes of halos are strongly aligned with the stretching and compressing directions of the tidal field, respectively, regardless of the morphology of the structure. Similar results were found by Libeskind et al. (2013a) using velocity tensors. In addition, Wang et al. (2011) found that halo spin vectors tend to be aligned with the intermediate axis and perpendicular to the stretching direction of the tidal field (see also Forero-Romero et al. 2014), broadly consistent with the tidal torque theory that works in the quasi-linear regime (e.g. Lee & Pen 2000;Porciani et al. 2002).
It is important to note that, in addition to halo spin and orientation, tidal field also affects various other halo properties, such as assembly history, substructure abundance, shape, dynamical properties and the accretion flow pattern (e.g. Wang et al. 2011;Shi et al. 2015;Kang & Wang 2015). Thus, for a given mass, halo clustering in space is expected to depend on halo properties, a phenomenon known as halo assembly bias (e.g. Gao et al. 2005;Wechsler et al. 2006;Wang et al. 2007;Jing et al. 2007;Bett et al. 2007;Faltenbacher & White 2010;Sunayama et al. 2015). Clearly, the alignments of halos in the cosmic web provide another avenue to investigate how environmental processes affect the formation and structure of dark matter halos in the cosmic density field.
In this paper, we present detailed analyses of the alignments of halo orientations and spins with the large scale tidal field, using directly the tidal tensors that can be reconstructed from the distribution of dark halos. We focus on how the mass and redshift dependencies of the alignments may reflect the importance of nonlinear evolution of the cosmic density field in affecting various alignments, and on how alignments on large and small scales are connected to each other. The paper is organized as follows. In section 2 we describe the simulations used here, and the methods we adopt for estimating halo principal axes, halo spins and the large scale tidal field. In section 3 we present our results for halo alignments in three dimensional space, and the dependence of alignments on redshift and halo mass. In section 4 we show results for the alignments in projection so that they can be compared directly with observations. Section 5 shows how tidal tensors are aligned on large scales, and how such alignments induce alignments of halos at large separations. Finally, our results are summarized in section 6.

N -body simulations and Dark matter halos
Our halo catalog is obtained from four independent cosmological N -body simulations carried out with Gadget-2 (Springel 2005). The cosmological parameters used in these simulations are Ω Λ,0 = 0.742 for the cosmological constant, Ω dm,0 = 0.214 and Ω b,0 = 0.044 for cold dark matter (CDM) and baryons, respectively, h = 0.72 for the dimensionless Hubble constant, σ 8 = 0.8 for the rms linear mass fluctuation in a sphere of radius 8 h −1 Mpc extrapolated to z = 0, and n = 1 for the slope of the primordial fluctuation spectrum. The CDM density field of each simulation set is traced by 1024 3 particles in a cubic box of 200 h −1 Mpc on each side, with particle mass m p ≈ 5.3 × 10 8 h −1 M ⊙ . The gravitational force is softened isotropically on a co-moving length scale of 4 h −1 kpc (Plummer equivalent). Each simulation produces 80 snapshots from z = 17 to z = 0, with the expansion factor evenly spaced in logarithmic space.
Dark matter halos are selected from each snapshot with the use of the standard FoF algorithm -4 - (Davis et al. 1985) with a link length equal to 0.2 times the average inter-particle separation. The mass of a FoF halo is the sum of the masses of all particles in the halo. We exclude halos dominated by 'fuzzy' particles, i.e. halos whose most massive sub-halo identified by the SUBFIND algorithm (Springel et al. 2001) contains less than half of the mass of the parent FoF halo. As shown in Wang et al. (2011, see their figure 2), the 'fuzzy' particle halos are more elongated and spin faster than normal halos, and are usually formed recently. The alignment signal for these halos can, therefore, be strongly affected by recent mergers. We exclude them from our analysis. Note that only about 4% to 6% of all halos with M h ≥ 10 12 h −1 M ⊙ are identified as 'fuzzy' particle halos, with the fraction increasing slightly with increasing halo mass. Because of the small fraction of this population, excluding or including it in our analysis does not change our results significantly.

Halo principal axes and spin vector
We use the inertia momentum tensor I of a halo to characterize its orientation. The components of I are computed using where x n,j (j = 1, 2, 3) are the components of the position vector of the nth particle relative to the center of the mass of the halo in question, and N is the total number of particles contained in the FoF halo. We use the normalized (unit) eigenvectors i 1 , i 2 , i 3 to denote the directions of the major, intermediate and minor axes, respectively. The spin vector of the halo is estimated though the definition where x n and v n are the position and velocity vectors of the nth particle relative to the center of mass, and the '×' denotes cross-product. The estimations for both the principal axes and spin vector are affected by the mass resolution (see Schneider et al. 2012). To reduce such effects as much as possible, we only calculate the orientation and spin vectors for halos with masses M h ≥ 10 12 h −1 M ⊙ , i.e. halos containing at least 1,880 particles.

Large-scale tidal field
Following Wang et al. (2011), we estimate the tidal field tensor on a halo by summing up the tidal field tensors exerted by other halos above a mass threshold M th . Thus the tidal field tensor on a halo can be written as Here r n (r n ) is the co-moving distance (unit vector) from the nth halos to the halo in question, R n is the virial radius of the nth halo, and N h is the number of halos with masses above M th and r n < r p , with r p being a distance limit to be specified below. The tidal field tensor is then diagonalized to obtain the three eigenvalues, t 1 , t 2 and t 3 (by definition satisfy t 1 > t 2 > t 3 and t 1 +t 2 +t 3 = 0), and the corresponding eigenvectors, t 1 , t 2 and t 3 (major, intermediate and minor axes). Defined in this way, t 1 corresponds to the direction of stretching of the external tidal force, while t 3 corresponds to the direction of compression. We refer the readers to Wang et al. (2011) for the details of the tidal field and comparisons with other environmental indicators of dark matter halos. In the literature, another way to calculate the local tidal field is to use the total mass density field (e.g. Hahn et al. 2007a). In those investigations, e 3 (or t 3 ) is usually used to denote the stretching direction, while e 1 (or t 1 ) is used to denote the compressing direction.
In this paper we adopt r p = 70 h −1 Mpc. Our tests suggests that choosing an even larger r p changes the results very little. In our previous studies, M th = 10 12 h −1 M ⊙ is adopted to estimate the tidal field at redshift z = 0. The co-moving number density of halos of M h ≥ 10 12 h −1 M ⊙ is about 2 × 10 −3 h 3 Mpc −3 at z = 0, and so the tidal field is relatively densely sampled by these halos. However, the number density of such halos decreases with increasing redshift, reaching to ∼ 10 −5 at z ∼ 5, so that only ∼ 100 such halos are available in the simulation box. Clearly, if we want to extend the analysis to redshift z ∼ 5, adopting M th = 10 12 h −1 M ⊙ is not appropriate.
To make a reasonable choice for M th , we calculate the tidal tensors at the location of a given halo using four different values of M th : 10 12 , 10 11.5 , 10 11 and 10 10.5 h −1 M ⊙ , and estimate the difference in the orientations of the tidal tensors obtained from these values of M th , namely we estimate cos α a,k = |t k (10 12 ) · t k (10 11.5 )|, cos α b,k = |t k (10 11.5 ) · t k (10 11 )| and cos α c,k = |t k (10 11 ) · t k (10 10.5 )| (k = 1, 2, 3). The mean values of cos α as functions of redshift are presented in Fig. 1. One can see that cos α c,k is the largest, followed by cos α b,k and cos α a,k . At z = 0, all the three axes have cos α a,k > 0.90, suggesting that adopting M th = 10 12 h −1 M ⊙ is sufficient for a reliable estimate of the orientations of the local tidal fields. However at z ∼ 5, the mean cos α a,k decreases to about 0.63 for t 1 , 0.54 for t 2 , and 0.60 for t 3 , suggesting that using M th = 10 12 h −1 M ⊙ is no long sufficient. On the other hand, the mean cos α c,k decreases only slowly with redshift and reaches to 0.9, 0.81 and 0.86 at z ∼ 5 for the three principal axes, respectively. It thus suggests that adopting M th = 10 11 h −1 M ⊙ and 10 10.5 h −1 M ⊙ do not yield significant difference in the estimated tidal tensor orientations even at z < ∼ 5, and that it is unnecessary to go down to smaller M th . In the following presentation, all tidal fields are estimated using M th = 10 10.5 h −1 M ⊙ .

Alignments in three-dimensional space
The alignment of halo principal axes and spin vector with the large scale structure, characterized either by the tidal field or velocity shear tensors, has been investigated extensively in the past (e.g. Hahn et al. 2007b;Aragon-Calvo et al. 2007;Zhang et al. 2009;Wang et al. 2011;Libeskind et al. 2013a;2013b;Forero-Romero et al. 2014;Forero-Romero & González 2015).
-6 -However, most of these investigations have been focused on z = 0, although some attempts have been made to extend the analysis to moderately high redshift (e.g. Hahn et al. 2007b). In this paper, we extend the analysis to z ∼ 5 and study how the alignments evolve with redshift so as to understand their origins. We first investigate the alignments between halo principal axes and the large scale tidal field ( §3.1) and then the alignments of halo spins ( §3.2).
3.1. Alignments of halo principal axes with local tidal field Wang et al. (2011) found that the major (i 1 ) and minor (i 3 ) axes of halos tend to align with the stretching (t 1 ) and compressing (t 3 ) directions of the large scale tidal field, respectively (see also Libeskind et al. 2013a for similar result based on velocity tensor). In Fig. 2, we show the distributions of the cosine of the angles between i 1 and t 1 for halos in four redshift bins, as indicated in the figure. The corresponding results for i 3 · t 3 are presented in Fig. 3. Results are shown only for log(1 + z) ≤ 0.8, as the tidal field estimated with M th = 10 10.5 h −1 M ⊙ becomes unreliable at higher z (see §2.3).
The top three panels of Fig. 2 show the results for halos in three different mass bins, as indicated in the figure. The choices of the three mass bins are the compromise of two considerations: first, we want to show results covering a wide mass range; second, in each mass bin we can have at least two relatively smooth curves to compare. All the distributions are peaked at one, indicating that i 1 tends to align with t 1 . At a given redshift, the alignment tends to be stronger for more massive halos, consistent with previous results obtained for z = 0 (e.g. Hahn et al. 2007a). For halos of the same mass, the alignment is stronger for halos at higher z. However, the redshift dependence can be almost completely eliminated if halo mass M h is expressed in terms of the peak height ν, defined by ν ≡ δc σ(M h ,z) , where δ c ≈ 1.686 is the critical linear over-density for collapse, and σ(M h , z) is the rms linear mass fluctuation on the halo mass scale extrapolated to redshift z. The bottom three panels show the distributions for halos in three ν bins selected so that for each ν bin at least two results are reliable for comparison. Note that halos of small masses at high redshift have ν comparable to that of the most massive halos at z = 0. For the highest ν, the distribution functions at the two low redshift bins are quite noisy, because the corresponding samples contain only a small number of massive halos. Overall our results demonstrate that the redshift dependence shown in the top panels is produced by the evolution of the characteristic mass scale, and that the alignment between i 1 and t 1 depends on redshift and halo mass only through a single parameter ν.
The behavior in the alignment between i 3 and t 3 is very similar, as shown in Fig. 3. Here the dependence on redshift and halo mass individually is even stronger than that in the i 1 -t 1 alignment, but again the dependence is almost entirely through the peak height ν. Given that the redshift dependence is only though ν, we use halos in the whole redshift range (log(1 + z) ≤ 0.8) to obtain an overall distribution function. The two overall functions for i 1 · t 1 and i 3 · t 3 are plotted as the black diamonds in Fig. 2 and 3, respectively. There is also a notable difference in the results between the major and minor axes. For major axis, the alignment in the intermediate ν bin is -7considerably stronger than that in the smallest ν bin, while no such difference is seen between the two higher ν bins. For minor axis, on the other hand, the alignment continues to strengthen with increasing ν across all the three bins. We will come back to this difference between minor and major axes later.
To see the dependence on redshift, halo mass and ν in more detail, Fig. 4 shows the mean cosine of the alignment angles between the three halo principal axes and the corresponding tidal directions as functions of halos mass and ν. The four colored lines represent the results in four different redshift bins. Bins in halo mass or in ν are equally spaced in logarithm scale, except at the highest mass or ν end, where wider bins are used so that the number of halos in each bin is not too small. The error bars (and all other error bars shown in this paper) are 1σ confidence intervals derived from the standard deviation of the values of our four independent simulations.
The top three panels show the alignments as functions of halo mass. The result for z = 0 is consistent with that obtained by Wang et al. (2011). Overall, the strengths of the alignments increase with mass and redshift, suggesting that the role of large scale structure in affecting halo orientation is more important for massive halo and at high redshift. Furthermore, the alignments of major and minor axes have similar strength while that of intermediate axis is weakest among the three. For the intermediate and minor axes, the curves for the four redshift bins share a similar positive slope. In contrast, the trends for the major axis appear to be different: the dependence on halo mass becomes weaker as redshift increases, and is almost absent for the highest redshift bin.
When ν is used instead of halo mass, the redshift dependence is eliminated almost entirely for all the three axes, as demonstrated in the bottom panels. For reference, we plot the mean values averaged over all halos (log(1 + z) ≤ 0.8) as black diamonds. For the major axis, the alignment strength first increases rapidly with ν and then is almost saturated above a transition scale, ν 1 ≃ 2.0. The strength of the alignment for the minor axis increases with ν over almost the entire range of ν that we can probe. A flat plateau also appears, but at much higher values of ν, ν > ν 3 ≃ 3.3. Since the maximum values of the average cosine for both the major and minor axes are about 0.75, the fact that ν 1 < ν 3 implies that the alignment for the major axis is stronger than that for the minor axis at ν < ν 3 . The alignment strength for the intermediate axis is overall much weaker, with a maximum value of ∼ 0.6 and a transition occurring at ν 2 ≃ 0.27, a value between ν 3 and ν 1 .
The results obtained here may give us some important insights into the origin of the alignments of halos with large-scale structure. Since ν ∼ 1.686/σ(M, z), and σ(M, z) characterizes the typical fluctuation amplitude of perturbations of mass scale M at redshift z, the value of ν basically describes the importance of non-linear environmental effects on the formation and structure of dark matter halos, with lower ν values indicating more important non-linear environmental effects. The fact that the strengths of alignments increase with ν, therefore, suggests that non-linear environments tend to weaken the alignments.
According to our definition of tidal field, the major and minor axes correspond to the stretching -8and compressing directions of the local gravitational field. Thus, gravitational collapse to form a halo is expected to proceed from being along the minor axis first, then along the intermediate axis, and lastly along the major axis of the local tidal field. As such, non-linear evolution is expected to be the most important along the minor axis and the least along the major axis. Consequently, for a given M , non-linear effects, which tend to suppress alignment, start to operate earlier along the minor axis, i.e. when σ(M, z) is smaller or ν is larger, than along the other two axes. This explains why ν 1 < ν 2 < ν 3 . According to this interpretation, ν k (k = 1, 2, 3) may be used to indicate the transition of the environmental effects from the linear to nonlinear regimes. While nonlinear effects become important to affect the alignments at ν < ν k , the results at ν > ν k mainly reflect the alignments between halos with the linear tidal field. Our results, therefore, show that, in the linear regime, the alignments between halos and tidal tensor are quite independent of ν. Similar behavior is also found in the alignments of halo spins with tidal tensor, as we will see in the next subsection.
Another possibility is that non-linear processes do not play any important role in affecting the alignments of halos with tidal tensor, and the dependence on ν is completely due to the initial alignments in the linear density field. The dependence of the alignment strength on ν may then be explained by the fact that halos of different ν reside in different local tidal fields. However, it is unclear how this scenario explains the difference in the transition scales for the three different axes.
Using the tidal field estimated from the mass density field, Hahn et al. (2007b) found that the major axes of halos embedded in filamentary structures tend to be parallel with the filament, while the major axes of halos in sheets are preferentially parallel to the sheet plane. In particular, they found that these alignments are independent of redshift once the halo mass is scaled with the typical halo mass, M * , defined through δ c /σ(M * , z) = 1. Our findings are consistent with theirs, but there are several important differences. In the investigation of Hahn et al. (2007b), only halos with z ≤ 1 are considered, while our analyses extend to much higher redshift, z ∼ 5. As we have demonstrated, including halos at high redshifts is crucial in revealing the regime where the dependence on ν becomes unimportant. When presenting their results, Hahn et al. adopted 2M * as the smoothing scale to calculate the tidal tensor. Since M * decreases rapidly with increasing redshift, the smoothing scale will become too small at high redshift to be defined properly in simulations. For instance, at z = 5, log M * ≃ 6.3 for the WMAP5 cosmology, and so the smoothing mass scale of 2M * corresponds to a length scale of 0.015 h −1 Mpc, which is usually much smaller than the grid size used in calculating the tidal tensor. This might be the reason why Hahn et al. did not go beyond z = 1. In our analysis, the tidal field is estimated from the halo population, and our tests have shown that the method provides a reliable estimate of the tidal tensor at z = 5 when halos with masses down to M th = 10 10.5 h −1 M ⊙ are used. In addition, instead of using the large-scale structures, such as filaments and sheets to represent the large scale environments of halos, as was done in Hahn et al., we use directly the local tidal tensor that is more closely related to accretion patterns around dark matter halos (see Shi et al. 2015). Finally, the tidal field derived from the mass density field includes the contribution of halo's self-gravity. This led suggest that the dependence of the alignment strength on halo mass is due to the fact that their tidal tensor estimate may be affected by halo shapes, which are more elongated for more massive halos. Our estimate of the tidal field does not include the self gravity of halos, and so our results are not affected by the mass-dependence of halo shape.

Halo spins
The tidal torque theory predicts that the halo spin axis tends to be parallel with the intermediate axis of the tidal field, i.e. with t 2 (e.g Lee & Pen 2000;Porciani et al. 2002;Lee & Erdogdu 2007). To test this with our simulations, we show in Fig. 5 the distributions of cos θ = |j · t 2 | for the same three mass bins and four redshift bins as used above for the halo principal axes. As one can see, the halo spin axis tend to align with t 2 , but the trend is not strong, with the alignment strength increasing with halo mass. These results are in good agreement with previous findings, and provide support to the tidal torque theory. In addition, our results also reveal that, for a given halo mass, the alignment of the spin axis with t 2 tends to be stronger at higher redshift.
Here again, the dependence on redshift and halo mass is through the peak height, ν, and the redshift dependence is almost entirely eliminated when ν is used instead of halo mass, as shown in the lower panels. Note that for the highest ν bin, the two high redshift curves match each other very well; the discrepancy seen for the two lower redshift curves is mainly caused by small number statistics, as halos with high ν are rare at low z. The black diamonds in the lower panels show the results obtained by averaging over halos in the entire redshift range. Fig. 6 shows the mean values of the cosine of the alignment angles between j and t k (k = 1, 2, 3) as functions of halo mass (top panels). In contrast to t 2 , t 1 tends to be perpendicular to j (see e.g. Wang et al. 2011;Forero-Romero et al. 2014). The strengths of both the alignment with t 2 and the anti-alignment with t 1 increase with increasing redshift and halo mass. The j-t 3 alignment appears more complicated. First, the dependence of the alignment strength on halo mass and redshift is weaker than those for the other two axes, t 1 and t 2 . Second, massive halos tend to have their spin direction weakly aligned with t 3 , while the ones with log M h /h −1 M ⊙ < 13.5 exhibit a weak but significant anti-alignment that is almost independent of z at z < 3.
The bottom three panels of Fig. 6 show the mean alignment angles as functions of ν (instead of halo mass). It is remarkable that the redshift dependence seen in the upper panel for the intermediate axis is almost entirely eliminated. The overall mean values together with the fitting results for the spin alignment with intermediate axis are also plotted in the lower middle panel for reference. One sees that the strength of the alignment first increases with increasing ν, and then remains roughly at a constant value of ∼ 0.57 at ν > ν j ≃ 2.5. This behavior is very similar to that seen in the alignments of halo principal axes with the tidal tensor. In particular, the transition scale, ν j , for the spin alignment is very close to ν 2 in the i 2 -t 2 alignment, indicating that the two alignments may have a similar origin.
Based on the tidal torque theory, Porciani et al. (2002) showed that the mean cosine of the alignment angle between j and t 2 is 0.59 for halos more massive than 10 12 h −1 M ⊙ . They also calculated such alignment for proto-halos and obtained a value of 0.56. These results are in good agreement with ours (0.57) for high ν. At lower ν, our simulations give lower alignment strengths than the theoretical predictions. This may not be surprising, because a lower value of ν implies that non-linear effects are more important (see §3.1) and because the tidal torque theory is expected to work well only in the quasi-linear regime. Thus, our results suggest that the strength of the spin-t 2 alignment in the linear regime is, on average, a constant over a large mass range, and non-linear effects tend to reduce the alignment.
The situations for the other two axes are more complicated. For halos of a given mass, redshift dependence in the strengths of the j-t 1 and j-t 3 alignments is clearly present, and particularly strong in the former, as shown in the upper panels of Fig. 6. The use of ν to replace halo mass shifts the results for the high redshift bins to the right, but the shift is so much that a reversed redshift trend is produced. Compared to the results shown in the top panels, the four lines for j-t 1 are now closer, particularly at small ν, although still not on top of each other. Since halos acquire their angular momenta through accretion, the correlation of spin vector with the major and minor axes of tidal field may be understood in terms of accretion flow. In Shi et al. (2015) it was found that the position and velocity vectors of the accreted sub-halos relative to the hosts tend to be parallel with, and perpendicular to, the major axis of the tidal field, respectively. Thus, the accreted angular momentum is expected to be preferentially perpendicular to the major axis, as we see in the results for the j-t 1 alignment. They also found that the position vector tends to be perpendicular to the minor axis, but the alignment between velocity vectors and the minor axis is weak. This is consistent with the weak j-t 3 alignment we see here. However, it is still unclear why the j-t 1 and j-t 3 alignments do not have as tight a scaling relation with ν as the j-t 2 alignment does.

Fitting to the scaling relations
Our results above show that the alignments between i 1 and t 1 , i 2 and t 2 , i 3 and t 3 , and j and t 2 all obey some scaling relations with the peak height ν. In this subsection, we present the fitting results for these relations. As shown above, these relations all seem to contain two phases, and we adopt the following form to fit the mean alignments as functions of ν, A(ν) = a 1 + a 2 arctan(a 3 (ν − 0.85)) . (4) The fitting results are shown in Figure 4 and 6 as dashed lines. Given the uncertainties, the fitting results describe the simulation data well. The best fitting parameters are (a 1 , a 2 , a 3 ) = (0.57, 0.13, 2.06) for i 1 -t 1 , (0.51, 0.09, 0.61) for i 2 -t 2 , (0.58, 0.16, 0.73) for i 3 -t 3 and (0.58, 0.16, 0.73) for j-t 2 .
For each ν bin, we find that the overall distribution of cos θ (shown as diamonds in Figure 2, where b is the only free parameter, β = [ √ πberfi( √ b)] −1 and erfi is the imaginary error function. The form of this equation makes sure that the integral from cos θ = 0 to 1 is equal to one (i.e. the distribution function is normalized) and the mean cos θ of the distribution gives A(ν). The Levenberg-Marquardt method is used to find the best fitting parameter b, and the results for different ν bins are given in Table 1. The corresponding curves are plotted in Figures 2, 3 and 5 as the dashed lines for the three ν bins we have chosen to plot. Note that the i 2 -t 2 alignment have properties similar to the other two axes. The fitting parameters for this axis are also given in the table for completeness, although the alignment results are not shown in figures.

Alignments in projection
In observation, three-dimensional tidal field can be reconstructed from the distribution of galaxy groups (e.g. Wang et al. 2012) or from galaxy distribution (e.g. Lee & Erdogdu 2007). However, halo orientations in 3-d space are difficult to obtain observationally. One common practice is to study the alignments between large scale structure and the following two projected orientations: (i) the projected distribution of satellite galaxies; (ii) the orientation of the image of the central galaxy in a group. In this subsection we present alignment results in two-dimensional space, which may be more closely related to observation.
We choose the x-y plane in a simulation to represent the sky, namely the z-axis to be along the line of sight. For a halo, the projected principal axes are then represented by the following vectors in the x-y plane: where i k,1 and i k,2 are the x and y components of the three dimensional principal axis, i k . Similarly, the projected tidal directions are given by where t k,1 and t k,2 are the x and y components of t k .
The mean alignment angles between I k and T k as functions of halo mass and ν are plotted in Fig. 7. Here we show the alignment angles instead of the their cosines. In two-dimensional space, the angle between two random vectors has a uniform distribution in the alignment angle, while for two random vectors in the three-dimensional space it is the cosine of the angle between the two vectors that has a uniform distribution. As is clear, there is a strong tendency for I k to be aligned with T k , as the average angles are all smaller than the expected value of 45 • . The alignment is stronger for halos of higher masses and and at higher redshift. The dependence on mass and redshift is largely through ν, as shown in the lower panels. The diamonds in the lower panels show the mean angles obtained from the entire redshift range, log(1 + z) < 0.8, and the dashed curves are derived from the fitting results in the three-dimensional case.
Our simulation results agree qualitatively with the observational results based on the orientations of central galaxies (see e.g. Zhang et al. 2013). However, the alignments obtained here are much stronger than that based on central galaxies, as is expected because central galaxies are not perfectly aligned with their host halos. Indeed, as shown in Kang et al. (2007), in order to reproduce the alignment between the satellite distribution and the central galaxy orientation, central galaxies have to have certain misalignment with their host halos (see also Wang et al. 2008). Moreover, as shown in Shi et al. (2015), the inner part of a halo, which may be more relevant to the properties of central galaxy (e.g. Wang et al. 2014b), is less strongly correlated with tidal field than the outer part.
In observations, the spin axis of a spiral galaxy is usually obtained from the axis ratio of its image, assuming that the disk is intrinsically round and that the spin axis is perpendicular to the disk. Since it is usually unknown which side of the disk is closer, namely the sign of the z component of the spin vector is not determined, a given axis ratio corresponds to two vectors with opposite signs for the z-component (e.g. Tempel et al. 2013). To account for such uncertainty, we define two spin directions for each halo, j + ≡ j = (j 1 , j 2 , +j 3 ) and j − ≡ (j 1 , j 2 , −j 3 ), where j l (l = 1, 2, 3) are the three components of the halo spin vector. The observed alignment should be the mean values averaged over the alignments of the two vectors. Fig. 8 shows the mean values between |j − · t k | and |j + · t k | as functions of halo mass and ν. The spin vectors defined in this way still tend to be parallel with t 2 and perpendicular to t 1 , but the strengths of the alignments are reduced in comparison to the full three dimensional cases, as is expected. As in the full three-dimensional case, for a given halo mass, the alignment of the projected spin with t 2 depends strongly on redshift, but the dependence can be eliminated if ν is used instead of halo mass.
Recently, Zhang et al. (2015) performed similar analyses and found |j ± ·t k=1,2,3 | = 0.500, 0.508, 0.488 for halos of masses ∼ 10 12 h −1 M ⊙ and 0.477, 0.519, 0.497 for halos of masses ∼ 10 13 h −1 M ⊙ , in good agreement with our results. 1 As shown in Zhang et al. (2015), the predicted halo spin -tidal tensor alignments are stronger than the observed results derived from disk galaxies, but the disagreement can be mitigated if spins of the inner parts of halos are used in the model predictions.

Alignments on large scales
Alignments of halo orientations on large scales (e.g. Hopkins et al. 2005;Lee et al. 2007) are important to understand, because such alignments may produce galaxy-galaxy alignments on large scale, thereby affecting the interpretations of gravitational lensing results (e.g. Heavens et al. 2000;Jing 2002;Heymans et al. 2004). As described above, halos show strong alignments with their local tidal tensors (halo-tidal tensor alignments). If the tidal tensors at locations separated by large distances are aligned too (tide -tide alignments), then halo-halo alignments on large scales may be understood as a result of these two kinds of alignments. In this section we investigate these large-scale alignments, first (in §5.1) focusing on the tide-tide alignments, and then (in §5.2) on halo-halo alignments on large scales.

Alignments of tidal tensors on large scales
We first investigate the tide-tide alignments at the locations of halo pairs as a function of the pair separation (in co-moving scale). Fig. 9 shows the results at four different redshifts, which are, respectively, the lowest redshift snapshot in each of the four redshift bins used above, and for two halo mass bins, 12 ≤ log M h /h −1 M ⊙ < 13 and 13 ≤ log M h /h −1 M ⊙ < 14. In the larger mass bin, the number of halos at z = 3.1 is too small to give reliable results, and so the corresponding results are not shown.
There are several interesting trends. (i) The alignment signal decreases with increasing separation and become marginally important at distances of 20 -30 h −1 Mpc. This scale may be directly related to the typical size of large scale structures in the cosmic density field. Note that the size of our simulation box is only 200 h −1 Mpc, which may limit the large scale modes we can probe. Thus, the alignment strength on large scales may be underestimated. (ii) The signal is stronger for massive halos, which may reflect the fact that more massive halos are more likely associated with larger structures. (iii) The signal strengthens with decreasing redshift. This may be due to the fact that large-scale structures become more prominent as the universe evolves. (iv) The minor axes of the tidal field are the most strongly aligned, followed by the major axes and then the intermediate axes. If the two halos are located within the same large-scale filament, the major axes of the tidal fields around these halo are expected to be aligned because both of the tidal tensors tend to align with the filaments, as is consistent with our results. However, in this case it is unclear why the minor axes of the tidal tensors have the strongest alignment. It may be that most halo pairs on large scales are not located within the same filamentary structure, but in two filaments that are embedded in the same sheet-like structure. Since the minor axes of the tidal fields are perpendicular to the sheet plane, strong alignments in the minor axes can be produced. For the same reason, the alignments of the major axes may be weakened by cross pairs between two filaments. Thus, our results may reflect the consequence of the dynamic nature of the cosmic web, in which halos are embedded in filaments which, in turn, -14are embedded in sheets.
To make connections to observations, we show in Fig. 10 the alignments of T k , the projections of tidal tensors at the locations of halo pairs. Here we see again that the alignments can extend to very large scales. Using the group catalog of Yang et al. (2007), Lim et al. (2016 have estimated the two-dimensional tide-tide alignments as a function of separations between galaxy groups, and found results that are very similar to what we find here. For example, the mean alignment angle of T 1 (T 3 ) for groups of log M h /h −1 M ⊙ ≥ 12.5 is about 35 • (30 • ) at a separation of 3 h −1 Mpc, and approaches ∼ 45 • at > 20 h −1 Mpc, in good agreement with our results. The details of the comparison between our model predictions and observational results are presented in Lim et al. (2016). Fig. 11 shows the halo-halo alignment as a function of halo pair separation. Significant alignments are seen only for i 1 and i 3 . The alignments are stronger on smaller scales, vanishing at separations of 10 -20 h −1 Mpc. The alignments are also stronger at higher redshift and for more massive halos. Lee et al. (2008) measured the ellipticity correlation function and found the same dependence on redshift and halo mass as we find here (see also Hopkins et al. 2005).

Halo-halo alignments on large scales
In order to facilitate comparison with observation, we also present the two dimensional results in Fig. 12. For massive halos at z = 0, the mean angles at ∼ 3 h −1 Mpc are 44 • ± 0.4 for I 1 and 43 • ±0.8 for I 3 . At higher redshift, the results are much noisier because of the much smaller number of halos that can be used. For low mass halos, the mean angle at ∼ 3 h −1 Mpc is about 44.5 • , with high significance for both I 1 and I 3 . Significant alignments can be seen at least to ∼ 10 h −1 Mpc. At z ∼ 3, the mean angles at the smallest scale can reach 43 • .
It is interesting to compare the halo-halo alignments with the tide-tide alignments and the halo-tide alignments obtained above. First, the dependence of the halo-halo alignment on halo mass and separation is very similar to that of the tide-tide alignment, but the strength of halohalo alignment is much weaker than the corresponding tide-tide alignment. Second, the alignments of the major and minor axes of halos have similar strength. This is in contrast to the tide-tide alignment, which is the strongest for minor axis, but similar to the halo-tide alignment. Third, the halo-halo alignment for the intermediate is absent, which is different from both the tide-tide and halo-tide alignments. This may be due to the rather weak alignment between the intermediate axes of halo and tidal field. Finally, the halo-halo alignment increases with increasing redshift, in contrary to the tide-tide alignment. However, this is in agreement with the halo-tide alignment, which strengthens with increasing redshift for a given halo mass. All these together suggest that the halo-halo alignments on large scales are produced by the alignments of halos with local tidal fields combined with tide-tide alignments on large scales, with the latter being produced by the large-scale coherent structures in the cosmic density field.

Summary
The spin and orientation of galaxies and dark matter halos are found to be aligned with the cosmic web. Such alignments are important for the interpretations of gravitational weak lensing observations, as well as for understanding the formation of galaxies in the cosmic density field. In this paper, we investigate in detail how various alignments of dark matter halos depend on redshift and halo mass, using simulated halos with masses above 10 12 h −1 M ⊙ in the redshift range of log(1+ z) ≤ 0.8. We use the large-scale tidal field, estimated from the halo population, to characterize the cosmic web. The tidal field tensors at halo locations are diagonalized to obtain the corresponding eigenvectors, t 1 , t 2 and t 3 (major, intermediate and minor axes), with t 1 corresponding to the stretching direction of the tidal force, and t 3 the compressing direction.
We find that the major, intermediate and minor axes (i 1 , i 2 and i 3 ) of halos are aligned with t 1 , t 2 and t 3 , respectively. In particular, all the three alignments generally strengthen with increasing halo mass and redshift. There are also significant differences among the three alignments. The halo mass dependence for major axis is stronger at lower redshift but absent at high redshift, while the results for the other two axes are almost independent of redshift.
We also investigate the alignment of halo spin (j) with the local tidal field, and find that the spin axis tends to be parallel with t 2 and perpendicular to t 1 , but the alignment with minor axis is weak. The strengths of the alignment with t 2 and anti-alignment with t 1 both increase with halo mass and redshift.
We find that once alignments are analyzed for halos of different peak heights, ν ≡ δc σ(M h ,z) , the dependence on redshift in both the i k -t k (k = 1, 2, 3) and j-t 2 alignments disappear, suggesting that the dependence on halo mass and redshift is only through ν. We provide accurate fitting formulae to describe the distributions of the cosine of the alignment angles as functions of ν. The scaling relations with ν for the four alignments, i 1 -t 1 ; i 2 -t 2 ; i 3 -t 3 and j-t 2 , exhibit a similar two-phase behavior, in that the alignment first strengthens with increasing ν and then remains roughly at a constant strength above a transition scale of ν. We suggest that this is due to the fact that halo formation preserves the alignment between halo propers and the large scale tidal field in the linear field, as long as the the large-scale structures remain in the quasi-linear regime, and that non-linear evolution tends to suppress the alignment. This scenario also explains why the transition scales for the three axes are different, being the largest for minor axis, along which nonlinear effects start to operate earlier, and the smallest for major axis, along which nonlinear effects are the least important.
In order to facilitate comparisons with observations, we also investigate the alignments taking into account projection effect. The overall trends are similar to those in the three dimensional results, except that the strengths of the alignments are reduced by projection.
Finally, we investigate the origin of the halo-halo alignments on large scales. We find that the orientations of the tidal tensors are correlated on scales up to about 30 h −1 Mpc. This, together with the alignments of halos with local tidal tensors, implies that halo-halo alignments should also extend to large scales. Our direct measurements of the halo-halo alignments confirm this, and the halo mass and redshift dependencies of the halo-halo alignments can be explained by similar dependencies in the tide-tide alignment and/or in the halo-tide alignment.