 
%When performing geometry optimization on real-space grids, the spacing should be one of the most important aspects to consider in order to get accurate results. However, one of the weaknesses in previous versions of Octopus was the prediction of low-energy structures, performing geometry optimizations, regardless of the spacing of the mesh. In low-dimensional systems, this is a significant issue, due the precise determination of the geometric arrangement of the atoms, is probably the first step in their description and understanding~\cite{Goedecker2005}.

With our approach, the forces tend to converge faster with the grid spacing than the energy. This means that to perform geometry optimizations it would be ideal to have a local minimization method that only relies on the forces, without needing to evaluate the energy, as both values will not be entirely consistent. Such a method is the fast inertial relaxation engine (FIRE) algorithm, put forward by Bitzek {\it et al.}~\cite{Bitzek2006}. FIRE has shown a competitive performance compared with both the standard conjugate-gradient method, and more sophisticated variations typically used in {\it ab initio} calculations. A recent article shows also the FIRE as one of the most convenient algorithm due to its speed and precision to reach the nearest local minimum starting from a given initial configuration~\cite{Asenjo2013}. 

The FIRE algorithm is based on molecular dynamics with additional velocity modifications and adaptive time steps which only requires first derivatives of the target function. In the FIRE algorithm, the system slides down the potential-energy surface, gathering ``momentum'' until the direction of the gradient changes, at which point it stops, resets the adaptive parameters, and resumes sliding. This gain of momentum is done through the modification of the time step $\Delta t$ as adaptive parameter, and by introducing the following velocity modification
%
\begin{equation}
  \label{eq:velocity_fire}
\mathrm{\vec{v}}(t) \rightarrow \mathrm{\vec{V}}(t) = (1-\alpha)\mathrm{\vec{v}}(t) + \alpha \left| \mathrm{\vec{v}}(t) \right| \hat{F}(t)\ ,
\end{equation}
%
where $\mathrm{\vec{v}}$ is the velocity of the atoms, $\alpha$ is an adaptive parameter, and $\hat{F}$ is a unitary vector in the direction of the force $\vec{F}$. By doing this velocity modification, the acceleration of the atoms is given by
%
\begin{equation}
  \label{eq:acceleration_fire}
\dot{\mathrm{\vec{v}}}{(t)} = \dfrac{\vec{F}{(t)}}{m} - \dfrac{\alpha}{\Delta t} \left| \mathrm{\vec{v}}(t) \right| \left[\hat{\mathrm{\vec{v}}}(t)-\hat{F}(t)\right]\ ,
\end{equation}
%
where the second term is an introduced acceleration in a direction ``steeper'' than the usual direction of motion. Obviously, if $\alpha = 0$ then $\mathrm{\vec{V}}(t) = \mathrm{\vec{v}}(t)$, meaning the velocity modification vanishes, and the acceleration $\dot{\mathrm{\vec{v}}}{(t)} = \vec{F}{(t)}/m$, as usual.

We illustrate how the algorithm works with a simple case: the geometry optimization of a methane molecule. The input geometry consists of one carbon atom at the center of a tetrahedron, and four hydrogen atoms at the vertices, where the initial C-H distance is 1.2~\AA. In Fig.~\ref{fig:go_fire} we plot the energy
difference $\Delta E_{\text{tot}}$ with respect to the equilibrium conformation, the maximum component of the force acting on the ions $F_{\text{max}}$, and the C-H bond length. On the first iterations, the geometry approaches the equilibrium position, but moves away on the 3rd. This means a change in the direction of the gradient, so there is no movement in the 4th iteration, the adaptive parameters are reset, and sliding resumes in the 5th iteration.
