2024-03-19 14:47:01 +01:00
|
|
|
BEGIN_PROVIDER [ logical, all_shells_closed ]
|
|
|
|
implicit none
|
|
|
|
BEGIN_DOC
|
|
|
|
!
|
|
|
|
END_DOC
|
|
|
|
all_shells_closed = (elec_alpha_num == elec_beta_num)
|
|
|
|
END_PROVIDER
|
|
|
|
|
2019-01-25 11:39:31 +01:00
|
|
|
BEGIN_PROVIDER [double precision, SCF_density_matrix_ao_alpha, (ao_num,ao_num) ]
|
|
|
|
implicit none
|
|
|
|
BEGIN_DOC
|
2019-03-07 16:29:06 +01:00
|
|
|
! $C.C^t$ over $\alpha$ MOs
|
2019-01-25 11:39:31 +01:00
|
|
|
END_DOC
|
|
|
|
|
|
|
|
call dgemm('N','T',ao_num,ao_num,elec_alpha_num,1.d0, &
|
|
|
|
mo_coef, size(mo_coef,1), &
|
|
|
|
mo_coef, size(mo_coef,1), 0.d0, &
|
|
|
|
SCF_density_matrix_ao_alpha, size(SCF_density_matrix_ao_alpha,1))
|
|
|
|
|
|
|
|
END_PROVIDER
|
|
|
|
|
|
|
|
BEGIN_PROVIDER [ double precision, SCF_density_matrix_ao_beta, (ao_num,ao_num) ]
|
|
|
|
implicit none
|
|
|
|
BEGIN_DOC
|
2019-03-07 16:29:06 +01:00
|
|
|
! $C.C^t$ over $\beta$ MOs
|
2019-01-25 11:39:31 +01:00
|
|
|
END_DOC
|
|
|
|
|
|
|
|
call dgemm('N','T',ao_num,ao_num,elec_beta_num,1.d0, &
|
|
|
|
mo_coef, size(mo_coef,1), &
|
|
|
|
mo_coef, size(mo_coef,1), 0.d0, &
|
|
|
|
SCF_density_matrix_ao_beta, size(SCF_density_matrix_ao_beta,1))
|
|
|
|
|
|
|
|
END_PROVIDER
|
|
|
|
|
|
|
|
BEGIN_PROVIDER [ double precision, SCF_density_matrix_ao, (ao_num,ao_num) ]
|
|
|
|
implicit none
|
|
|
|
BEGIN_DOC
|
2019-03-07 16:29:06 +01:00
|
|
|
! Sum of $\alpha$ and $\beta$ density matrices
|
2019-01-25 11:39:31 +01:00
|
|
|
END_DOC
|
|
|
|
ASSERT (size(SCF_density_matrix_ao,1) == size(SCF_density_matrix_ao_alpha,1))
|
2024-03-19 14:47:01 +01:00
|
|
|
if (all_shells_closed) then
|
2019-01-25 11:39:31 +01:00
|
|
|
SCF_density_matrix_ao = SCF_density_matrix_ao_alpha + SCF_density_matrix_ao_alpha
|
|
|
|
else
|
|
|
|
ASSERT (size(SCF_density_matrix_ao,1) == size(SCF_density_matrix_ao_beta ,1))
|
|
|
|
SCF_density_matrix_ao = SCF_density_matrix_ao_alpha + SCF_density_matrix_ao_beta
|
|
|
|
endif
|
|
|
|
|
|
|
|
END_PROVIDER
|
|
|
|
|