# fix gcmc - the meaning of N, X, M

Dear LAMMPS community,
I am trying to run GCMC and I got a bit confused by fix command. There are three different variables N, X, M. I want to run GCMC every timestep, therefore N=1. However, I somehow don’t get the meaning of X. If I set X = 10, then 10 items for insertion/deletion should be made, of which several are accepted. But in the end I will store information only about the last attempt?, right? In other words, does this mean that running:
fix 1 10 10

run 1
1

is equal to:
fix gcmc 1 1 1

run 10
10

?
What is the advantage of setting X > 1 then?

Kind regards,
Katarina

Dear LAMMPS community,
I am trying to run GCMC and I got a bit confused by fix gcmc command. There are three different variables N, X, M. I want to run GCMC every timestep, therefore N=1. However, I somehow don't get the meaning of X. If I set X = 10, then 10 items for insertion/deletion should be made, of which several are accepted. But in the end I will store information only about the last attempt?, right? In other words, does this mean that running:
fix gcmc 1 10 10
run 1
thermo 1

is equal to:
fix gcmc 1 1 1
run 10
thermo 10
?

no it isn't.

What is the advantage of setting X > 1 then?

X is the maximum number of molecules for which insertion/deletion is
attempted. M is how many tries are made for each. so in the worst
case, with 1 MD step using 1 10 10 up to a 100 insertion/deletion
attempts are made. with 1 MD steps and 1 1 1, only 10 attempts are
made. also, in the second case, your system has some (minimal) time to
relax.

specifically for dense systems, successful insertions are very
improbable, so lots of attempts are needed.

axel.

Dear Axel,
thank you for your comments. I am somehow confused with your explanation, because according to the manual:
N - invoke this fix every N steps
M - average number of MC moves to attempt every N steps; i.e. rotations and translations
X - average number of GCMC exchanges to attempt every N steps

So if I interpret this correctly: Let's assume that I set fix gcmc 1 10 10.
N=1 means that I call this fix every single step of "run" command (I run only MC simulation, no hybrid MC/MD).
X,M = 10 means that max. 10 insertions/deletions are made simultaneously with 10 transaltions/rotations (is it max, or average?).
So in total 10 trials are made during one cycle. Can you tell me which part of this interpretation is wrong? Which values are reasonable for X? Is there any way to test, which value is good for me?

Moreover, you say that with 1 MD steps and 1 1 1, only 10 attempts are made. Why 10?

In my case I have a water-zeolite system with a fixed framework - that's my motivation to run something like fix gcmc 1 1 1 - there is no need for dynamics.

Thank you
Kind regards,
Katarina

the best way to be certain is to make tests and benchmarks.

but moreover, from your description it sounds, like you should be
looking for a real monte carlo code. fix gcmc is not very efficient
(and not meant to be, as it was conceived to be used in conjunction
with MD runs, where monte carlo moves were applied infrequently) for
non-MD calculations. a typical example would be the diffusion of a
noble gas in a zeolithe framework. once you have to use long-range
electrostatics, e.g. in the case of water, things get *much* worse,
especially when trying to run in parallel.

Dear Axel,
thank you for your comments. I am somehow confused with your explanation, because according to the manual:
N - invoke this fix every N steps
M - average number of MC moves to attempt every N steps; i.e. rotations and translations
X - average number of GCMC exchanges to attempt every N steps

So if I interpret this correctly: Let's assume that I set fix gcmc 1 10 10.
N=1 means that I call this fix every single step of "run" command (I run only MC simulation, no hybrid MC/MD).
X,M = 10 means that max. 10 insertions/deletions are made simultaneously with 10 transaltions/rotations (is it max, or average?).
So in total 10 trials are made during one cycle. Can you tell me which part of this interpretation is wrong? Which values are reasonable for X? Is there any way to test, which value is good for me?

Moreover, you say that with 1 MD steps and 1 1 1, only 10 attempts are made. Why 10?

your example was stating 10 MD steps and a 1 1 1 setting.

axel.