2023-07-02 21:49:25 +02:00
! ---
2023-02-07 17:07:49 +01:00
progr a m test_natorb
2023-07-02 21:49:25 +02:00
2023-02-07 17:07:49 +01:00
BEG I N_DOC
2023-07-02 21:49:25 +02:00
! TODO : Reads psi_det in the EZFIO folder and prints out the left- and right-eigenvectors together with the energy. Saves the left-right wave functions at the end.
2023-02-07 17:07:49 +01:00
END _ DOC
2023-07-02 21:49:25 +02:00
imp l icit none
2023-02-07 17:07:49 +01:00
pri n t * , 'Hello world'
2023-07-02 21:49:25 +02:00
2023-02-07 17:07:49 +01:00
my_ g rid_becke = . True .
2023-07-02 21:49:25 +02:00
PRO V IDE tc_grid1_a tc_grid1_r
my_ n _ pt_r_grid = tc_grid1_r
my_ n _ pt_a_grid = tc_grid1_a
tou c h my_grid_becke my_n_pt_r_grid my_n_pt_a_grid
2023-02-07 17:07:49 +01:00
rea d _ wf = . True .
tou c h read_wf
2023-07-02 21:49:25 +02:00
cal l routine ( )
! call test()
2023-02-07 17:07:49 +01:00
end
2023-07-02 21:49:25 +02:00
! ---
subro u tine routine ( )
2023-02-07 17:07:49 +01:00
impl i cit none
doub l e precision , allocatable :: fock_diag ( : ) , eigval ( : ) , leigvec ( : , : ) , re igvec(:,:),mat_ref(:,:)
allo c ate ( eigval ( mo_num ) , leigvec ( mo_num , mo_num ) , reigvec ( mo_num , mo_num ) , f ock_diag(mo_num),mat_ref(mo_num, mo_num))
doub l e precision , allocatable :: eigval_ref ( : ) , leigvec_ref ( : , : ) , reigvec _ref(:,:)
allo c ate ( eigval_ref ( mo_num ) , leigvec_ref ( mo_num , mo_num ) , reigvec_ref ( mo_n um,mo_num))
doub l e precision :: thr_deg
inte g er :: i , n_real , j
prin t * , 'fock_matrix'
do i = 1 , mo_num
foc k _ diag ( i ) = Fock_matrix_mo ( i , i )
pri n t * , i , fock_diag ( i )
endd o
thr_ d eg = 1.d-6
mat_ r ef = - one_e_dm_mo
prin t * , 'diagonalization by block'
call diag_mat_per_fock_degen ( fock_diag , mat_ref , mo_num , thr_deg , leigvec , r eigvec,eigval)
call non_hrmt_bieig ( mo_num , mat_ref &
, leigvec_ref , reigvec_ref &
, n_real , eigval_ref )
prin t * , 'TEST ***********************************'
doub l e precision :: accu_l , accu_r
do i = 1 , mo_num
acc u _ l = 0.d0
acc u _ r = 0.d0
do j = 1 , mo_num
ac c u_r + = reigvec_ref ( j , i ) * reigvec ( j , i )
ac c u_l + = leigvec_ref ( j , i ) * leigvec ( j , i )
end d o
pri n t * , i
wri t e ( * , '(I3,X,100(F16.10,X))' ) i , eigval ( i ) , eigval_ref ( i ) , accu_l , accu_r
endd o
end