
114 5 Simulation of Structural Phase Transitions in Crystals: The Metadynamics Approach
adapted for use with various MD codes. Since the exploration of the Gibbs free
energy landscape is performed by means of a series of NVT simulations (an
alternative continuous version of metadynamics is proposed in Ref. [21]), any MD
code is suitable if it allows for simulation of a crystal in a general (triclinic) supercell
and is able to calculate the stress tensor. The procedure can be performed by a
simple code acting as a driver which writes the input files for the MD simulation,
then calls the MD code executable via a system call and when the MD run is
completed, extracts the average value of the stress tensor, reads the MD output
files and writes new input files for the next run (Figure 5.1). The length of the MD
run should be sufficient to allow both for a good equilibration of the system after
change of the supercell induced by metadynamics and for a good averaging of the
stress tensor. Even more important, however, is to allow sufficient time for the
system to complete the transition, once this starts. Using too short simulation for
one metastep might result in creation of defective or even disordered structures,
since the structural transformation is disturbed by the rapidly changing supercell
before it is complete.
In the case of classical potentials the above requirements do not pose a practical
problem. For systems containing several hundreds of atoms an MD run of several
thousand MD steps, representing several ps, takes a wallclock time of the order
of 1 min. Since a typical metadynamics simulation takes of the order of hundred
metasteps, it can be readily performed in few hours on a PC. The situation is
different in the case of ab initio simulations. If the system is insulating and
point description is sufficient, for a typical system of about 100 atoms, running on
a parallel computer with 16 cores, one ionic step of ab initio Born–Oppenheimer
MD may take about 10 s. In such a case performing at each metastep an MD
run of several thousand steps might be prohibitively expensive. It is possible to
run metadynamics even performing at each metastep just few hundred MD steps
and in such case one metastep might take just few hours. A typical simulation of
hundred metasteps then could take about 10 days which is still feasible. In case of
systems requiring the use of k-points the situation is clearly more complicated and
here it is an advantage if the ab initio code is parallelized also over k-points and a
sufficient number of computing cores are available.
Since during a structural transition the system might release a large amount of
heat, it is convenient to use some kind of temperature control in order to prevent
melting or creation of structural defects. To this end, simple velocity rescaling
might be sufficient. If available in the MD code, more sophisticated thermostats
such as Berendsen thermostat [22] or Nose-Hoover thermostat [23] can be used.
An important issue is the choice of the Gaussian parameters. Since at the
beginning no information is available about the landscape of the Gibbs free energy
of the system, such as the height of the barrier or the distance between the minima
in the order parameter space, there is no obvious way to determine the appropriate
values. Using the relation W ∼ δs
2
mentioned in the previous section we need to
specify only one parameter. A convenient way to find a starting value is based on
the assumption that the barrier for the transition in the supercell is typically of
the order of several 10 meV multiplied by the number of structural units N
u
in