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

Fixed small bugs

This commit is contained in:
Anthony Scemama 2019-06-27 23:46:30 +02:00
parent 92e44f53ba
commit 82bbf95fea
4 changed files with 20 additions and 7 deletions

View File

@ -141,6 +141,10 @@ END_PROVIDER
n_act_orb_tmp = 0 n_act_orb_tmp = 0
n_virt_orb_tmp = 0 n_virt_orb_tmp = 0
n_del_orb_tmp = 0 n_del_orb_tmp = 0
core_bitmask = 0_bit_kind
inact_bitmask = 0_bit_kind
act_bitmask = 0_bit_kind
virt_bitmask = 0_bit_kind
do i = 1, mo_num do i = 1, mo_num
if(mo_class(i) == 'Core')then if(mo_class(i) == 'Core')then
n_core_orb_tmp += 1 n_core_orb_tmp += 1

View File

@ -3,8 +3,8 @@ program casscf
BEGIN_DOC BEGIN_DOC
! TODO : Put the documentation of the program here ! TODO : Put the documentation of the program here
END_DOC END_DOC
! no_vvvv_integrals = .True. no_vvvv_integrals = .True.
! SOFT_TOUCH no_vvvv_integrals SOFT_TOUCH no_vvvv_integrals
call run call run
end end
@ -13,15 +13,13 @@ subroutine run
double precision :: energy_old, energy double precision :: energy_old, energy
logical :: converged logical :: converged
integer :: iteration integer :: iteration
PROVIDE mo_two_e_integrals_in_map
converged = .False. converged = .False.
energy = 0.d0 energy = 0.d0
mo_label = "MCSCF" mo_label = "MCSCF"
iteration = 1 iteration = 1
do while (.not.converged) do while (.not.converged)
call run_cipsi call run_stochastic_cipsi
energy_old = energy energy_old = energy
energy = eone+etwo+ecore energy = eone+etwo+ecore
@ -39,6 +37,7 @@ subroutine run
iteration += 1 iteration += 1
FREE mo_integrals_map mo_two_e_integrals_in_map psi_det psi_coef FREE mo_integrals_map mo_two_e_integrals_in_map psi_det psi_coef
SOFT_TOUCH mo_coef N_det SOFT_TOUCH mo_coef N_det
enddo enddo
end end

View File

@ -135,7 +135,7 @@ subroutine ZMQ_pt2(E, pt2,relative_error, error, variance, norm, N_in)
PROVIDE psi_occ_pattern_hii det_to_occ_pattern PROVIDE psi_occ_pattern_hii det_to_occ_pattern
endif endif
if (N_det < max(4,N_states)) then if (N_det <= max(4,N_states)) then
pt2=0.d0 pt2=0.d0
variance=0.d0 variance=0.d0
norm=0.d0 norm=0.d0
@ -719,6 +719,15 @@ END_PROVIDER
double precision :: rss double precision :: rss
double precision, external :: memory_of_double, memory_of_int double precision, external :: memory_of_double, memory_of_int
if (N_det_generators == 1) then
pt2_w = 1.d0
pt2_cw = 1.d0
pt2_W_T = 1.d0
pt2_u_0 = 1.d0
pt2_n_0 = 1
return
endif
rss = memory_of_double(2*N_det_generators+1) rss = memory_of_double(2*N_det_generators+1)
call check_mem(rss,irp_here) call check_mem(rss,irp_here)
@ -754,7 +763,7 @@ END_PROVIDER
end if end if
pt2_n_0(1) += 1 pt2_n_0(1) += 1
if(N_det_generators - pt2_n_0(1) < pt2_minDetInFirstTeeth * pt2_N_teeth) then if(N_det_generators - pt2_n_0(1) < pt2_minDetInFirstTeeth * pt2_N_teeth) then
stop "teeth building failed" print *, "teeth building failed"
end if end if
end do end do
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

View File

@ -55,6 +55,7 @@ END_PROVIDER
nongen(inongen) = i nongen(inongen) = i
endif endif
enddo enddo
ASSERT (m == N_det_generators)
psi_det_sorted_gen(:,:,:N_det_generators) = psi_det_generators(:,:,:N_det_generators) psi_det_sorted_gen(:,:,:N_det_generators) = psi_det_generators(:,:,:N_det_generators)
psi_coef_sorted_gen(:N_det_generators, :) = psi_coef_generators(:N_det_generators, :) psi_coef_sorted_gen(:N_det_generators, :) = psi_coef_generators(:N_det_generators, :)