I must be missing something. I could not find an answer in similar posts.

Suppose I have an energy $E(x)$ and have sampled many points, $\{x_1, x_2, ..., x_N\}$ through a Metropolis Monte Carlo simulation. If the space is high enough dimension such that numerically integrating over the space is impossible, what are my options for estimating the partition function (or free energy)?

P.S. I don't really care about the accuracy of the estimate. This question is more for didactic reasons than for practical ones.

  • $\begingroup$ Sampled according to which distribution? -- Note that from a normalized sample of the Gibbs distribution, you cannot reconstruct the normalization (unless you use the sample to estimate the entropy and compute the free energy). $\endgroup$ Jul 8 at 9:40
  • $\begingroup$ What is each individual point $x_i$? $\endgroup$
    – GiorgioP
    Jul 8 at 9:55
  • $\begingroup$ Correct, I was assuming the canonical ensemble. And $x \in \mathbb{R}^N$ where $N$ is the dimension of the space. $x_i$ is a single point in $\mathbb{R}^N$ and is the $i$th point in the sample. $\endgroup$
    – edissnoon
    Jul 9 at 10:19

The aim of the Metropolis Monte Carlo method is to evaluate the main macroscopic thermodynamic quantities of a system. These quantities are evaluated through an ensemble average. The idea of the Metropolis algorithm is to replace ensemble averages with time averages on a sufficiently large number $M$ of steps. The partition function $Q$ does not represent a quantity of interest for this method since it is not required for the calculation of the acceptance probability and it is not even involved in the calculation of time averages. Moreover, $Q$ is not a function of the coordinates and depends only on the parameters $N, V, T$. I see from your question that you also refer to free energy $A=U-TS$. The evaluation of the energy average is quite straightforward: $$U=\frac{1}{M}\sum_{i=0}^{M}U(\vec{R}_{i})$$ with $\vec{R}_{i}=(\vec{r}_1...\vec{r}_N)$ is the set of all the coordinates at time $i$. On the other hand we need to be very careful in the entropy calculation: first of all, we cannot calculate the "real" thermodynamic entropy but a "coarse grained" function which not necessarily approximates the fine-grained entropy. The entropy and the free energy do not admit an explicit expression in time when the system is evolving, but we can compute the differences of these quantities between equilibrium states. Here I want to give a sort of recipe for the evaluation of $S$: one divides the phase space into $R$ cells (all with the same size) and calculates the "weights" $w_j$, i.e., the number of particles placed in the $j$-th cell divided by the number of particles $N$. Then the coarse-grained entropy is given by $$S=-\sum_{j=1}^{R}w_j\ln(w_j)$$ P.S.: when we run a computer simulation starting from everywhere in the state space, then we expect the distribution to be approximately stationary after a large number of steps, therefore one can discard the non-equilibrium values of the quantities in order to get a more precise evaluation of the integrals.

  • $\begingroup$ Thanks, but Im unclear on what you are suggesting the expression with the integral represents. It certainly is not a good estimate for the partition function as it only take the ith monte carlo step into account (rather the full sample of M steps). $\endgroup$
    – edissnoon
    Jul 9 at 10:12
  • $\begingroup$ Yes, your comment is right. That formula takes into account only the i-th step. In order to have a more complete information you should sum over M steps as it is suggested for S and U. I think I will edit my answer now. $\endgroup$ Jul 9 at 10:58
  • $\begingroup$ But your expression for the partition function does not seem correct now either. I have the sense that if my sample was uniformly distributed in $\mathbb{R}^N$ your method might work. But the sample is distributed $p(x)=e^{-\beta E(x)}$ since it comes from a Metropolis Monte Carlo simulation (I'm assuming the simulation is long enough to converge to equilibrium). $\endgroup$
    – edissnoon
    Jul 9 at 13:12
  • $\begingroup$ Mine was just an attempt, actually I don't think there is a real way to calculate the partition function from your simulation since it is does not depend on the coordinates of your system like U and S, in fact Q=Q(N, V, T). Therefore, you can't really pick up a sample of your partition function at every time step. $\endgroup$ Jul 9 at 14:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.