9
1
mirror of https://github.com/QuantumPackage/qp2.git synced 2024-12-21 11:03:29 +01:00

added sort_by_fock_energies.irp.f

This commit is contained in:
Emmanuel Giner 2019-03-08 18:12:15 +01:00
parent 0e3013a71a
commit 8705a7d5f7
3 changed files with 39 additions and 2 deletions

8
ocaml/.gitignore vendored
View File

@ -9,20 +9,24 @@ Input_ao_two_e_erf_ints.ml
Input_ao_two_e_ints.ml
Input_auto_generated.ml
Input_becke_numerical_grid.ml
Input_champ.ml
Input_davidson.ml
Input_density_for_dft.ml
Input_determinants.ml
Input_dft_keywords.ml
Input_dft_mu_of_r.ml
Input_dressing.ml
Input_ijkl_ints_in_r3.ml
Input_mo_one_e_ints.ml
Input_mo_two_e_erf_ints.ml
Input_mo_two_e_ints.ml
Input_mu_of_r_ints.ml
Input_mu_of_r.ml
Input_nuclei.ml
Input_perturbation.ml
Input_pseudo.ml
Input_rsdft_ecmd.ml
Input_scf_utils.ml
Input_variance.ml
Input_two_body_dm.ml
qp_create_ezfio
qp_create_ezfio.native
qp_edit

View File

@ -1,3 +1,4 @@
fci
mo_two_e_erf_ints
aux_quantities
hartree_fock

View File

@ -0,0 +1,32 @@
program sort_by_fock_energies
BEGIN_DOC
! programs that save the current mos ordered by Diagonal element of the Fock operator.
!
! Warning : the Fock operator, and therefore its matrix elements, depends on the occupancy.
END_DOC
implicit none
integer :: i,j,k
integer, allocatable :: iorder(:)
double precision, allocatable :: fock_energies_tmp(:), new_mo_coef(:,:)
allocate(iorder(mo_num), fock_energies_tmp(mo_num),new_mo_coef(ao_num,mo_num))
do i = 1, mo_num
fock_energies_tmp(i) = Fock_matrix_diag_mo(i)
print*,'fock_energies_tmp(i) = ',fock_energies_tmp(i)
iorder(i) = i
enddo
print*,''
print*,'Sorting by Fock energies'
print*,''
call dsort(fock_energies_tmp,iorder,mo_num)
do i = 1, mo_num
k = iorder(i)
print*,'fock_energies_new(i) = ',fock_energies_tmp(i)
do j = 1, ao_num
new_mo_coef(j,i) = mo_coef(j,k)
enddo
enddo
mo_coef = new_mo_coef
touch mo_coef
call save_mos
end