mirror of
https://github.com/LCPQ/quantum_package
synced 2024-08-25 14:01:46 +02:00
Fixed SCF
This commit is contained in:
parent
7b55cfad05
commit
783c890dbe
@ -20,7 +20,7 @@ default: 0.
|
|||||||
type: Threshold
|
type: Threshold
|
||||||
doc: Threshold on the convergence of the Hartree Fock energy.
|
doc: Threshold on the convergence of the Hartree Fock energy.
|
||||||
interface: ezfio,provider,ocaml
|
interface: ezfio,provider,ocaml
|
||||||
default: 1.e-12
|
default: 1.e-10
|
||||||
|
|
||||||
[n_it_scf_max]
|
[n_it_scf_max]
|
||||||
type: Strictly_positive_int
|
type: Strictly_positive_int
|
||||||
@ -32,7 +32,7 @@ default: 500
|
|||||||
type: Positive_float
|
type: Positive_float
|
||||||
doc: Energy shift on the virtual MOs to improve SCF convergence
|
doc: Energy shift on the virtual MOs to improve SCF convergence
|
||||||
interface: ezfio,provider,ocaml
|
interface: ezfio,provider,ocaml
|
||||||
default: 0.3
|
default: 0.0
|
||||||
|
|
||||||
[scf_algorithm]
|
[scf_algorithm]
|
||||||
type: character*(32)
|
type: character*(32)
|
||||||
|
@ -13,8 +13,9 @@ END_DOC
|
|||||||
integer :: iteration_SCF,dim_DIIS,index_dim_DIIS
|
integer :: iteration_SCF,dim_DIIS,index_dim_DIIS
|
||||||
|
|
||||||
integer :: i,j
|
integer :: i,j
|
||||||
|
double precision, allocatable :: mo_coef_save(:,:)
|
||||||
|
|
||||||
allocate( &
|
allocate(mo_coef_save(ao_num,mo_tot_num), &
|
||||||
Fock_matrix_DIIS (ao_num,ao_num,max_dim_DIIS), &
|
Fock_matrix_DIIS (ao_num,ao_num,max_dim_DIIS), &
|
||||||
error_matrix_DIIS(ao_num,ao_num,max_dim_DIIS) &
|
error_matrix_DIIS(ao_num,ao_num,max_dim_DIIS) &
|
||||||
)
|
)
|
||||||
@ -72,9 +73,7 @@ END_DOC
|
|||||||
Fock_matrix_AO_alpha = Fock_matrix_AO*0.5d0
|
Fock_matrix_AO_alpha = Fock_matrix_AO*0.5d0
|
||||||
Fock_matrix_AO_beta = Fock_matrix_AO*0.5d0
|
Fock_matrix_AO_beta = Fock_matrix_AO*0.5d0
|
||||||
level_shift_save = level_shift
|
level_shift_save = level_shift
|
||||||
if (max_error_DIIS > 0.1d0) then
|
level_shift += max_error_DIIS
|
||||||
level_shift += 0.5d0
|
|
||||||
endif
|
|
||||||
TOUCH Fock_matrix_AO_alpha Fock_matrix_AO_beta
|
TOUCH Fock_matrix_AO_alpha Fock_matrix_AO_beta
|
||||||
level_shift = level_shift_save
|
level_shift = level_shift_save
|
||||||
|
|
||||||
@ -97,21 +96,21 @@ END_DOC
|
|||||||
Fock_matrix_AO_alpha = Fock_matrix_AO*0.5d0
|
Fock_matrix_AO_alpha = Fock_matrix_AO*0.5d0
|
||||||
Fock_matrix_AO_beta = Fock_matrix_AO*0.5d0
|
Fock_matrix_AO_beta = Fock_matrix_AO*0.5d0
|
||||||
TOUCH Fock_matrix_AO_alpha Fock_matrix_AO_beta
|
TOUCH Fock_matrix_AO_alpha Fock_matrix_AO_beta
|
||||||
dim_DIIS = 0
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
double precision :: level_shift_save
|
double precision :: level_shift_save
|
||||||
level_shift_save = level_shift
|
level_shift_save = level_shift
|
||||||
if (max_error_DIIS > 0.5d0) then
|
mo_coef_save(1:ao_num,1:mo_tot_num) = mo_coef(1:ao_num,1:mo_tot_num)
|
||||||
level_shift += 0.5d0
|
|
||||||
endif
|
|
||||||
do while (Delta_Energy_SCF > 0.d0)
|
do while (Delta_Energy_SCF > 0.d0)
|
||||||
|
mo_coef(1:ao_num,1:mo_tot_num) = mo_coef_save
|
||||||
|
TOUCH mo_coef
|
||||||
level_shift = level_shift + 0.1d0
|
level_shift = level_shift + 0.1d0
|
||||||
MO_coef = eigenvectors_Fock_matrix_MO
|
mo_coef(1:ao_num,1:mo_tot_num) = eigenvectors_Fock_matrix_MO(1:ao_num,1:mo_tot_num)
|
||||||
TOUCH MO_coef level_shift
|
TOUCH mo_coef level_shift
|
||||||
Delta_Energy_SCF = HF_energy - energy_SCF_previous
|
Delta_Energy_SCF = HF_energy - energy_SCF_previous
|
||||||
energy_SCF = HF_energy
|
energy_SCF = HF_energy
|
||||||
if (level_shift-level_shift_save > 0.5d0) exit
|
if (level_shift-level_shift_save > 1.d0) exit
|
||||||
|
dim_DIIS=0
|
||||||
enddo
|
enddo
|
||||||
level_shift = level_shift_save
|
level_shift = level_shift_save
|
||||||
SOFT_TOUCH level_shift
|
SOFT_TOUCH level_shift
|
||||||
|
Loading…
Reference in New Issue
Block a user