# How to avoid zero line search alpha

Dear Lammps users,

I am using minimize to equilibrate a 2D atomic system. The box is triclinic and I use fix box/relax to get a final state where stress components pxx, pyy and pxy are zero. But I got a stopping message “line search alpha is zero” when the stress components and interatomic forces were still not small enough. The force tol was not satisfied. What can I do to the minimization procedure so that I can get a final configuration satisfying the force tol? For systems of a few hundred of atoms, I find I can achieve that by reducing vmax value in the fix box/relax command. But for a 2000 atom system, I still have the above problem even when vmax is as small as 1.0e-8. I tried changing nreset, but that did not help.

Thanks,
Dan

Are you using a potential that goes to zero energy at its cutoff?
The minimize doc page talks about that. You can also try different
minimizers.

Steve

Yes, I am using lj96/cut potential. The minimizer I used was min_style cd + line quadratic:

fix 3 all box/relax x 0.0 y 0.0 xy 0.0 vmax 1.0e-8 nreset 100
minimize 0.0 1.0e-6 10000000 100000000

The output is:
Step PotEng Pxx Pyy Pxy Fnorm Fmax

30000000 -1912.4461 0.02459897 0.024634918 0.00025049874 0.00062196554 2.5261088e-05
30100000 -1912.4461 0.028138294 0.028180445 0.00028620011 0.00053956081 2.1926999e-05
30170679 -1912.4461 0.02887261 0.019117344 -0.010915359 0.00033869102 1.3637053e-05
Loop time of 30.1189 on 12 procs for 170679 steps with 2000 atoms

Minimization stats:
Stopping criterion = linesearch alpha is zero
Energy initial, next-to-last, final =
-1912.44612277 -1912.44614 -1912.44614
Force two-norm initial, final = 0.000705052 0.000484255
Force max component initial, final = 0.000234961 0.000275379
Final line search alpha, max atom move = 1.81568e-05 5e-09
Iterations, force evaluations = 170679 170681

I then tried hftn with the same settings, but got warning “trust region too small”. I tried restarting the minimization from 26,000,000th step (when the energy stablized to almost -1912.4461) and reduced vmax further to 5e-10. The stresses and interatomic forces became smaller than the above, but still the iteration stopped due to zero line search alpha. Is there any other settings I can play with to probably solve the problem?

Thanks,
Dan

Aidan can comment - doing a minimization with fix box/relax has
subtle issues. It may be that is as far as you can go. Since

Steve

It looks like you are getting good convergence, but not perfect. One reason the line search might fail is because of a discontinuity in the energy. Even if the probability of this is very low, high-tolerance minimization has a knack for finding those rare cases. Are you shifting the lj96 potential to eliminate the jump at the cutoff? If not, do it. Also eliminate anything else in the simulation that might be causing steps in the energy.

Thank you very much, Aidan and Steve. I did shift the potential to make it smooth. What else would possibly cause steps in the energy? I am simply doing a minimization on a random initial configuration. I have attached my input file and data file here, which may be helpful.

Regards,
Dan

initial.txt (71.8 KB)

minimize.in (854 Bytes)

This is a tricky system. The disorder in the atom positions interferes with the stress relaxation. I played with it for a bit, alternating between atom relaxation and atom/cell relaxation. I was able to get the forces down to 1e-9. See attached. The key is to pay attention to when the minimizer is “churning”. There are a variety of reasons for this: dmax too big or too small, vmax too big or two small, cell/relax interfering with atom relaxation. Each time you see churning, stop the run and adjust the parameters accordingly.

Aidan

minimize.tgz (61.8 KB)

And you should note that performing a minimization with
both box and atom relaxation is not a mathematically well-defined
minimization problem. I.e. the objective function you are minimizing

changes when the box changes. This makes it easier for
the minimizer to get “stuck”, hence the need for restarting (from
the current box size/shape) as Aidan suggests.

Steve

Dear Aidan,

I ran the minimization in file you gave me and the forces were reduced to very small values. But I did not find it until today that there are many holes in the final configuration. I was wondering if there are ways to get rid of them. If it were too difficult to solve this problem, I would probably need to find alternatives to the box/relax method. I am sorry for not finding this problem earlier. Thank you very much!

Best regards,
Dan