According to Wikipedia -

Periodic boundary conditions (PBCs) are a set of boundary conditions that are often chosen for approximating a large (infinite) system by using a small part called a unit cell.

When we are generating new locations in a box/cell, we can use a random number generator such that the locations never cross the boundary of that box/cell. Therefore, from the implementation point of view, we don't need periodic boundary conditions.

So, my question is, why do we even need periodic boundary conditions?

Wouldn't our simulations attain equilibration if we only use random numbers?

  • 4
    $\begingroup$ If you are not allowing particles to travel outside a certain area, that is a pretty harsh constraint not found in reality. What are you trying to model? if you are modelling a realistic bulk fluid, you can't constrain it so it only moves in a small box. $\endgroup$
    – B. Kelly
    Apr 28, 2022 at 21:24
  • 1
    $\begingroup$ Furthermore, your proposal only works for Monte Carlo simulations. The locations of particles at each step of a Molecular Dynamics simulation are not randomly generated. $\endgroup$
    – Hayden S
    Apr 28, 2022 at 23:57
  • $\begingroup$ @HaydenS it shouldn't work in Monte Carlo either to be honest. In Monte Carlo you should be calculating a random change in position, not an absolute coordinate. $\endgroup$
    – B. Kelly
    Apr 29, 2022 at 1:32

1 Answer 1


In (Metropolis) Monte Carlo one should be generating random changes in coordinates such that

\begin{equation} X_{new} = X_{old} + \Delta X \end{equation}

and we used a random number to generate $\Delta X$. So by all means, the particles have no reason to stop at a boundary provided the $\Delta X$ tells them to cross it. I don't know how one would keep particles inside a boundary without periodic boundary conditions.

If one was to bias the generation of $\Delta X$ in some way, we would probably not be maintaining detailed balance

There are cases where particles cannot cross a boundary, however, one needs to account for a physical boundary, such as in a nanopore or molecular sieve, by making a real boundary that interacts with particles.

If there is no periodic boundary conditions, rather than simulating a bulk fluid we will be simulating some cluster of molecules with a very real surface tension contribution that cannot be ignored. Some people study droplets, so this makes sense. However, if we want to study bulk fluids, we cannot have a system with such a large surface tension contribution.

It is a good idea to compare the simulation with what one is trying to model, and make sure the simulation reflects the reality of ones interests.

  • $\begingroup$ I don't know how one would keep particles inside a boundary without periodic boundary conditions. --- You run a loop to check to see if the newly generated random location is in the box/cell. If not, you continue to generate new locations until you find an appropriate location inside the box/cell. $\endgroup$
    – user366312
    Apr 29, 2022 at 7:09
  • 1
    $\begingroup$ @user366312 For this to work you will have to persuade us that details balance is maintained as the answer says. And even if you can do that I can assure you that for a many materials under standard conditions the procedure you propose will be, at best, extremely expensive - there just aren't enough holes big enough in the bulk. $\endgroup$
    – Ian Bush
    Apr 29, 2022 at 7:24
  • $\begingroup$ @user366312 I have published a paper doing similar to what you propose, but, the caveat is that you cannot pick particles at random, they are chosen with a probability proportional to their Rosenbluth weight, which is to say, the particle least comfortable, has the highest probability of being chosen. It is not Metropolis sampling though, and I infer, you are doing Metropolis sampling. In this other method, all moves are accepted, and if it was a bad move, that particle, or the one it overlaps, will likely be chosen next to be moved. I doubt it would work for polymers. Avgs are weighted. $\endgroup$
    – B. Kelly
    Apr 29, 2022 at 13:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .