Monodisperse hard rods in external potentials

We consider linear arrays of cells of volume $V_\mathrm{c}$ populated by monodisperse rods of size $\sigma V_\mathrm{c}$, $\sigma=1,2,\ldots$, subject to hardcore exclusion interaction. Each rod experiences a position-dependent external potential. In one application we also examine effects of contact forces between rods. We employ two distinct methods of exact analysis with complementary strengths and different limits of spatial resolution to calculate profiles of pressure and density on mesoscopic and microscopic length scales at thermal equilibrium. One method uses density functionals and the other statistically interacting vacancy particles. The applications worked out include gravity, power-law traps, and hard walls. We identify oscillations in the profiles on a microscopic length scale and show how they are systematically averaged out on a well-defined mesoscopic length scale to establish full consistency between the two approaches. The continuum limit, realized as $V_\mathrm{c}\to0$, $\sigma\to\infty$ at nonzero and finite $\sigma V_\mathrm{c}$, connects our highest-resolution results with known exact results for monodisperse rods in a continuum. We also compare the pressure profiles obtained from density functionals with the average microscopic pressure profiles derived from the pair distribution function.


I. INTRODUCTION
In classical statistical mechanics, particles with shapes are ubiquitous. Their prominence in granular matter [1,2], soft condensed matter [3,4], and, more specifically, biological matter [5,6], is well established. Their shapes vary from the highly complex such as folded proteins to the most elementary such as hard spheres. Their equilibrium and nonequilibrium properties are investigated by a broad array of experimental and computational probes.
Analytic approaches in this area of research see their predictive power restricted to fairly simple scenarios regarding shapes, environment, and dimensionality. For rigorous calculations the domains of applicability are further narrowed. This limitation finds ample compensation in their usefulness as benchmarks and anchor points for approximations and simulations. The work reported in the following is motivated by this chain of reasoning. It deals with hard rods in one dimension at thermal equilibrium in external potentials. We consider monodisperse rods of size σV c , σ = 1, 2, . . . on a lattice (linear array of cells with volume V c ). Hard rods of size V r populating a continuum emerge from the limit V c → 0, σ → ∞ with σV c = V r .
There are several approaches that facilitate an exact derivation of thermodynamic and structural properties for a homogeneous one-dimensional hard rod system (Tonks gas) with first-neighbor Takahashi-type interactions [7]. One rather elegant method uses convolution relations between Boltzmann factors to determine partition functions [8]. It produces the free enthalpy and the equation of state (EOS) for first-neighbor interactions of arbitrary range. Many-body-density distribution functions can be calculated by an extension of this approach [9]. An alternative method of similar scope has recently been developed. It uses statistically interacting vacancy particles (SIVP) as quasiparticles [10]. This method also yields the size distribution of vacancies between rods.
On the basis of these approaches for homogeneous systems, it is possible to treat inhomogeneous systems by assuming that the EOS is valid on a coarse-grained local scale. From the requirement of mechanical equilibrium, spatial variations of pressure and density can then be calculated from the spatial variations of the external potential. This provides a simple and common thermodynamic route for calculating density and pressure profiles [11], which generally is a difficult task for an interacting many-particle system. We will refer to this thermodynamic route as the EOS method in the following. Because the EOS method relies on the assumption of the existence of a local EOS, it is interesting to gain insight into how far this assumption is justified and whether the method gives useful information even if the underlying assumption does not hold.
To tackle this question analytically, exact results for inhomogeneous systems are required. For hard rods with first-neighbor interactions in one dimension, exact treatments are possible via recursion relations for partition functions [9,12] or density functional theory (DFT) [13][14][15]. These methods allow for the exact derivation of density profiles as well as many-body distribution functions. Given exact density profiles, pressure profiles can be obtained by resorting to the requirement of mechanical equilibrium as in the EOS method, but without assuming a local EOS.
The exact calculation of local pressures is a more subtle task. Generally, the local pressure can be defined via the trace of the local stress tensor, which governs the time evolution of the momentum density in a coarse-grained continuum description [16,17]. In case of pair interaction forces, thermodynamic averaging over the corresponding local stress tensor allows for the determination of pressure profiles from the density profiles and pair distribution function.
Our calculations here will employ two approaches. The DFT for lattice fluids [12,14,[18][19][20][21] is used to determine exact density profiles in external fields and the SIVP approach [10,[22][23][24][25][26][27] is used as a realization of the EOS method. The DFT and SIVP approaches have domains that partially overlap and strengths that complement each other. In the DFT, the operational degrees of freedom are the rods themselves. In the SIVP approach, the operational degrees of freedom are the vacancies between the rods.
We begin by describing the general methodology and background (Sec. II) and then proceed with applications to rods in a uniform gravitational field (Sec. III) and in a power-law trap (Sec. IV). The subtleties regarding average microscopic pressure are addressed in the context of the first application. Steric wall effects in lattice systems and their relations to known continuum results are discussed in Sec. V. In Sec. VI we summarize the main conclusions and outline projected extensions to polydisperse rods. Appendices A and C summarize outlying background materials for use in the main text. Appendix B presents a highly practical method of calculating exact density profiles within the DFT framework for arbitrary external potentials.

A. Model system
Consider rods on a linear chain i = 1, . . . , L of lattice sites, represented in Fig. 1 as an array of cells. Each cell has volume V c . Rods of size σ occupy that many adjacent cells. Hard walls at both ends of the chain define the boundary conditions. Assuming that cells (and rods) have unit cross section we can conveniently use V c as a microscopic scale for both volume and length.
Microstates of this system are encoded in a sequence of occupation numbers, n . = {n 1 , . . . , n L }, n i = 0, 1. To a rod that occupies sites i, . . . , i + σ − 1, we assign the occupation number n i = 1. Hardcore exclusion imposes the conditions n i n i+j = 0, j = 1, . . . , σ − 1, and the hard walls imply n i = 0 for i < 1 and i > L − σ + 1, respectively. Ui and interaction potentials Vi,j are stated. One is a contact potential and the other represents an interaction of maximum range (σ − 1)Vc.
The model system analyzed in this work is specified by the Hamiltonian, where U i is an external potential and V i,j an interaction potential restricted to first-neighbor rods. The firstneighbor restriction is naturally ascertained by interactions V i,j with a range limited to j = i + ξ, where σ ≤ ξ < 2σ, but an extended range between firstneighbor rods is permitted.
In this work we mainly examine the effects of hardcore repulsion in combination with external potentials. Contact forces are included in one application (Secs. III D and III E). The effects of long-range forces are being analyzed in a separate study [28].

B. Exact density functionals
The analysis carried out in [21] is based on former work [12,14,[18][19][20] and expresses the grand potential as a density functional, i.e. a functional of the mean occupation numbers of rodsñ i .
where µ is the chemical potential. The intrinsic freeenergy functional in Eq. (2) can be written in the form where T is the temperature, and , and s i [ñ] are local functionals of the intrinsic free energy, internal interaction energy, and entropy. The latter are given by and with pair correlators Φ(x) . = x ln x, and [37] The pair correlators (6) have their dependence onñ encoded in the implicit relations, The equilibrium density profile of rods follows from the extremum condition, With the solutionn of (9), the functions f i [n], e i [n] and s i [n] become the intrinsic free energy, internal interaction energy, and entropy per site. The equilibrium density profilen and the profiles of the thermodynamic potentials depend on temperature, crowding, interaction, and environment via β, µ, V i,j , and U i , respectively. The cell occupancy (mass density) is obtained from the rod occupancy (number density) via In homogeneous systems the pressure p follows rigorously from the free-energy density f . = F/LV c via p =n df /dn − f . A natural extension of this relation to systems with external potential has the form and produces pressure profiles on a microscopic length scale. However, there is no guarantee that the pressure thus derived coincides with the average microscopic pressure as commonly defined via the pair-distribution function. More on this question follows in Secs. II E and III C. Exact profiles forn i and ρ i for arbitrary external potentials and interactions limited to hardcore repulsion on the lattice are calculated by the method introduced in Appendix B.

C. Coarse graining
For this comparative study of methods we need a continuum description for rod positions on a microscopic length scale used in the DFT approach (Sec. II B) that carries over naturally to the mesoscopic length scale used in any of the EOS methods, specifically the SIVP approach (Sec. II D). This continuum description of the lattice system is unrelated to the continuum limit. We replace each lattice site i with the interval [iV c , (i + 1)V c [ across one cell (of unit cross section), and we define the interaction potential v(x, x ) and external potential u(x) by setting v(x i , x j ) = V i,j and u(x i ) = U i . The firstneighbor restriction for the interaction potential becomes v(x, x ) = 0 for |x − x | ≥ σV c . The local coverage at equilibrium of this interval allows us to define a number density by the piecewise continuous function For a homogeneous situation we have ρ(x) =n. From any density profile ρ(x) we can calculate the associated pressure profiles p(x) by invoking the balance between internal and external forces at thermodynamic equilibrium [11], where f u = −du/dx is the external force field [38]. Integration of this differential equation yields In some applications the reference pressure p(x 0 ) is known, e.g. via the weight of the rods in a uniform gravitational field. In other cases it can be determined from the average number N of rods, which we know from summingn j over all sites, by using the normalization relation If x 0 = LV c then we can use p(x 0 ) = −∂F [n]/∂x 0 . If the rods are only subject to hardcore repulsion we can use the fact that at the system boundaries we have kinematic pressure k B T ρ (Sec. II E). In Sec. III B we compare profiles inferred from (11) with profiles calculated from Eq. (14).

D. EOS method and SIVP approach
If one assumes that the EOS of a homogeneous system remains valid in a corresponding inhomogeneous system on a coarse-grained local scale in the presence of external potentials, the balance equation (13) is sufficient to determine density and pressure profiles. Depending on the circumstances we use (13) to calculate the functions p(x) andρ p(x) or the functions ρ(x) andp ρ(x) [39].
In the former case we have an EOS in the formρ(p) and solve (13) by separating variables p and x: where p 0 = p(x 0 ) is determined by one of the conditions stated in Sec. II C. In the latter case we proceed analogously via separation of variables ρ and x. The EOS method is particularly useful if long-range interactions are present. For such cases an exact DFT calculation of density profiles tends to be be impracticable and calculations based on recursion relation for partition functions [9,12] are cumbersome. For long-range firstneighbor interactions, the SIVP method [10] provides a user-friendly way to derive the EOS.
The microstates are encoded in a sequence of N − 1 vacancies of size m (m = 0, 1, 2, . . .) between consecutive rods, N in number. Summing over all microstates means summing over all size combinations of N − 1 vacancies. This sum is free of constraints. The interaction energy of first-neighbor rods at distance m is equivalent to part of the excitation energy m (p) of the vacancies, where φ m = V i,i+m+σ . The vacancies themselves are free of interaction energies and form a set of polydisperse quasiparticles with generalized exclusion statistics. Their statistical mechanics has been worked out in [10] building on a host of foundational work [22][23][24][25][26][27]. This treatment produces exact results for any thermodynamic quantity of interest for spatially homogeneous situations. The free enthalpy G(p) per site is given by from which other thermodynamic quantities are inferred via the auxiliary quantities [10] B αγ (p) This includes the mean sizem of vacant cells from which the EOS is obtained in the form E. Local pressure from pair density function In continuum mechanics, the 'microscopic' pressure is defined as one third of the (negative) trace of the microscopic stress tensor and the divergence of this tensor determines the time evolution of the momentum density caused by the internal interaction forces. In onedimension, the local stress tensor reduces to the microscopic pressure p mic (x, t) and the equation of motion for the momentum density Π(x, t) becomes How statistical mechanical expressions for the local pressurep mic (x) = p mic (x, t) eq in thermodynamic equilibrium (or the equilibrium-averaged microscopic stress tensor) are obtained when starting with these Euler equations of continuum mechanics was first studied by Irving and Kirkwood in 1950 [16]. In Appendix A we have adapted the elegant derivation by Lutsko [17] to one dimension, which for pair interactions yields Here ρ (2) (x 1 , x 2 ) is the pair distribution function and f (x 1 , x 2 ) the force of a particle at position x 1 on a particle at position x 2 . The first term represents the kinematic pressure and the second the interaction pressure. We set V c = 1 throughout Sec. II E. For hard rod systems, the interaction potential v = v(|x 2 − x 1 |) is infinite for |x 2 − x 1 | < σ. This singularity can be accounted for in Eq. (23) by considering a modified continuous potential v (r), which agrees with v(r) for r ≥ σ while for r < σ it is given by After inserting the corresponding force in Eq. (23) the pressure is obtained by taking the limit v 0 → ∞, → 0 . For non-interacting hard rods (v(r) = 0 for r ≥ σ) in particular, this procedure yields Because ρ (2) (x, y) = 0 for x < 0 or y > L − σ, the range of integration in the second term extends from zero to x for x ≤ σ, and from x − σ to L − 2σ for (L − 2σ) ≤ x ≤ (L−σ). This means that the interaction pressure at x = 0 and x = L − σ (the effective system boundary) vanishes. Accordingly, the local pressure at these boundary points is just given by the kinematic pressure, as earlier pointed out by Ibsen et al. [29], who derived Eqs. (23) and (24) based on the approach in [16]. For interacting hard rods (V (r) = 0 for r ≥ σ), the interaction pressure generally does not vanish at the system boundaries.
It is interesting to note that equating the expressions for the local pressure in Eqs. (14) and (23) [or Eq. (24)] yields an integral equation connecting the pair distribution with the density. This could in principle be used to determine ρ (2) (x, y). Alternatively, the pair distribution can be obtained by solving the inhomogeneous Ornstein-Zernike relation with the direct correlation function given by the second order derivatives of the density functional. For hard rods with first-neighbor interactions, manyparticle-density distribution functions are most conveniently obtained by employing recursion relations for partition functions, both for continuum [9] and for lattice systems [12]. We note that for the latter, the integrals for the interaction pressure in Eqs. (23) and (24) can be replaced by corresponding sums (Appendix C).

III. GRAVITATIONAL FIELD
Consider a semi-infinite vertical column of cells numbered i = 1, 2, . . . from the bottom up. A uniform gravitational field g acts on rods of mass m r . We use it here to represent any linear potential. We begin with non-interacting rods of size σ on a lattice and then take the continuum limit. Results from SIVP operating on a mesoscopic length scale are compared with those from DFT operating on a microscopic length scale. Pressure profiles on a microscopic length scale obtained from DFT via (11) are then compared with average microscopic pressure profiles inferred via (24). Finally, we discuss some effects of repulsive contact interaction as made manifest in one or the other method. For the sake of brevity we limit the discussion to one simple case study of each approach. They can both be adapted to different applications.

A. SIVP approach
The gravitational potential to be used in (13) is Convenient scaled variables for position, pressure, and temperature in this application arê where z s = N σV c is the length of all N rods stacked up in a solid column. The pressure at z = 0 is p s = N m r g, independent of T . The thermal energy k B T is measured in units of the work p s σV c required to lift this weight a distance equal to the size of one rod. The SIVP analysis (Sec. II D) starts from the expression for the density of vacant cells, derived in [10] from (20). The scaled mass density (volume fraction) inferred from (21) then reads Performing the integral (16) with (25) and (28) yields the following equation for the pressure profile The density profile follows from (28) by substitution. The solid curves in Fig. 2 show the profilesp(ẑ) and ρ (mes) (ẑ) at various values ofT for rods of size σ = 1. The variation of pressure with height crosses over from hydrostatic to atmospheric with increasing temperature. The density profile is rectangular in the low-temperature limit and varies like ρ (mes) p/T atT 1. These profiles do not vary much with the rod size σ when expressed by the scaled quantities (26). In the limit σ → ∞, V c → 0 with σV c = V r fixed, we have a system of rods of size V r and mass m r in a continuum. The continuum versions of (28) and (29) read respectively. The pressure and mass density profiles in the continuum are shown as dashed curves in Fig. 2.

B. DFT approach
On the length scale of single rods additional features, not resolved by any EOS method including SIVP, emerge in the profiles for σ ≥ 2 when analyzed via DFT. We write where z i is the position of the center of the lowest cell occupied by a rod. The free energy functional (3) with no interaction except hardcore repulsion acquires the form (B1) and the density profile of rods for any given U i are the solutions of the coupled equations (B2). Here, for the linear potential (31), we set M → ∞ in all expressions imported from Appendix B.
We first examine the case σ = 1. The solution (B4) is constructed from an exponential function as follows: whereẑ i = z i / N σV c and the average number N of rods is controlled by the fugacity ζ = eμ /T , wherê µ . = µ/p s σV c is the scaled chemical potential. This DFT result exactly reproduces the functional dependence of ρ (mes) onẑ obtained via SIVP and given by (28) with (29) for σ = 1 if we use (10) and set The results from both methods are fully consistent. The SIVP solution remains exact even for small numbers of rods. There exist no microscopic features in the density profile that SIVP does not resolve. Now we turn to the case σ = 2, where the microscopic length scale does indeed reveal additional structures in the various profiles. These structures are encoded in Eqs. (B5), which for slowly varying profiles we expand into the form, and note that the first correction is of second order. The leading term alone leads to the density profile, which coincides with (28) and (29) for σ = 2 if we set Thus full consistency between the two approaches is established on the mesoscopic length scale.
Finding the microscopic structures in the density profiles of rods and mass requires that we solve Eqs. (B5) and then use (10) instead of Eq. (35). The solution as derived in Appendix B reads with the h i determined recursively from The circles in the panels on the left in Fig. 3 are derived from (37). The probabilityn i that a rod occupies cells i and i + 1 varies with index i in a manner that reflects the combined effects of the hardcore exclusion interaction between rods and the presence of a hard floorẑ = 0. The spatial oscillations are mild at high T and discernible only very close to the floor. As T is lowered, the amplitude becomes stronger and the range wider. In the limit T → 0 then i strictly alternate between one and zero, reflecting a compact stack of rods.
When transcribed via (10) to the mass density, the wall effect is not nearly as strong. The evidence is represented by the circles in the panels on the right, where we set z = 1 2 (ẑ i +ẑ i−1 ) for the discrete data andẑ from (26) for the curves. At high T the effect is still strongest in the immediate vicinity of the floor but that is no longer the  (28) and (29) as predicted by SIVP for a system with N 1. Thenidata on the left (circles) originate from (37) with ζ from (36) and λi from (32) with N = 5. These data are transcribed into the circles on the right via (10) and into the circles of panel (g) via (39).
case at the lowest T used in Fig. 3. At T = 0 the effect disappears altogether.
The local pressure predicted by DFT as inferred from (11) with then i from (B2) substituted into the freeenergy functional (B1) becomes with ρ i from (10).
In panel (g) of Fig. 3 we show the pressure profiles thus obtained from the density data of panels (a)-(f). The profiles are monotonically decreasing fromp(0) = 1. Remarkably, the wild oscillations of then i are almost completely smoothed by (39). However, there does exist a systematic albeit small deviation between the DFT and SIVP pressure profiles. The DFT pressure profile is closer to but not identical with the true microscopic pressure as will be further discussed in Sec. III C.
The agreement of the DFT and SIVP approaches on the mesoscopic length scale defined earlier is underlined by expressions (32) and (33) for σ = 1 and by expressions (35) and (36) for σ = 2. It can further be shown that for any σ the density ρ (mes) (ẑ) determined by (28) and (29) is the solution of a polynomial equation of order σ. Likewise, the probabilitiesn i atẑ i inferred from (B2) with alln j within the square brackets set equal to each other is also the solution of a polynomial equation of order σ. The control variables areT , N in the first polynomial equation (canonical ensemble) whereas they areT and ζ in the second polynomial equation (grandcanonical ensemble). The two polynomial equations are equivalent if we set The agreement between DFT and SIVP on the mesoscopic length scale also extends to the pressure profiles.
which is equivalent to (28). The microscopic features in the density profile remain conspicuous for σ > 2. The oscillations that are superimposed on profile predicted by SIVP are characterized by a 'wavelength' proportional to σ. Such profiles are readily produced from (B15) and (B16). The exact hard-wall effects for rods of arbitrary size σ will be investigated in Sec. V. Soft walls as realized in power-law traps also produce structures on a microscopic length scale. Some examples will be investigated in Sec. IV.

C. Average local microscopic pressure
The average local microscopic pressurep mic (x) as inferred via (24) from the pair distribution function by the method presented in Appendix C has two parts: a kinematic pressure and an interaction pressure (in a formal sense). In Fig. 4 we show the profiles of both parts and their sum for rods of size σ = 10 at low temperature (T = 0.1). Both parts show strong oscillations that are somewhat out of phase. These oscillations are strongly attenuated with distance from the hard floor. They quickly become imperceptible with rising T (see Fig. 5). The non-monotonic features ofp mic (x) remain totally unresolved in the EOS pressure profiles discussed earlier but are partially resolved by the DFT pressure profiles as illustrated in Fig. 5. At highT the two profiles are virtually identical and equal to the SIVP profile. At lowT , the additionalp mic (x) oscillations are reproduced by DFT with remarkable accuracy albeit not exactly [40].

D. Contact interaction via SIVP
Consider a contact interaction potential v that is attractive for v > 0 and repulsive for v < 0. As inferred from [10], the contact interaction changes the local density of vacant cells from (27) where we have introduced the variable and the scaled interactionv .
= v/σp s V c in addition to the scaled variables (26). The mass density ρ (mes) is inferred from (21). The integral (16) can still be evaluated exactly and yields the pressure profile, in generalization of (29). An attractive contact interaction affects the profiles in a way similar to what a drop in temperature does (see Fig. 2). No significant additional features make their appearance. Repulsion is more interesting in that respect as documented in Fig. 6 for σ = 1.
The configuration of rods becomes stratified at low temperature. The density profile now exhibits an additional layer of intermediate density. The width of that layer increases with the strength of the repulsion. The (largely hydrostatic) pressure profile acquires different slopes inside different layers.
These profiles depend systematically on σ without producing any additional features. From [10] we know that the effects of attractive or repulsive contact interactions of finite strength fade away completely in the continuum limit.
One subtle feature of note concerns the initial slope of the hydrostatic pressure as presented in panel (a) of Fig. 2 and then again in panel (c) on a much expanded scale. What in panel (a) looks like a clean change between slope −1 for interaction strengthsv > −1 and slope −1/2 for stronger contact repulsion,v ≤ −1 is, at very smallẑ, a two-step change with slope −2/3 atv = −1 in the middle. This asymptotic slope is evident in the expansion of (44):

E. Contact interaction via DFT
Here we wish to demonstrate how a repulsive contact force of infinite strength effectively increases the size of rods. The inclusion of a scaled contact potential as shown in [21], where the contact interaction v c is contained in the correlators, that appear in the first three terms of (46). The last two terms reflect the hardcore repulsion. The metamorphosis of hard rods of one size into hard rods of a bigger size is most transparent if we consider the case σ = 1 and compare the limits v c = 0 and v c = +∞. The extremum condition (9) applied to (46) leads to the following set of relations that determine the density profile {n i } for external potential U i and fugacity ζ: where A i = 1+η(n i−1 +n i ) and η = e −vc −1.
For v c → 0 we have C i,i+1 =n ini+1 and (49) reduces to whereas for v c → ∞ we have C i,i+1 = 0 and (49) becomes representing rods of size σ = 2 with only hardcore repulsion. In the application to a uniform gravitational field, (51) is equivalent to (32) and (52) is equivalent to (B5). The SIVP approach of Sec. III D describes the same crossover from rods of size σ to rods of size σ + 1 under a repulsive contact interaction of increasing strength. The pressure profile (44) evaluated forv = 0 and any σ reproduces (29). When the same expression is evaluated for v = −∞ it connects again with (29) but now for σ + 1 provided the scaled variables are properly adjusted.

IV. POWER-LAW TRAP
Optical or magnetic traps of several different designs for atomic or molecular gases produce wells with a range of profiles. How does the pressure at the center of the trap vary with temperature? How does the shape of the trap potential affect the profiles of density and pressure? Power-law traps are well-suited for our two approaches and can illuminate these questions with answers from an exact analysis.

A. Profiles for lattice and continuum
In this application we consider an infinite row of cells numbered i = 0, ±1, ±2, . . . at positions x i = iV c . The rods are confined to a region centered at x = 0 by the symmetric power-law potential with u 0 representing a depth and x 0 representing (at least for α > 1) a width of the trap. The analysis proceeds as in Sec. III A. Expression (28) remains unchanged. However, the pressure profile is now determined by the relation where, in addition top andT from (26), we use the scaled variablesx A solid stack of rods extends out to x s = 1 2 N σV c and the pressure at the center becomes p s = u 0 (x s /x 0 ) α /(σV c ). In the continuum limit, σ → ∞, V c → 0 with σV c = V r , Eqs. (28) and (54) turn into One additional relation is needed to bring closure to (28) and (54), namely reflecting mass conservation. The pressurep T atx = 0 can be determined from this relation. For the two extreme rod sizes we thus obtain Γ(1/α + 1)f 1/α ep T /T − 1 T 1/α = 1 (σ = 1), (58) where f n (z) is the Fermi-Dirac function. The rods remain confined at any finite temperature: we havep T > 0 ifT < ∞ for any α > 0. The limit α → ∞, representing a trap of width 2x 0 with rigid walls, is subtle. Relation (58) reduces to We then havep =p T inside the trap, with a uniform density, ρ (mes) = x s /x 0 . We thus recover the familiar EOS pV c /k B T = − ln(1 − ρ (mes) ) of the ideal lattice gas. The limitT → 0 yieldsp T = 1 and the profiles for pressure and density arê respectively. If α > 1 (α < 1) the pressurep T at the center of the trap increases (decreases) withT rising from zero. For the linear potential (α = 1), which is equivalent to the case of the uniform gravitational field (Sec. III A), we havep T = 1 for allT . In Fig. 7 we show pressure and density profiles for the two extreme rod sizes in two different power-law potentials. The shape of one potential (α = 1 2 ) is concave and that of the other (α = 2) convex. Corresponding profiles for a linear potential (α = 1) have already been shown in Fig. 2 albeit on a somewhat different scale.
The oppositeT -dependence of the pressure near the center of the trap is evident. The curves at the lowest temperature are close to theT = 0 profiles (61). Naturally, the pressure decrease with risingT in for α = 1 2 has a much larger effect on the density than does the pressure increase for α = 2. Another noteworthy feature is that the difference in profile between the lattice system and the continuum system is much more pronounced for the convex potential than for the concave potential.

B. Oscillations in density profile
In Sec. III B we have already identified some hard-floor effects in the form of spatially attenuated oscillations in the density profilesn i and ρ i of rods and mass, respectively. We found (in Fig. 3) that the effect is very conspicuous in the former and partially averaged out in the latter. A more systematic analysis of hard-wall effects for rods of various sizes on the lattice and for rods in a continuum will be presented in Sec. V.
Here we briefly examine the question whether the soft walls of power-law traps also produce patterns of spatial density oscillations. We begin with rods of size σ = 2. In Fig. 8 we compare data for traps with walls of two different degrees of softness. These data are produced by using the potential (53) with x = iV c and calculating the profiles from (B10) and (10). We use M = 2I max +1 with I max = 20 and a shift that positions the rod with index i = 0 at the center of the trap.
The harmonic trap is, in some sense, the smoothest form of confinement. We see in panels (a) and (b) that oscillations do make their appearance in then i -profiles. The amplitudes of these oscillations tend to be rather uniform across the region where the rod population is significant. The general trend is that the amplitudes increase with increasing chemical potentialμ . = µ/u 0 or decreasing temperatureT . = k B T /u 0 . Superimposed on this systematic trend is an oscillatory dependence onμ. The data in the panels (a) and (b) are for two successive values near maximum and minimum amplitude ofn i -oscillations. The minimum amplitude is almost imperceptible. We also note that in the ρ i -profiles these oscillations are almost completely averaged out.
Increasing the stiffness of the trap walls produces no  dramatic changes. The dependence onμ of the spatial oscillations remains qualitatively similar. The amplitudes still oscillate asμ is varied. The data in the panels (c) and (d) are for α = 10 and for values ofμ near successive maximum and minimum amplitude. One systematic trend as the trap wall becomes increasingly firm is that the spatial oscillations become weaker near the center of the trap and stronger near the walls. This trend is visible between the data in panels (a) and (c), for example. We shall see in Sec. V that the oscillatory dependence of the amplitudes onμ disappears when the walls become hard (α → ∞).
In Fig. 9 we show some data for rods of size σ = 3 in a trap with relatively stiff walls (α = 10) and twice the width of the one used before. The calculations are based on Eqs. (B15) and (B16). Here we only show data of thē n i -profiles for two conditions.
The average numbers of rods in the data of panel (a) are such that the rods easily fit into the space at low potential energy. We observe significant oscillations with a period near but not exactly three. A small change in chemical potential produces shifts in the oscillatory patterns and variations in the average amplitude. We also observe slightly larger amplitudes near the wall compared to the center of the trap. At significantly smaller values of N the oscillations are much weaker.
The data in panel (b) are for circumstances where the rods are squeezed into the trap. Here the rod positions are more correlated. The oscillations are closer to period three. We also observe the oscillatory dependence of the amplitude onμ. For some values there are one or two dominant configurations, producing high amplitude. For other values, there are three configuration that have very similar statistical weight, producing low amplitude.

V. STERIC WALL EFFECTS
Microscopic density profiles of rods or other particles with shapes near hard walls are relevant in the contexts of granular matter, porous solids, and zeolites among oth-ers. Robledo and Rowlinson [30] studied the effects of confinement on hard rods in a continuum. Davis [9] extended that study to include first-neighbor interactions between rods. More recently, Ibsen et al [29] reported a general and exact solution for hard rods confined by a gravitational field and a hard floor. A computer simulation study of Mehrotra et al [31] of hard spheres under the same confinement in 3D produces similar results.
Here we pick up threads from Secs. III B and IV B to investigate steric wall effects of hard rods on a lattice. One goal is to showcase the versatility of the method of analysis presented in Appendix B and to establish how it connects to the continuum analysis familiar from previous work.
We consider a box with rigid walls and investigate the oscillations in the density profiles produced by the steric interactions between rods of size σ ≥ 2. The effects of a single wall, relevant in sufficiently wide boxes, can be determined analytically for rods of any size on the lattice and for rods in the continuum. Two walls within the distance of a certain coherence length affect the density profile from opposite sides. That coherence length is shown to grow with average density. We combine exact analytic results with results from a rigorous recursive scheme.

A. σ = 2
We begin with the case of a semi-infinite box with one wall at i = I and the other at i → −∞ populated by rods of size σ = 2 to an average mass density 0 < ρ (mes) < 1. Later we move the second wall to i = −I. For the semiinfinite box we have found an analytic solution. The result (with j = I − i in the present context) turns out to have a simple structure: The relation between the fugacity and the average mass density is (63) We have derivedn 1 in (62) directly from (B11) with g 2 in the form of an infinite continued fraction that is readily evaluated. Then i for i = 2, 3, . . . then follow directly from (B5). The oscillations in the probability distributionn i of rod positions thus decay exponentially with distance from the wall. The boundary coherence length, vanishes for ρ (mes) → 0 and diverges for ρ (mes) → 1.
Next we examine how the oscillations near the wall at i = I are affected by the presence of a second wall at i = 0.75. Here the coherence length (64) is much smaller than the distance between the walls. At larger mass density the two sets of results begin to deviate from each other as ξ grows and reaches about half the wall-towall distance at ρ (mes) 0.95.
The signature wall effect for σ = 2 manifests itself in the form of attenuated, period-2 spatial oscillations in then i . The exponential attenuation is governed by a coherence length that grows with the density of rods in the box. In the limit ρ (mes) → 1 the oscillations persist across the box as expected.

B. 2 < σ < ∞
We continue with the analysis of a system of rods of size 2 < σ < ∞ subject to the potential representing a single rigid wall at i = 0. We present the exact solution of Eqs. (B2) adapted to this case, We haven i = 0 for i ≤ 0 and assume that far from the wall (i 1) then i approach uniformity, where 0 < ρ (mes) < 1 is the mass density in the bulk (average cell occupancy). The fugacity, the only control variable aside from σ, depends on the asymptotic solution (67) as follows: (68) Next we convert (66) into a recursion relation that expresses the solution at a given site as a function of the solutions at the σ − 1 sites immediately to its left: for i = σ, σ + 1, . . . and with ζ from (68). This recursion relation depends on the σ − 1 parametersn 1 , . . . ,n σ−1 .
Assuming that the solution with asymptotics (67) is unique, these parameters can be found with a little guidance from (62) for the case σ = 2. They arē In Fig. 11 we show data generated recursively from (69) for the scaled densityν i . = σn i versus the scaled position x i . = (i − 1)/σ for rods of sizes σ = 5 and σ = 200. The latter size is meant to generate an impression of what to expect in the continuum limit. The data suggest that the dominant wall effect manifests itself again in an attenuated spatial oscillation. Successive minima are approximately spaced by σ. Only in the limit ρ (mes) → 1, when the attenuation disappears, are the oscillations locked into the wavelength σ. This raises the interesting question, best analyzed in the continuum limit, what the spectrum of the wall oscillations is and how it depends on ρ (mes) .
C. σ = ∞ The continuum limit carried out for 0 < x < 1 produces an exponential function as follows: This result can now be extended to x > 1 by using a continuum version of the fugacity (68), and a continuum version of (66), where as derived Percus [32]. Following Vanderlick et al. [33], we convert (73) and (74) into difference-differential equation, respectively. Next we integrate (75) and (76) in alternating sequence over intervals of unit length, using (71) and h(x) ≡ 0 for x < 0. We thus obtain the following exact, continuous, and piecewise analytic expression for ν on successive intervals m < x < m + 1: with asymptotic value, far from the wall, approached more and more slowly with increasing average mass density ρ (mes) . The lattice DFT analysis thus connects neatly with known results [9,29,30,32,33] for monodisperse rods in a continuum. In Fig. 12 we graphically compare this analytic solution (77) for the continuum model with the iterative solution (69) for the lattice model with σ = 20. The dominant feature of the curves is an attenuated spatial oscillation. The singularities at x = m become progressively weaker with increasing m: d kν (x)/dx k is continuous at x = m for k < m. Except for m = 1, the singularities do not coincide with the minima ofν(x).
The limit ρ (mes) → 1 (s → ∞) is subtle. As the population of rods becomes more crowded, they begin to line up with increasing probability near the integer positions as illustrated in Fig. 13(a). In the limit ρ (mes) → 1, maxima and minima approach the singularity values x = m in pairs from opposite sides. The maxima diverge and the minima approach zero. The area under the curve between successive singularities approaches unity. The shape of the curve approaches an L of infinite height and unit width, effectively the function In Fig. 13(b) we show the spectrum of the attenuated oscillation (77), This quantity features a peak at wave number 1 q/π < 2 emerging from a broad and flat background. The Fourier transform (80) and the limit s → ∞ are not interchangeable operations. With increasing ρ (mes) the peak becomes taller and sharper as it moves toward commensurability at q/π = 2.
The DFT mass density in the continuum, calculated from (77) via a continuum version of (10), becomesρ on successive intervals m < x < m + 1. In Fig. 14 we show profiles ofρ(x) for the corresponding to the profiles ofν(x) shown in Figs. 12 and 13. The oscillatory wall effects are somewhat milder inρ(x) than inν(x) but still fairly conspicuous. In the limit s → ∞ the oscillations inν(x) diverge as in (79) but disappear inρ(x), which becomes constant.

VI. CONCLUSIONS AND OUTLOOK
In this work we have investigated the equilibrium statistical mechanics of monodisperse hard rods confined by external potentials, producing characteristic spatial profiles of density and pressure. The rods occupy σ consecutive cells of volume V c in a linear array. The continuum limit is implemented as σ → ∞, V c → 0 with σV c kept finite and nonzero. The rods interact via hardcore exclusion forces. Contact forces have also been considered.
We have been employing two distinct methods of analysis, density functionals and generalized exclusion statistics, with partially overlapping domains of applicability and somewhat complementary strengths. The usefulness, soundness, and consistency of the two approaches has been demonstrated in a series of applications that include confinement by rigid walls, gravity, and power-law traps.
We have shown that profiles of density, for example, exhibit characteristic features on a mesoscopic length scale that are reproduced identically by both approaches and, for σ ≥ 2, additional features on a microscopic length scale that are only resolved in the DFT analysis. The DFT pressure profiles are also compared with profiles of average microscopic pressure inferred from pair distribution functions in the context of one application. Finally, we have established contact between our results for the lattice system and prior results for corresponding continuum systems, demonstrating full consistency The statistical mechanical analysis of hard rods of mixed sizes presents itself as a natural and promising extension of this work. Significant ground has already been broken via both calculational tools used in this work. The mathematical structure of exact density functionals for hard-rod mixtures has recently been established [15] and is awaiting analysis in specific applications.
Hard rod ensembles of mixed sizes on a lattice are mathematically equivalent to magnetic domains in Ising chains. The combinatorics and statistical mechanics of such domains analyzed via generalized exclusion statistics have been in place for some time [34] and is awaiting extensions to heterogeneous environments and new applications of current interest. The completion of the work reported here has paved the way for projects along these lines [35].
Appendix A: Local pressure from momentum flow In terms of the particle (hard rod) momenta Π n (t) and positions x n (t), the microscopic momentum density in Eq. (22) is given by Π(x, t) = n Π n (t)δ(x − x n (t)) . The time derivative of its Fourier transformΠ(k, t) = dx Π(x, t) e −ikx = n Π n (t) e −ikxn(t) reads (with m r the mass of the rods, and assuming only pair interaction forces to be present) Here f mn (t) ≡ f (x m (t), x n (t)) is the force of the mth on the nth particle (f nn ≡ 0), f ext n (t) = f ext (x n (t)) the external force on the nth particle, and we have usedẋ n = Π n /m r and Newton's equationṡ Π n = f ext To obtain the corresponding expression in real space, we calculate dk 2π e −ikXmn+ikx sin(kx mn ) kx mn where Accordingly, x m (t), x n (t)) .
Using f mn x mn = f nm x nm and Eq. (A4), the double sum can be written as xm<x xn>x f mn x mn /|x mn |, and the equilibrium average of Eq. (A5) then yields Eq. (23).
Appendix B: Density profiles Consider a system of rods of size σ confined to a finite array of cells numbered 1, . . . , L = M + σ − 1. The hardcore repulsion is the only interaction between rods. The external potential U i is arbitrary. The free energy functional (3) simplifies into for i = 1, . . . , M withn i = 0 for i < 1 and i > M implied. In some applications we use a semi-infinite array (M → ∞) with the second boundary condition replaced by a prescribed (zero or nonzero) limitn ∞ . In the following we use the control variables, with the implication that λ i = 0 for i < 1 and i > M . For rods of size σ = 1 the hardcore repulsion does not produce any interference between then i at different positions. Equations (B2) remain uncoupled. The density profilen i of rods, which, in this case, coincides with the mass density profile ρ i , reads Its only structure is that imposed by the potential U i . In the case σ = 2 a rod at position i obstructs the placement of a rod positions i − 1 and i + 1. This interference is reflected in Eqs. (B2), which now read (B5) withn 0 =n M +1 = 0 implied. We solve the coupled Eqs. (B5) by a strategy that also works for σ > 2 as we shall see. We reduce the set of nonlinear equations into two sets of recursion relations to be solved in sequence. This method has the benefit of isolating the physical solution. We begin by introducing the auxiliary quantities, A different rendition of that solution is derived from (B9) with use of (B8): where the g i are generated recursively: , i = M, . . . , 1.
If the external potential is symmetric under under reflection, as in power-law traps or boxes with rigid walls, we have λ M +1−i = λ i , i = 1, . . . , M . The density profile of rods must then also exhibit that symmetry. To make this symmetry transparent we recognize that we have g M +1−i = h i , i = 1, . . . , M , under these circumstances. We can then transformn M +1−i inton i as follows:  The density and pair distribution functions are then expressible as follows in terms of partial partition functions Z k (l, m) representing systems of k rods confined by hard walls at positions l and m [9,12,13,29]: A lattice version of expression (24) for the average microscopic pressure to be used in Sec. III C for comparison with the DFT pressure profiles thus reads p mic (i) = k B T ρ(i) + k B T σ k=0 ρ (2) (i − k, i + σ − k). (C7)