BFGS: the initial step is reduced when the forces are smaller than a given threshold.

The linear scaling algorithm has been removed (never used and bad performance) allowing for
a considerable clean up of the module.
A new Pulay mixing has been added on top of the BFGS scheme which improves (sometimes considerably)
the performace of the relaxation (similar to the GDIIS). It is activated by setting bfgs_ndim (default is 1
which corresponds to no Pulay mixing). The algorithm has to be tested against difficoult problems.
C.S.


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@1823 c92efa57-630b-4861-b058-cf58834340f0
This commit is contained in:
sbraccia 2005-04-20 23:43:15 +00:00
parent 0053815f14
commit 3093b314e1
6 changed files with 264 additions and 714 deletions

View File

@ -578,13 +578,12 @@ upscale REAL ( default = 10.D0 )
but conv_thr will not be reduced to less that
conv_thr / upscale
lbfgs_ndim INTEGER ( default = 1 )
bfgs_ndim INTEGER ( default = 1 )
number of old forces and displacements vectors used in the
linear scaling BFGS algorithm. When lbfgs_ndim = 1 the complete
inverse Hessian is stored (suggested for small/medium-size
systems).
On large systems (some hundreds of atoms) a good performance can
be achieved with only 4 or 6 old vectors
PULAY mixing of the residual vectors obtained on the basis
of the inverse hessian matrix given by the BFGS algorithm.
When bfgs_ndim = 1, the standard quasi-Newton BFGS method is
used.
(bfgs only)
trust_radius_max

File diff suppressed because it is too large Load Diff

View File

@ -1030,7 +1030,7 @@ MODULE input_parameters
! ... variables added for new BFGS algorithm
!
INTEGER :: lbfgs_ndim = 1
INTEGER :: bfgs_ndim = 1
REAL(KIND=DP) :: trust_radius_max = 0.5D0
REAL(KIND=DP) :: trust_radius_min = 1.D-5
@ -1106,7 +1106,7 @@ MODULE input_parameters
fixed_tan, use_freezing, use_fourier, &
trust_radius_max, trust_radius_min, &
trust_radius_ini, trust_radius_end, w_1, w_2, &
lbfgs_ndim, sic_rloc, &
bfgs_ndim, sic_rloc, &
smd_polm, smd_kwnp, smd_linr, smd_stcd, &
smd_stcd1, smd_stcd2, smd_stcd3, smd_codf, &
smd_forf, smd_smwf, smd_lmfreq, smd_tol, &

View File

@ -380,7 +380,7 @@ MODULE read_namelists_module
!
! ... BFGS defaults
!
lbfgs_ndim = 1
bfgs_ndim = 1
trust_radius_max = 0.8D0
trust_radius_min = 1.D-5
trust_radius_ini = 0.5D0
@ -781,7 +781,7 @@ MODULE read_namelists_module
!
! ... BFGS
!
CALL mp_bcast( lbfgs_ndim, ionode_id )
CALL mp_bcast( bfgs_ndim, ionode_id )
CALL mp_bcast( trust_radius_max, ionode_id )
CALL mp_bcast( trust_radius_min, ionode_id )
CALL mp_bcast( trust_radius_ini, ionode_id )

View File

@ -163,7 +163,7 @@ SUBROUTINE iosys()
!
USE constraints_module, ONLY : nconstr, constr_tol, constr, target
!
USE bfgs_module, ONLY : lbfgs_ndim_ => lbfgs_ndim, &
USE bfgs_module, ONLY : bfgs_ndim_ => bfgs_ndim, &
trust_radius_max_ => trust_radius_max, &
trust_radius_min_ => trust_radius_min, &
trust_radius_ini_ => trust_radius_ini, &
@ -218,7 +218,7 @@ SUBROUTINE iosys()
ds, use_fourier, use_freezing, fixed_tan, &
free_energy, write_save, trust_radius_max, &
trust_radius_min, trust_radius_ini, &
trust_radius_end, w_1, w_2, lbfgs_ndim
trust_radius_end, w_1, w_2, bfgs_ndim
!
! CELL namelist
!
@ -1001,9 +1001,9 @@ SUBROUTINE iosys()
fixed_tan_ = fixed_tan
free_energy_ = free_energy
!
! ... new BFGS specific
! ... BFGS specific
!
lbfgs_ndim_ = lbfgs_ndim
bfgs_ndim_ = bfgs_ndim
trust_radius_max_ = trust_radius_max
trust_radius_min_ = trust_radius_min
trust_radius_ini_ = trust_radius_ini

View File

@ -41,7 +41,6 @@ SUBROUTINE move_ions()
USE symme, ONLY : s, ftau, nsym, irt
USE ener, ONLY : etot
USE force_mod, ONLY : force
USE bfgs_module, ONLY : lbfgs_ndim
USE control_flags, ONLY : upscale, lbfgs, loldbfgs, lconstrain, &
lmd, conv_ions, history, alpha0, beta0, tr2, istep
USE relax, ONLY : epse, epsf, starting_scf_threshold
@ -52,7 +51,7 @@ SUBROUTINE move_ions()
!
! ... external procedures
!
USE bfgs_module, ONLY : new_bfgs => bfgs, lin_bfgs, terminate_bfgs
USE bfgs_module, ONLY : new_bfgs => bfgs, terminate_bfgs
USE constraints_module, ONLY : dist_constrain, check_constrain, &
new_force
USE basic_algebra_routines, ONLY : norm
@ -129,23 +128,8 @@ SUBROUTINE move_ions()
pos = RESHAPE( SOURCE = tau, SHAPE = (/ 3 * nat /) ) * alat
gradient = - RESHAPE( SOURCE = force, SHAPE = (/ 3 * nat /) )
!
IF ( lbfgs_ndim == 1 ) THEN
!
! ... standard BFGS
!
CALL new_bfgs( pos, etot, gradient, tmp_dir, stdout, epse, &
epsf, energy_error, gradient_error, step_accepted, &
conv_ions )
!
ELSE
!
! ... linear scaling BFGS
!
CALL lin_bfgs( pos, etot, gradient, tmp_dir, stdout, epse, &
epsf, energy_error, gradient_error, step_accepted, &
conv_ions )
!
END IF
CALL new_bfgs( pos, etot, gradient, tmp_dir, stdout, epse, epsf, &
energy_error, gradient_error, step_accepted, conv_ions )
!
IF ( conv_ions ) THEN
!