10
0
mirror of https://github.com/LCPQ/quantum_package synced 2024-12-23 21:03:56 +01:00
quantum_package/plugins/Hartree_Fock_SlaterDressed/SCF_dressed.irp.f

99 lines
2.2 KiB
Fortran
Raw Normal View History

2017-06-08 22:15:42 +02:00
program scf
BEGIN_DOC
! Produce `Hartree_Fock` MO orbital with Slater cusp dressing
! 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
call check_mos
call debug
call run
end
subroutine check_mos
implicit none
BEGIN_DOC
! Create a MO guess if no MOs are present in the EZFIO directory
END_DOC
logical :: exists
PROVIDE ezfio_filename
call ezfio_has_mo_basis_mo_coef(exists)
if (.not.exists) then
print *, 'Please run SCF first'
stop
endif
end
subroutine debug
implicit none
2017-06-12 16:31:34 +02:00
integer :: i,j,k
2017-06-08 22:15:42 +02:00
print *, 'A'
do i=1,nucl_num
print *, i, cusp_A(1:nucl_num, i)
enddo
print *, 'B'
do i=1,mo_tot_num
print *, i, cusp_B(1:nucl_num, i)
enddo
2017-06-12 16:31:34 +02:00
print *, 'X'
2017-06-08 22:15:42 +02:00
do i=1,mo_tot_num
print *, i, cusp_C(1:nucl_num, i)
enddo
2017-06-12 16:31:34 +02:00
print *, '-----'
return
do k=-100,100
double precision :: x, y, z
x = 0.01d0 * k
y = 0.d0
do i=1,ao_num
z = 0.d0
do j=1,ao_prim_num(i)
z += ao_coef_normalized_ordered_transp(j,i) * dexp(-ao_expo_ordered_transp(j,i) * x**2)
enddo
y += mo_coef(i,1) * z
y += exp(-slater_expo(1)*dabs(x)) * slater_coef(1,1)
z = 0.d0
do j=1,ao_prim_num(i)
z += ao_coef_normalized_ordered_transp(j,i) * dexp(-ao_expo_ordered_transp(j,i) * x**2)
enddo
y -= z * GauSlaOverlap_matrix(i,1)* slater_coef(1,1)
enddo
print *, x, y
enddo
print *, '-----'
2017-06-08 22:15:42 +02:00
end
subroutine run
BEGIN_DOC
! Run SCF calculation
END_DOC
use bitmasks
implicit none
double precision :: SCF_energy_before,SCF_energy_after,diag_H_mat_elem
double precision :: EHF
integer :: i_it, i, j, k
mo_label = "CuspDressed"
2017-06-16 15:35:52 +02:00
print *, HF_energy
2017-06-12 16:31:34 +02:00
call ezfio_set_Hartree_Fock_SlaterDressed_slater_coef_ezfio(cusp_C)
2017-06-08 22:15:42 +02:00
2017-06-16 15:35:52 +02:00
do i=1,ao_num
print *, mo_coef(i,1), cusp_corrected_mos(i,1)
enddo
mo_coef(1:ao_num,1:mo_tot_num) = cusp_corrected_mos(1:ao_num,1:mo_tot_num)
TOUCH mo_coef
2017-06-08 22:15:42 +02:00
2017-06-16 15:35:52 +02:00
EHF = HF_energy
print *, HF_energy
2017-06-08 22:15:42 +02:00
! call Roothaan_Hall_SCF
end