10
0
mirror of https://github.com/LCPQ/quantum_package synced 2024-11-09 07:33:53 +01:00
quantum_package/plugins/Hartree_Fock/SCF.irp.f

62 lines
1.4 KiB
Fortran
Raw Normal View History

2015-06-17 18:22:08 +02:00
program scf
2015-07-06 14:06:49 +02:00
BEGIN_DOC
! Produce `Hartree_Fock` MO orbital
! output: mo_basis.mo_tot_num mo_basis.mo_label mo_basis.ao_md5 mo_basis.mo_coef mo_basis.mo_occ
! output: hartree_fock.energy
! optional: mo_basis.mo_coef
END_DOC
2015-06-17 18:22:08 +02:00
call create_guess
call orthonormalize_mos
call run
end
subroutine create_guess
implicit none
BEGIN_DOC
! Create a MO guess if no MOs are present in the EZFIO directory
2015-06-17 18:22:08 +02:00
END_DOC
logical :: exists
PROVIDE ezfio_filename
call ezfio_has_mo_basis_mo_coef(exists)
if (.not.exists) then
if (mo_guess_type == "HCore") then
mo_coef = ao_ortho_lowdin_coef
TOUCH mo_coef
mo_label = 'Guess'
2018-01-09 17:34:15 +01:00
call mo_as_eigvectors_of_mo_matrix(mo_mono_elec_integral,size(mo_mono_elec_integral,1),size(mo_mono_elec_integral,2),mo_label,1,.false.)
2015-06-17 18:22:08 +02:00
SOFT_TOUCH mo_coef mo_label
else if (mo_guess_type == "Huckel") then
call huckel_guess
else
print *, 'Unrecognized MO guess type : '//mo_guess_type
stop 1
endif
endif
end
subroutine run
BEGIN_DOC
! Run SCF calculation
2015-06-17 18:22:08 +02:00
END_DOC
use bitmasks
implicit none
double precision :: SCF_energy_before,SCF_energy_after,diag_H_mat_elem
double precision :: EHF
2015-06-17 18:22:08 +02:00
integer :: i_it, i, j, k
EHF = HF_energy
2015-06-17 18:22:08 +02:00
mo_label = "Canonical"
! Choose SCF algorithm
2017-06-19 09:42:52 +02:00
! call damping_SCF ! Deprecated routine
2017-06-02 23:53:44 +02:00
call Roothaan_Hall_SCF
2015-06-17 18:22:08 +02:00
end
2017-06-02 22:49:42 +02:00