1,546
Views
14
CrossRef citations to date
0
Altmetric
Cummings Special Issue

Improving the accuracy of computing chemical potentials in CFCMC simulations

ORCID Icon, ORCID Icon, ORCID Icon & ORCID Icon
Pages 3493-3508 | Received 10 Apr 2019, Accepted 30 May 2019, Published online: 19 Jun 2019

ABSTRACT

The CFCMC simulation methodology considers an expanded ensemble to solve the problem of low insertion/deletion acceptance probabilities in open ensembles. It allows for a direct calculation of the chemical potential by binning of the coupling parameter λ and using the probabilities p(λ=0) and p(λ=1), which require extrapolation. Here, we show that this extrapolation leads to systematic errors when the distribution p(λ) is steep. We propose an alternative binning scheme which improves the accuracy of computed chemical potentials. We also investigate the use of multiple fractional molecules needed in simulations of multiple components, and show that these fractional molecules are very weakly correlated and that calculations of chemical potentials are not affected. The statistics of Boltzmann averages in systems with multiple fractional molecules is shown to be poor. Good agreement is found between CFCMC averages (uncorrected for the bias) and Boltzmann averages when the number of fractional molecules is less than 1% of the total number of all molecules. We found that, in dense systems, biased averages have a smaller uncertainty compared to Boltzmann averages.

GRAPHICAL ABSTRACT

1. Introduction

Knowledge on Vapor–Liquid Equilibrium (VLE)/reaction equilibria and chemical potentials is important for process design and modelling [Citation1–3]. The past decades, force field-based molecular simulation has been developed as an attractive alternative for experiments, to accurately describe the behaviour of matter, and to obtain reliable thermodynamic and transport properties [Citation4–10]. Force field-based molecular modelling is used extensively for studying phase equilibria of pure and multicomponent systems [Citation11–15], describing the behaviour of guest molecules inside porous media [Citation16–19], and reaction equilibria [Citation19–25] etc. In his pioneering work in 1987, Panagiotopoulos introduced the Gibbs Ensemble (GE) to directly determine the phase coexistence properties using Monte Carlo (MC) simulations [Citation26–28]. In the GE, sufficient molecular exchanges between the phases leads to equal chemical potentials (which are directly related to activity/fugacity coefficients). The chemical potentials of components in each phase can be obtained from GE simulations using a variation of Widom's Test Particle Insertion (WTPI) method [Citation29], taking into account the density fluctuations of each phase [Citation2]. Computation of the chemical potential in the GE is an independent and important check on chemical equilibrium [Citation1], and it can also be used to detect programming errors and errors in the implementation of the simulation technique.

The GE is widely used for VLE calculations [Citation1,Citation28]. It is a simple and fast method to obtain relatively accurate critical properties for most systems, using relatively small system sizes [Citation15,Citation30]. For accurate VLE calculations in the GE, one relies on sufficient molecule exchanges between the phases. A major drawback is that the acceptance probabilities of molecule insertions/deletions are very low in dense systems or systems with strong/directional intermolecular interactions, e.g. for water at ambient conditions [Citation3,Citation31]. Another drawback is that computing the excess chemical potential in the GE using insertion/deletion methods [Citation29,Citation32–35] suffers severely from molecule overlaps or random cavity formation. Methods based on the WTPI method are known to perform poorly for high density systems, even when combined with CBMC or related methods [Citation1,Citation31,Citation36,Citation37]. Due to the difficulties associated with free energy calculations and molecule exchanges in systems with high densities, other methods are required to facilitate phase equilibrium calculations in MC simulations.

To solve the sampling problems of the WTPI method, alternative methods are developed to obtain chemical potentials by combining particle insertions and removals [Citation38,Citation39], or by gradual insertions/deletions in multiple MC steps such that the surrounding molecules can adjust to the molecule that is inserted or deleted [Citation37,Citation40,Citation41]. In the past decades, the idea of gradual insertion/deletion was used for different systems, see the works of Mon et al. [Citation40], Squire et al. [Citation42], Mruzik et al. [Citation43] and de Pablo from the 90s [Citation44]. A few years ago, the Continuous Fractional Component Monte Carlo (CFCMC) technique was developed by Shi and Maginn [Citation45,Citation46], leading to efficient molecule exchanges in open ensembles. The main difference with other methods is that the gradual insertion of molecules is continuous, rather than in discrete stages [Citation47,Citation48]. The CFCMC method has been applied to the NPT/NVT ensemble [Citation49], grand-canonical (GC) [Citation50], Gibbs Ensembe (GE) [Citation45,Citation46,Citation49,Citation51] and the reaction ensemble (RxMC) [Citation25,Citation52]. In the CFCMC method, a fractional molecule with scaled interactions with the surroundings is added to the ensemble. A coupling parameter λ is introduced as an extended variable in an expanded ensemble, and trial moves are carried out to change the value of λ. The fractional molecule is distinguishable from the other ‘whole’, or normal molecules. The value λ=0 means that the fractional molecule does not interact with other molecules in the simulation box and acts as an ‘ideal gas’ molecule. The value λ=1 means that the fractional molecule is fully interacting with other molecules in the system, and thus acts as a ‘whole’ molecule. To further increase the efficiency of molecule exchanges, an additional biasing potential W(λ) can be used to ensure that the sampled probability distribution of λ is flat [Citation45,Citation46,Citation53,Citation54]. The Lennard-Jones (LJ) interactions of the fractional molecule with the rest of the molecules is often scaled as follows [Citation49,Citation51,Citation52,Citation55]: (1) uLJr,λLJ=λLJ4ϵ1121λLJ2+rσ621121λLJ2+rσ6(1) in which, σ and ε are the LJ parameters and r is the intermolecular distance between two interaction sites. In principle, other thermodynamic pathways are possible to scale the interactions of the LJ molecule between λ=0 and λ=1 [Citation56–58]. The scaling of the electrostatic interactions are explained in Refs. [Citation11,Citation52,Citation55]. In principle, the λ-space can be chosen discrete [Citation47] or continuous [Citation45,Citation46,Citation51]. If the λ-space is discrete, it is limited to a certain number of states between (and including) 0 and 1. To avoid high energy barriers for gradual insertions/removals, the number of these states has to be carefully chosen for each system. The main new element of the method by Shi and Maginn is that λ has been changed from a discrete parameter into a continuous parameter [Citation45,Citation46]. The advantages of having a continuous λ-space is that changes in λ (denoted by Δλ) can be adjusted during the simulation to facilitate transfers between intermediate λ states. Since in CFCMC simulations, insertions/deletions are performed with fractional molecules, biasing of λ is used to improve molecule transfer efficiency [Citation45,Citation46,Citation51,Citation52]. Adaptive computation of the weight function W(λ) is performed iteratively to obtain a flat distribution of λ [Citation53,Citation54]. This significantly improves the efficiency of CFCMC simulations. Using an optimum weight function in the simulations ensures smooth transitions between λ=0 and λ=1. In CFCMC simulations, ensemble averages of thermodynamic properties can be computed, either Boltzmann averages or biased averages (uncorrected for the bias introduced by the biasing potential W(λ)). The Boltzmann average of any observable X is obtained from [Citation51,Citation52]: (2) XBoltzmann=XexpWλCFCNPTexpWλCFCNPT.(2) Equation (Equation2) is used to transform the averages back to the CFCNPT ensemble [Citation51,Citation52]. Biased averages are obtained by taking the normal averages without correcting for the bias: (3) XBiased=i=1NSXNS,(3) where NS is the number of times X is sampled. The averages of Equation (Equation3) may be considered as approximations for averages in the CFCNPT ensemble, which in turn are approximations for averages in the conventional NPT ensemble. As the CFCNPT and conventional NPT ensemble have a different number of degrees of freedom [Citation1,Citation49], ensemble averages in both ensembles are in principle different, but in practice these differences are small [Citation51,Citation52]. Based on the earlier work of Shi and Maginn [Citation45,Citation46], recent work of Vlugt and co-workers, combines CFCMC in open ensembles (GC, reaction ensemble, Gibbs ensemble) with free energy calculations, in which molecule transfers are facilitated by CFCMC [Citation51,Citation52]. In those CFCMC simulations, the excess chemical potential can be computed by sampling the Boltzmann probability distribution of the coupling parameter, p(λ). The ratio between p(λ=0) and p(λ=1) is directly related to the free energy difference of inserting a full additional molecule [Citation51,Citation52]. For a continuous λ-space, in this method, it is not possible to directly sample p(λ=0) and p(λ=1). One could only perform extrapolation on the averages of the few first/last bins to estimate p(λ=0) and p(λ=1). Therefore, it is necessary to use a binning scheme to sample the distribution p(λ). The excess chemical potential is related to the Boltzmann probability distribution of λ [Citation49,Citation51,Citation52]: (4) μex=1βlnp(λ1)p(λ0).(4) Here p(λ1) is the probability of λ0,1 approaching 1 and p(λ0) is the probability of λ approaching zero. Recently, free energy calculations using Equation (Equation4) were applied to phase equilibria and reaction equilibria: computation of chemical potentials of coexisting gas and liquid phases of water, methanol, hydrogen sulfide and carbon dioxide between T=220K and T=375K [Citation3], and computing the reaction equilibrium of the Haber-Bosch process for pressures between 100 bar to 1000 bar [Citation52,Citation59]. We also combined the recent CFCMC method with the idea of Frenkel, Ciccotti, and co-workers [Citation60,Citation61] to obtain partial derivatives of the chemical potential with respect to pressure and temperature in the expanded NPT ensemble. The method was also used to calculate the enthalpy of reaction of the Haber–Bosch process for pressures between 100 bar to 800 bar [Citation49].

In our current version of the CFCMC method  [Citation3,Citation49,Citation51,Citation52,Citation55], one relies on extrapolation to λ0 and λ1 to compute the excess chemical potential (Equation (Equation4)) which may affect the accuracy of the method. In Ref. [Citation51] it was proposed that in practice linear extrapolation of p(λ) is sufficient to calculate the excess chemical potential using Equation (Equation4). A clear distinction needs to be made between ‘precise’ and ‘accurate’ computation of the excess chemical potential. The values for the computed excess chemical potential may be systematically wrong (inaccurate) with small error bars (precise). This leads to a false impression of precision while missing accuracy (large difference from the actual value). This sampling issue appears especially for systems in which the number of bins, Nb, is insufficient to capture the steepness of distribution p(λ), leading to inaccurate extrapolation results. One could increase Nb to improve the accuracy of the extrapolation, however this leads to poor sampling of p(λ) (less statistics per bin) and therefore loss of precision of the extrapolation. Therefore, it is not a priori clear which value to select for Nb for different systems. In this work, we investigate how the accuracy of the extrapolation scheme changes with Nb, and we develop a much more accurate scheme that allows a continuous coupling parameter λ[0,1] without having to use extrapolation for chemical potential calculations. The new scheme allows sampling a continuous coupling parameter including the states λ=0 and λ=1. This means that the chemical potential is obtained independent of any extrapolation scheme since the states λ=0 and λ=1 are directly sampled. We will show that this significantly improves the accuracy of computed values of μex for systems with strong intermolecular interactions. In principle, the intermediate λ states can be either continuous or discrete. Continuous and discrete intermediate stages for λ are both commonly used in expanded ensembles [Citation45–47]. The advantage of having a continuous λ is that changes in λ can be adjusted to facilitate transfers between intermediate λ states. This eliminates the guesswork about how many intermediate stages are needed. When the number of intermediate stages is close to optimal, we do not expect much differences in the accuracy of the computed chemical potentials between continuous and discrete staging. The effect of Nb on the accuracy and precision of our new binning scheme is also investigated.

Simulations in the CFCMC ensemble with multiple fractional molecules may be used to study complex systems e.g. the multicomponent Gibbs ensemble [Citation62], the reaction ensemble [Citation49,Citation52] and the reaction ensemble combined with phase equilibria [Citation21,Citation23,Citation24]. It is not recommended to include more fractional molecules in the system than required. However, in many cases it is necessary to use multiple fractional molecules [Citation52]. Therefore, it is important to understand how multiple fractional molecules influence computed properties. For dense systems or systems in which Nfrac fractional molecules are present, the multidimensional weight function W(λ1,λ2,,λNfrac) becomes steeper with increasing Nfrac. This results in difficulties when sampling Boltzmann averages (Equation (Equation9)). In principle, Nfrac is the number of fractional molecule types in the simulation. This is important to consider when performing simulations in the reaction ensemble as fractional molecule types of reactants and reaction products are different [Citation52]. For the rest of this work, all fractional types are considered the same, however the conclusions are transferable to the reaction ensemble [Citation52]. Another drawback is the difficulty of computing the multidimensional weight function using an adaptive scheme such as the Wang–Landau algorithm [Citation53,Citation54]. To calculate the biasing function, a multidimensional histogram has to be filled until some flatness criterion is met, which can be difficult computationally. We find that splitting the multidimensional weight function into a sum of one-dimensional weight functions can improve the calculation of the biasing function W(λ) and sampling of Boltzmann averages. To the best of our knowledge, the effect of having multiple fractional molecules on the statistics of Boltzmann averages and biasing in CFCMC simulations are not systematically investigated/reported in literature. In this work, three important points relevant to systems with multiple fractional molecules are investigated: (1) The correlation between λ's of different fractional molecules are investigated.  (2) Sampling of Boltzmann averages using Equation (Equation2) is numerically difficult if the weight function is large. Due to this, sampling of the biased averages, Equation (Equation3), is an attractive alternative to Boltzmann averages in CFCMC simulations. Therefore, it is of interest to study the difference between the Boltzmann and biased averages for different systems. (3) The excess chemical potential is a thermodynamic property for any system state, independent of the number of the fractional molecules, Nfrac. Therefore, it is important to check whether the value of the computed chemical potentials varies with Nfrac.

This paper is organised as follows. In Section 2, a binning scheme is introduced as to directly sample the chemical potential of a component. For this scheme, a continuous coupling parameter λ(λ)[0,1] is introduced by a linear transformation of λ. The expression for computing the excess chemical potential using this method is described. The mathematical framework for calculating correlations between multiple fractional molecules in a single CFCMC ensemble simulation is described. The theory on using biased averages instead of Boltzmann averages is also discussed in this section. The direct sampling of λ(λ)=0 and λ(λ)=1 is tested both for a 2-atom model system consisting of two LJ molecules and liquid water. Simulation details, force field parameters and the scaling of the intramolecular interactions are described in Section 3. Our simulation results are presented in Section 4. It is shown that the excess chemical potential can be obtained accurately only by using the values from the first and the last bins of the histogram of p(λ(λ)), independent of any extrapolation scheme. Correlations between different λ's in CFCMC simulations with multiple fractional molecules are investigated in Section 4. The systems selected for this study are LJ colour mixtures with different numbers of fractional molecules, and equimolar mixtures of water and methanol with a fractional molecule of each molecule type. It is shown that fractional molecules are very weakly correlated (essentially uncorrelated) independent of the biasing. The differences associated with using Boltzmann averages and biased averages in CFCMC simulations with multiple fractional molecules are compared to Boltzmann averages obtained from the conventional NPT ensemble. The ensemble averages obtained from conventional NPT simulations are considered as a reference. The results show that in systems in which the ratio between the fractional molecules and the total number of molecules are below 1%, Boltzmann and biased averages for density, volume and energy are very similar. However, the error bars associated with Boltzmann averages can be an order of magnitude larger compared to biased averages, especially for dense systems. Our conclusions are summarised in Section 5.

2. Theory and computational methods

In our previous work, a continuous coupling parameter λ0,1, corresponding to each fractional molecule type was used in the partition function [Citation3,Citation11,Citation49,Citation51,Citation52,Citation63], and atomistic/molecular interactions were scaled with λ (e.g. according to Equation (Equation1)). Therefore, it was not possible to directly sample the system states in which exactly λ=0 or λ=1. Here, we introduce a coupling parameter λ(λ)[0,1] to calculate the atomistic/molecular interactions, including system states when the interactions of the fractional molecule are completely switched on or off. e.g. for LJ interactions, this means that λ in Equation (Equation1) is replaced by λ, which is a function of λ. λ(λ) is obtained from linear transformation of λ: (5) λ(λ)0,λ<1NbNbλ1Nb2,1NbλNb1Nb1,λ>Nb1Nb(5) in which Nb is the number of the bins. It is important to note that the extended parameter in the partition function is still λ0,1. Using the transformation of Equation (Equation5), only the interactions of the fractional molecule are scaled with λ(λ)[0,1] in an extra step. Note that the electrostatic interactions of the fractional molecule can also be scaled in a similar manner using the transformation of Equation (Equation5). It follows directly from Equation (Equation5) that λ(λ) is a continuous function at λ=1Nb and λ=Nb1Nb. Scaling the interactions of the fractional molecule using λ(λ) means that there are now two bins in λ space where interactions are completely switched on or off. Therefore, one can directly sample the probability of λ(λ)=0 in the first bin, and the probability of λ(λ)=1 in the last bin. The linear transformation of Equation (Equation5) is illustrated in Figure  for p(λ) and p(λ(λ)). The inset of this figure shows the function λ(λ). As shown in Figure (a), p(λ) is constructed by sampling the probability of λ where the λ space is binned at equal distances; [12,32,52,,Nb52,Nb32,Nb12] in units of 1Nb. The width of each bin, Δλ, equals 1Nb and value of λ assigned to each bin equals the middle of the bin, i.e. i1/2Nb. Therefore, the value of λ in the first and last bins correspond to λ=12Nb and λ=Nb1/2Nb, respectively, and not to 0 or 1. To calculate μex (Equation (Equation4)) from p(λ) instead of p(λ(λ)), one needs to perform a linear extrapolation on the first/last few points of p(λ) [Citation51]. The distribution p(λ(λ)) can be directly reconstructed from p(λ) in a single step using Equation (Equation5). As shown in Figure (b), p(λ) is constructed using bins with the values of [0,12,32,,Nb72,Nb52,1] in units of 1Nb2. This grid is continuous but non-equidistant. Using the new binning scheme, μex can be obtained directly using the probabilities of the first and the last bin, as shown in Figure (b): (6) μex=1βlnp(λ(λ)=1)p(λ(λ)=0).(6) In principle one could directly sample p(λ=0) and p(λ=1) without any biasing (and hence no binning is required). However, it is well-known that not applying a biasing function W(λ) significantly reduces the efficiency of the simulation [Citation51,Citation52]. In this work, we compare the differences between extrapolation, and direct sampling for calculating the chemical potential for different systems.

Figure 1. Linear transformation of the scaling parameter from λ (subfigure a) to λ (subfigure b). Based on the transformation of Equation (Equation5), the value λ(λ) is set to zero for the first bin of p(λ), and the value λ(λ) equals one for the last bin. When the interaction parameter λ(λ)=0, the fractional molecule behaves as an ideal gas, and when λ(λ)=1, the fractional molecule behaves exactly as a whole molecule. The inset shows how λ depends on λ (Equation (Equation5)).

Figure 1. Linear transformation of the scaling parameter from λ (subfigure a) to λ∗ (subfigure b). Based on the transformation of Equation (Equation5(5) λ∗(λ)≡0,λ<1NbNbλ−1Nb−2,1Nb≤λ≤Nb−1Nb1,λ>Nb−1Nb(5) ), the value λ∗(λ) is set to zero for the first bin of p(λ), and the value λ∗(λ) equals one for the last bin. When the interaction parameter λ∗(λ)=0, the fractional molecule behaves as an ideal gas, and when λ∗(λ)=1, the fractional molecule behaves exactly as a whole molecule. The inset shows how λ∗ depends on λ (Equation (Equation5(5) λ∗(λ)≡0,λ<1NbNbλ−1Nb−2,1Nb≤λ≤Nb−1Nb1,λ>Nb−1Nb(5) )).

The linear transformation of λ (Equation (Equation5)) can be easily implemented in the original CFCMC algorithm. For instance, the partition function of a mixture of S different monoatomic components in the NPT ensemble expanded with a fractional molecule equals [Citation49] (7) QCFCNPT=βPi=1S1Λi3NiNi!×1Λ301dλdVVN+1expβPV×dsNexp[βU(sN,V)]×dsfracAexp[βUfracA(sfracA,sN,λ(λ),V)](7) in which N is the total number of whole molecules which are distinguishable from the fractional molecule, S is the number of components, Λi is the thermal wavelength of component i, Λ is the thermal wavelength of the fractional molecule, U is the total potential energy of the whole molecules and UfracA is the interaction potential of the fractional molecule with the surrounding molecules scaled with λ(λ). No further changes are required for calculating the weight function W(λ) and p(λ) during the simulation [Citation3,Citation49,Citation52]. Only at the end of the simulation, p(λ) is transformed into p(λ(λ)) in a single step using Equation (Equation5). Note that the CFCNPT ensemble is used here as an example to explain the method. The linear transformation of the λ can be implemented in open ensembles in a similar manner. The linear transformation of λ(λ) has several advantages: (1) The first bin of p(λ) corresponds to system states where the interaction potential is completely switched off (λ(λ)=0). At λ(λ)=0, reinsertions of the fractional molecule at a randomly selected position [Citation49] are always accepted since the energy difference between the old and new configurations is zero. It is important to note that the fractional molecule is part of the ensemble partition function and is never deleted from the system even when λ(λ)=0. (2) The last bin of p(λ), (λ(λ)=1), corresponds to system states where the fractional molecule is interacting as a whole molecule. For λ=1, identity changes of the fractional molecule [Citation49] with a whole molecule are always accepted as the energy difference between the old and new configurations is zero. In the identity change trial moves, the fractional molecule is changed into a whole molecule of the same type, and a randomly selected whole molecule of the same molecule type is changed into a fractional molecule, while keeping the value of λ, positions and orientations of the molecules unchanged [Citation49,Citation51,Citation52]. The identity change trial move can also serve as an independent check of the correctness of the simulation code and the bookkeeping. Essentially, the transformation of Equation (Equation5) allows rigorous sampling of the states p(λ(λ)=0) and p(λ(λ)=1) during the simulation without performing extrapolation. This method combines the benefits of free energy calculations in the CFCMC simulations with rigorous sampling of states in which λ=0 and λ=1 [Citation47,Citation49,Citation51].

It is straightforward to extend the partition function of Equation (Equation7) to systems with multiple fractional molecules [Citation49]. In CFCMC simulations with multiple fractional molecules, the biasing function W is a multidimensional weight function [Citation52] used to improve the efficiency of molecule insertions/removals and smooth transitions between λ=0 and λ=1 for every fractional molecule. However, calculating a multidimensional adaptive biasing function requires filling and flattening a multidimensional histogram during a random walk in (λ1,λ2,) space, using a certain flatness criterion. Filling multidimensional histograms can be difficult with many fractional molecules in the system, e.g. using the Wang–Landau algorithm [Citation53,Citation54]. One could split the multidimensional biasing function into a series of one-dimensional biasing functions. For a system in which Nfrac fractional molecules are present, this leads to (8) Wλ1,λ2,λNfraci=1NfracWiλi.(8) Filling multiple independent one-dimensional histograms is computationally more straightforward than filling a single multidimensional histogram. The biasing is then calculated for each λi independently. In Equation (Equation8), it is assumed that the λi's are independent coupling parameters. If there would be a strong correlation between λ's, the computed Boltzmann averages are still correct. However, the sampling of the distributions p(λi) may be very inefficient due to neglected correlations between λ's (Equation (Equation8)). By combining Equations (Equation8) and (Equation2), the Boltzmann average of any observable X is obtained as follows (9) XBoltzmann=Xexpi=1NfracWiλiCFCNPTexpi=1NfracWiλiCFCNPT.(9) In many systems with strong intermolecular interactions or with multiple fractional molecules, the weight function i=1NfracWi(λi) is a large number, typically between 101 and 102 [Citation49,Citation55]. This means that the exponents in Equation (Equation9) are very small for such systems. This results in averaging over very small numbers, numerically close to zero, when sampling Boltzmann averages of Equation (Equation9). Therefore, taking Boltzmann averages for these systems may mostly lead to a 00 numerical problem for ensemble averages like volume and energy. Except for excess chemical potentials, most ensemble averages hardly depend on the instantaneous values of λ's. In Refs. [Citation51,Citation63], it was shown that the presence of multiple fractional molecules hardly influences the thermodynamic properties of the system however, the statistics of the Boltzmann averages are affected. To avoid the 00 sampling problem of the Boltzmann averages, a possible solution is to sample biased averages as shown in Equation (Equation3). Here, we investigate how computed averages change with the number of fractional molecules. Preferably, one should use as few fractional molecules as possible in production runs. If no fractional molecules are required, it is recommended to use conventional ensembles instead of expanded ensembles.

It is not a priori clear whether fractional molecules are weakly or strongly correlated. The requirement for efficient splitting of the biasing, Equation (Equation8), is that λi's are independent. To validate this, we compute the pairwise correlation between different λi's as a function of the number of fractional molecules in the system, while keeping the number of whole molecules constant. The pairwise correlation between two (randomly) selected λi's in a simulation can be calculated by computing the correlation: (10) Corrλ1,λ2=λ1λ2λ1λ2λ12λ12λ22λ22,(10) where λ1 and λ2 are the instantaneous values of two randomly selected coupling parameters during the single simulation. Equation (Equation10) can be applied to systems with and without biasing. In addition, we investigate how the presence of multiple fractional components influences the computed values of μex and other thermodynamic properties such as the average volume, density and energy.

3. Simulation details

As a proof of principle, the performance of the original binning scheme and the binning scheme of Equation (Equation5) are compared for a 2-atom model system consisting of two LJ molecules in one-dimensional phase space. Here, reduced units are used, so ϵ=1 and σ=1. The 2-atom model system has two degrees of freedom, namely the interatomic distance r and λ. The partition function for this ensemble equals: (11) Q=1L0Ldr01dλexp[βU(r,λ)],(11) where we selected L=3, in units of σ, β=1/T in reduced units, and T is the reduced temperature. The interaction potential U(r,λ) is a function of the distance r[0,3] and λ0,1, obtained from Equation (Equation1). By performing long simulations, we can compute p(λ) with brute-force sampling of λ and r. From the original binning scheme it follows that: (12) p(λ)=1L0Ldr01dλexp[βU(r,λ)]δ(λλ)1L0Ldr01dλexp[βU(r,λ)].(12) In the new binning scheme of Equation (Equation5), the term βU(r,λ) is replaced by βU(r,λ(λ)) and after the simulation the distribution p(λ) is converted to p(λ(λ)). Simulations are carried out at different temperatures between T=0.005 and T=2 in reduced units. For both binning schemes, the simulations at every temperature are repeated with different values of Nb ranging from 10 to 500. In each cycle, r and λ are randomly selected from uniform distributions, and the probability of λ is sampled using Equation (Equation12). To compare the simulation results, a reference value of p(λ=1) is obtained from direct sampling of the last bin from simulations carried out 10 times longer. Since the value of the last bin is directly sampled, no systematic errors are present in this reference value. To obtain p(λ1) in the original binning scheme, linear extrapolation is carried out using the last three points of the λ grid. p(λ(λ)=1) is obtained by directly sampling the last bin in the new binning scheme. For all the simulations, 108 random states of (r,λ) were generated to sample the probability of λ. To obtain the reference values for p(λ)=1, 109 random states of (r,λ) were generated.

Simulations of SPC/E [Citation64] water and TraPPE methanol [Citation65] are performed in the CFCNPT ensemble [Citation49] at T=323.15 K and p=1 bar. Both the original and the new binning scheme are used to compute excess chemical potentials. To investigate the effect of binning on chemical potential calculations, simulations are performed with different values of the number of bins, Nb, ranging from 5 to 100, for both binning schemes. All molecules are modelled as rigid objects, and the intermolecular potential consists only of LJ and Coulombic interactions. A cut off radius of 14 Å is used for LJ interactions, and the DSF version of the Wolf method [Citation66–70] is used for handling electrostatic interactions. Rc and α were set to 14 Å and 0.12 A1. For details on selecting Rc and α for water and methanol, the reader is referred to Refs. [Citation11,Citation55]. The LJ interactions of the fractional molecules are scaled using Equation (Equation1). The scaling of the Coulombic interactions of fractional molecules is described in Ref. [Citation55]. To protect the charges from overlapping, the LJ interactions of the fractional molecules are switched on before the electrostatics [Citation55–58,Citation71–73]. Analytic tail corrections and periodic boundary conditions are applied [Citation74]. The Lorentz–Berthelot mixing rule [Citation1,Citation74] is used to calculate cross interactions. Force field parameters for SPC/E water and TraPPE methanol are provided in Table S1 of the Supporting Information. Simulations in the CFCNPT ensemble of the SPC/E water [Citation64] are started with with 105 equilibration cycles, followed by 4×106 production cycles. In each MC cycle, the number of trial moves equals the total number of molecules, with a minimum of 20. The trial moves are selected with the following probabilities: 1% volume changes, 35% translations, 30% rotations, 17% λ changes, 8.5% reinsertions of fractional molecules at randomly selected positions, and 8.5% identity changes of fractional molecules.

Simulations of LJ colour mixtures (σ=1 and ϵ=1) are carried out in the CFCNPT and NPT ensembles, at T=2 and pressures between P=0.5 and P=0.6. For these systems, the LJ interactions were truncated and shifted at 2.5σ. In the CFCNPT simulations, 800 whole molecules are present. For every temperature and pressure, the simulations are repeated with different number of fractional molecules, 3<Nfrac<50 while keeping the number of whole molecules constant. In practice, when studying complex molecular systems, Nfrac is nearly always below 5 [Citation3,Citation6,Citation11,Citation25,Citation49,Citation51,Citation52,Citation55,Citation75]. Larger values of Nfrac can be considered as an extreme situation to test the limits of the CFCMC method. The percentage of the fractional molecules in the CFCNPT simulations prf, changes between 0.125% and 6.25%. At each temperature and pressure, simulations are carried out with 105 equilibration cycles to equilibrate the system. From the equilibrated configurations, 106 productions runs are carried out to sample both Boltzmann averages, Equation (Equation9), and biased averages, Equation (Equation3). For the CFCNPT simulations, the trial moves in every MC step are selected with the following probabilities: 1% volume changes, 49% translations, 20% λ changes, 15% reinsertions of fractional molecules at a randomly selected position and 15% identity changes of fractional molecules. The trial moves in simulations in the conventional NPT ensemble (i.e. without fractional molecules) are selected with probabilities: 1% volume changes and 99% translations. All trial moves are accepted or rejected based on the Metropolis acceptance rules [Citation1].

4. Results

MC simulations are performed for the 2-atom model system in the ensemble of Equation (Equation11), between T=0.005 and T=2. The distributions p(λ) and p(λ) are sampled using Equation (Equation12). Linear extrapolation is performed on the last three bins of p(λ) to calculate p(λ1). The value of p(λ(λ)=1) is obtained by the direct sampling scheme. The results obtained for temperatures between T=0.005 and T=0.05 are shown in Table , and the raw data for temperatures between T=0.1 and T=2 are provided in Tables S2 and S3 of the Supporting Information. In Table , it is shown that the reference values obtained from the direct sampling of the last bin are very similar, independent of the number of bins Nb. The results from the extrapolation scheme systematically deviate from the reference values for small Nb, while the uncertainties (standard deviation of the mean) are very small. This leads to a false impression of accuracy. Good agreement between the results based on the extrapolation scheme and the reference values is found with increasing Nb. However, a larger value of Nb leads to a significant increase of the uncertainty of the results (between 1 and 4 orders of magnitude) for the extrapolation scheme. Therefore, it is difficult to a priori know what a sufficient Nb is for the extrapolation scheme. In sharp contrast to the extrapolation scheme, the magnitude of uncertainty does not change significantly with Nb for the direct sampling scheme. Excellent agreement is found between the results obtained from the direct sampling scheme and the reference values, independent of Nb. The simulation results clearly show that the direct sampling scheme is far less affected by the sampling issues pronounced in the extrapolation scheme. Therefore, the direct sampling scheme is recommended as the best method.

Table 1. Comparison of p(λ=1) for the 2-atom model system in the temperature range between T=0.005 and T=0.05, using different number of bins ranging from 10 to 500.

To map all results in a single plot, the corresponding bin size Δλ=1/Nb is used as a scaling factor to scale p(λ) at every temperature. The scaled probabilities are shown in Figure . The advantage of this representation is that the results obtained at multiple temperatures can be shown in a single plot. As an alternative, a plot of p(λ=1)/pref(λ=1) versus Nb for different temperatures is provided in Figure S1 of the Supporting Information. From Figure , it is clear that the extrapolation scheme reaches its limitation for Δλp(λ=1)1. In Figure  it is observed clearly that the performance of the extrapolation scheme depends both on Δλ=1/Nb and the steepness of the distribution p(λ). This means that in sharp contrast to the direct sampling, the accuracy of the extrapolation scheme strongly relies on Δλp(λ), especially when p(λ) is steep. As shown in Figure , the values for Δλp(λ=1) obtained from direct sampling scheme are in excellent agreement with the reference values.

Figure 2. Comparison of scaled p(λ=1) for the 2-atom model system in the temperature range between T=0.005 and T=2, using different number of bins ranging from 10 to 500. To map all results for all temperatures in a single plot, for each system, the corresponding bin size Δλ is used as a scaling factor for p(λ=1). Alternatively, a plot of p(λ=1)/pref(λ=1) versus Nb for different temperatures is provided in Figure S1 of the Supporting Information. The vertical axis is used for the scaled probabilities obtained based on the extrapolation scheme (squares) and direct sampling (circles). The horizontal axis is used for the reference scaled probabilities Δλpref(λ=1) obtained from very long MC simulations, using direct sampling (thereby eliminating systematic errors). Raw data are listed in Tables S2 and S3 in the Supporting Information.

Figure 2. Comparison of scaled p(λ=1) for the 2-atom model system in the temperature range between T∗=0.005 and T∗=2, using different number of bins ranging from 10 to 500. To map all results for all temperatures in a single plot, for each system, the corresponding bin size Δλ is used as a scaling factor for p(λ=1). Alternatively, a plot of p(λ=1)/pref(λ=1) versus Nb for different temperatures is provided in Figure S1 of the Supporting Information. The vertical axis is used for the scaled probabilities obtained based on the extrapolation scheme (squares) and direct sampling (circles). The horizontal axis is used for the reference scaled probabilities Δλpref(λ=1) obtained from very long MC simulations, using direct sampling (thereby eliminating systematic errors). Raw data are listed in Tables S2 and S3 in the Supporting Information.

The relative uncertainties of p(λ=1) obtained from the simulations of the 2-atom model system are shown in Figure , as a function of number of the bins. σ is the uncertainty of p(λ=1). It is clear that for small Nb, the relative uncertainties obtained using the extrapolation scheme are smaller compared to those obtained from the direct sampling. This indicates that the results obtained from the extrapolation scheme may be more precise but less accurate. For large Nb the relative uncertainties for both methods are very similar. Very similar results for p(λ)=1 are obtained for both methods when Nb is large. Based on the results obtained from the 2-atom model system, it is obvious that the direct sampling scheme is the best method with the least dependence on Nb. This is an important advantage as it may be difficult to a priori know the best value for Nb for the other schemes.

Figure 3. Relative uncertainty computed for the sampled p(λ=1) for the 2-atom model system, σp(λ=1)/p(λ=1), using (a) linear extrapolation, Equation (Equation4), and (b) the direct sampling scheme, Equation (Equation5) as a function of number of the bins. The simulations are performed at reduced temperatures: T=0.05 (filled triangles), T=0.5 (upward-pointing triangles), T=1.0 (squares) and T=1.5 (down-ward pointing triangles).

Figure 3. Relative uncertainty computed for the sampled p(λ=1) for the 2-atom model system, σp(λ=1)/⟨p(λ=1)⟩, using (a) linear extrapolation, Equation (Equation4(4) μex=−1βlnp(λ↑1)p(λ↓0).(4) ), and (b) the direct sampling scheme, Equation (Equation5(5) λ∗(λ)≡0,λ<1NbNbλ−1Nb−2,1Nb≤λ≤Nb−1Nb1,λ>Nb−1Nb(5) ) as a function of number of the bins. The simulations are performed at reduced temperatures: T∗=0.05 (filled triangles), T∗=0.5 (upward-pointing triangles), T∗=1.0 (squares) and T∗=1.5 (down-ward pointing triangles).

As an example of a system with strong LJ and electrostatic interactions, the excess chemical potential of SPC/E water is computed at T=323.15 K and P=1 bar, in the CFCNPT ensemble. The probabilities p(λ0) and p(λ1) are computed using extrapolation scheme, and p(λ=0) and p(λ=1) are obtained from the direct sampling. The excess chemical potential of water is computed using Equation (Equation4) for extrapolation, and Equation (Equation6) for the direct sampling. The simulations in the CFCNPT ensemble are repeated for different Nb ranging from 5 to 100. The distributions p(λ) are scaled with Δλ=1/Nb and the results are shown in Figure . Alternatively, plots of p(λ)/pref(λ) versus Nb for p(λ=0) and p(λ=1) are provided in Figure S2 of the Supporting Information. Raw data for Figure  are provided in Tables S4 to S7 of the Supporting Information. In Figure (a), overall good agreement between all methods is observed except for one outlier for the extrapolation scheme for very few bins (Nb=5). This means selecting five bins for the entire λ space is not sufficient even for extrapolation to λ0 where p(λ) is relatively flat. The distributions p(λ) and p(λ) for water are shown in Figures S3 and S4 of the Supporting Information. The choice of five bins may not be practical for CFCMC simulation, but it is considered here only to investigate the limitations of Equations (Equation6) and (Equation4). The scaled probabilities of λ=1 are shown in Figure (b). The performances of both methods to obtain p(λ=1) for water are very similar to what is observed for the 2-atom model system, as shown Figures  and . The results of the extrapolation scheme deviate significantly from the reference values when Δλp(λ=1)>1. The direct sampling scheme is clearly the best method to calculate p(λ=0) and p(λ=1). The excess chemical potential of water is calculated based on the extrapolation scheme using Equation (Equation4), and the direct sampling using Equation (Equation6). The results are compared to a reference simulations that are 10 times longer, where the excess chemical potential is obtained based on the direct sampling scheme. The relative difference between both methods and the reference are shown in Figure . It can be seen in Figure  that the accuracy of the extrapolation scheme improves with increasing Nb, while the accuracy of direct sampling scheme is hardly influenced by a change in Nb. However, very large values of Nb makes computing μex more difficult as the statistics of the computed occupancy of the bins of p(λ) are reduced. As shown in Figure S5 of the Supporting Information, the free energy barrier as a function of λ that the system needs to overcome is about 12kBT at T=323 K. Using fewer bins for the weight function increases the free energy barrier between adjacent λ bins, which affects the statistics. Increasing the number of bins results in decreasing the free energy barrier between adjacent bins. However, increasing the number of bins also decreases the statistics of the computed occupancy of bins. The relative difference with respect to the reference values observed for the direct sampling scheme is about one to two orders of magnitude smaller compared to those for the extrapolation scheme. The results clearly show that the direct sampling scheme outperforms the extrapolation scheme. The Boltzmann probability distribution of p(λ) for water and methanol in equimolar water–methanol mixture at T=323.15 K and P=1 bar are also shown in Figure S6 of the Supporting Information.

Figure 4. Comparison of the scaled probability distributions (a): p(λ)=0 and (b): p(λ=1) for the SPC/E water at T=323 K and P=1 bar, using different number of bins ranging from 5 to 100. To map all results in a single plot, for each system, the corresponding bin size Δλ is used as a scaling factor for p(λ=0) and p(λ=1). Alternatively, plots of p(λ)/pref(λ) versus Nb for p(λ=0) and p(λ=1) are provided in Figure S2 of the Supporting Information. The vertical axis is used for the scaled probabilities obtained based on the extrapolation scheme (squares) and direct sampling (circles). The horizontal axis is used for the reference scaled probabilities pref(λ=0) and Δλpref(λ=1) obtained longer MC simulations, using direct sampling. Raw data are listed in Tables S4 to S6 in the Supporting Information.

Figure 4. Comparison of the scaled probability distributions (a): p(λ)=0 and (b): p(λ=1) for the SPC/E water at T=323 K and P=1 bar, using different number of bins ranging from 5 to 100. To map all results in a single plot, for each system, the corresponding bin size Δλ is used as a scaling factor for p(λ=0) and p(λ=1). Alternatively, plots of p(λ)/pref(λ) versus Nb for p(λ=0) and p(λ=1) are provided in Figure S2 of the Supporting Information. The vertical axis is used for the scaled probabilities obtained based on the extrapolation scheme (squares) and direct sampling (circles). The horizontal axis is used for the reference scaled probabilities pref(λ=0) and Δλpref(λ=1) obtained longer MC simulations, using direct sampling. Raw data are listed in Tables S4 to S6 in the Supporting Information.

Figure 5. Relative difference (in percent) in the computed excess chemical potential of SPC/E water at T=323 K and P=1 bar using the extrapolation scheme Equation (Equation4) (squares), and the direct sampling Equation (Equation6) (circles). The chemical potential obtained using direct sampling from longer MC simulations is considered as the reference value for the chemical potential. The raw data are provided in Table S7 of the Supporting Information.

Figure 5. Relative difference (in percent) in the computed excess chemical potential of SPC/E water at T=323 K and P=1 bar using the extrapolation scheme Equation (Equation4(4) μex=−1βlnp(λ↑1)p(λ↓0).(4) ) (squares), and the direct sampling Equation (Equation6(6) μex=−1βlnp(λ∗(λ)=1)p(λ∗(λ)=0).(6) ) (circles). The chemical potential obtained using direct sampling from longer MC simulations is considered as the reference value for the chemical potential. The raw data are provided in Table S7 of the Supporting Information.

To investigate the correlation between the fractional molecules, simulations in the CFCNPT ensemble of LJ colour mixtures with multiple fractional molecules are carried out at a reduced temperature of T=2 and a reduced pressure of P=6. The simulations are repeated by keeping the number of whole molecules constant (800) while changing Nfrac between 3 and 50. The instantaneous λ's for two randomly selected fractional molecules are recorded every 100 MC cycles. Simulations are performed both with and without biasing. Calculation of the optimal biasing leads to a flat distribution in λ space during the simulation, the so-called observed p(λi), denoted by pobs(λi). It is expected that the average λi is close to 0.5 when an optimum biasing is used.  Equation (Equation10) is used to calculate the covariance between the two randomly selected coupling parameters and the results are shown in Table . The correlation between λ1 and λ2 is very weak independent of the biasing. The averages λ1 and λ2 are around 0.5 for the simulations when biasing is used. The correlation between for λ1 and λ2 is very weak for all the systems studied, independent of the number of the fractional molecules present in the system. The changes in the correlation between λ1 and λ2 appear to be very small and random with respect to changes in Nfrac. λ1 and λ2 are also weakly correlated when no biasing is used (W(λ)=0), as shown in Table . Obviously, the average λi0.5 when no biasing is used (except for ideal gas). It is clear that the coupling parameters are not correlated in simulations in the CFCNPT ensemble, independent of the weight function W(λ). No significant change in the correlation between λ1 and λ2 is observed when varying Nfrac.

Table 2. Correlations between two randomly selected fractional molecules in a LJ colour mixture at T=2 and P=6.

As an example of a atomistic system with electrostatic interactions, in an equimolar water–methanol mixture of water–methanol the correlation between the fractional molecules of water and methanol is studied. The results are obtained by performing simulations in the CFCNPT ensemble. Coupling parameters λ1 and λ2 are assigned to the fractional molecules of water and methanol, respectively. It is clear from Table  that λ1 and λ2 are very weakly correlated or essentially uncorrelated. In the simulation of water–methanol with non-zero biasing, the averages λ1 and λ2 are close to 0.5. This is due to the fact that the observed p(λ) for water and methanol is flat. The values for λ1 and λ2 are very close to 1 when the weight function W(λ) is zero. This is due to the fact that the interactions between the fractional molecules and the whole molecules are most favourable when the value of the coupling parameters are close to 1. Figures for p(λ) and W(λ) for water–methanol simulations are provided in Figs. S3 and S4 of the Supporting Information. Since the fractional molecules are not correlated, we can verify that the approximation of Equation (Equation8) is valid.

Table 3. Correlations between the fractional molecules of SPC/E water and traPPE methanol at T=323.15 k and P=1 bar.

To investigate the effect of biasing on sampling Boltzmann averages (Equation (Equation9)) two LJ colour mixtures are considered in which 1 and 5 fractional molecules are present, respectively. The optimum biasing is calculated using the Wang-Landau algorithm at P=6 and T=2. During the simulations, the instantaneous weight factor exp[i=1NfracWi(λi)] for both systems is recorded every 100 cycles and the results are shown in Figure . The instantaneous weight factor is the statistical weight of a sample system state. It is shown in Figure  that the statistical weight for the system including five fractional molecules fluctuates mostly between 109 and 104, and quite rarely, between 104 and 102. Multiplying any observable X by such a small number (weight) results in very small numbers, or practically ‘zero’, resulting in poor statistics for XBoltzmann. The sum of weights in the denominator of Equation (Equation9) is also a very small number close to zero. This is the aforementioned numerical problem of 00 when computing Boltzmann averages using Equation (Equation9). For the system including a single fractional molecule, the weight fluctuates between 102 to 100 during the simulation. Based on Figure , it can be concluded that the uncertainty in the Boltzmann average of any observable X increases with the increase in the number of fractional molecules.

Figure 6. Instantaneous weight factor, exp[i=1NFWi(λi)], for a LJ system with 1 fractional molecule (triangles) and 5 fractional molecules (circles), at T=2 and P=6. Wi(λi) is set such that pobs(λi) for every fractional molecule is flat.

Figure 6. Instantaneous weight factor, exp⁡[−∑i=1NFWi(λi)], for a LJ system with 1 fractional molecule (triangles) and 5 fractional molecules (circles), at T∗=2 and P∗=6. Wi(λi) is set such that pobs(λi) for every fractional molecule is flat.

One possible solution to circumvent the sampling of Boltzmann averages in simulations with multiple fractional molecules, is to directly sample the averages without removing the biasing (Equation (Equation3)). Xbiased is the average of observable X in simulations in the CFCMC ensemble. To compare the statistics of the Boltzmann and biased averages, we have selected the average volume of the system in the CFCNPT simulations. The Boltzmann and biased ensemble averages of volume obtained from the CFCNPT ensemble simulations, with prf between 0.125% and 6.25%, are calculated for P=1 and P=6. prf is the ratio between the number of the fractional molecules with respect to the number of the whole molecules, expressed as a percentage. The Boltzmann average of volume in the NPT is computed for the same number of whole molecules at the same temperature and pressure as a reference value. The relative uncertainty of the volume of every system is shown in Figure  as a function of prf. The normalised uncertainty of the volume obtained from the NPT ensemble simulations is shown on the vertical axis. It is shown in Figure (a) that at a number density ρNPT=0.43, the normalised uncertainties of the Boltzmann and biased averages of the volume are very similar for prf1.25%. Good agreement is observed with the results from the NPT ensemble simulations. However, poor statistics are observed for increasing prf. As shown in Figure (b), the differences between the averages obtained from Equations (Equation9) and (Equation3) are more pronounced at higher densities (ρNPT=0.80). It is observed in Figure (b) that the sampling of the Boltzmann average of the volume is significantly affected with increasing prf, in sharp contrast to the biased averages. The uncertainty of the biased average of volume does not change significantly for increasing prf. This is due to the aforementioned 00 sampling problem. Excellent agreement is observed between the relative uncertainties of biased averages of volume and the results obtained from the NPT ensemble. Raw data for Figure  are provided in Tables  and .

Figure 7. Relative uncertainty of the Boltzmann averages of the volume, σ/V, (triangles) and the biased averages of volume (circles) in the CFCNPT ensemble, at (a) T=2, P=1 and (b) T=2, P=6. prf is the ratio between the number of the fractional molecules with respect to the number of the whole molecules (constant 800), expressed as a percentage. The relative uncertainty of V is defined as the ratio of the uncertainty of the volume σV to the mean volume V. The arrows on the left indicate the value of the relative uncertainty of volume obtained from the NPT simulations, on the vertical axes. Raw data are provided in Tables  and .

Figure 7. Relative uncertainty of the Boltzmann averages of the volume, σ/⟨V⟩, (triangles) and the biased averages of volume (circles) in the CFCNPT ensemble, at (a) T∗=2, P∗=1 and (b) T∗=2, P∗=6. prf is the ratio between the number of the fractional molecules with respect to the number of the whole molecules (constant 800), expressed as a percentage. The relative uncertainty of V is defined as the ratio of the uncertainty of the volume σV to the mean volume ⟨V⟩. The arrows on the left indicate the value of the relative uncertainty of volume obtained from the NPT simulations, on the vertical axes. Raw data are provided in Tables 5 and 4.

Table 4. Relative differences between Boltzmann averages obtained from CFCNPT simulations and Boltzmann averages obtained from NPT simulations of different LJ colour mixtures, at T=2 and reduced pressures between P=0.5 to P=6.

Table 5. Relative difference between the biased averages obtained from the CFCNPT simulations and boltzmann averages obtained from the NPT simulations of different LJ colour mixtures, at T=2 and reduced pressures between P=0.5 to P=6. prf is the ratio between the number of the fractional molecules with respect to the number of the whole molecules (constant 800), expressed as a percentage.

The results in Figure  show that the biased average of volume in the CFCNPT ensemble simulations can be statistically more precise compared to the Boltzmann average of the volume. Therefore, it is instructive to investigate the difference between the Boltzmann and biased averages obtained from the CFCNPT simulations, with multiple fractional molecules, and the Boltzmann averages obtained from the conventional NPT ensemble. This may provide guidelines for how many fractional molecules are allowed before the Boltzmann/biased averages significantly deviate from those obtained from the conventional NPT ensemble simulations. Note that by increasing the number of fractional molecules, we are investigating the performance of the CFCMC method in extreme cases. In most practical applications Nfrac is usually smaller than five which means that prf is significantly smaller than 1% [Citation3,Citation6,Citation11,Citation25,Citation31,Citation49,Citation51,Citation52,Citation55,Citation75]. For this percentage of fractional molecules, very good estimations for conventional ensemble averages are obtained from CFCMC simulations [Citation3,Citation49,Citation51,Citation52]. For instance, CFCGE simulations of binary or ternary mixtures include at most two or three fractional molecules. For a reactive system of A+BC+D in the liquid phase where component A is volatile, three fractional molecules are required i.e. two fractional molecules of reactant molecules (A and B) or reaction products (C and D) and a fractional molecule of the type A in the gas phase. We also investigate how the excess chemical potential calculations are affected when prf increases. For these systems, the excess chemical potential of a randomly selected fractional molecule, μ1ex and the average of all the chemical potentials of all fractional molecules, μiex are shown in Table . As shown in this table, the uncertainty of μ1ex increases as the number of the fractional molecules in the system increases. This is because the simulation time is divided to perform random walks multidimensional λ space. However, the statistics of the chemical potential averaged over all fractional molecules μiex does not depend strongly on the number of fractional molecules in the colour mixture. This is due to the fact that all the intermolecular interactions in the colour mixture are similar. Therefore, the chemical potentials of all the LJ molecules in this simulation are equal.

The relative difference for ensemble averages of the energy, density and the volume in the CFCNPT simulations are compared to Boltzmann averages obtained from the NPT simulations. The results are provided in Tables  and . At p=6, the relative difference for the Boltzmann average of energy increases significantly with the increase in prf, in sharp contrast to the error associated with the biased average of energy. This shows once more that the sampling issue of Boltzmann averages in dense systems with multiple fractional molecules is more pronounced (because of larger biasing). It can be seen in Table  that the Boltzmann averages obtained from the CFCNPT ensemble where prf1% are very similar to those obtained from the NPT ensemble. For prf=1%, the relative difference for the Boltzmann averages density and volume in the CFCNPT ensemble are about 1% or smaller. We consider 1% as a typical uncertainty from simulations (also differences between experimental data and force field-based simulations are typically also of that order). This applies to normal averages e.g. density, volume etc, but not chemical potentials. The chemical potentials computed by CFCMC and without fractional molecule are usually identical [Citation51]. The relative error for the Boltzmann averages density and volume decreases to 0.3% by increasing the pressure to P=6. As shown in Table , good agreement is observed between the biased averages from the CFCNPT simulations and the Boltzmann averages from the NPT simulations for prf1% (typical differences are around 1%). The relative difference between the biased averages density and volume obtained from the simulations at P=1 and P=6 are smaller than 1%. For P=0.5, relative difference smaller than 1% are obtained for prf0.375%. It can be seen from Tables  and that the errors associated with the biased averages are smaller compared to the Boltzmann averages, especially at high densities. Therefore, it is possible to use biased averages in systems where prf1%. The advantage is that the statistics of biased averages may be better, depending on the system density, compared to Boltzmann averages. In practice, Nfrac is nearly always below 5 even for studying complex molecular systems [Citation3,Citation6,Citation11,Citation25,Citation49,Citation51,Citation52,Citation55,Citation75]. This means that for a system of 500 molecules (a relatively small system size), prf would nearly always be smaller than 1%.

5. Conclusions

An alternative binning scheme is presented to compute the excess chemical potential in CFCMC simulations. This scheme is developed to overcome sampling issues of the excess chemical potential associated with the linear extrapolation to λ0 and λ1 used in CFCMC simulations in our earlier work. The drawback of linear extrapolation is that precise values obtained for the excess chemical potential may provide a false impression of accuracy. Increasing the number of bins may improve the accuracy of the extrapolation scheme, however, this leads to poor sampling (larger uncertainty) of p(λ) for a fixed simulation time. It is a priori unclear what the optimum number of bins should be for a certain system. In the alternative binning scheme, the first and the last bins are directly used to sample the probability of the interaction parameters λ=0 (ideal gas behaviour) and λ=1 (fully scaled interactions), respectively. The excess chemical potential is computed by sampling the beginning and end states of λ rigorously (the direct sampling scheme). This method can be implemented in a single step in existing CFCMC codes by performing linear transformation of λ (Equation (Equation5)) when calculating the interaction potential of the fractional molecule with the surroundings. In sharp contrast to linear extrapolation, the accuracy and precision of this alternative binning scheme does not strongly depend on the number of the bins. As an example of a system with strong intermolecular interactions, we have computed the excess chemical potential of SPC/E water using both methods. We observed that the excess chemical potential is underestimated for SPC/E water using linear extrapolation to λ0 and λ1, since p(λ) is steep close to λ=1. Generally, this steepness is observed for dense systems or systems with large molecules or with strong intermolecular interactions. We found that the direct sampling scheme is the best method for chemical potential calculations. Very weak or no correlation was found between the fractional molecules in multicomponent systems. This allows one to effectively split a multidimensional weight function into a series of one-dimensional weight functions for every fractional molecule. Using this approach, filling a multidimensional histogram of the weight function is avoided, which is computationally not efficient, and a flatness criterion can be applied to each histogram separately. In systems where multiple fractional molecules are present, the weight function is typically large, which leads to the aforementioned 00 numerical problem associated with poor sampling of Boltzmann averages. Our solution is to use biased averages instead of Boltzmann averages. To have similar ensemble averages compared to those obtained from the conventional ensembles, it is recommended that the number of the fractional molecules does not exceed 1% of the total number of molecules. The threshold may be system dependent. In may practical applications, the percentage of fractional molecules is much lower than 1%. To investigate the limits of the CFCMC method, systems with higher percentage of fractional molecules were considered in this work. We have shown that increasing the number of the fractional molecules does not affect the value/accuracy of the excess chemical potential of each fractional molecule.

Disclosure statement

No potential conflict of interest was reported by the authors.

Additional information

Funding

This work was sponsored by NWO Exacte Wetenschappen (Physical Sciences) for the use of supercomputer facilities, with financial support from the Nederlandse Organisatie voor Wetenschappelijk Onderzoek (Netherlands Organization for Scientific Research, NWO). TJHV acknowledges NWO-CW for a VICI grant.

References