MANIAC documentation

MANIAC is a lightweight Monte Carlo simulation code written in modern Fortran. It is designed for grand canonical Monte Carlo (GCMC) simulations used for constant chemical potential calculations, particularly useful in adsorption studies. The main difference between MANIAC and other Monte Carlo codes is that it reads basic LAMMPS-style topology files.

MANIAC supports the following Monte Carlo moves:

  • Translation - A molecule is randomly selected, and a translational move of random distance (shorter than a specified maximum value) and random direction is attempted. The move is accepted according to the Metropolis criterion:

    \[p_{\rm accept} = \min \left( 1, \mathrm{e}^{-\beta \Delta U} \right)\]

    where \(\Delta U\) is the change in potential energy due to the move and \(\beta = 1 / (k_\mathrm{B} T)\).

  • Rotation - A molecule is randomly chosen, and a random rotational move around a randomly selected axis is attempted, within a defined maximum rotation angle. The move is accepted using the same Metropolis criterion:

    \[p_{\rm accept} = \min \left( 1, \mathrm{e}^{-\beta \Delta U} \right)\]
  • Insertion - A new molecule is randomly inserted into the simulation box at a random position and orientation. The move is accepted according to the grand canonical acceptance criterion:

    \[p_{\rm accept} = \min \left( 1, \frac{V}{\Lambda^3 (N+1)} \mathrm{e}^{\beta \mu} \mathrm{e}^{-\beta \Delta U} \right)\]

    where \(V\) is the box volume, \(\Lambda\) is the thermal wavelength, \(N\) is the number of molecules before insertion, \(\mu\) is the chemical potential of the reservoir, and \(\Delta U\) is the energy change.

  • Deletion - An existing molecule is randomly selected and removed from the system. The acceptance probability is:

    \[p_{\rm accept} = \min \left( 1, \frac{\Lambda^3 N}{V} \mathrm{e}^{-\beta \mu} \mathrm{e}^{-\beta \Delta U} \right).\]
  • Swap - A molecule of type A is randomly selected and replaced with a molecule of type B at the same position with a random orientation. In the semi-grand canonical ensemble, the acceptance criterion for swapping type A to B is:

    \[p_{\rm accept} = \min \left( 1, \frac{N_A}{N_B + 1} \mathrm{e}^{-\beta (\Delta U + \mu_A - \mu_B)} \right)\]

    where \(N_A\) is the number of molecules of type A before the swap, \(N_B\) is the number of molecules of type B, \(\Delta U\) is the energy change, and \(\beta = 1 / (k_\mathrm{B} T)\), and where \(\mu_A\) and \(\mu_B\) are the chemical potentials of types A and B.

Why the name MANIAC?

The name MANIAC, or MANIAC-MC, is an homage to the original MANIAC computer (Mathematical Analyzer, Numerical Integrator, and Computer), built in the early 1950s at Los Alamos National Laboratory. This pioneering machine was among the first to perform Monte Carlo simulations for statistical physics and nuclear research. The MC in MANIAC reflects its core use of Monte Carlo methods.

LAMMPS compatibility

MANIAC uses the same .data file format as LAMMPS for molecular topology. MANIAC assumes that the real units system is used, and that a pair style of the family lj/cut/coul/long is used.