10
0
mirror of https://github.com/QuantumPackage/qp2.git synced 2024-12-22 20:34:58 +01:00

saving olympe2 modif

This commit is contained in:
AbdAmmar 2024-04-07 00:29:40 +02:00
parent 83ed57312d
commit d872d60e70
6 changed files with 81 additions and 46 deletions

View File

@ -56,10 +56,10 @@
print*,'Average trace of overlap_bi_ortho is different from 1 by ', dabs(accu_d-1.d0)
print*,'And bi orthogonality is off by an average of ',accu_nd
print*,'****************'
print*,'Overlap matrix betwee mo_l_coef and mo_r_coef '
do i = 1, mo_num
write(*,'(100(F16.10,X))')overlap_bi_ortho(i,:)
enddo
!print*,'Overlap matrix betwee mo_l_coef and mo_r_coef '
!do i = 1, mo_num
! write(*,'(100(F16.10,X))')overlap_bi_ortho(i,:)
!enddo
endif
print*,'Average trace of overlap_bi_ortho (should be 1.)'
print*,'accu_d = ',accu_d

View File

@ -2144,6 +2144,7 @@ subroutine impose_biorthog_degen_eigvec(n, deg_num, e0, L0, R0)
enddo
!print*,' accu_nd after = ', accu_nd
if(accu_nd .gt. 1d-12) then
print*, ' accu_nd =', accu_nd
print*, ' your strategy for degenerates orbitals failed !'
print*, m, 'deg on', i
stop

View File

@ -20,7 +20,7 @@ program minimize_tc_angles
! TODO
! check if rotations of orbitals affect the TC energy
! and refuse the step
call minimize_tc_orb_angles
call minimize_tc_orb_angles()
end

View File

@ -40,9 +40,6 @@ subroutine LTxSxR(n, m, L, S, R, C)
end subroutine LTxR
! ---
! ---
subroutine minimize_tc_orb_angles()
@ -103,7 +100,10 @@ subroutine routine_save_rotated_mos(thr_deg, good_angles)
double precision, allocatable :: stmp(:,:), T(:,:), Snew(:,:), smat2(:,:)
double precision, allocatable :: mo_l_coef_tmp(:,:), mo_r_coef_tmp(:,:), mo_l_coef_new(:,:)
E_thr = 1d-04
PROVIDE TC_HF_energy
PROVIDE mo_r_coef mo_l_coef
E_thr = 1d-07
E_old = TC_HF_energy
allocate(mo_l_coef_old(ao_num,mo_num), mo_r_coef_old(ao_num,mo_num))
mo_r_coef_old = mo_r_coef
@ -145,6 +145,7 @@ subroutine routine_save_rotated_mos(thr_deg, good_angles)
else
call give_degen_full_list(fock_diag, mo_num, thr_deg, list_degen, n_degen_list)
endif
print *, ' fock_matrix_mo'
do i = 1, mo_num
print *, i, fock_diag(i), angle_left_right(i)
@ -159,6 +160,8 @@ subroutine routine_save_rotated_mos(thr_deg, good_angles)
if(n_degen .ge. 1000) n_degen = 1 ! convention for core orbitals
if(n_degen .eq. 1) cycle
print*, ' working on orbital', i
print*, ' multiplicity =', n_degen
allocate(stmp(n_degen,n_degen), smat2(n_degen,n_degen))
allocate(mo_r_coef_tmp(ao_num,n_degen), mo_l_coef_tmp(ao_num,n_degen), mo_l_coef_new(ao_num,n_degen))
@ -166,11 +169,11 @@ subroutine routine_save_rotated_mos(thr_deg, good_angles)
print*,'Right orbitals before'
do j = 1, n_degen
write(*,'(100(F16.10,X))') mo_r_coef_new(1:ao_num,list_degen(i,j))
write(*,'(1000(F16.10,X))') mo_r_coef_new(1:ao_num,list_degen(i,j))
enddo
print*,'Left orbitals before'
do j = 1, n_degen
write(*,'(100(F16.10,X))')mo_l_coef(1:ao_num,list_degen(i,j))
write(*,'(1000(F16.10,X))') mo_l_coef(1:ao_num,list_degen(i,j))
enddo
if(angle_left_right(list_degen(i,1)).gt.80.d0.and.n_degen==2)then
integer :: i_list, j_list
@ -194,7 +197,7 @@ subroutine routine_save_rotated_mos(thr_deg, good_angles)
endif
print*,'Right orbitals '
do j = 1, n_degen
write(*,'(100(F16.10,X))')mo_r_coef_tmp(1:ao_num,j)
write(*,'(1000(F16.10,X))') mo_r_coef_tmp(1:ao_num,j)
enddo
print*,'Left orbitals '
do j = 1, n_degen

View File

@ -5,7 +5,8 @@ program print_detweights
read_wf = .True.
touch read_wf
call main()
call print_exc()
!call main()
end
@ -41,6 +42,7 @@ subroutine main()
do i = 1, N_det
deg_sorted(i) = deg(ii(i))
print *, deg_sorted(i), c(i)
enddo
print *, ' saving psi'
@ -63,4 +65,33 @@ subroutine main()
end
! ---
subroutine print_exc()
implicit none
integer :: i
integer, allocatable :: deg(:)
PROVIDE N_int
PROVIDE N_det
PROVIDE psi_det
allocate(deg(N_det))
do i = 1, N_det
call get_excitation_degree(psi_det(1,1,1), psi_det(1,1,i), deg(i), N_int)
enddo
open(unit=10, file="exc.dat", action="write")
write(10,*) N_det
write(10,*) deg
close(10)
deallocate(deg)
end