## Abstract

A relatively general thermodynamic formalism for adaptive molecular resolution (AMR) is presented. The description is based on the approximation of local thermodynamic equilibrium and considers the alchemic parameter λ as the conjugate variable of the potential energy difference between the atomistic and coarse-grained model *Φ*=*U*^{(1)}−*U*^{(0)}. The thermodynamic formalism recovers the relations obtained from statistical mechanics of H-AdResS (Español *et al*., *J. Chem. Phys.* **142**, 064115, 2015 (doi:10.1063/1.4907006)) and provides relations between the free energy compensation and thermodynamic potentials. Inspired by this thermodynamic analogy, several generalizations of AMR are proposed, such as the exploration of new Maxwell relations and how to treat λ and *Φ* as ‘real’ thermodynamic *variables*.

This article is part of the themed issue ‘Multiscale modelling at the physics–chemistry–biology interface’.

## 1. Introduction

More than one decade has passed since the appearance of the first papers on adaptive molecular resolution (AMR) [1,2]. In particular, the adaptive resolution simulation (AdResS) method introduced by Praprotnik *et al.* [1] is the subject of the present discussion. The idea of adaptive resolution is certainly attractive for multiscale modelling: a finely detailed model (atomistic) is used to resolve some (small) location of the simulation box, whereas molecules gradually lose or gain atomistic details as they cross towards or backwards from the outer coarse-grained (CG) domain. The idea received attention and contributions from several groups [3–7] and has been generalized in several directions, such as coupling AdResS with continuum hydrodynamics [8,9], using open molecular dynamics (MD) [10], polarizable water models [11] and more. The main idea of AMR is to reduce the computational burden outside the domain of *interest* (e.g. a protein [12–14], a DNA strand [15], the active centre of a protein [5], the bulk of a polymer melt [16], etc.). However, the first papers on the subject already realized that the AMR involves a drop in ‘resolution’ free energy across the hybrid layer. This feature has been more recently considered with interest as a way to measure free energy differences between models. The idea has been explored in references [17–20] and adapted to measurement of chemical potential of several types of molecules in water [17]. There have been several works trying to unveil the statistical physics of adaptive resolution [21] and focusing on different theoretical aspects. The group of Delle Site [22] has explored aspects of the statistical mechanics of AdResS, whereas some of us derived an energy-conserving adaptive resolution H-AdResS [18–20]. A perspective that is however lacking is a simple and clear thermodynamic description of adaptive resolution. This work is an attempt in this direction. Thermodynamics is one of the basic theories in physics, and also one of the most slippery ones. In fact, it was only after our recent work on statistical mechanics of H-AdResS that we have been able to provide a glance of such a thermodynamic view. The strength of thermodynamics resides in its (apparent) simplicity and its enormous ability of provide useful relations between variables [23]. In this paper, we share this view and suggest several of the research lines it opens. We show that thermodynamic arguments are simple and sufficient to recover the equilibrium side of the statistical mechanics theory developed in [20], which starts from the Liouville equation associated with the H-AdResS Hamiltonian and climbs up to the (fluid) equations of motion for the density of conserved variables. The thermodynamic formalism is probably more agile for deriving new relations such as those stemming from the Maxwell relations. Here, we provide no numerical tests but rather intend to encourage the community to further research on this line.

In what follows, we shall briefly explain the main idea of adaptive resolution, AdResS. There are several versions based on AdResS, and I use the generic name of AMR to refer to all of them. This paper assumes the reader has some knowledge of AdResS and its energy-conserving version H-AdResS. We refer, for instance, to references [1,4,18,20] and references therein. The following sections unfold a thermodynamic view of AMR and possible research avenues that this view opens. Table 1 lists the acronyms used in this paper.

The idea of AdResS, or adaptive molecular resolution in general, is to connect two phases resolved by different molecular models. At one side, the coarse-grained model ‘0’ describes the system at the molecular level (a molecule is reduced to one coarse-grained unit) and uses a pairwise intermolecular potential *V* _{0}(*R*_{μν}) based on a CG description (here *R*_{μν} is the intermolecular distance). At the other side, the atomistic domain ‘1’ resolves the atomic interactions in detail using a potential *V* _{1}(*r*_{ij}), where *r*_{ij} is the interatomic distance. A hybrid domain separates the two phases and there molecular interaction is described by a mixture of forces (AdResS) or potentials (H-AdResS) with the generic form
Here, *R*_{μν}=|**R**_{μ}−**R**_{ν}|, where is the centre of mass of molecule *μ*. In the original AdResS formulation, this mixture applies on forces *F*_{μν}=(1−*ω*_{μν})*F*_{0}+*ω*_{μν}*F*_{1} and conserves momentum, owing to its symmetric form for *μν* [1]. The more recent Hamiltonian formalism [18] is based on a mixture of potentials and conserves energy, but not momentum. Yet another approach is based on open boundary molecular dynamics (OBMD) [24,25] and allows one to open up the AMR simulation box making it grand canonical [10,16]. The present thermodynamic framework is applicable to all these approaches, and to others not yet tried.

The pairwise function *ω*_{μν} is constructed with the switching function λ(**R**), an interpolating field that gradually turns from λ=0 (CG model) to λ=1 (atomistic model). While the original AdResS uses *ω*_{μν}=λ_{μ}λ_{ν}, the H-AdResS formulation was derived using *ω*_{μν}=(λ_{μ}+λ_{ν})/2 and λ_{μ}=λ(**R**_{μ}). This combination is convenient for the Hamiltonian form, because the potential energy of each particle can be summed up by pairs, like in standard MD and Monte Carlo (MC) (see [19]). As explained in these references, H-AdResS does not conserve momentum. The reason is the jump in ‘resolution’ free energy across the hybrid layer. This free energy is related to the Kirkwood free energy difference between models and acts like a hydrostatic pressure acting across the hybrid layer. If no other ‘external’ potential is added to H-AdResS, mechanical equilibrium will only be possible by closing the system with walls or with periodic boundaries [20], which is usually the case. Under mechanical equilibrium, a density and pressure jump appears across the hybrid layer as a consequence of the free energy difference. The lack of momentum conservation of H-AdResS is deeply connected with the models’ free energy difference, and the work needed to counterbalance its effect provides a mean to use H-AdResS as a free-energy-meter under quite general conditions (e.g. flow [16]). By contrast, AdResS is designed to conserve momentum [1], but essentially for the same reason (the free energy difference between phases), it cannot conserve the *mechanical* energy. In this case, the free energy difference expresses itself in the form of heat, which has to be thermalized. The associated entropy is then related to the free energy difference between models [22]. It has to be said that in most implementations of the original AdResS set-up the internal potential energy of those molecules in the CG domain [7] is not taken into account. In this case, the free energy jump across the hybrid layer will also contain the internal free energy of the molecules. By contrast, to simplify the Hamiltonian description in H-AdResS, the kinetic and bonded parts of the internal free energy (atoms) are explicitly taken into account in the CG molecule because, moreover, these terms (kinetic and bonding energies) are efficiently evaluated (no neighbour search required). A way to quantify the difference in free energy between models at the same pressure or density (Helmholtz, Gibbs) is to perform work against this free energy difference until their pressure or density becomes equal. This is carried out by the free energy compensation (FEC) correction.

The derivation of the statistical mechanics of H-AdResS presented in reference [20] provides an important relation between fields under equilibrium (see equations (26) and (52) in reference [20]),
1.1where *v*(**r**)=1/*n*(**r**) is the molar volume (inverse of the local number density), *p* is the pressure field and is a molar energy field (per particle), with being the energy density. Microscopically, the density field is and where is the potential energy of molecule *μ* obtained from the atomistic AA=1 model interactions, and similarly for *V* ^{0}: for details, we refer to reference [20]. The remaining term is a force per unit mass arising from the external potential *field* given by the free energy correction .

Thermodynamic relations constitute an essential guide to understand, use and design AMR simulations, either based on MD [1,18] or on MC [19]. In deriving thermodynamic relations for the local variables and their jumps across the transition layer, the local equilibrium approximation (LEA) will be invoked. As discussed in [20], the LEA assumes that the local average of any microscopic quantity obtained from the H-AdResS Hamiltonian *H*_{[λ]}, is equal (or close) to the (bulk) equilibrium average of a ‘λ fluid’ whose global environmental variables are given by the local H-AdResS ones. The LEA also ensures that gradients of local functions are proportional to gradients of the switching function λ=λ(**r**). In particular, ∇_{r}λ(**r**) d**r**=dλ, the pressure difference across a small lump of fluid is ∇_{r}*p*(**r**) d**r**=d*p* while . Using the LEA, equation (1.1) can then be interpreted as a thermodynamic relation between differences in local thermodynamic variables,
1.2where we have defined the molar energy difference as
which just depends on the intermolecular potentials used. One expects the LEA to be valid if the variations of the switching function λ are smooth enough compared with the scale of molecular correlations. Simulations presented in [20] showed that, even for transition layers of just about twice the molecular interaction cutoff, the total FEC resulted to be quite close to the free energy difference obtained from Kirkwood thermodynamic integration (TI) . The Kirkwood TI is carried out using a series of independent equilibrium simulations in independent (large) boxes with different λ values, where, unlike any AMR simulation, molecular correlations among λ boxes are obviously absent. We will come back to this issue later.

## 2. Thermodynamic ensemble equivalent to adaptive molecular resolution

The LEA permits one thus to construct a thermodynamic equivalent of the AMR set-up, as illustrated in figure 1 (see also reference [7]). The equivalent ensemble in figure 1 consists of a series of λ subsystems that can exchange mass (and therefore energy). They might represent small portions of the AMR box, with fixed volume *V* _{λ} and temperature *T* (as long as they are thermally connected). They can exchange mass, so, at equilibrium, one should also expect that they have the same chemical potential. The *total* AMR system is however *closed* with fixed mass and volume . The total energy balance in AMR is, quite generally,
2.1where the term is the work done *by* the system and it is divided into two parts, . The first term is the work done by the system under some change in its *global* constraints and is the work *we* need to perform to (reversibly) add a new internal constraint into the system (see reference [23]). Note that is also the work done *by the system along the inverse path* [23] but only if the new internal constraint is released *reversibly*. In fact, in an irreversible process related to the removal of the internal constraint, the system’s work can even be zero and, in this case, the work we have done to impose the internal constraint is completely converted into heat upon the constraint removal (like a free expansion without a piston).

The heat exchanged with the surroundings is and the second law states that it will be smaller than the increase in entropy produced when some *internal* constraint is removed (spontaneous or induced process),
2.2In terms of work, this relation implies that the system does maximum work when the internal constraint is released under control or, more precisely, reversibly,
2.3

Adaptive molecular resolution permits one to play with a new type of work source called *alchemic free energy*. Like in the Middle Ages, this work is that needed for transmutation of simple metal (CG model) into gold (atomistic model). In going from gold to simple metal, the system should be able to do work (or, else, irreversibly explode!). In our game, the alchemic system’s work is written as *λ*Δ*Φ*,^{1} where the alchemic parameter λ is selected as intensive and the ‘transmutation’ energy *Φ*=*U*^{(1)}−*U*^{(0)} is extensive. This energy is the internal energy difference between 1=AA and 0=CG models, in particular , where the sum runs over the molecules *μ* inside the system. A local value of *Φ* is obtained by summing over molecules in a subsystem with given λ (a λ box in figure 1), and it can be written as *Φ*=*N*_{λ}(*u*^{1}−*u*^{0}), where *u*^{1} and *u*^{0} are local molar energies and *N*_{λ} is the number of molecules within that volume (same holds for *U*^{(0)}). Thus, if *λ*Δ*Φ*>0 the gold turns into metal doing useful work (which is actually the inverse of what Middle Ages chemists aimed for). As implicit in the definition of *Φ* (see references [18,20]) *Φ* and λ are conjugate and
where the remaining *X* natural variables of *U* are kept fixed. Admittedly, we proceed here with heuristic arguments. Unlike energy and mass, some new dynamics where *Φ* is conserved have not yet been derived. In present AdResS implementations, *Φ*=*Nϕ* is conserved because (i) *ϕ* is *fixed* by the model potentials and (ii) mass (*N*) is conserved. Moreover, current AMR approaches fix λ as a field, so it is neither a real mechanical or thermodynamic variable (such as temperature, pressure or chemical potential). Considering *Φ* and λ as new *real* ‘alchemic’ thermodynamic variables is an attempt to enlarge, at least theoretically, the scope of AMR. Further work is needed to complete this picture. For instance, the full AMR thermodynamic scenario requires an equilibrium condition for λ arising from an alchemic extension of the second law.

To start with any thermodynamic analysis, one needs to specify the constraints of the AMR total system and λ subsystems. The *global constraints* depend on the AMR method. One can include three set-ups: H-AdResS, AdResS and OBMD. All of them fix the total volume , whereas H-AdResS and AdResS also fix the total mass as . H-AdResS can be made either insulated (no heat exchange with exterior), isolated (constant total energy) or isothermal (by a global thermostat). AdResS just ensures momentum balance, and does not explicitly treat the heat produced in the hybrid layer. In AdResS, such heat (appearing in equation (2.1) and its entropy (2.2)) comes from the free energy difference between models [22], and has to thermalized. Finally, in open MD (OBMD) [10,16], the *total* system is open to ‘the surroundings’ (variable ), and the *total* chemical potential is fixed.

### (a) Global constraints

Global constraints permit one to derive the thermodynamic potential of the total AMR system. To that end, we follow Heiss [23],
2.4where, for H-AdResS and AdResS (with fixed total mass and volume),
2.5Here, we are also using that the total alchemic energy *Φ*_{tot} is fixed in a closed system.

For a globally insulated H-AdResS system (no heat exchange with the exterior) , and are conserved, where is the total entropy. We shall also consider *Φ*_{tot} as fixed, to write
2.6This means that is the thermodynamic potential for the *whole* insulated H-AdResS. will increase in any path starting from the global equilibrium state () and ending in another equilibrium state with some extra *internal* constraint at a work cost −Δ*W*_{1}. The thermodynamic potential of AdResS (or thermostatted H-AdResS) would be the Helmholtz potential and in the case of OBMD , the grand potential.

### (b) The λ *open* subsystem

Let us now focus on the equilibrium of a λ subsystem (figure 1). These systems (or phases of the total system) are *open* with fixed volume *V* _{λ}. The work associated with these constitutive constraints is of chemical origin Δ*W*_{0,λ}=−*μ*_{λ}Δ*N*_{λ}. Quite generally, the energy variation in the λ subsystem is then
2.7where *μ*_{λ} is the molar Gibbs free energy of the λ subsystem *in the AMR system*. The total mass of the system is fixed , so that . Summing up for all λ and using equation (2.7) with (2.5) one concludes that
2.8which is valid for any set of Δ*N*_{λ}, therefore,
2.9In other words, the AMR equilibrium is characterized by equal values of the AMR chemical potential, *μ* in all λ phases.

Relation (2.9) also means that a λ subsystem *resembles* a grand canonical one, even if the *total* AMR system is *closed*. This subtle difference has been overlooked in some works [26,27]. In particular, when considering the statistics of one λ phase, it should be noted that there is a limitation on the number of particles it might contain, which is . Therefore, each *open* λ phase in a *closed* AMR simulation is *not a fully open system* (which otherwise might contain ). This difference obviously alters (decreases) the mass fluctuation in any λ subsystem. For a generalization, one should work with a *global* grand canonical system, using, for instance, the OBMD method [10,16] for which a tentative extension of the Liouville theorem has been recently presented [28].

Up to this point, the free energy compensation (FEC) has not really been used. One could be tempted to state that the FEC is *work* added to the AMR system to impose an internal constraint (constant density or pressure). This would have been written as for each single λ phase. This statement is however false and leads to erroneous conclusions. In the thermodynamic formalism, the FEC is not adding any internal constraint, because, as Heiss clearly states [23], any new constraint implies the appearance of a new variable, which is not the case when introducing the FEC into the AMR system. The correct thermodynamic argument is to treat the FEC as an *external field* that alters the density and pressure profiles within the AMR system, like gravity leads to the barotropic density profile. The idea of the FEC is to modify the density or pressure profiles to make them flat. Although the FEC is *not* a work source in thermodynamic terms, it *does* work in the system, which can be measured so as to obtain an evaluation of different kinds of free energy jumps across the hybrid layer. To state a useful example of a real internal constraint in an AMR simulation, consider a macromolecule inside the atomistic domain, which is not allowed to cross the hybrid layer. Here, however, we shall not impose any internal constraint on the AMR system, so
2.10However, we are adding an FEC field into the AMR simulation and it has to be considered in the energy balance. At each λ phase, the FEC field is constant , and it is possible to decompose differences in energy *U*_{λ} as
2.11Partial derivation of this relation with respect to *N*_{λ} leads to
2.12where is the chemical potential of the λ phase *in the absence* of the external field ().

Equations (2.9) and (2.12) tell that d*μ*=0 across λ phases, so that
2.13This means that the total jump in FEC can be used (and it *has* already been [17] used) to evaluate differences in the *molecular* chemical potential between the CG and atomistic models. This tool is certainly interesting. However, it is noted that is really *the chemical potential of the λ phase in the absence of the FEC*, and whether the external field is altering or not is a question that does not pertain to thermodynamics and needs to be checked in simulations. One should expect that spatial molecular correlations across the AMR system might alter , but these are usually short-ranged.

We are now ready to derive relations between and other thermodynamic variables. To that end, a useful path is to use the Gibbs–Duhem relation obtained from the zero potential for the *ensemble* of λ systems: . The Gibbs–Duhem relation in molar form gives
2.14which indicates that . In doing the Legendre transformation for the zero potential, λ becomes a natural variable as we are now considering the ensemble of boxes of figure 1. A similar thermodynamic argument is used in reference [23], chapter XII. Equation (2.14) allows us to better understand : it is the energy required to insert a particle *coming from* a λ box into another box with λ+dλ.

In general, d*μ*=0 from equation (2.9) and from equation (2.12) so, from (2.14),
2.15At equilibrium d*T*=0 (owing to thermal contact between λ phases) so
2.16Equation (2.16) is the LEA equivalent of the momentum flux balance derived in [20] (see equation (1.2)). Note that in the absence of FEC, (and at fixed *T*), one concludes that and that . This relation might be useful, provided the equations of state for the CG model are known (e.g. use CG as an ideal gas).

## 3. Forms for the free energy compensation

### (a) Constant pressure constraint

From equation (2.16), it is clear that if
3.1then the pressure will be constant for all λ systems, d*p*(λ)=0. This relation was also derived in reference [20] (equation (69) therein) from the translational *invariance* of the H-AdResS free energy functional. From equation (2.13), the jump in between CG and atomistic models is
3.2This difference is to be considered at fixed pressure for all λ. Because, in this set-up, *p* is the same for all λ boxes, a constant pressure in equation (2.14) tells us that should contain no contribution from variations in local pressure across λ phases, being now solely due to the alchemic transformation, as desired.

### (b) Constant density constraint

From equation (2.16) is also possible to derive the FEC to ensure constant density over the H-AdResS system. The number density is just the inverse of the molar volume *n*=1/*v*; we demand the constraint , which requires a pressure variation across λ subsystems equal to
3.3Using equation (2.16)
3.4So that
3.5which coincides with the constant density FEC correction in [18,20]. Again, equation (2.13),
3.6provides a way to evaluate the chemical potential of the atomistic model (provided the CG is known at the same density). The FEC was evaluated by measuring both terms in equation (3.6) using TI in independent λ boxes (i.e. assuming the LEA). The resulting FEC was shown to provide a quite flat density profile in H-AdResS [19] indicating that equation (3.6) can be satisfactorily used in AMR simulations. A self-consistent iterative method to evaluate within the same H-AdResS simulation was proposed in reference [20]. Slight differences with respect to the TI-evaluated FEC λ profile were observed inside the hybrid layer; however, the net value of agreed within error bars with the Kirkwood route.

As an illustration of the present formalism, it is interesting to comment on the work in reference [7], where a thermodynamic (TD) force was introduced to correct density variations over the hybrid layer of a calibrated CG potential (i.e. *p*_{AA}=*p*_{CG} for the target *T* and *n*). In that work, the TD force acts like would act here (with ). The *excess* part of the ‘molecular’ chemical potential (, i.e. obtained without TD) was measured by Widom insertion across λ layers. Then, the TD force was set to , which in our terminology implies . Decomposing into ideal and excess parts, (with Λ the de Broglie thermal wavelength) and using equation (2.13),
3.7Thus by imposing , one gets d*n*=0 across the system, as desired. A similar argument involving the excess chemical potential to achieve the constant density route was derived in reference [20]. In fact, the self-consistent iterative evaluation of to achieve constant density presented in [20] looks at the relation the other way around, i.e. as a fast and efficient way to evaluate the excess chemical potential of complex molecules (e.g. polymers), on which the Widom insertion method fails.

### (c) Kirkwood free energy integration: canonical λ subsystems

In terms of our description, the Kirkwood thermodynamic integration (TI) corresponds to a series of λ subsystems which are thermally connected but which are *not* allowed to exchange mass. Thus, each λ box has the same *N*, *T* and *V* and density *n*=*N*/*V* . Equivalently, it can be seen as a unique system with fixed mass and volume (and temperature) whose transformation parameter is varied from λ=0 to λ=1. The thermodynamic potential for this ensemble is the Helmholtz potential, *F*=*U*−*TS*+*λΦ*, whose molar form is
3.8Note that the variable *ϕ* has been Legendre transformed to work with λ as natural variable. In differential form,
3.9The Helmholtz free energy difference between λ=1 and λ=0 subsystems along the alchemic process is called the Kirkwood free energy difference [18,20],
3.10

The relation between and the FEC is a subject of interest ([20,22] and references therein). Using an isothermal AMR at fixed density, one can measure the Helmholtz free energy difference between models via the Kirkwood route. From equation (3.4), is the molar Gibbs free energy difference between the two models at the same density . The relation between and is derived in the appendix (see equation (5.11)).

### (d) Calibrated coarse-grained model: adaptive molecular resolution without compensation term

It is interesting to consider the case where no FEC term is used. This is one of the standard set-ups used in the first AMR papers [1,7,9] where the CG potential is *calibrated* so as to fit the molecular radial distribution function *g*(*R*_{μν}) of the atomistic model. In such a case, models λ=0 and λ=1 attain the same pressure *p*(1;*n*_{t})=*p*(0;*n*_{t}) at the target density *n*_{t}=*n*_{1}=*n*_{0} and temperature *T* (see reference [29] for additional technicalities). However, in general, *p*(λ)≠*p*(1) and *n*(λ) varies over the hybrid layer. Different types of density corrections at the hybrid layer have been proposed for fitted CG models [1,7,9,29]. Note that using an on-the-fly evaluation of the FEC , we showed [20] that the density profile has differences of about 1% even using highly disparate models. Using and *v*=1/*n* in equation (2.16),
3.11where use has been made of the Kirkwood free energy in equation (3.10) at the target density, . Although is not strictly zero for the CG-fitted case (despite previous claims), it should be small and even evaluable according to equation (3.11).

## 4. Generalizations to adaptive molecular simulations

This section provides some ideas for computational studies, going in the direction of a generalization of AMR thermodynamics. The foundation of AMR thermodynamics requires fulfilment of several basic properties, for instance, proving that AMR thermodynamic variables are state functions. Non-trivial generalizations are still required to convert λ and *Φ* into true thermodynamic variables, at the same level of and *N* or *p* and *V* . Nevertheless, a solid ground exists which allows one to use differential forms in the current AMR method (at least for H-AdResS): the momentum flux balance in equations (1.1) and (1.2). These relations indicate that it is possible to verify the validity of thermodynamic relations obtained from exact differentials using the current versions of AMR.

### (a) Maxwell relations

This leads, in particular, to one of the most powerful thermodynamic machineries: Maxwell relations in AMR. Let us focus on , whose derivative (via Gibbs–Duhem relation) is 4.1Fulfilment of Maxwell relations is the necessary and sufficient condition for to be an exact differential. The new relations would be 4.2and 4.3

These two relations, and many other similar ones (e.g. based on the Helmholtz free energy *f*=*μ*−*p*/*n*), can be tested in different sorts of simulations. For instance, demonstration of relation (4.2) is relatively straightforward: in an isothermal simulation at fixed λ, we change the pressure using a piston (or use the OBMD set-up) to evaluate the change in transmutation molar energy *ϕ*. This change should be equal to the local derivative of the density at the local value of λ, in an independent H-AdResS simulation at constant pressure. (As we are dealing with partial derivatives, to first order, the pressure should be the average pressure in the previous set of pure-λ processes.) Alternatively, one could directly use the λ ensemble in figure 1 using a barostat with fixed *p* for all λ boxes. This route would avoid any effect of molecular correlations in the AMR set-up.

Demonstration of relation (4.3) is more delicate. One could perform a series of simulations at constant λ∈[0,1] with fixed pressure in insulated boxes. In all these independent simulations, one adds a certain known amount of heat *δq*_{λ}.^{2} This (known) heat increases the temperature as *δq*_{λ}=*c*_{p}(λ) d*T* and provides the isobaric molar heat capacity *c*_{p}(λ)=(∂_{T}*s*)_{λ,p}. On the other hand, one has (∂_{λ}*s*)_{T,p}=*c*_{p}(∂_{λ}*T*)_{s,p}, which permits one to check the desired Maxwell relation (4.3) from the change of *T* with λ and the variation of *ϕ* with temperature. The Maxwell relation involving the molar entropy might also be checked independently, from a non-isothermal AMR simulation at constant pressure. One can add a spatially varying thermostat to induce a temperature gradient across the hybrid layer. Caution should be taken about any phoretic effect related to a large temperature gradient. In any case, details on numerical confirmation of these Maxwell relations are the scope for future work.

### (b) Control of the total H-AdResS pressure

The pressure in H-AdResS is not an external parameter. Even if we achieve constant pressure, we cannot really talk about a ‘constant pressure ensemble’ in the sense that the H-AdResS pressure is not an external (reservoir) parameter, but it is rather achieved by the imposition of an *external field* (the FEC). In order to have a real isobaric ensemble, there should be some ‘external pressure’ specified at will. In principle, the barostatted AdResS is a straightforward computational exercise.

## 5. Conclusion

This work intends to suggest a new approach to adaptive molecular simulations based on thermodynamics. It shows that thermodynamic arguments lead to the same formulae as hard and solid statistical mechanics [20]. The second intention is to provoke further research in this interesting line whose main goal would be to generalize the role of the switching function λ and transmutation energy *Φ* to convert them into true conjugate thermodynamic variables with proper conservation (first law) and relaxation (second law). In particular, the transmutation energy *Φ* should then have proper dynamics and conservation law, and this would bring up a second law for the alchemic processes where λ would be in the footage as *p*, *T* and . This generalization would allow much more flexibility to AMR, which so far has been tightened into a fixed domain decomposition in space. Adaptive resolution would then fully use the power of statistical physics and thermodynamics, and a battery of numerical methods and algorithms designed for molecular dynamics and Monte Carlo could be generalized to include alchemic dynamic transformations. The notion of ‘alchemostats’ to fix λ around a *moving* region of interest is already close to what AMR can now do. But a couple of possible new applications can be mentioned. By selecting *Φ* as the thermodynamic potential in MC or MD simulations, the AMR system would be able to find, on the fly, the best choice among a family of CG models, by minimizing *Φ* according to the alchemic dynamics. In another example, λ could be dynamically connected to some microscopic variable and increase as one ligand approaches the active centre of a protein. More ideas would surely appear but, in whatever case, a strong motivation, at least for me, is to play the role of a twenty-first-century *computational alchemist*.

## Competing interests

I declare I have no competing interests.

## Funding

I received no funding for this study.

## Acknowledgements

R.D.B. acknowledges funding from Spanish MINECO, under project FIS2013-47350-C05- 1-R. This research was initiated in the KAVLI Institute in Santa Barbara, California, and I thank this institution for its hospitality and support. I thank Pep Español for his comments and useful manuscript corrections and E. Velasco for discussions.

## Appendix A. Kirkwood free energy difference and

In reference [20], it was claimed that it could be possible to measure the Kirkwood TI free energy from constant pressure simulations. I hereby discuss this point by obtaining the relation between (constant pressure FEC) and . Inspection of equations (3.10) and (3.2) indicates that we need to relate with . Recall that is the molecular chemical potential (in general, containing alchemic energy). First, using standard thermodynamic manipulations,
A 1
A 2and
A 3one gets
A 4Now, the derivative of the molecular chemical potential is
A 5
A 6
A 7where we have used equation (5.4). We are now close to the desired result. Using a Taylor expansion for (∂*f*/∂λ)_{n(λ)} around the mean density , one gets
A 8or equivalently
A 9Using (5.4)–(5.9), we finally get
A 10

In summary, (the H-AdResS FEC for constant pressure) is not *exactly* equal to the Kirkwood free energy, but it is quite close. The difference has to be small, because the deviation from the average density integrates to zero over the space *x*, i.e. . However, in general, . If *δn*(*x*) is odd around half the layer and λ′(*x*) is even, then the integral in (5.10) vanishes.

However, the next term in the expansion need not be necessarily small,
A 11One expects that *ϕ* increases nearly linearly with *n*, so that its second derivative is small. This could be checked in simulations.

## Footnotes

One contribution of 17 to a theme issue ‘Multiscale modelling at the physics–chemistry–biology interface’.

↵1 In fact, it is also possible to use Λ=

*λN*as the extensive quantity and*ϕ*=*Φ*/*N*as the intensive one. The work would then be*ϕ*Δ*Λ*. The determination of the best choice will have to wait for a practical implementation on this idea.↵2 It is possible to add heat to a system by inserting over a time Δ

*t*a random set of forces with zero mean and variance , where is the heat rate.

- Accepted July 5, 2016.

- © 2016 The Author(s)

Published by the Royal Society. All rights reserved.