Skip to content

Commit

Permalink
Merge branch 'dev-stable' of https://github.com/QuantumPackage/qp2 in…
Browse files Browse the repository at this point in the history
…to dev-stable
  • Loading branch information
eginer committed Feb 7, 2025
2 parents 25e98da + 8c7184f commit fcf8898
Show file tree
Hide file tree
Showing 18 changed files with 1,449 additions and 637 deletions.
2 changes: 1 addition & 1 deletion external/ezfio
Submodule ezfio updated from d02132 to dba01c
12 changes: 10 additions & 2 deletions scripts/qp_exc_energy.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,15 @@ def compute(data):
B = np.array( [ [ data[-1][0] ],
[ data[-2][0] ] ] )
E0 = np.linalg.solve(A,B)[1]
E0 = E0[0]

A = np.array( [ [ data[-1][4], 1. ],
[ data[-2][4], 1. ] ] )
B = np.array( [ [ data[-1][3] ],
[ data[-2][3] ] ] )
E1 = np.linalg.solve(A,B)[1]
E1 = E1[0]

average_2 = (E1-E0)*to_eV

A = np.array( [ [ data[-1][1], 1. ],
Expand All @@ -170,14 +174,18 @@ def compute(data):
B = np.array( [ [ data[-1][0] ],
[ data[-2][0] ],
[ data[-3][0] ] ] )
E0 = np.linalg.lstsq(A,B,rcond=None)[0][1]
E0 = np.linalg.lstsq(A,B,rcond=None)[0]
E0 = E0[0][0]

A = np.array( [ [ data[-1][4], 1. ],
[ data[-2][4], 1. ],
[ data[-3][4], 1. ] ] )
B = np.array( [ [ data[-1][3] ],
[ data[-2][3] ],
[ data[-3][3] ] ] )
E1 = np.linalg.lstsq(A,B,rcond=None)[0][1]
E1 = np.linalg.lstsq(A,B,rcond=None)[0]
E1 = E1[0][0]

average_3 = (E1-E0)*to_eV

exc = ((data[-1][3] + data[-1][4]) - (data[-1][0] + data[-1][1])) * to_eV
Expand Down
18 changes: 14 additions & 4 deletions src/casscf_cipsi/chol_bielec.irp.f
Original file line number Diff line number Diff line change
Expand Up @@ -191,10 +191,15 @@ double precision function bielec_PQxx_no(i_mo, j_mo, i_ca, j_ca)
END_DOC
integer, intent(in) :: i_ca, j_ca, i_mo, j_mo
integer :: ii_ca, jj_ca
double precision :: bielec_no_basis
ii_ca = list_core_inact_act(i_ca)
jj_ca = list_core_inact_act(j_ca)
bielec_PQxx_no = bielec_no_basis(i_mo,j_mo,ii_ca,jj_ca)
! double precision :: bielec_no_basis
! bielec_PQxx_no = bielec_no_basis(i_mo,j_mo,ii_ca,jj_ca)
integer :: i
bielec_PQxx_no = 0.d0
do i = 1, cholesky_mo_num
bielec_PQxx_no = bielec_PQxx_no + cholesky_no_total_transp(i,i_mo, j_mo) * cholesky_no_total_transp(i,ii_ca,jj_ca)
enddo
end

double precision function bielec_PxxQ_no(i_mo, j_ca, i_ca, j_mo)
Expand All @@ -206,10 +211,15 @@ double precision function bielec_PxxQ_no(i_mo, j_ca, i_ca, j_mo)
END_DOC
integer, intent(in) :: i_ca, j_ca, i_mo, j_mo
integer :: ii_ca, jj_ca
double precision :: bielec_no_basis
ii_ca = list_core_inact_act(i_ca)
jj_ca = list_core_inact_act(j_ca)
bielec_PxxQ_no = bielec_no_basis(i_mo, jj_ca, ii_ca, j_mo)
double precision :: bielec_no_basis
! bielec_PxxQ_no = bielec_no_basis(i_mo, jj_ca, ii_ca, j_mo)
integer :: i
bielec_PxxQ_no = 0.d0
do i = 1, cholesky_mo_num
bielec_PxxQ_no = bielec_PxxQ_no + cholesky_no_total_transp(i,i_mo, jj_ca) * cholesky_no_total_transp(i,ii_ca,j_mo)
enddo

end

Expand Down
5 changes: 3 additions & 2 deletions src/ccsd/ccsd_space_orb.irp.f
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
! Code

program ccsd

implicit none

BEGIN_DOC
! Closed-shell CCSD
END_DOC
read_wf = .True.
touch read_wf

Expand Down
15 changes: 5 additions & 10 deletions src/ccsd/ccsd_space_orb_sub.irp.f
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ subroutine run_ccsd_space_orb

double precision, allocatable :: all_err(:,:), all_t(:,:)
integer, allocatable :: list_occ(:), list_vir(:)
integer(bit_kind) :: det(N_int,2)
integer :: nO, nV, nOa, nVa

call set_multiple_levels_omp(.False.)
Expand All @@ -38,9 +37,8 @@ subroutine run_ccsd_space_orb
PROVIDE all_mo_integrals
endif

det = psi_det(:,:,cc_ref)
print*,'Reference determinant:'
call print_det(det,N_int)
call print_det(psi_det(1,1,cc_ref),N_int)

nOa = cc_nOa
nVa = cc_nVa
Expand All @@ -57,10 +55,6 @@ subroutine run_ccsd_space_orb
allocate(list_occ(nO),list_vir(nV))
list_occ = cc_list_occ
list_vir = cc_list_vir
! Debug
!call extract_list_orb_space(det,nO,nV,list_occ,list_vir)
!print*,'occ',list_occ
!print*,'vir',list_vir

! GPU arrays
call gpu_allocate(d_cc_space_f_oo, nO, nO)
Expand Down Expand Up @@ -183,10 +177,12 @@ subroutine run_ccsd_space_orb
call guess_t2(nO,nV,cc_space_f_o,cc_space_f_v,cc_space_v_oovv,h_t2)
call gpu_upload(h_t2, t2)

deallocate(h_t1, h_t2)

call update_tau_space(nO,nV,h_t1,t1,t2,tau)
call update_tau_space(nO,nV,t1%f,t1,t2,tau)
call update_tau_x_space(nO,nV,tau,tau_x)
call det_energy(det,uncorr_energy)

call det_energy(psi_det(1,1,cc_ref),uncorr_energy)
print*,'Det energy', uncorr_energy

call ccsd_energy_space_x(nO,nV,d_cc_space_v_oovv,d_cc_space_f_vo,tau_x,t1,energy)
Expand Down Expand Up @@ -316,7 +312,6 @@ subroutine run_ccsd_space_orb

call save_energy(uncorr_energy + energy, e_t)

deallocate(h_t1, h_t2)
if (do_mo_cholesky) then
call gpu_deallocate(d_cc_space_v_oo_chol)
call gpu_deallocate(d_cc_space_v_ov_chol)
Expand Down
2 changes: 0 additions & 2 deletions src/ccsd/ccsd_spin_orb.irp.f
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
! Prog

program ccsd

implicit none
Expand Down
Loading

0 comments on commit fcf8898

Please sign in to comment.