Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add maximum overlap method in hartree fock #347

Merged
merged 2 commits into from
Sep 20, 2024

Conversation

antoine-marie
Copy link

This commit introduces the do_mom keyword in scf_utils to run maximum overlap method hartree-fock calculation.

Copy link
Member

@scemama scemama left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!!

do j = 1, mo_num ! curent mo
do k = 1, ao_num
do l = 1, ao_num
overlap(i,j) += mo_coef_begin_iteration(k,i)* ao_overlap(k,l) * mo_coef(l,j)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please change ao_overlap(k,l) into ao_overlap(l,k) for better array access :-)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But it would be better to use dgemm here:

call dgemm('T','N', mo_num, ao_num, ao_num, 1.d0, &
mo_coef_begin_iteration, size(mo_coef_begin_iteration,1), &
ao_overlap, size(ao_overlap,1), 0.d0, &
tmp, size(tmp,1))

call dgemm('N','N', mo_num, mo_num, ao_num, 1.d0, &
tmp, size(tmp,1), &
mo_coef, size(mo_coef, 1), 0.d0, &
overlap, size(overlap,1) )

overlap_alpha(:,:) = 0d0
proj_alpha(:) = 0d0
iorder_alpha(:) = 0d0
do i = 1, mo_num ! old mo
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, dgemm!!!

Comment on lines 115 to 120
! if ( (SCF_algorithm == 'DIIS').and.(Delta_Energy_SCF > 0.d0) ) then
! Fock_matrix_AO(1:ao_num,1:ao_num) = Fock_matrix_DIIS (1:ao_num,1:ao_num,index_dim_DIIS)
! Fock_matrix_AO_alpha = Fock_matrix_AO*0.5d0
! Fock_matrix_AO_beta = Fock_matrix_AO*0.5d0
! TOUCH Fock_matrix_AO_alpha Fock_matrix_AO_beta
! endif
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't comment, delete please

@scemama scemama merged commit 360ac7b into QuantumPackage:dev-stable Sep 20, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants