[Pw_forum] can't minimize electrons by cp.x in some case
Nicola Marzari
marzari at MIT.EDU
Wed Jul 18 17:14:50 CEST 2007
Dear Liping,
excellent. Let's move this discussion to personal email, but just start
by using a smaller passop.
Let me comment on what the code writes, below:
> ------------------
> later case:
> ------------------
> 1 302.959497331307261 0.000000000000000000E+00 0.000000000000000000E+00
> CG1
> 302.9594973313************************************************************
> CG2 1.0000000 0.3000000 0.0000000**********
> 2 208.080403140153123 0.000000000000000000E+00 0.000000000000000000E+00
> CG1
> 208.0804031402************************************************************
> CG2 1.0000000 0.3000000 0.0000000**********
> ---------------------------------------------------
> the former case:
> ---------------------------------------------------
> 1 297.040229170397595 0.000000000000000000E+00 0.000000000000000000E+00
> CG1 297.0402291704 -327.1583825617 -386.8660741503 -363.1527920080
> CG2 1.0000000 0.3000000 0.4258172 0.4826634
> 2 -363.152792007997846 0.000000000000000000E+00 0.000000000000000000E+00
> CG1 -363.1527920080 -272.6635984330 -798.6105501259 -287.3075660536
> CG2 1.0000000 0.8516344 0.4057333-0.0870868
Let's discuss former case - the first three lines refer to the first
CG step. The total energy is 297.040..., from random wavefunctions.
The code takes an initial step of 0.3 in the search direction, the
new energy is -327.158, and with the parabolic interpolation
it decides that the perfect step should have been 0.4258... , with a
predicted value of the energy of -386.866 . Instead, when the energy is
recalculated for a 0.4258 step, it finds -363.152. This is still good,
but in the first steps the problem is highly non-quadratic,
and that is what the fourth number of the third line shows (for a
perfect parabola, the ratio between the energy decrease predicted
by a quadratic interpolator/extrapolator should be exactly 0.5 of the
energy decrease predicted by the linear extrapolator - in the later
steps, this fourth number is close to 0.5).
CG step 2 - you start from the energy calculated before (-363.152...)
and take an optimal step (assuming that the curvature of the parabola
has not changed). This step of 0.85 in the search direction gives you a
new energy at the minimum (extrapolated !) of -798, and a minimum
coordinate of 0.40. Once the code goes there, it finds only -287,
still good, etc...
Note that the first few steps are highly nonlinear, but quickly it
settles down.
1) solution for you - to use a smaller passop for the code, 0.1 or
smaller, and see how things change.
2) suggestion to improve the code - the initial step could always be
fixed, or only midly reduced or augmented, with caution, following the
trend from previous steps. I think moving from 0.3 to 0.85 from one
iteration to the next is too much.
nicola
--
---------------------------------------------------------------------
Prof Nicola Marzari Department of Materials Science and Engineering
13-5066 MIT 77 Massachusetts Avenue Cambridge MA 02139-4307 USA
tel 617.4522758 fax 2586534 marzari at mit.edu http://quasiamore.mit.edu
More information about the users
mailing list