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

the casscf does not work with mo optimization ...

This commit is contained in:
eginer 2024-07-12 18:25:17 +02:00
parent 228796cff5
commit 6985d4d549
4 changed files with 94 additions and 80 deletions

View File

@ -79,3 +79,9 @@ type: logical
doc: If |true|, the pt2_max value in the CIPSI is set to 10-10 and will not change
interface: ezfio,provider,ocaml
default: False
[act_mos_opt]
type: logical
doc: If |true|, the active orbitals are also optimized variationally
interface: ezfio,provider,ocaml
default: False

View File

@ -3,4 +3,4 @@ selectors_full
generators_cas
two_body_rdm
dav_general_mat
mo_optimization
mo_optimization_utils

View File

@ -46,6 +46,11 @@ subroutine run
do while (.not.converged)
print*,'pt2_max = ',pt2_max
call run_stochastic_cipsi(Ev,PT2)
! if(act_mos_opt)then DOES NOT WORK
! call run_orb_opt_trust_v2
! call run_stochastic_cipsi(Ev,PT2)
! endif
if(.True.)then
print*,'Ev,PT2',Ev(1),PT2(1)
E_PT2(1:N_states) = Ev(1:N_states) + PT2(1:N_states)
energy_old = energy
@ -55,9 +60,9 @@ subroutine run
call write_time(6)
call write_int(6,iteration,'CAS-SCF iteration = ')
call write_double(6,energy,'State-average CAS-SCF energy = ')
! if(n_states == 1)then
! call ezfio_get_casscf_cipsi_energy_pt2(E_PT2)
! call ezfio_get_casscf_cipsi_energy(PT2)
!! if(n_states == 1)then
!! call ezfio_get_casscf_cipsi_energy_pt2(E_PT2)
!! call ezfio_get_casscf_cipsi_energy(PT2)
double precision :: delta_E_istate, e_av
e_av = 0.d0
do istate=1,N_states
@ -68,12 +73,12 @@ subroutine run
endif
write(*,'(A6,I2,A18,F16.10)')'state ',istate,' E + PT2 energy = ',E_PT2(istate)
write(*,'(A6,I2,A18,F16.10)')'state ',istate,' PT2 energy = ',PT2(istate)
! call write_double(6,E_PT2(istate),'E + PT2 energy = ')
! call write_double(6,PT2(istate),' PT2 = ')
!! call write_double(6,E_PT2(istate),'E + PT2 energy = ')
!! call write_double(6,PT2(istate),' PT2 = ')
enddo
call write_double(6,e_av,'State-average CAS-SCF energy bis = ')
call write_double(6,pt2_max,' PT2_MAX = ')
! endif
!! endif
print*,''
call write_double(6,norm_grad_vec2,'Norm of gradients = ')
@ -132,8 +137,10 @@ subroutine run
soft_touch state_following_casscf
endif
endif
endif
enddo
if(.True.)then
integer :: i
print*,'Converged CASSCF '
print*,'--------------------------'
@ -153,6 +160,7 @@ subroutine run
! write(*,*)mcscf_fock_alpha_mo(i,i)
enddo
endif
end