espressomd / espresso

The ESPResSo package
https://espressomd.org
GNU General Public License v3.0
228 stars 183 forks source link

Functions to calculate the non-bonded energy for a single particle #3924

Closed RudolfWeeber closed 3 months ago

RudolfWeeber commented 4 years ago

For MC simulations. Currently, the full energy needs to be calculated, even for single particle MC moves

KaiSzuttor commented 4 years ago

can this be done with electrostatics? are single particle MC moves efficient?

RudolfWeeber commented 4 years ago

can this be done with electrostatics? Up to a point, but I'm not going to do that near-term. E.g., you can reuse/update the P3M charge assignment and tune to high cao and low fft mesh sizes.

are single particle MC moves efficient? For the Gibbs ensemble, yes. However, moves that affect small clusters can make use of this, too.

My plan is to implement something along the lines of non-bonded loop with one partner fixed and a templateable kernel.

jonaslandsgesell commented 3 years ago

are single particle MC moves efficient?

It depends on the system. The fundamental problem with it, is that the correlations are high, resulting in the need of having to perform many single steps in order to obtain reliable average values (see Markov Chain central limit theorem).

Additionally MC moves typically need to be taylored to the system which is investigated. Here hybrid MC/MD schemes help.

RudolfWeeber commented 3 years ago

The single energy calculation is also needed for efficient particle insertion/removal as in the Gibbs scheme.

jonaslandsgesell commented 3 years ago

Do we have runtime measurements for a charged system? I have the impression that in this case most time is spent in the coulomb energy computation. If this part is not optimized, optimized energy computation of other non-bonded interactions (mainly LJ) won't help too much, right?

schlaicha commented 3 years ago

You have to get started somewhere, the logical order is to first reproduce a simple system (i.e. a LJ liquid) before turning to more complicated stuff. And in a second (third, fourth, etc.) step you can then also optimize electrostatics. Here you would re-use the interpolation of all other charges etc. So plenty of room for improvement, but again, start simple first!

schlaicha commented 3 years ago

are single particle MC moves efficient?

It depends on the system. The fundamental problem with it, is that the correlations are high, resulting in the need of having to perform many single steps in order to obtain reliable average values (see Markov Chain central limit theorem).

Additionally MC moves typically need to be taylored to the system which is investigated. Here hybrid MC/MD schemes help.

You can also have the exactly opposite where you make use of non-Markovian MC moves (Cluster algorithms etc) to overcome strongly correlated systems with large free energy barriers. Wang-Landau sampling is another alternative where often you don't want MD sampling. As said, it depends on the system. And the main advantage is that with efficient MC Espresso is able to perform Grand-Canonical simulations!

jonaslandsgesell commented 3 years ago

And the main advantage is that with efficient MC Espresso is able to perform Grand-Canonical simulations!

You can already do this now (It was excessively used by me and Peter ): https://github.com/espressomd/espresso/blob/python/samples/grand_canonical.py

It works and gives correct results.

jngrad commented 2 years ago

Progress report: #4401 introduced a core callback function particle_short_range_energy_contribution() to compute the non-bonded energy of particle pairs. For bond breaking MC moves and acid-base MC moves with P3M electrostatics, the short-range bonded energy and long-range non-bonded energy would have to be implemented.

RudolfWeeber commented 3 months ago

The non bonded energy contribution of a single particle is now available in Python. Closing for now. Better MC support for P3M is a different matter.