Initial maximum overlap method

This commit is contained in:
edoapra 2024-02-28 17:31:21 -08:00
parent 7b1de9016a
commit e4b344a037
No known key found for this signature in database
GPG key ID: 9E6A0B70826967BA
12 changed files with 8173 additions and 31 deletions

View file

@ -601,6 +601,8 @@ if [[ ! -z "${BUILD_ELPA}" ]]; then
./runtests.mpi.unix procs $np siosi3_elpa
let "myexit+=$?"
fi
./runtests.mpi.unix procs $np dft_formaldehyde_mom
let "myexit+=$?"
#--- if we only want quick tests get out now!
if [[ "$what" == "fast" ]]; then
echo

View file

@ -0,0 +1,38 @@
start
title "formaldehyde n to pi-star excitation"
#https://dx.doi.org/10.1021/acs.jctc.0c00502
geometry
C 0.00000000 0.00000000 -0.6029850807
O 0.00000000 0.00000000 0.6053939853
H 0.00000000 0.934673129 -1.182174761
H 0.00000000 -0.934673129 -1.182174761
end
basis spherical
* library aug-cc-pvtz
end
dft
xc hfexch
vectors input atomic output form_ground.mos
end
task dft
dft
odft
vectors input form_ground.mos swap beta 11 8 output form_excited_mom.mos
convergence lshift 0. density 1d-8
max_ovl
end
task dft
dft
vectors input form_ground.mos swap beta 11 8 output form_excited_imom.mos
end
set dft:imom t
task dft

File diff suppressed because it is too large Load diff

View file

@ -43,6 +43,7 @@ cc AJL/Begin/FDE
cc AJL/End
logical
& nodamping, nolevelshifting, nodiis, ltight, lmaxov, incore,
& lmaxov_imom,
& XCFIT, CDFIT, store_wght, ldelley, lcfac, nlcfac, lxfac,
& nlxfac, xccomb, levelshift, damp, diis, direct, oskel,
& oadapt, lssw, lkeeps,trunc_neigh, lb94, cs00, bqdontcare,
@ -69,7 +70,7 @@ c
& AO_bas_han, CD_bas_han, XC_bas_han,
, lrchi,irchi,lrdelchi,irdelchi,
, g_cdinv, g_2ceri, sic_orb_spin, sic_orb_occ, sic_orb_index,
, g_sic_dens(2), aux_ik, g_s12m,g_s12p,
, g_sic_dens(2), aux_ik, g_s12m,g_s12p, g_movecs0(2),
cc AJL/Begin/FDE
& geom_fde, FD_bas_han, nbf_fde, nbf_fde_mxprim, nbf_fde_mxang,
& nbf_fde_mxcont, nbf_fde_mxnbf_cn, nbf_fde_mxnbf_ce,
@ -93,6 +94,7 @@ c
c Logicals
c
& nodamping, nolevelshifting, nodiis, ltight, lmaxov, incore,
& lmaxov_imom,
& XCFIT, CDFIT, store_wght, ldelley, lcfac(numfunc),
, nlcfac(numfunc),lxfac(numfunc), nlxfac(numfunc),
, xccomb(numfunc), levelshift, damp, diis,
@ -123,7 +125,7 @@ c
& AO_bas_han, CD_bas_han, XC_bas_han,
, lrchi,irchi,lrdelchi,irdelchi,
, g_cdinv, g_2ceri, sic_orb_spin, sic_orb_occ, sic_orb_index,
, g_sic_dens, aux_ik, g_s12m,g_s12p,
, g_sic_dens, aux_ik, g_s12m,g_s12p, g_movecs0,
cc AJL/Begin/FDE
& geom_fde, FD_bas_han, nbf_fde, nbf_fde_mxprim, nbf_fde_mxang,
& nbf_fde_mxcont, nbf_fde_mxnbf_cn, nbf_fde_mxnbf_ce,

View file

@ -840,6 +840,12 @@ c
call util_print_centered
& (LuOut,'Convergence Information',20,.true.)
write(LuOut,3231)hl_tol, nfock
if(lmaxov_imom) then
write(luout,'(10x,a,/)')
I ' Initial Maximum Overlap Method'
elseif(lmaxov) then
write(luout,'(10x,a,/)') ' Maximum Overlap Method'
endif
write(LuOut,3232)ndamp, rlshift
asap_10c = ' ASAP '
start_10c = ' start '

View file

@ -172,7 +172,10 @@ c
& lmaxov)) lmaxov=.false.
if (.not. rtdb_put(rtdb, 'dft:max_ovl',
& mt_log, 1, lmaxov))
& call errquit('dft_rdinput: rtdb_put failed', 6, RTDB_ERR)
& call errquit('dft_rdinput: rtdb_put failed', 6, RTDB_ERR)
else
if (.not. rtdb_get(rtdb, 'dft:imom', mt_log, 1, lmaxov_imom))
& lmaxov_imom=.false.
endif
c
if (.not. rtdb_get(rtdb, 'dft:lb94', mt_log, 1,

View file

@ -348,14 +348,6 @@ c
endif
if (nodiis)diising = .false.
c
lmaxov = lmaxov_sv
c don't turn off max_ovl
c if ((lumo - homo).lt.-hl_tol.and.lmaxov)then
c lmaxov = .false.
c if (ga_nodeid().eq.0 .and. oprint)
c & write(LuOut,224)homo, lumo
c endif
c
if (oprint.and.ga_nodeid().eq.0)then
current_cpu = util_cpusec()
if (nexc.le.1)then

View file

@ -15,7 +15,7 @@ c convergence declarations
double precision homo, lumo, homo_lumo_gap
double precision ssmear,rho_n
integer ndamp_input, ndamp_def
logical check_shift, lmaxov_sv
logical check_shift
c
c early convergence tolerances
c
@ -28,7 +28,7 @@ c integer
c logical
. diising, damping, levelshifting,ldmix,
. keep_damp_on,keep_levl_on, keep_diis_on,
. check_shift, lmaxov_sv
. check_shift

View file

@ -3,6 +3,7 @@ cedo#define USE_ELPA 1
subroutine dft_diagn(levelshifting,
, nmo,ncanorg,
. g_fock,g_s,g_movecs,g_tmp,g_svecs,
, g_movecs_old,
, evals,svals,nocc,homo,lumo,toll_s,
c
c MN solvation models -->
@ -31,6 +32,7 @@ c
integer g_s ! [in]
integer g_movecs ! [in]
integer g_svecs ! [in]
integer g_movecs_old ! [in]
integer nocc ! [in]
double precision evals(*) ! [out]
double precision svals(*) ! [in]
@ -197,7 +199,7 @@ c of maximum overlap with previous iteration.
c
if (lmaxov)then
call dft_mxovl(ao_bas_han, evals,
& g_movecst, g_movecs, g_s, g_fock,
& g_movecst, g_movecs_old, g_s, g_fock,
, nocc,oprint_conv_details,
, homo,lumo)
endif

View file

@ -86,12 +86,12 @@ c if(me.eq.0) then
c write(*,*)' orbital order: ',(int_mb(k_ord+i-1),i=1,nbf)
c endif
c
call ga_copy(g_evecs,g_oevecs)
call ga_copy(g_evecs,g_tmp)
call dcopy(nbf,evals,1,dbl_mb(k_tmp),1)
call dfill(nbf,0.d0,evals,1)
do i=me+1,nbf,nproc
ix=int_mb(k_ord+i-1)
call get_col(g_oevecs,nbf,ix,DBL_MB(k_scr))
call get_col(g_tmp,nbf,ix,DBL_MB(k_scr))
evals(i)=dbl_mb(k_tmp+ix-1)
call put_col(g_evecs,nbf,i,DBL_MB(k_scr))
enddo

View file

@ -297,7 +297,6 @@ c
call ecce_print_module_entry('dft')
dft_scf = .false.
ocosmo_got_gasphase = .false.
lmaxov_sv = lmaxov
oprint = util_print('information', print_low)
oprint_info = util_print('common', print_debug)
oprint_parm = util_print('parameters', print_default)
@ -867,7 +866,19 @@ c no movecs available, use svecs
endif
if(staticguess) llldb_out=util_statldb(llldb,rtdb)
call dft_guessout(nmo,nbf_ao,g_gmovecs,g_movecs,ipol)
cedo store g_movecs for max_ovl as g_movecs0
if (.not.rtdb_get(rtdb, 'dft:imom', mt_log, 1,
& lmaxov_imom)) lmaxov_imom=.false.
if (lmaxov_imom) then
c store g_movecs for max_ovl as g_movecs0
if(.not.ga_duplicate(g_movecs(1),g_movecs0(1),'movecs0'))
& call errquit('dft_scf: ga_duplicate failed',0, GA_ERR)
call ga_copy(g_movecs(1),g_movecs0(1))
if(ipol.gt.1) then
if(.not.ga_duplicate(g_movecs(2),g_movecs0(2),'movecs0'))
& call errquit('dft_scf: ga_duplicate failed',2,GA_ERR)
call ga_copy(g_movecs(2),g_movecs0(2))
endif
endif
if (me.eq.0.and.oprint)
& write(LuOut,'(2x," Time after variat. SCF: ",f8.1)')
& util_wallsec()
@ -1464,9 +1475,13 @@ cc AJL/End
endif
enddo
endif
if (.not.lmaxov_imom) then
g_movecs0(ispin)=g_movecs(ispin)
endif
call dft_diagn(levelshifting,
, nmo(ispin),ncanorg,
. g_focks(ispin),g_s,g_movecs(ispin),g_tmp,g_svecs,
. g_movecs0(ispin),
, dbl_mb(k_eval(ispin)),svals,noc(ispin),
, homo,lumo,toll_s,
, oprint_intermediate_fock,oprint_time,
@ -2522,7 +2537,15 @@ C
& ('dft_scf: could not destroy g_focks1', 0, GA_ERR)
if (ipol.gt.1) then
if (.not. ga_destroy(g_focks(2))) call errquit
& ('dft_scf: could not destroy g_focks2', 0, GA_ERR)
& ('dft_scf: could not destroy g_focks2', 0, GA_ERR)
if (lmaxov_imom) then
if (.not. ga_destroy(g_movecs0(1))) call errquit
& ('dft_scf: could not destroy g_movecs01', 0, GA_ERR)
if (ipol.gt.1) then
if (.not. ga_destroy(g_movecs0(2))) call errquit
& ('dft_scf: could not destroy g_movecs02', 0, GA_ERR)
endif
endif
end if
c
c == if frozen embedding ==

View file

@ -204,7 +204,7 @@ c
double precision homo, lumo, homo_lumo_gap
integer l_ir, k_ir
logical last_time_energy
logical check_shift, lmaxov_sv
logical check_shift
character*7 name
character*4 scftype
character*255 basis_name, basis_trans
@ -273,7 +273,6 @@ c
dft_scf_so = .false.
lfon_occ=0
nbf_mo = 2*nbf_ao
lmaxov_sv = lmaxov
oprint = util_print('information', print_low)
oprint_info = util_print('common', print_debug)
oprint_parm = util_print('parameters', print_default)
@ -2041,16 +2040,6 @@ c
c
Etold = Etnew ! store new energy
c
lmaxov = lmaxov_sv
if ((lumo - homo).lt.-hl_tol.and.lmaxov)then
lmaxov = .false.
if (me.eq.0 .and. oprint_conv_details)
& write(LuOut,224)homo, lumo
224 format(10x,' HOMO = ',f6.2,' LUMO = ',f6.2,
& /,10x,'Significant orbital reordering with',
& ' maximum overlap',
& /,10x,'turned ON. Turning max_ovl OFF.')
endif
c
if (oprint_energy_step.and.me.eq.0)then
current_cpu = util_cpusec()