10
0
mirror of https://github.com/LCPQ/quantum_package synced 2024-06-19 19:52:15 +02:00

Guess based on the overlap matrix of AOs to remove linear dependencies

This commit is contained in:
Michel Caffarel 2015-11-25 18:04:05 +01:00
parent afbdda0dab
commit 6cad30269f
3 changed files with 47 additions and 0 deletions

View File

@ -0,0 +1,14 @@
program guess_mimi
BEGIN_DOC
! Produce `H_core` MO orbital
END_DOC
implicit none
character*(64) :: label
mo_coef = ao_ortho_lowdin_coef
TOUCH mo_coef
label = "Guess"
call mo_as_eigvectors_of_mo_matrix(-ao_overlap, &
size(ao_overlap,1), &
size(ao_overlap,2),label)
call save_mos
end

View File

@ -0,0 +1,10 @@
program prog_truncate_mo
BEGIN_DOC
! Truncate MO set
END_DOC
implicit none
integer :: n
write(*,*) 'Number of MOs to keep'
read (*,*) n
call save_mos_truncated(n)
end

View File

@ -21,6 +21,29 @@ subroutine save_mos
end
subroutine save_mos_truncated(n)
implicit none
double precision, allocatable :: buffer(:,:)
integer :: i,j,n
call system('$QP_ROOT/scripts/save_current_mos.sh '//trim(ezfio_filename))
call ezfio_set_mo_basis_mo_tot_num(n)
call ezfio_set_mo_basis_mo_label(mo_label)
call ezfio_set_mo_basis_ao_md5(ao_md5)
allocate ( buffer(ao_num,n) )
buffer = 0.d0
do j = 1, n
do i = 1, ao_num
buffer(i,j) = mo_coef(i,j)
enddo
enddo
call ezfio_set_mo_basis_mo_coef(buffer)
call ezfio_set_mo_basis_mo_occ(mo_occ)
deallocate (buffer)
end
subroutine mo_as_eigvectors_of_mo_matrix(matrix,n,m,label)
implicit none
integer,intent(in) :: n,m