From 2465b1b91d843f5588d594a4e3d845cfd74820b6 Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Sun, 21 Mar 2021 10:26:03 +0100 Subject: [PATCH] Comment to optimize DIIS --- src/scf_utils/roothaan_hall_scf.irp.f | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/scf_utils/roothaan_hall_scf.irp.f b/src/scf_utils/roothaan_hall_scf.irp.f index 5f445ad6..a63b46b6 100644 --- a/src/scf_utils/roothaan_hall_scf.irp.f +++ b/src/scf_utils/roothaan_hall_scf.irp.f @@ -218,7 +218,7 @@ END_DOC scratch(ao_num,ao_num) & ) -! Compute the matrices B and X + ! Compute the matrices B and X B_matrix_DIIS(:,:) = 0.d0 do j=1,dim_DIIS j_DIIS = min(dim_DIIS,mod(iteration_SCF-j,max_dim_DIIS)+1) @@ -226,7 +226,7 @@ END_DOC i_DIIS = min(dim_DIIS,mod(iteration_SCF-i,max_dim_DIIS)+1) -! Compute product of two errors vectors + ! Compute product of two errors vectors call dgemm('N','N',ao_num,ao_num,ao_num, & 1.d0, & @@ -235,7 +235,7 @@ END_DOC 0.d0, & scratch,size(scratch,1)) -! Compute Trace + ! Compute Trace do k=1,ao_num B_matrix_DIIS(i,j) = B_matrix_DIIS(i,j) + scratch(k,k) @@ -243,6 +243,17 @@ END_DOC enddo enddo +! TODO : Could be simplified (to be checked) +! +! call dgemm('T','N', & +! min(dim_DIIS,iteration_SCF), min(dim_DIIS,iteration_SCF), & +! ao_num*ao_num, & +! 1.d0, & +! error_matrix_DIIS,size(error_matrix_DIIS,1)*size(error_matrix_DIIS,2), & +! error_matrix_DIIS,size(error_matrix_DIIS,1)*size(error_matrix_DIIS,2), & +! 0.d0, & +! B_matrix_DIIS,size(B_matrix_DIIS,1)) + ! Pad B matrix and build the X matrix C_vector_DIIS(:) = 0.d0