Coarse-grained models of polymer and biomolecular systems have enabled the computational study of cooperative phenomena, e.g., self-assembly, by lumping multiple atomistic degrees of freedom along the backbone of a polymer, lipid, or DNA molecule into one effective coarse-grained interaction center. Such a coarse-graining strategy leaves the number of molecules unaltered. In order to treat the surrounding solvent or counterions on the same coarse-grained level of description, one can also stochastically group several of those small molecules into an effective, coarse-grained solvent bead or “fluid element.” Such a procedure reduces the number of molecules, and we discuss how to compensate the concomitant loss of translational entropy by density-dependent interactions in spatially inhomogeneous systems.

## I. INTRODUCTION

The development of coarse-grained models has a longstanding tradition in polymer science. Early renormalization group approaches established the universality of macromolecular conformations in solutions and melts and provided insights into the scaling behavior as a function of the chain length.^{1,2} Subsequently, attention focused on systematic coarse-graining strategies, where a small number of atomistic repeating units along the backbone of a macromolecule,^{3–5} a lipid,^{6–11} or a DNA molecule^{12–14} are lumped together into an effective, coarse-grained interaction center—fine-to-coarse map. This coarse-graining strategy decimates the number of degrees of freedom (DoFs), and the coarse-grained particles interact via soft potentials. Both effects permit the investigation of significantly longer time and larger length scales and thereby enable the systematic investigation of cooperative phenomena in soft matter.^{9,15}

Coarse-graining gives rise to interactions between the coarse-grained particles that depend on the thermodynamic state and may include multi-body or density-dependent terms.^{15–20} Significant practical progress has been achieved in deriving the interaction free energies between the coarse-grained particles from an underlying atomistic model by iterative Boltzmann inversion (IBI),^{19,21,22} inverse Monte Carlo (IMC) schemes,^{23,24} or force matching,^{18,25} and a unifying framework, based on the relative entropy^{26,27} of the atomistic and coarse-grained description, has been devised. More recently, data-driven formulations, using a probabilistic coarse-to-fine map, have been explored which do not require an explicit fine-to-coarse map.^{28}

Work on the foundation of Dissipative Particle Dynamics (DPD) has also considered the dynamics of coarse-grained particles that capture the behavior of a simple fluid of non-bonded microscopic constituents.^{29–32} The DoFs that have been integrated out give rise to friction and noise in the coarse-grained model, and the energy and entropy of these decimated DoFs can be captured by endowing each coarse-grained particle with an additional, internal-energy DoF, *e*, and a concomitant internal entropy, *s*(*e*). Locally conserving the total energy comprised of the kinetic and potential energy of the explicit DoF and the internal energy, these eDPD,^{33,34} eMC,^{35} or related^{36} simulation schemes capture the specific heat and thermal transport properties. The exchange of internal energies between neighboring coarse-grained particles during an eMC move is controlled by their internal entropy, *s*(*e*), and the internal DoF, *e*, also couples to the equation of motion of the explicit DoFs, i.e., the positions and momenta of the coarse-grained particles. Alternatively, the internal DoF may characterize multiple metastable states (e.g., discrete molecular conformations or chemical states) “within” a coarse-grained particle.^{37}

Whereas many coarse-graining schemes of polymer and biomolecular systems group the microscopic DoF along the *same* molecule into a coarse-grained particle, it may also be advantageous to treat the surrounding solvent molecules on the same level of coarse-graining by lumping *multiple* solvent molecules into one coarse-grained particle.^{38} The most drastic approach is an implicit solvent model, where the complete elimination of the solvent DoFs results in density-dependent effective interactions between the remaining particles.^{10,39,40} Another example is the MARTINI^{8} description of water, where 4 water molecules are grouped together into a single, coarse-grained particle^{41,42} or the recently devised cDPD algorithm^{43} for electrokinetic phenomena, which represents a fluctuating number of ions by a coarse-grained particle.

Coarse-graining approaches that map multiple, indistinguishable, microscopic molecules into a coarse-grained particle do not conserve the number of molecules but often do not consider the loss of translational entropy that goes along with the decimation of DoFs. In a spatially homogeneous system, this omission can be compensated by state-dependent, coarse-grained interactions, in particular one-body terms that are independent of the microscopic configuration.^{17,44} The lack of transferability, however, becomes even more important in spatially inhomogeneous systems.^{17,19,45} This issue can be illustrated by the simple example of an ideal gas of particles with mass *m* in a gravitational field. In thermodynamic equilibrium, the density distribution, *ρ*(*z*), of the microscopic particles as a function of altitude, *z*, follows the barometric formula, *ρ*(*z*) ∼ exp(−*mgz*/*k*_{B}*T*) with *k*_{B}*T* being the thermal energy scale. This distribution arises from a competition between the energy in the gravitational field, which favors the accumulation of particles at low altitudes, and the translational entropy that encourages the particles to explore space uniformly. Obviously, we cannot capture this behavior in a simple, coarse-grained model where each coarse-grained particle is comprised of $q\xaf=2$ microscopic particles and has the mass $q\xafm$. While such a coarse-grained model faithfully captures the energy in the gravitational field, it fails to account for the loss of translational entropy due to the reduction of the number of indistinguishable particles. In spatially inhomogeneous polymeric and biomolecular systems, similar balances between the translational entropy and energy are ubiquitous, e.g., in the adsorp tion of particles onto surfaces or onto large biomolecules, or the partitioning of particles between coexisting phases.

In this manuscript, we study the statistical mechanics of decimating the number of indistinguishable, microscopic molecules and discuss how to account for the concomitant loss of translational entropy by density-dependent potentials. Each coarse-grained particle, *β*, is characterized by its explicit DoF (e.g., position, **r**_{β}) and, additionally, a fluctuating, discrete, internal DoF, *q*_{β}, representing the number of indistinguishable, microscopic molecules contained in it. The fine-to-coarse map is stochastic, i.e., one configuration of indistinguishable microscopic molecules may be represented by multiple configurations of coarse-grained particles. Explicit expressions are obtained using a lattice of subvolumes, and a generalization to an approximate off-lattice description is outlined.

In our manuscript we use simple algorithms—random particle displacements, Monte Carlo moves that transfer a microscopic particle from one coarse-grained particle to another, or Monte Carlo moves that swap the contents *q*_{i} and *q*_{j} between two coarse-grained particles, *i* and *j*—that suffice to appropriately sample configuration space. More sophisticated algorithms could be devised inspired by Monte Carlo algorithms for supramolecular systems,^{46–48} polydisperse systems,^{49,50} or the recently devised adaptive resolution approach for coupling atomistic water models with supramolecular ones.^{42}

Both lattice-based and off-lattice coarse-grained models are quantitatively validated by simulating two one-dimensional model systems—(a) repulsive particles in a gravitational field and (b) cylindrically symmetric distribution of counterions around an oppositely charged wire. These systems were chosen to highlight the role of translational entropy: The pairwise interactions do not pose a challenge for coarse-graining, the systems exhibit mean-field-like behavior, and explicit, analytical predictions for their equilibrium density distributions are available for a quantitative comparison.

The outline of the manuscript is as follows: In Sec. II, we derive classes of coarse-grained models by stochastically mapping multiple, indistinguishable molecules into a coarse-grained particle. Depending on the coarse-graining scheme, the number, *q*_{β}, of microscopic particles that are comprised in the coarse-grained particle, *β*—the degree of coarse-graining—may be constant or fluctuate, and we also discuss schemes that allow us to control the spatial variation of *q*_{β} in order, e.g., to obtain a less coarse-grained description in the vicinity of a surface and a more aggressive coarse-graining farther away. At the end of Sec. II, we indicate an approximate scheme that allows us to avoid the lattice of non-overlapping subvolumes, which is employed to quantify the translational entropy. In Sec. III, we apply the lattice-based and off-lattice coarse-grained models to the two test systems. Comparing the results with the exact analytic predictions we find excellent agreement. Sec. IV details our conclusions and presents a brief outlook on potential future applications.

## II. COARSE-GRAINING PROCEDURE THAT REDUCES THE NUMBER OF MOLECULES

### A. Definition of the original model of *N* microscopic particles and division into subvolumes

We consider a system of *N* microscopic particles—gas molecules, solvents, or counterions—with coordinates, {**R**_{α}}, in a fixed volume, *V*, at constant temperature, *T*. A typical system configuration is depicted in the left panel of Fig. 1. The canonical partition function of the original system of interacting, microscopic particles is given by

where $H$ denotes the total interaction energy as a function of the microscopic particle coordinates, which is comprised of the potential energy in an external field and pairwise interactions between the microscopic particles. We have chosen to normalize the conformational partition function by a generic length *λ* that sets the unit of length. For the particles in the gravitational field, this length scale is the thermal de Broglie wavelength, whereas we identify it with the Bjerrum length in the case of counterions around a charged wire.

We define a dimensionless density, $\rho ^(r)$, of microscopic particles by

where the “hat” indicates that this quantity depends on the configuration of microscopic particles, {**R**_{α}}. The external and pairwise interactions can be expressed as a functional of the microscopic density, $H({R\alpha})=H[\rho ^]$, a relation that is exploited to devise top-down, coarse-grained models.^{51}

For bookkeeping purposes, let us subdivide the total volume, *V*, of the system into *M* non-overlapping subvolumes, *V*_{i}, and let *N*_{i} denote the number of microscopic particles in the *i*th volume element. $\u2211i=1MNi=N$ with $Ni=\u222bVidr\u2211\alpha =1N\delta (r\u2212R\alpha )$, and $\u2211i=1MVi=V$. The position of the $\alpha ith$ microscopic particle in subvolume *V*_{i} is denoted by $Ri\alpha i$. With these definitions, we can rewrite the partition function in the form

where the multinomial $N!/(\u220fi=1MNi!)$ quantifies the number of possibilities to distribute *N* identical, microscopic particles so that the *i*th subvolume contains *N*_{i} microscopic particles. The integral over the microscopic coordinate, $Ri\alpha i$, is confined to the subvolume, *V*_{i}. Here and in the following, it is understood that the sum over {*N*_{i}} is restricted to combinations that fulfill the condition

### B. Alternate representations: From${R\alpha}\alpha =1,\cdots \u2009,N$ to ${r\beta ,{\eta}\beta}\beta =1,\cdots \u2009,n$

We group the *N*_{i} microscopic particles in subvolume *V*_{i} into *n*_{i} coarse-grained particles as illustrated in the middle panel of Fig. 1. In contrast to Voronoi fluid particles,^{30,31} the coarse-grained particles may overlap, i.e., typically, we assume that a subvolume contains multiple coarse-grained particles. Note that such a fine-to-coarse map is not deterministic but stochastic, i.e., there are different possible ways to represent a microscopic configuration of indistinguishable particles by coarse-grained particles, and we assign an *a priori* probability (see below) to the different alternate representations.

In the following, we assume that the total number of coarse-grained particles, $n\u2009=\u2009\u2211i=1Mni$, is constant (i.e., the canonical ensemble of the coarse-grained model). The coarse-grained particle with index *iβ*_{i} in *V*_{i} is comprised of $qi\beta i$ microscopic particles that are all located inside the same subvolume *V*_{i}. Thus the subvolume defines the “size” of a coarse-grained particle, i.e., the spatial region, from which microscopic particles can be recruited into a coarse-grained one.^{52} $qi\beta i=\u2211\alpha i\beta i=1qi\beta i1$ where $\alpha i\beta i=1,\cdots \u2009,qi\beta i$ enumerates the microscopic particles that are grouped into the coarse-grained particles, *iβ*_{i}. We select one, $\alpha i\beta i*$, of the $qi\beta i$ microscopic particles to define the explicit position, $ri\beta i$, of the coarse-grained particle, whereas the $qi\beta i\u22121$ other coordinate vectors define the internal positional degrees of freedom (DoFs), ${\eta}i\beta i$, of the coarse-grained particle, *iβ*_{i},^{53}

This choice of the explicit positional DoF, **r**_{β}, as *primus inter pares* has the advantage that if all coarse-grained particles are comprised of the same number of microscopic particles, $q\beta =q\xaf$ see Sec. II D 1, the average densities of microscopic and coarse-grained particles are simply related by $\u27e8\rho ^(r)\u27e9=\u27e8q\xaf\rho ^cg(r)\u27e9$. The variables $ri\beta i,{\eta}i\beta i$ with *i* = 1, $\cdots \u2009$, *M* and *β*_{i} = 1, $\cdots \u2009$, *n*_{i} are a complete, alternative description of the microstate of the system of microscopic particles, and the Jacobian determinate of this mapping from {**R**_{α}} to ${ri\beta i,{\eta}i\beta i}$ is unity.

Bock and co-workers^{38} also considered the coarse-graining of two (solvent) particles into one effective interaction center in a homogeneous fluid. They lumped any two particles together into a coarse-grained particle and characterized the resulting coarse-grained particle by the average position (midpoint) of the two constituent, microscopic particles. In the thermodynamic limit, the typical distance between the two constituent particles is much larger than the finite range of interactions or the fluid-like packing effects in the liquid. Using a rigorous approach, they explicitly demonstrated that the coarse-grained particle contributes to the Hamiltonian only via a constant, chemical potential term. In turn, we consider a spatially inhomogeneous system, require that the two particles which are lumped together into a coarse-grained particle are located within the same subvolume, and characterize the position of the coarse-grained segment by the position of one of the constituent microscopic particles.

As illustrated by the two middle panels of Fig. 1, the number, *N*_{i}, of microscopic particles in the *i*th subvolume does not uniquely determine the number, *n*_{i}, of coarse-grained particles in *V*_{i}. Instead, for a given configuration of microscopic particles, the number, *n*_{i}, of coarse-grained particles and the numbers, $qi\beta i$, of microscopic particles contained in the coarse-grained particle, *iβ*_{i}, fluctuate, subjected to the constraints that (i) the total number of coarse-grained particles in the entire system amounts to *n* and (ii) the total number of microscopic particles in subvolume *V*_{i} is *N*_{i}

Thus configurations of the microscopic model can be represented in the form {**r**_{β}, {** η**}

_{β}}, where {

**}**

*η*_{β}collectively denotes the

*q*

_{β}− 1 internal, positional DoFs of the coarse-grained particle,

*β*. In particular, this representability condition requires that there is at least one coarse-grained particle in each subvolume that is populated by microscopic particles, i.e.,

*n*

_{i}> 0 if

*N*

_{i}> 0. The number, $qi\beta i$, of microscopic particles that are lumped into the coarse-grained particle,

*iβ*

_{i}, can adopt non-negative, integer values including 0, corresponding to an “empty” coarse-grained particle.

The mapping procedure from the microscopic system, {**R**_{α}}, to an alternate representation, ${ri\beta i,{\eta}i\beta i}$, as illustrated in Fig. 1, specifies the grouping of the microscopic particles into the coarse-grained ones in each of the subvolumes, *V*_{i}. To a given distribution, {*N*_{i}}, of microscopic particles in the different subvolumes, we assign a distribution {*n*_{i}} of coarse-grained particles with an *a priori* probability, $PnM{Ni}(0)({ni})$. For given distributions of microscopic and coarse-grained particles, {*N*_{i}} and {*n*_{i}}, in subvolume *V*_{i}, in turn, a particular set of numbers of internal, positional DoFs ${qi\beta i}=qi1,\u2026,qini$ of the coarse-grained particles is assigned the *a priori* probability, $pNini(0)({qi\beta i})$. Note that $pNini(0)({qi\beta i})$ does not account for the number of ways the *N*_{i} microscopic particles can be grouped into *n*_{i} coarse-grained ones [see Eq. (10)]. Both *a priori* distributions are normalized,

where, here and in the following, the first sum is restricted to fulfill the condition, $\u2211i=1Mni=n$, and the second one obeys the constraint, Eq. (6). Apart from these normalizations and the representability condition, Eq. (6), the *a priori* distributions are arbitrary, and we shall discuss different choices in Sec. II D.

Each configuration, {**r**_{β}, {** η**}

_{β}}, corresponds to a valid configuration of $N^=\u2211\beta =1nq\beta $ indistinguishable, microscopic particles according to Eq. (3). Here and in the following, the “hat” indicates that the quantity is computed from the coarse-grained configuration. The number of microscopic particles, $N^i$, in subvolume

*V*

_{i}is computed from the position of the coarse-grained particles, {

**r**

_{β}}, and their number of internal DoFs, {

*q*

_{β}}, according to

where *i*(**r**_{β}) denotes the index of the subvolume in which the coarse-grained particle, *β*, is located. Conversely, however, it is not automatically ensured that, for an arbitrary choice of *a priori* distributions and subvolumes, the configurations {**r**_{β}, {** η**}

_{β}} can represent all typical configurations of the $N^$ microscopic particles {

**R**

_{α}} because all

*q*

_{β}microscopic particles associated with the coarse-grained particle,

*β*, must be located in subvolume,

*i*(

**r**

_{β}).

^{54}For example, consider the extreme case that all coarse-grained particles are comprised of the same, large number of microscopic particles, $q\beta \u2009=\u2009q\xaf\u2009\u226b\u20091$, see Sec. II D 1. In this extreme case, each subvolume contains a multiple of $q\xaf$ microscopic particles, which would not be a typical representation of an ideal gas of microscopic particles if the average density,

*N*/

*V*, is not much larger than $q\xaf/Vi$, i.e., the typical microscopic values of

*N*

_{i}cannot be represented by $qi\beta i$ according to Eq. (6). In the following, we

*assume*that the

*a priori*distributions and subvolumes have been appropriately chosen so that the typical configurations of the microscopic model can be represented by the alternate representation—representability condition on the coarse-grained DoFs.

Defining an alternate representation, ${ri\beta i,{\eta}i\beta i}$, of the microscopic configuration in subvolume *V*_{i}, we group the *N*_{i} indistinguishable, microscopic particles into *n*_{i} coarse-grained particles comprised of $qi\beta i$ microscopic particles. The number of possible ways of grouping is given by the multinomial $Ni!/\u220f\beta i=1niqi\beta i!$. Furthermore, for each coarse-grained particle, the explicit position, $ri\beta i$, has to be chosen from the $qi\beta i$ possibilities and the remaining $qi\beta i\u22121$ internal positions have to be indexed, yielding $qi\beta i!$ possibilities. Thus, a given configuration of *N*_{i} microscopic particles in *V*_{i} can be assigned in *N*_{i}! distinct ways. Since the microscopic particles are indistinguishable, the different ways of mapping must not contribute to the entropy. Thus the configurational integral over the *N*_{i} indistinguishable, microscopic particles in *V*_{i} corresponds to the configurational integral over the *n*_{i} coarse-grained particles in volume *V*_{i} and the configurational integral over the internal, positional DoFs,

Using Eq. (3), we write the partition function in the form

### C. Coarse-graining: From${r\beta ,{\eta}\beta}\beta =1,\cdots \u2009,n$ to ${r\beta ,q\beta}\beta =1,\cdots \u2009,n$

In the course of coarse-graining, the internal, positional DoFs, {** η**}

_{β}, are integrated out so that, finally, a coarse-grained particle is only characterized by its position,

**r**

_{β}, and the number of positional DoFs,

*q*

_{β}. A typical configuration of the coarse-grained model, {

**r**

_{β},

*q*

_{β}} is presented in the right panel of Fig. 1. Splitting the integration over the explicit and internal, positional DoF and re-summing the former, we obtain the final expression for the partition function of the coarse-grained model,

where *i*(**r**_{β}) denotes the index of the subvolume that contains the coarse-grained particle *β*, and $N^i$ and $n^i$ are the number of microscopic and coarse-grained particles in subvolume *V*_{i}, calculated from the explicit coordinates, {**r**_{β}}, of the coarse-grained particles. Moreover, the sum of {*q*_{β}} is constrained by the condition $\u2211\beta =1nq\beta =N$; see Eqs. (4) and (6). In Appendix A, we explicitly demonstrate how to obtain the partition function of an ideal gas for $H=0$ from Eq. (14).

The DPD community has made some efforts as well to discuss the problem of lumping non-bonded particles. To the best of our knowledge, however, the additional free-energy terms in Eq. (15) have not been considered but, instead, the focus has been on the general form and thermodynamic consistency of the equations of motion.^{29–32}

The different terms in the Boltzmann factor of Eq. (15) have a simple interpretation: The first term, $Fcg$, is the effective excess free energy that is obtained by integrating out the *q*_{β} − 1 internal, positional DoFs of the coarse-grained particles at fixed {**r**_{β}, *q*_{β}}, i.e.,

Note that the internal, positional DoFs are constraint to remain within the subvolume of the associated coarse-grained particle,^{55} i.e., $Fcg$ describes the effective interaction between clusters of microscopic particles of “size” *V*_{i}.^{56} The derivation of these effective interactions between the coarse-grained beads is an important challenge in its own right that has attracted abiding interest.^{17–19,21–23,25–27,57} In general, it contains density-dependent or multibody interaction. The computation of $Fcg({r\beta ,q\beta})$ is not the focus of the present manuscript, and we have deliberately chosen applications, where an accurate approximation for the effective interactions can be obtained rather straightforwardly (see Sec. II E and Appendix C). For instance, for an ideal gas of microscopic particles with mass *m* in a gravitational field *g* and a fine discretization (see Sec. II E), we obtain the intuitive result, $Fcg({r\beta ,q\beta})\u2248q\beta mgz\beta $.

The second term is associated with the possibilities of distributing the *n* coarse-grained particles into the *M* subvolumes so that each subvolume contains *n*_{i} coarse-grained beads,

Note that $n^i$ and $N^i$ can be computed from the coarse-grained configuration, {**r**_{β}, *q*_{β}}, according to Eq. (9).

The third term, $SQ$, is associated with the entropy of dividing the number of *N*_{i} microscopic particles in the subvolume *V*_{i} into the numbers $qi\beta i$ (with *β*_{i} = 1, $\cdots \u2009$, *n*_{i}) of internal, positional DoFs of the *n*_{i} coarse-grained particles. A particular realization, ${qi\beta i}$, occurs with probability $pNini(0)({qi\beta i})$. Thus, we obtain

Specific choices for $F(0)$ and $SQ$ will be discussed in Sec. II D.

The fourth term, $Fid$, is the translational entropy of the microscopic particles or, equivalently, the free energy of the ideal gas of microscopic particles distributed over the *M* subvolumes,

where we have used Stirling’s formula, which is appropriate if each subvolume contains a sufficiently large number of microscopic particles, $N^i\u226b1$. The dimensionless densities of microscopic particles in the *i*th subvolume are given by

The “hat” again indicates that these quantities are calculated from the explicit configuration, {**r**_{β}, *q*_{β}}, of the coarse-grained model. Moreover, in the last expression, we have additionally approximated the subvolume-based density by its continuum limit, $\rho ^(r)\u2248N^i(r)\lambda 3Vi(r)$, which is appropriate in the fine-discretization limit, see Sec. II E. Here *i*(**r**) is the index of the subvolume, in which the position **r** is located. These two approximations are mutually compatible only if the instantaneous density of the microscopic particles is high and slowly varying in space.

The fifth term, $Fidcg$, corresponds to the translational entropy of the coarse-grained particles,

with the coarse-grained density distribution $\rho ^cg(r)\u2248n^i(r)\lambda 3Vi(r)$. This term has to be subtracted because the translational entropy of the explicit, positional DoFs is generated by the configurational integral over the coarse-grained positions, {**r**_{β}}, but does not contribute to the free energy of the original system of microscopic particles. Thus, the difference, $Fid\u2212Fidcg$, quantifies the translational entropy of the *N* − *n* internal, positional DoFs that have been integrated out.

This exact rewriting, Eq. (15), of the partition function of the original *N*-body system of microscopic particles in terms of *n* coarse-grained particles with explicit positions, **r**_{β}, and a fluctuating number, *q*_{β}, of internal, positional DoFs, {** η**}

_{β}, is the central result of this manuscript.

### D. Special choices of the *a priori* distributions

Since the *a priori* distributions, $PnM{Ni}(0)({ni})$ and $pNini(0)({qi\beta i})$, only have to be normalized and obey the constraint, Eq. (6), different choices are possible, corresponding to different coarse-graining schemes. In this section, we discuss different schemes that are compiled in Table I.

. | $PnM{Ni}(0)({ni})$ or . | $pNini(0)({qi\beta i})$ or . |
---|---|---|

. | $F(0)$ in Eq. (17) . | $SQ$ in Eq. (18) . |

Constant degree of coarse-graining, $q\beta =q\xaf$ | Equation (22) | Equation (23) |

Gas of coarse-grained particles | Equation (31) | Bimodal Eq. (47) or unconstraint Eq. (49) |

Coarse-grained particles with varying fugacity | Equation (34) | Bimodal Eq. (47) or unconstraint Eq. (49) |

Uniform fluid elements, n_{i} = 1 and $q\beta =Ni(r\beta )$ | Equation (39) | Equation (40) |

Gas of fluid elements | Equation (42) | Bimodal Eq. (47) or unconstraint Eq. (49) |

Biased fluid elements with varying fugacity | Equation (43) | Bimodal Eq. (47) or unconstraint Eq. (49) |

. | $PnM{Ni}(0)({ni})$ or . | $pNini(0)({qi\beta i})$ or . |
---|---|---|

. | $F(0)$ in Eq. (17) . | $SQ$ in Eq. (18) . |

Constant degree of coarse-graining, $q\beta =q\xaf$ | Equation (22) | Equation (23) |

Gas of coarse-grained particles | Equation (31) | Bimodal Eq. (47) or unconstraint Eq. (49) |

Coarse-grained particles with varying fugacity | Equation (34) | Bimodal Eq. (47) or unconstraint Eq. (49) |

Uniform fluid elements, n_{i} = 1 and $q\beta =Ni(r\beta )$ | Equation (39) | Equation (40) |

Gas of fluid elements | Equation (42) | Bimodal Eq. (47) or unconstraint Eq. (49) |

Biased fluid elements with varying fugacity | Equation (43) | Bimodal Eq. (47) or unconstraint Eq. (49) |

#### 1. Constant and equal number, $q\xaf$, of microscopic particles per coarse-grained particle

In the simplest case “constant degree of coarse-graining”, each coarse-grained particle is comprised of a fixed number, $q\xaf$, of microscopic particles.^{58} This choice of {**r**_{β}, {** η**}

_{β}} restricts the corresponding microscopic configurations, {

**R**

_{α}}, of the original particle-based model to those where the number of microscopic particles in each subvolume,

*V*

_{i}, is a multiple of $q\xaf$. As discussed above, such a restriction becomes irrelevant in the limit that each subvolume typically contains a large number of microscopic particles, $Ni\u226bq\xaf$, but it becomes problematic if the density is low or the subvolumes are small. We will illustrate these representability issues in Sec. III A.

Since $q\xaf$ is constant, the number of microscopic particles, *N*_{i}, in subvolume, *V*_{i}, dictates the number of coarse-grained particles in this subvolume, $ni\u2261Ni/q\xaf$, and the *a priori* distributions take the form

For constant $q\xaf$, the sum over {*q*_{β}} in Eq. (15) contains only one term, and its *a priori* probability is $pN^in^i(0)({qi\beta i})=1$. Therefore, the charge-distribution entropy vanishes, $SQ=0$, and we obtain

Thus, the additional term in the exponential merely compensates for the difference between the translational entropies of the microscopic and coarse-grained particles.

It is instructive to describe a Monte Carlo scheme that samples the microscopic configurations characterized by {**r**_{β}, {** η**}

_{β}} according to the partition function, Eq. (25). Consider the attempt to move a randomly chosen coarse-grained particle,

*β**, which is comprised of $q\xaf$ microscopic particles, from its old position, $r\beta *$, to a new position, $r\beta *\u2032$. The displacement vector, $\Delta r\u2261r\beta *\u2032\u2212r\beta *$, is chosen from a symmetric distribution,

*p*

_{Δ}(Δ

**r**) =

*p*

_{Δ}(−Δ

**r**). The old and new positions of the coarse-grained particle are located in the subvolumes with indices, $iold=i(r\beta *)$ and $inew=i(r\beta *\u2032)$, respectively. The new positions, ${\eta \u2032}\beta *$, of the $q\xaf\u22121$ internal, positional DoFs of the coarse-grained particle,

*β**, are randomly chosen within the new subvolume, $Vinew$. The probability to propose the Monte Carlo trial consisting of a displacement vector, Δ

**r**, and a specific set of new internal, positional DoF is $pold\u2192newprop=p\Delta (\Delta r)/Vinewq\xaf\u22121$. Such a move implies a change of the interaction energy, $\Delta H$, and the statistical weight,

*p*

^{eq}, of the configuration changes according to

where $ninew\u2032\u2009=\u2009ninew+1$ is the occupancy of the subvolume, $Vinew$, after the move has been accepted. Thus, within our coarse-grained simulation, we will accept this trial movement of the coarse-grained particle with the Metropolis acceptance criterion,

Conceiving this Monte Carlo move as a cluster move, we present an alternative derivation of this acceptance criterion in Appendix B.

#### 2. Choices for $PnM{Ni}(0)({ni})$—Coarse-grained particles vs fluid elements

In all other cases that we discuss in this section, *q*_{β} can adopt multiple values and thus there is no one-to-one relation between the number of microscopic and coarse-grained particles, *N*_{i} and *n*_{i}, i.e., a microscopic configuration, {**R**_{α}}, can be represented by multiple coarse-grained configurations, {**r**_{β}, *q*_{β}}. The mapping between the microscopic and coarse-grained configurations is controlled by the *a priori* distributions. One can combine different choices of distributing the coarse-grained particles onto the subvolumes, $PnM{Ni}(0)({ni})$, with different schemes of grouping the microscopic particles into coarse-grained ones, $pNini(0)({qi\beta i})$, as summarized in Table I. In this section, we discuss two different options for the former *a priori* distribution, $PnM{Ni}(0)({ni})$.

##### a. Coarse-grained particles.

In order to link the number of coarse-grained particles to the number of microscopic particles, we choose the *a priori* probability

where *Z*_{i}(*N*_{i}) is an arbitrary function of the local number, *N*_{i}, of microscopic particles. $PnM{Ni}(0)({ni})=0$ if $\u2211i=1Mni\u2260n$. This *a priori* distribution corresponds to an ideal gas with a spatially varying fugacity, *Z*_{i}(*N*_{i})/*V*_{i}. The corresponding free energy takes the form^{59}

In the following, we discuss two options for *Z*_{i}(*N*_{i}):

The fugacity of an ideal gas is proportional to its density, i.e., $Zi(Ni)/Vi\u223c\rho ^icg$. Therefore, choosing

*Z*_{i}=*N*_{i}, we correlate the density of the coarse-grained particles with the density of the microscopic particles^{60}and obtain the simple expression

The first term is an irrelevant constant that does not depend on the configuration of coarse-grained particles,{**r**_{β}, *q*_{β}}, the second term cancels the correction for the translational entropy of the coarse-grained particles in Eq. (15), and the third term represents the coupling between the coarse-grained and microscopic particles. In this case, we expect that the density of coarse-grained particles follows the density of microscopic particles. Thus, the “local degree of coarse-graining” defined by

is rather uniform.

- (ii)
In order to control the local degree of coarse-graining, $q\xafi$, as a function of the spatial position (e.g., in order to obtain a fine-grained description of the solvent in the vicinity of a macromolecule or a surface, and a coarser description farther away), we set

*Z*_{i}(*N*_{i}) =*ϵ*_{i}*N*_{i}. The parameter,*ϵ*_{i}, is large in regions where the number of internal, positional DoFs per coarse-grained particle is low and, conversely, a small*ϵ*_{i}gives rise to a low ratio of the density of coarse-grained particles and microscopic particles, i.e., the coarse-grained particles have a larger*q*_{β}. In this case, we obtain

which reduces to Eq. (31) for *ϵ*_{i} ≡ 1 for all 1 ≤ *i* ≤ *M*. The last equation indicates that the extensive free energy, $F(0)$, is comprised of additive contributions from each coarse-grained particle, *β*.

##### b. Fluid elements: *A priori* de-correlation between microscopic and coarse-grained particles.

In the previous case, Sec. II D 2 a, the *a priori* distribution generated a correlation between the distribution of coarse-grained particles, {*N*_{i}}, and that of the microscopic particles, {*n*_{i}}. In this subsection, we consider the opposite limit, i.e., there is no *a priori* correlation between the distribution of coarse-grained and microscopic particles because $PnM{Ni}(0)({ni})$ does *not* depend on {*N*_{i}}. In this limit, a coarse-grained particle merely corresponds to a fluid element, i.e., the physical information is not related to the spatial density of coarse-grained particles (which is uniform on scales larger than *V*_{i}) but rather to the number of DoFs, $qi\beta i$, that it contains. In this sense, it can be conceived as a discretized volume element for the simulation of the free-energy functional.

In the limit of fine discretization (FiDis), $H({r\beta ,{\eta}\beta})\u2248FiDisHFiDis({Ni})$, where the interaction energy is specified by the number, *N*_{i}, of microscopic particles in a subvolume and the dependence on the positions of the microscopic particles within the subvolume can be ignored, we can provide a general result for arbitrary *a priori* distributions by rewriting Eq. (12) in the form

Thus, the probability distributions of the microscopic and the coarse-grained particles decouple, provided that $PnM{Ni}(0)({ni})$ does not explicitly depend on {*N*_{i}}. The distribution of the microscopic particles is dictated by the free-energy functional, $F({Ni})$, that accounts for the translational entropy of the coarse-grained particles and their interactions (within the fine-discretization approximation). The distribution of the coarse-grained particles is dictated by the *a priori* distribution, $PnM{Ni}(0)({ni})$. A local increase of the density of microscopic particles does not result in an increase of the density of the coarse-grained particles (or fluid elements) but rather to a change of their properties (i.e., the number of internal, positional DoFs, *q*_{β}).

In the following, we discuss three special cases: (i) one fluid element per subvolume, *V*_{i}, (ii) an ideal gas of fluid elements, and (iii) a biased spatial distribution of fluid elements.

In order to establish the connection to the field-based simulation of the discretized free-energy functional, we choose the

*a priori*distribution of the coarse-grained particles so that each non-overlapping subvolume,*V*_{i}, is occupied by exactly one coarse-grained particle, i.e.,*n*=*M*and*n*_{i}= 1. In this case, there is a bijective correspondence between coarse-grained particles and subvolumes, and the number of internal, positional DoFs of the coarse-grained particle is identical to the number of microscopic particles in that subvolume, $qi\beta i=Ni$.

The *a priori* distributions for these “uniform fluid elements” take the form

Starting from Eq. (12), we obtain for the partition function

where, for the last two expressions, we have assumed that the discretization of the total volume into the *M* subvolumes is fine (cf. Sec. II E). Thus, we re-cover the field-based simulation of the original system of microscopic particles.

- (ii)
Contrarily, we can simply distribute the

*n*coarse-grained particles randomly among the subvolumes,*V*_{i}. This procedure corresponds to the*a priori*distribution

which is identical to Eq. (28) with *Z*_{i}(*N*_{i}) ≡ *V*_{i}/*λ*^{3} for all *i*. This special choice de-correlates the *a priori* distribution of the coarse-grained particles and the microscopic particles, i.e., the coarse-grained particles constitute a fluctuating set of sample points for the discretized free-energy functional. The free energy that corresponds to this *a priori* distribution takes the form [cf. Eq. (30)]

The two contributions correspond to the negative of the free energy of the ideal gas of fluid elements, which does not depend on the microscopic configuration, and the translational entropy of a specific configuration {*n*_{i}}, of coarse-grained particles, respectively. Again, the extensive free-energy can be expressed in terms of additive contributions of the individual, coarse-grained particles.

- (iii)
Alternatively, we can exploit the choice of the

*a priori*probability, $PnM{Ni}(0)({ni})$, to bias the spatial density of fluid elements, $\rho icg$, and thereby, indirectly, also the local degree of coarse-graining, $q\xaf$, according to Eq. (32). A simple*a priori*distribution that allows us to tailor the coarse-grained density is

where the *a priori* chemical potential, *μ*_{i}, of the coarse-grained particles in the subvolume *V*_{i} can be chosen arbitrarily. This *a priori* distribution corresponds to Eq. (28) with the special choice $Zi(Ni)\u2261Vie\mu ikBT/\lambda 3$ for all *i*, and the corresponding free energy takes the form

Note that the first term is irrelevant for the simulation because it does not depend on the microscopic configuration, and the second and third terms are additive.

#### 3. Choices for $pNini(0)({qi\beta i})$—Bimodal vs unconstrained distributions

Unless the degree of coarse-graining is fixed to a constant value, $q\xaf$, for all particles or the number of coarse-grained particles per subvolume is constant (“uniform fluid elements”), there are different strategies, $pNini(0)({qi\beta i})$, to distribute the *N*_{i} microscopic particles onto the *n*_{i} coarse-grained ones. In this section, we discuss two different options for the *a priori* distribution, $pNini(0)({qi\beta i})$:

##### a. Bimodal distribution of the number of internal, positional DoFs per coarse-grained particle.

In the first case, there are two types of coarse-grained particles, characterized by either *q*_{β} = 1 or *q*_{β} = *q* (with *q* > 1). The former particles are identical to the microscopic particles of the original model, whereas the latter correspond to proper, coarse-grained particles that are comprised of *q* microscopic ones. The distribution of the coarse-grained particles is not completely determined by that of the microscopic particles; for a given number of microscopic particles, *N*_{i}, in the *i*th subvolume the number of coarse-grained particles can vary from *N*_{i}/*q* to *N*_{i}.^{61} Therefore one can combine this $pNini(0)({qi\beta i})$ with one of the *a priori* distributions discussed in Sec. II D 2.

Given *N*_{i} = *n*_{i1} + *qn*_{iq} and *n*_{i} = *n*_{i1} + *n*_{iq}, the numbers, $ni1=qni\u2212Niq\u22121$ and $niq=Ni\u2212niq\u22121$ of both types of coarse-grained particles in subvolume *V*_{i} are completely determined. This case corresponds to the *a priori* distribution

and the entropy takes the form

where $F\u2009idcg1$ and $F\u2009idcgq$ denote the additive translational entropies of the coarse-grained particles with *q*_{β} = 1 and *q*_{β} = *q*, respectively.

##### b. Unconstrained fluctuations of *q*_{β}.

Limiting the number of internal, positional DoFs, *q*_{β}, we constrain the microscopic configurations, {**R**_{α}}, that can be represented by {**r**_{β}, {** η**}

_{β}}, particularly if the number of coarse-grained particles in a subvolume becomes small. Instead, we randomly group the

*N*

_{i}microscopic particles in subvolume

*V*

_{i}into

*n*

_{i}coarse-grained particles, i.e., the

*a priori*distribution, $pNini(0)({qi\beta i})$, and the concomitant extensive entropy takes the form

where, in the last expression, we have used Sterling’s formula to indicate that $S\u2009Q$ is associated with the deviation of the number *q*_{β}, of positional DoFs of a particle at **r**_{β} from its average, $Ni/ni=q\xafi$, in the subvolume, in which the particle is located.

### E. Limit of fine discretization (FiDis)—Coarse-grained point particles

If all subvolumes, *V*_{i}, are small compared to the length scale, over which the physical properties of the system, e.g., density or external field, vary in space—the limit of fine spatial discretization, FiDis—the spatial extent of coarse-grained particles is irrelevant, and they can be conceived as coarse-grained point particles. This FiDis approximation is particularly appropriate if the microscopic particles do not exhibit local, fluid-like packing effects, i.e., there are no harsh, short-range, repulsive interactions as it is, e.g., the case for point-like particles of an ideal gas or if the microscopic particles interact via a soft potential. Then, one can approximate the density of microscopic particles by

where we have explicitly indicated, from which DoFs the density of microscopic particles is computed. Approximating $\rho ^(r|{R\alpha})$ by $\rho ^(r|{r\beta ,{\eta}\beta})$ will be accurate if the typical configurations, {**R**_{α}}, of the microscopic model are well represented by {**r**_{β}, {** η**}

_{β}}. The relation, $\rho ^(r|{r\beta ,{\eta}\beta})=\rho ^(r|{r\beta ,q\beta})$, relies on the definition of the explicit, coarse-grained DoF (

*primus inter pares*), asserting that the distribution of the explicit, positional DoF,

**r**

_{β}, and that of the

*q*

_{β}− 1 implicit, positional DoFs, {

**}**

*η*_{β}, are identical in the subvolume, $Vi(r\beta )$. Thus, the

*average*density of the microscopic particles can be estimated by rescaling the

*average*density of the coarse-grained particles by a factor $q\u0303i=\rho ^i\rho ^icg$, i.e., $\u27e8\rho ^(r|{r\beta ,{\eta}\beta})\u27e9\u2248\u27e8q\u0303i(r)\rho ^cg(r)\u27e9$. Equation (52) provides an appropriate estimate of the density of microscopic particles also on scales that are smaller than a subvolume if the instantaneous density does not significantly fluctuate.

If the number of coarse-grained particles in a subvolume is small, it will be more accurate to account for the *q*_{β} − 1 internal, positional DoFs, {** η**}

_{β}, by their (unknown) distribution inside the subvolume $Vi(r\beta )$,

where $w$(**r**, **r**_{β}) denotes the distribution of microscopic particles inside a subvolume that could be derived from a coarse-graining procedure.

If we assume that the physically relevant quantities slowly vary on the scale of a subvolume—the proper approximation of fine discretization—we can approximate the unknown distribution, *w*(**r**, **r**_{β}), of microscopic particles inside the subvolume $Vi(r\beta )$ by an index function, $w(r,r\beta )\u2248\Theta Vi(r\beta )(r)/Vi(r\beta )$ and obtain

In the following, we do not explicitly mention how the microscopic density is computed and simply denote this quantity as $\rho ^(r)$ because the argument, {**R**_{α}}, {**r**_{β}, {** η**}

_{β}}, or {

**r**

_{β},

*q*

_{β}}, is set by the context.

This sequence of approximations allows us to express the density of microscopic particles as a function of the coarse-grained variables—the positions, {**r**_{β}}, and the number of internal, positional DoFs, {*q*_{β}}, of the coarse-grained particles—only; the internal positional DoFs, {{** η**}

_{β}}, are not required. Since the interaction energy, $H$, can be computed from the density of microscopic particles, we can use this approximation to calculate the interaction energy from the coarse-grained variables, {

**r**

_{β},

*q*

_{β}},

^{62}

Since neither the grid-based density, $\rho ^i(r)$, of microscopic particles nor $HFiDis$ depend on the *q*_{β} − 1 internal, positional DoFs, {** η**}

_{β}, of the coarse-grained particles, we use this fine-discretization approximation to integrate out the internal, positional DoFs in the partition function, Eq. (15), i.e., $\u222bVi(r\beta )d{\eta}\beta Vi(r\beta )q\beta \u22121=1$, and obtain

An appropriate choice for the size, *V*_{i}, of a subvolume or the range of the weighting function can be illustrated by the following representability consideration: In the special case of an ideal gas with a low density of coarse-grained particles, *nV*_{i}/*V* ∼ *n*/*M* ≤ 1, the typical configurations of the coarse-grained model consist of isolated clusters of *q*_{β} microscopic particles. For *q*_{β} ∼ *N*/*n* > 1, such a coarse-grained configuration is not a typical configuration of the ideal gas of microscopic particles, i.e., the configurations {**r**_{β}, {** η**}

_{β}} do not well represent the microscopic configurations, {

**R**

_{α}}. Thus, the choice of

*V*

_{i}∼

*V*/

*M*is a compromise: (a)

*V*

_{i}should be large enough for the coarse-grained particles to well represent the typical configurations of the microscopic particles and (b)

*V*

_{i}should be small enough in order to facilitate the computation of the coarse-grained interactions, $Fcg$, e.g., by the fine-discretization approximation. While the representability issue is inherent to the coarse-graining strategy, the calculation of $Fcg$ can be systematically improved.

### F. Towards a coarse-grained, off-lattice description

The explicit reference to the lattice of subvolumes gives rise to several disadvantages that are typical for lattice-based models: The lattice breaks translational and rotational invariance and imparts a lattice anisotropy onto the model. Moreover, the absence of forces does (a) not permit molecular dynamics simulation that is popular in biomolecular simulations, (b) prevents the calculation of the pressure via the virial of forces, and (c) complicates a hydrodynamic description (flow, shear, etc.).

Technically, the division into subvolumes is important for defining the free energies, $F\u2009(0)$ and $S\u2009Q$, associated with the *a priori* distributions, as well as the translational entropies, $F\u2009id$ and $F\u2009idcg$, which appear in the Boltzmann factor of the partition function, Eq. (15). All these free-energy contributions can be computed from the knowledge of ${N^i}$ and ${n^i}$ on the lattice of subvolumes or, equivalently, they only depend on the explicit configuration of the coarse-grained model {**r**_{β}, *q*_{β}} via the dimensionless, local densities of microscopic and coarse-grained particles, $\rho ^i\u2261N^i\lambda 3/Vi$ and $\rho ^icg\u2261n^i\lambda 3/Vi$.

Importantly, being extensive free energies, these contributions are additive in the number of coarse-grained particles. The expressions for $F\u2009(0)$ in Eqs. (34) and (45) as well as the entropy $S\u2009Q$ in Eqs. (47) and (49) are comprised of sums over the coarse-grained particles, and each addend involves the number of internal, positional DoF, *q*_{β}, or the local densities of microscopic or coarse-grained particles, $\rho ^i(r\beta )$ and $\rho ^i(r\beta )cg$, in the subvolume *i*(**r**_{β}), in which the particle is located. The translational entropies of microscopic and coarse-grained particles can be re-written in the same form

Since the lattice of subvolumes is only a technical aid, we can approximately replace the lattice-based density by a weighted density around the location of a coarse-grained particle, i.e., we approximate the density of microscopic particles in the surrounding of the coarse-grained particle, *β*, by a weighted density, $\rho ^(r\beta )$, similar to multibody DPD techniques,^{10,63–65} embedded-atom potentials,^{66} or systematic coarse-graining schemes,^{18,57}

The spatial extent, Δ*V*(**r**_{β}), of the weighting function, $w$(**r**, **r**_{β}), characterizes the size of a coarse-grained particle, and it obeys the normalization condition

Similarly, we can define the weighted densities of coarse-grained particles without making reference to a lattice of subvolumes

and analogous expressions hold for $\rho ^cg1(r\beta )$ and $\rho ^cgq(r\beta )$.

In the same spirit, we approximate the integral over the *q*_{β} − 1 internal, positional DoFs, {** η**}

_{β}, of the coarse-grained particle,

*β*, by

and the size of a subvolume, $Vi(r\beta )$, in which the coarse-grained particle *β* is located is represented by Δ*V*(**r**_{β}).

Thus, the final approximate expression for the off-lattice partition function is

## III. RESULTS

In the following, we test the lattice and off-lattice, coarse-grained models using computer simulation of two example systems. These test systems were selected because (a) they highlight the role of translational entropy, (b) the interaction between the coarse-grained particles, $Fcg({r\beta ,q\beta})$, is easily obtained, and (c) analytic results are available for a quantitative comparison because the systems are mean-field-like.

### A. Test system 1: One-dimensional, repulsive particles in a gravitational field

#### 1. Definition and prediction of the mean-field behavior

We consider *N* microscopic particles at positions, {**R**_{α}}, that are subjected to an external, gravitational field and interact via a pair potential, $V(r)$. The potential energy is given by $H({R\alpha})=\u2211\alpha =1NmgZ\alpha +12\u2211\alpha ,\alpha \u2032=1NV(R\alpha \u2212R\alpha \u2032)$, where *Z*_{α} is the coordinate of the *α*th microscopic particle in the direction of the gravitational field, and *m* and *g* being the mass of a microscopic particle and gravitational acceleration, respectively.^{67} Using the definition of the microscopic density, Eq. (2), we can rewrite the interaction energy in the form

Alternatively, the structure and thermodynamics of the system can be described by a free-energy functional, $F$, of the density, *ρ*(**r**), of microscopic particles so that the canonical partition function, $Z$, takes the form

where the functional integral sums over all density fields, *ρ*(**r**), that satisfies the normalization constraint

where *ξ* denotes the average number density of microscopic particles, *L* = *L*_{x} = *L*_{y} are the two spatial extensions of the system perpendicular to the direction of the gravitational field, and *Z*_{0} and *z*_{0} are the upper and lower boundaries of the system, respectively. For the system of pairwise interacting particles in a gravitational field, the free-energy functional is given by

where the first term quantifies the translational free energy, the second term describes the interaction with the external, gravitational field, and the third contribution arises from the interactions between the microscopic particles. In the last line, we assume that the range of the repulsive pair potential is smaller than the characteristic length scales of all other system properties and set $V(r\u2212r\u2032)=kBTv\delta (r\u2212r\u2032)$, where *v* characterizes the excluded volume of a particle, which can be defined via the 2nd-order virial coefficient, $v=B22$ with $B2=\u22122\pi \u222bdrr2e\u2212V(r)kBT\u22121$ Thus, the interactions are characterized by two dimensionless parameters, *mgλ*/*k*_{B}*T* and $v$/*λ*.^{3}

Additionally, we only consider *one-dimensional variations* of the density along the direction, *z*, of the gravitational field, i.e., we replace the three-dimensional density, $\rho ^(r)$, of microscopic particles by its laterally averaged analog, $\rho ^(z)$,

i.e., the microscopic particles “live” only in one spatial dimension and are only characterized by their altitude, *Z*_{α}. The averaging over the lateral directions has two benefits: (a) It imparts a mean-field-like behavior onto the system that allows for an exact prediction of the density profile and (b) the “size” of the coarse-grained particles is large so that they strongly overlap, i.e., each subvolume contains many coarse-grained particles. The latter property, however, significantly slows down the off-lattice approach because one coarse-grained particle interacts with all particles within its Δ*V* = Δ*zL*^{2}.

For this one-dimensional system, the free-energy functional takes the form

This one-dimensional system exhibits mean-field behavior in the limit *L* →*∞*, *N* → *∞* but *ξ* → const because (*λ*/*L*)^{2} plays the role of a Ginzburg parameter, i.e., the functional integral over the one-dimensional density fields in Eq. (66) is dominated by the density field that minimizes $F\u2009[\rho ]$ under the constraint that the system contains *N* microscopic particles; see Eq. (67). Minimization yields

where the chemical potential, *μ*, appears as a Lagrange multiplier of the constraint, Eq. (67). For a system of non-interacting particles—$v$ = 0, ideal gas—we obtain the barometric formula $\rho (z)=exp[\mu \u2212mgz]/kBT$ with $exp(\mu /kBT)=mg\lambda 3N/L2exp(\u2212mgz0/kBT)\u2212exp(\u2212mgZ0/kBT)$. In the general case, $v$ > 0, the density profile, *ρ*(*z*), is obtained numerically.

#### 2. Coarse-grained simulations

We discretize the system extension, *z*_{0} ≤ *z* ≤ *Z*_{0}, in *M* uniform subvolumes, i.e., slabs of thickness, $\Delta z=Z0\u2212z0M$, and area, *L*^{2}. The characteristic length scale of the system is set by the variations of the one-dimensional microscopic density profile, $\rho ^i\u2248\rho (zi)$ with *i* = 1, …, *M*, where *z*_{i} = *z*_{0} + [*i* − 1/2]Δ*z* denotes the position of the *i*th subvolume. Since, in the large-*L* limit, each subvolume contains a large number, $N^i\u223c\xi L2\Delta z$, of microscopic particles, $\rho ^$ does not fluctuate and varies smoothly with position. If the maximal, relative gradient $\u2212\lambda \rho ^(z)d\rho ^dz\u223cmgkBT$ is small compared to $\lambda \Delta z$, the density can be considered as approximately constant inside a slab, corresponding to the fine-discretization limit. Thus, the interactions in the coarse-grained model are

Before the fine-discretization approximation, $\rho ^(z)$ is calculated from the microscopic configuration, {**R**_{α}} = {**r**_{β}, {** η**}

_{β}}, according to Eq. (70), whereas the density of microscopic particles in a slab is estimated from the coarse-grained configuration, {

*z*

_{β},

*q*

_{β}}, according to Eq. (75) afterwards. Within the fine-discretization approximation, the difference between the altitude,

*z*

_{β}, of a coarse-grained particle,

*β*, and the center $zi(z\beta )$ of the slab, in which it is located, is negligible, and $\rho ^(z\beta )\u2248\rho ^i(z\beta )$. Similar expressions hold for the number density of coarse-grained particles, $\rho ^icg$, in the

*i*th slab, $\rho ^icg1$, and $\rho ^icgq$. This completes the description of the grid-based, coarse-grained model within the fine-discretization approximation.

We can exactly calculate the coarse-grained interaction free energy, $Fcg({r\beta ,q\beta})$, for an ideal gas, $v$ = 0, in the gravitational field and, in Appendix C, we provide an approximation for finite $v$,

While this is sufficient to obtain the number of microscopic particles, *N*_{i}, in the large subvolumes and to compute the density, $\rho ^cg(z)$, of coarse-grained particles, in principle, we have to re-consider the relation between the coarse-grained configuration, {*z*_{β}, *q*_{β}}, and the microscopic density on scales smaller than a subvolume because the microscopic particles are no longer uniformly distributed inside a subvolume. Therefore, we obtain the local density according to Eq. (52) with a subgrid resolution.

#### 3. Numerical results

(a) Let us start with the example discussed in the Introduction, i.e., an ideal gas, $v$ = 0, of coarse-grained particles that are all comprised of $q\beta =q\xaf$ microscopic particles, subjected to a gravitational field.

In the limit of fine-discretization, $mg(Z0\u2212z0)kBT\u226aM\u2192\u221e$, the coarse-grained model is described by the free-energy function(al), $G({r\beta ,q\beta})=G[\rho ^cg(z)]$,

where the first term arises from the integral over the positions of the coarse-grained particles, the second term models the interaction free energy of the coarse-grained particles, and the third term denotes the additional contributions due to coarse-graining according to Eq. (24). Note that $\rho ^(r)=q\xaf\rho cg(r)$ is the density of microscopic particles computed from the coarse-grained configuration, {**r**_{β}, *q*_{β}}, according to Eq. (52).

In the limit of large subvolumes,

also the coarse-grained model exhibits mean-field behavior, and minimization of $G$ with respect to $\rho ^cg(z)$ yields the barometric formula, $\rho (z)=q\xaf\rho cg(z)\u223cexp\u2212mgzkBT$. This result is confirmed by the simulation of the coarse-grained model with parameters, *ξ* = 3, $mg\lambda kBT\u2009=\u20091$, $v$ = 0, $q\xaf\u2009=\u20092$, $L\u2009=\u2009819227\lambda $, and $\Delta z=9\lambda 64$, as shown in Fig. 2. For these parameters, $q\xaf\xi \Delta zL2=18\u226a1$.

If we increase the degree of coarse-graining to $q\xaf=128$, leaving all other parameters unaltered, the condition, Eq. (82), is not met, $q\xaf\xi \Delta zL2=1$. For these parameters, the number, $n^i=\rho ^icgVi$, of coarse-grained particles in a subvolume is small and fluctuates. Thus, (a) the system no longer exhibits mean-field behavior (which is not important for non-interacting particles, $v$ = 0) and (b) the typical configurations of the microscopic model, $N^i=0,1,2,\cdots \u2009$, are not well represented by the coarse-grained description, which only allows for $N^i=0,q\xaf,2q\xaf,\cdots \u2009$ according to Eq. (6). The density profile in Fig. 2 exhibits a step-like behavior; each step corresponds to a particular integer value of coarse-grained particles in a subvolume. In this unfavorable case, we also note that the acceptance ratio of random particle displacements of our Monte Carlo simulation significantly decreases compared to $q\xaf=2$.

This difference becomes less important when the typical values of $n^i$ are large. For a given overall density, *ξ*, of microscopic particles and system size, *L*, this representability problem can only be mitigated by decreasing the number of subvolumes, *M*, and abandon the fine-discretization approximation. To illustrate this effect, Fig. 2 also presents the density profile for $q\xaf=128$ and Δ*z* = *λ*. Symbols represent the density on the grid, $\u27e8\rho ^i\u27e9$, whereas the line shows the density profile, $\u27e8\rho ^(z)\u27e9$, with subgrid resolution according to Eq. (52). Using Eq. (78), we observe good agreement with the expected behavior even on length scales smaller than Δ*z*.

(b) In order to illustrate the effect of pairwise interactions, we present results for $v=12$ in Fig. 3. The pairwise repulsion between the particles reduces the compressibility of the gas, and the density decays slower with the altitude, *z*. The figure presents results for *ξ* = 3, $mg\lambda kBT=1$, $L=819227\lambda $, and $q\xaf=2$ or 128 and $\Delta z=9\lambda 64$ or *λ*. All results agree with the numerical solution of Eq. (72) except the data set with the large degree of coarse-graining, $q\xaf=128$, and the fine discretization, $\Delta z=9\lambda 64$, which suffers from the representability issue. Increasing Δ*z* and using Eq. (78), we can significantly reduce these artifacts; only for *z* ≥ 6*λ* is the density so low that also for the larger Δ*z* representability problems become visible. The good agreement with the other data for *z* < 6*λ*, even for the density inside the subvolumes, indicates that the approximation, Eq. (78), of the coarse-grained interaction free energy is rather accurate.

### B. Test system 2: Poisson-Boltzmann theory of the distribution of counterions around a charged wire

#### 1. Definition and mean-field behavior

We consider a charged wire with a positive line density, *eN*/*L*, of charges along the *z* direction and negative counterions of charge, −*e*. The counterions are confined into a cylindrical shell with inner radius, *r*_{0}, and outer radius, *R*_{0}. The energy scale is set by *k*_{B}*T*, and lengths are measured in units of the Bjerrum length, $\lambda =\beta e24\pi \u03f5$. The charge density of counterions is $\rho e(r)=\u2212e\rho (r)\lambda 3$, where *ρ*(**r**) is the dimensionless number density in units of the length scale, *λ*. The total charge density takes the form

where $\Theta r0$ denotes the index function of the charged cylinder. The line charge density of the wire is quantified by the Manning parameter $\xi =N\lambda L$, and the overall charge neutrality requires that

Similar to the first test system, we consider a system with *cylindrical symmetry*, i.e., the microscopic particles (counterions) are only characterized by their radial distance, *R*_{α}, from the wire. Averaging the density over the azimuthal and *z* direction, we replace $\rho ^(r)$ by

The assumption that the system is homogeneous in the azimuthal and *z* direction imparts the mean-field behavior onto the system and asserts that the coarse-grained particles, which have the shape of hollow cylinders, strongly overlap.

We scale the electric potential, Φ^{tot}(*r*), by $kBTe$ and decompose it into the attractive external electric field of the charged wire and the Coulomb repulsion between the like-charged counterions,

where $\varphi ^*$ is a linear functional of *ρ* and therefore depends on the microscopic configuration, {**r**_{β}, {** η**}

_{β}}. The charge density and electric potential are related by the Gauss law,

*λ*

^{2}△

*ϕ*= 4

*πρ*, which in cylindrical geometry adopts the form

and yields

where, in the second-to-last line, we have exploited the cylindrical geometry and adjusted the constant *C* so that $\varphi tot(R0)=\varphi ^*(R0)=0$.

The system is described by the free-energy functional

The prefactor, *λ*/*L*, plays the role of the Ginzburg parameter so that the system exhibits the mean-field behavior in the limit *L* → *∞*. Thus, the equilibrium density profile is obtained by minimizing $F[\rho (r)]$ with the constraint that the number of counterions is *N*, which yields together with Eq. (89) the Poisson-Boltzmann equation

Here we have used that the electric potential $\varphi ^*$ is a linear functional of the density; see Eq. (88). The chemical potential on the left-hand side contains the Lagrange multiplier, *γ*, of the constraint number of counterions. The analytic solution of the Poisson-Boltzmann equation, Eqs. (89) and (94), is given by^{68}

where the Lagrange multiplier, *γ*, is numerically determined from

These equations provide an explicit, analytical solution of the mean-field behavior that serves as a reference to validate our simulations. In particular, we note that if we scale all lengths, *r*_{0}, *r*, and *R*_{0}, by a factor of Λ at fixed *ξ*, the density of counterions scales like *ρ*(**r**) → *ρ*′(**r**) = *ρ*(Λ**r**)/Λ^{2}.

#### 2. Coarse-grained simulations—Using hollow cylinders for grid-based and off-lattice models

We discretize the radial dimension, *r*_{0} ≤ *r* ≤ *R*_{0}, in *M* hollow cylinders of constant thickness, $\Delta r=R0\u2212r0M$, and length *L*. The central radius of the *i*th subvolume is *r*_{i} = *r*_{0} + [*i* − 1/2]Δ*r*, and its volume is given by *V*_{i} = 2*πr*_{i}Δ*rL*.

Using hollow long cylinders as subvolumes, (a) we enforce the mean-field behavior because the Ginzburg parameter is small, *λ*/*L* → 0 for long cylinders, and (b) we mitigate representability issues because the number, *N*_{i}, of counterions in each subvolume, *N*_{i} = 2*πr*_{i}Δ*rLρ*_{i}, remains large for *L* → *∞* even if we choose Δ*r* small enough for the approximation of fine discretization to be accurate.

In the large-*L* limit, each subvolume contains a large number of counterions, $N^i\u223cL$ so that $\rho ^(r)$ is a smooth function of *r* for each coarse-grained configuration. The inverse characteristic length scale of the system is set by^{69}

Thus, the limit of fine discretization is reached for $M\u226b2\xi R0r0\u22121$, and we obtain

The densities of coarse-grained particles and those with charges *q*_{β} = 1 and *q*_{β} = *q* are computed in analogy to Eq. (100). The partition function of the coarse-grained model can be re-written in terms of the partition function of particles with a one-dimensional coordinate, *r*_{β}, and charge, *q*_{β},

with

where the additional free energy, $Fjac({r\beta})$, accounts for the Jacobian of the transformation from cylindrical coordinates to a one-dimensional radial coordinate. This completes the description of the grid-based coarse-grained model with hollow cylindrical subvolumes within the approximation of fine discretization.

An approximate off-lattice model is obtained by defining the one-dimensional density, $\rho ^(r\beta )$, of charges around the coarse-grained particle, *β*, via

The shift of the central radius, $r\beta \u2192r\u0303\beta $, of the hollow cylinder, which characterizes the shape of the particle, in the vicinity of the hard impenetrable walls mitigates the missing-neighbor effect. Note that in the cylindrical symmetry, the volume of a particle, $\Delta V(r\beta )=2\pi r\u0303\beta \Delta rL$, in Eq. (60) depends on the position of the coarse-grained particle and is also affected by the shift of the central radius.

#### 3. Numerical results

For the numerical study, we use the Manning parameter *ξ* = 3. The system geometry is characterized by the inner radius, *r*_{0} = *λ*, the outer radius, *R*_{0} = 10*λ*, and the cylinder length, $L=81923\lambda $. The total number of microscopic particles (counterions) is $N=\xi L\lambda =8192$. We use *M* = 64 hollow cylinders as subvolumes, i.e., $\Delta r=9\lambda 64$.

In Fig. 4, we compare the counterion density, ⟨*ρ*(*r*)⟩, with the prediction of Poisson-Boltzmann theory for a small and large degree of coarse-graining. For the former case, we keep the ratio *N*/*n* = 2 constant, i.e., the average degree of coarse-graining is 2, and we consider various choices of *a priori* distributions, $PnM{Ni}(0)({ni})$ and $pNini(0)({qi\beta i})$, and also consider the off-lattice implementation. Red circles correspond to constant $q\xaf=2$ (according to Sec. II D 1). Filled circles refer to an array of cylindrical subvolumes, whereas open circles present the results of the off-lattice approximation. Blue squares present the result of a fluctuating *q* according to Eq. (49) using cylindrical subvolumes (filled symbols) or the off-lattice approximation (open squares), respectively. Black diamonds show the counterion density for a bimodal distribution, *q* = 1 and 3, of counterions per coarse-grained particle, using Eq. (47). In order not to bias the spatial distribution of coarse-grained particles, we have used Eq. (31), and the corresponding results are presented by filled diamonds. Alternatively, we have also employed Eq. (34) with a spatially varying *ϵ* in order to increase the number of coarse-grained particles with no degree of coarse-graining, *q* = 1, in the vicinity of the charged wire. The open diamonds show the corresponding counterion density. Triangles present the results for a large constant degree of coarse-graining, $q\xaf=128$. Additionally, the figure depicts the result for fluid elements, see Eq. (42), by crosses.

For all combinations, we find good quantitative agreement, which is expected because the Poisson-Boltzmann approach becomes correct in the quasi-one-dimensional cylindrical system. Only for $q\xaf=128$, we find a small “step” in the density profile around *r* ≈ 2*λ*, which indicates the representability problem at these low densities similar to what we discussed in Sec. III A 3.

Whereas the different coarse-graining schemes give rise to the same physical distribution of microscopic particles, the profiles, ⟨*ρ*^{cg}(*r*)⟩, of the coarse-grained particles, shown in Fig. 5, markedly differ.

For the case, $q\beta =q\xaf$, of course, the distribution of coarse-grained particles follows from $\rho ^icg=\rho ^i/q\xaf$. Also for the *a priori* distribution, $PnM{Ni}(0)({ni})$, according to Eq. (34) with *ϵ*_{i} = 1 for all *i* = 1, $\cdots \u2009$, *M*, the ratio ⟨*ρ*(*r*)⟩/⟨*ρ*^{cg}(*r*)⟩ ≈ 2 is independent from the spatial position. This observation also holds true for a bimodal distribution of counterions per coarse-grained particle, *q*_{β} = 1 or 3, which corresponds to the *a priori* distribution, $pNini(0)({qi\beta i})$, according to Eq. (47), or for a fluctuating number of counterions per coarse-grained particle, *q*_{β} = 0, 1, $\cdots \u2009$, which corresponds to the *a priori* distribution, $pNini(0)({qi\beta i})$, according to Eq. (49).

In the bimodal case with *ϵ*_{i} = 1, the distribution of each coarse-grained species, *q* = 1 and *q* = 3, is proportional to ⟨*ρ*(*r*)⟩. For our specific choice, *q*_{β} = 1 and 3, the number of both types of coarse-grained particles is the same. Thus, their distributions agree, i.e., 2⟨*ρ*^{cg1}(*r*)⟩ ≈ 2⟨*ρ*^{cgq}(*r*)⟩ = ⟨*ρ*(*r*)⟩/2.

We control the distribution of coarse-grained particles by varying *ϵ*_{i} in the different subvolumes [according to Eq. (34)]. In these Monte Carlo simulation, we use random particle displacements and a Monte Carlo move that swaps the contents of two, randomly selected particles, *i* and *j*, for *q*_{i} ≠ *q*_{j}. Both Monte Carlo moves are subjected to a Metropolis acceptance criterion according to the equilibrium distribution of the coarse-grained model. The non-locality of the latter Monte Carlo move prevents a dynamical interpretation of the sequence of states, but it allows for a very efficient equilibration of the microscopic (charge) density. More sophisticated algorithms that locally make, break, and remake clusters of particles, like the “SWINGER” algorithm of Praprotnik and co-workers,^{42} could be advantageous if an appropriate acceptance criterion was available.

As indicated by the stars in Fig. 5 (referring to the right ordinate axis), large values of *ϵ*_{i} = 3 are located in the vicinity of the charged wire and favor the presence of (not) coarse-grained particles with *q*_{β} = 1, i.e., microscopic particles. Further away from the central wire, *ϵ*_{i} adopt the value 1 and promote a large degree of coarse-graining. Figure 5 demonstrates that in the region, *ϵ*_{i} = 3, the density of *q* = 1-particles is more than 3 times larger than that of *q* = 3-particles, and the suppression of the density of *q* = 3-particles at the wire could be increased even more by increasing the value of *ϵ*_{i}. In the volume with *ϵ*_{i} = 1, in turn, the density of *q* = 1-particles is vanishingly small and the system is entirely represented by coarse-grained *q* = 3-particles. Such a switch of degree of coarse-graining as a function of the distance from an embedded object (wire, surface, macromolecule) may be useful in circumstances where it is difficult to calculate the effective excess free energy, $F\u2009cg$, that describes the interaction of the coarse-grained particles among each other and with the embedded object (e.g., because of strong liquid-like layering effects), yet an accurate coarse-grained description is available farther away from the embedded object.^{70} In the present example, $F\u2009cg$ is only given by the electrostatic energy, but more sophisticated schemes to devise the effective interactions between particles with different degree of coarse-graining are available.^{71,72}

## IV. CONCLUDING REMARKS AND OUTLOOK

We have presented a general formalism of coarse-graining where multiple, indistinguishable, microscopic particles are stochastically mapped into one effective, coarse-grained interaction center. In addition to devising appropriate coarse-grained interactions, $Fcg$, see Eq. (16),^{21–23,25–27} one also has to account for the loss of translational entropy associated with the decimation of indistinguishable particles.

We have considered different schemes of coarse-graining, see Table I, in which a coarse-grained particle, *β*, is comprised of a fixed number, $q\xaf$, of microscopic particles (i.e., 1-to-$q\xaf$ mapping) or is characterized by an internal variable, *q*_{β}, that quantifies its fluctuating content of microscopic particles. We have discussed schemes where *q*_{β} fluctuates around a local degree of coarse-graining, $q\xafi$, or where the density of coarse-grained particles (“fluid elements”) is independent from that of the microscopic ones.

In all schemes, the coarse-graining of translational entropy gives rise to density-dependent, effective interactions on the coarse-grained scale. Dividing the system volume into non-overlapping subvolumes to facilitate counting, we have derived explicit expressions for the coarse-grained interactions, $Fcg$, and the additional coarse-grained entropic contribution to the interaction free energy on the coarse-grained level. Moreover, we have indicated how this exact, grid-based procedure can be generalized to an approximate off-lattice description using density-dependent but translationally invariant interactions. These density-dependent interactions are particularly important in systems with pronounced spatial inhomogeneities.

Using two simple examples, an ideal gas in a gravitational field and distribution of counterions around a linear charged wire within mean-field approximation, we have illustrated our scheme and validated it against exact, analytical results. We expect that this density-dependent, coarse-grained entropy be useful for devising coarse-grained models for solvents in biophysical simulations or ionic liquids.

## ACKNOWLEDGMENTS

It is a great pleasure to thank William Noid and Matej Praprotnik for stimulating and encouraging comments on this manuscript. Financial support has been provided by the German Science Foundation (DFG) SFB 1073/TP A03. J.J.dP. and N.E.J. gratefully acknowledge support from the U.S. Department of Energy Office of Science, Program in Basic Energy Sciences, Materials Sciences and Engineering Division. The calculations have been performed at the GWDG Göttingen, HLRN Hannover/Berlin, Neumann Institute for Computing, Jülich, Germany. N.E.J. thanks the Argonne National Laboratory Maria Goeppert Mayer Named Fellowship for support.

### APPENDIX A: RECOVERING THE PARTITION FUNCTION OF AN IDEAL GAS FROM EQ. (14)

Starting from Eq. (14) with $H=0$, we derive the partition function of an ideal gas,

Note that the $n^i$ depend on the positions of the coarse-grained particles (as indicated by “ $\u02c6$ ”). Instead of integrating the coarse-grained particle positions over the entire volume *V*, we first distribute the coarse-grained particles into the subvolumes and subsequently integrate over their positions inside this subvolume, i.e.,

Since the particle *iβ*_{i} is localized in subvolume *V*_{i} and comprises $qi\beta i$ microscopic particles, the number of coarse-grained and microscopic particles in the subvolume *V*_{i} are given by $n^i\u2009\u2261\u2009\u2211\beta =1N\delta i,i(r\beta )\u2009=\u2009ni$ and $N^i\u2009\u2261\u2009\u2211\beta =1nq\beta \delta i,i(r\beta )\u2009=\u2009\u2211\beta i=1niqi\beta i\u2009=\u2009Ni$, respectively. Note that $\u2211{q\beta}\u2009=\u2009\u2211{Ni}\u220fi=1M\u2211{qi\beta i}$ because the sum $\u2211{qi\beta i}\u2009=\u2009\u2211qi1\u2026\u2211qini\delta Ni,\u2211\beta i=1niqi\beta i$ restricts the number of microscopic particles in each subvolume *V*_{i} to *N*_{i}.

Thus, we can perform the integration over the explicit particle coordinates, yielding

### APPENDIX B: CLUSTER MONTE CARLO MOVE FOR $q\xaf=$ CONST

Alternatively and equivalently, we can conceive this Monte Carlo move of a coarse-grained particle as a cluster move in the original system of microscopic particles. To this end, we randomly select a microscopic particle from the $N=q\xafn$ microscopic particles in the system. The probability that this selected particle is identical to the one that defines the explicit DoF of the coarse-grained particle *β** is $1/(q\xafn)$. This particle is located in subvolume $Viold$, which contains a total of $Niold=q\xafniold$ microscopic particles. The number of possibilities to add $q\xaf\u22121$ other microscopic particles from this subvolume, $Viold$, to the cluster is

The probability to construct the specific set of microscopic particles that make up the coarse-grained particle, *β**, is the inverse of that number. Subsequently we choose a displacement vector of the first microscopic particle of the cluster according to *p*_{Δ}(Δ**r**). Like in the Monte Carlo move of the coarse-grained model, the probability to propose a specific new set of the $q\xaf\u22121$ microscopic particle coordinates, ${\eta \u2032}\beta *$, in the new subvolume is $1/Vinewq\xaf\u22121$. Thus, the overall probability to propose this cluster move in the original system of microscopic particles is

Within the original system of microscopic particles, the ratio of the statistical weights of the new and old configuration simply is

Thus, the probability to accept the Monte Carlo move in the original system of microscopic particles is

which, gratifyingly, agrees with Eq. (27).

### APPENDIX C: BEYOND THE FINE-DISCRETIZATION APPROXIMATION—PARTICLES IN A GRAVITATIONAL FIELD

In order to calculate the coarse-grained interaction free energy, $Fcg$, for the interacting particles in a gravitational field, we assume that the microscopic density profile inside the *i*th subvolume (slab) centered at *z*_{i} is approximately linear, i.e., the gravitational field gives rise to a inhomogeneous density distribution (“polarization”) inside of a subvolume.

We employ the fluctuations, $\delta \rho ^(z)$,

around this linear profile as small parameter. $\Theta Vi(r)$ denotes the index function of the subvolume, *V*_{i}. $\u222bVidr\delta \rho ^(z)=0$ and $\u222bVidr(z\u2212zi)=0$ in all subvolumes. Here, *γ*_{i}/*λ* with *i* = 1, $\cdots \u2009$, *M* are variational parameters that quantify the local slope of the density profile. $\rho ^(z)$ denotes the density of microscopic particles according to Eq. (51), whereas $\rho ^i$ is the average density of microscopic particles in the *i*th subvolume, Eq. (54).

The interactions comprise the external gravitational field and the repulsive binary interactions. The Hamiltonian of the binary interactions takes the form

and we obtain for the total Hamiltonian

Neglecting the last term, which is proportional to the fluctuations of the microscopic density profile around the linear, mean-field approximation, we are able to compute the coarse-grained interaction free energy, $Fcg({z\beta ,q\beta})$, because the internal, positional DoF decouple. Introducing an effective, dimensionless, external field, $hi\u2261mg\lambda kT\u2212v\lambda 3\gamma i$, in the *i*th subvolume, we obtain

Note that this coarse-grained interaction free energy, $Fcg({r\beta ,q\beta})$, is the only term in the statistical weight of the coarse-grained configuration that explicitly depends on the position of the coarse-grained particle, **r**_{β}, inside of a subvolume; all other contributions are functions of the number of microscopic or coarse-grained particles, $\rho ^i(r\beta )$ and $\rho ^i(r\beta )cg$, respectively. Thus, we define an averaged coarse-grained free-energy, $F\xafcg$, by integrating **r**_{β} over $Vi(r\beta )$,

which explicitly demonstrates that the terms beyond the fine-discretization approximation are of order Δ*z*^{2}. In order to determine the variational parameters, *γ*_{i}, we use the expression up to order Δ*z*^{2} and compute the optimal values, $\gamma i*$,

Thus, the gradient, −*γ*_{i}/*λ*, results from the linear response of the gas with an isothermal compressibility that is proportional to $1\rho i+v\lambda 3$, to the gravitational field, $mg\lambda kT$.

Alternatively, we obtain the gradient of the density profile by differentiating Eq. (72) with respect to *z*,

Since both approaches neglect fluctuations, they yield the identical result.

Inserting the optimal values, $\gamma i*$ and $hi*$, we obtain the coarse-grained interaction free-energy

### APPENDIX D: BEYOND THE FINE-DISCRETIZATION APPROXIMATION—RELATION BETWEEN $Z$ AND $Zcg$ FOR $q\beta =q\xaf$ AND $v$ = 0

For an ideal gas, $v$ = 0 in the gravitational field, the effective coarse-grained interaction, $Fcg$, in Eq. (C13) is exact and does not depend on *γ*_{i}, i.e.,

where the constant, *C*, does not depend on the configuration, {*z*_{β}, *q*_{β}}, of the coarse-grained model. This simpler expression allows us to explicitly relate the partition function of the coarse-grained model for large subvolumes and the partition function of the original microscopic model

This partition function would be the partition function of the original microscopic model if the sum ran over all values, *N*_{i} = 0, 1, 2, $\cdots \u2009$. Instead, the result is the partition function obtained by summing over all microscopic configurations that can be represented in the form {**r**_{β}, {** η**}

_{β}}, i.e., $Ni=0,q\xaf,2q\xaf,\cdots \u2009$.

If $n^i\u2009\u226b\u20091$ in the typical configurations of the coarse-grained model, we can approximate $\u2211ni=0,1,\cdots \u2009\u2248\u2009\u222bdni=1q\xaf\u222bdNi\u22481q\xaf\u2211Ni=0,1,\cdots $. Thus, if we choose the discretization coarse enough for each subvolume to contain many coarse-grained particles, i.e., the coarse-grained particles strongly overlap, we can approximately relate the partition function of the coarse-grained model, $Zcg$, and the original, microscopic model, $Z$,

where the factor $q\xafM$ accounts for the ratio of the number of configurations of the original model of microscopic particles and its coarse-grained representation.

## REFERENCES

An internal, positional DoF refers to *d* scalar degrees of freedom where *d* denotes the spatial dimension.

Obviously, this constraint on the *a priori* distribution becomes irrelevant if there is only a single subvolume, *M* = 1 and *V* = *V*_{1}.

This constraint is somewhat similar to coarse-graining along the backbone of a molecule where the decimated, internal DoFs are also restrained around the positions of the coarse-grained particles, which define the conformation of the molecule.

In addition to one-body terms, we expect $Fcg$ also to include two-body terms (and higher-order interactions), in contrast to coarse-graining strategies where the DoFs associated with a coarse-grained particle are delocalized in the entire system.^{38} The position of the coarse-grained particle, **r**_{β}, coincides with the position of a microscopic particle, cf. Eq. (5).

The special, trivial case, $q\xaf=1$, corresponds to the original system of coarse-grained particles.

Note that this expression for $F(0)$ does not assume that there are many microscopic or coarse-grained particles in a subvolume.

Since *q*_{β} = 0 is allowed, there can be subvolumes that contain a coarse-grained particle but no microscopic particle, i.e., *N*_{i} = 0 but *n*_{i} > 0. In these subvolumes, we set $Zi(Ni)=\lambda 3Vi$, which excludes these subvolumes from the last sum in Eq. (30).

Given *N* and *n*, however, the number of coarse-grained particles with *q*_{β} = 1 and *q*_{β} = *q* in the entire system is fixed.

In the general case, we approximate$H({R\alpha})=H({r\beta ,{\eta}\beta})=H[\rho ^(r)]\u2248Fcg({r\beta ,q\beta}),$where the free-energy functional, $Fcg$, accounts for the local, packing correlations because the length scale of the interaction between the microscopic particles is not much smaller than the linear dimension of the subvolumes. This free-energy functional is either obtained by analytically integrating out the internal DoFs, {{** η**}

_{β}}, or by computing the free energy by computer simulations for small systems using iterative Boltzmann inversion or force matching.

The energy of pairwise interactions includes the constant, irrelevant self-interaction term $NV(0)$.

The use of a generic three-dimensional cubic grid with linear dimension, Δ*L*, in conjunction with the approximation of fine discretization for $Fcg$, requires a judicious choice of Δ*L*. We illustrate the criteria for choosing Δ*L* for the case $q\beta \u2261q\xaf$: (i) The fine-discretization approximation requires $\Delta L\u223c\Delta r\u226ar0\xi $ according to Eq. (99). This length scale also allows us to roughly estimate the counterion density in the vicinity of the wire, $\rho (r0)\u223c\xi \lambda 2/(r0\Delta L)\u223c\xi 2\lambda 2/r02$. (ii) Representability requires that the number of coarse-grained particles fulfills $ni\u223c\rho i\Delta L3/(q\xaf\lambda 3)\u2265O(1)$; otherwise the typical configuration of the coarse-grained model consists of isolated clusters of $q\xaf$ counterions, which is not a typical configuration of the original model. Using the crude estimate of the charge density, we obtain $\rho i\Delta L3/(q\xaf\lambda 3)\u223cr0\xi q\xaf\lambda \u2265O(1)$. Thus, using the approximation of fine discretization while simultaneously avoiding representability issues, we require a large inner radius, *r*_{0}/*λ*, and a small degree, $q\xaf$, of coarse-graining.