question about cgwf

Documentation, Web site and code modifications

Moderators: baguetl, routerov

Locked
chen
Posts: 13
Joined: Mon Apr 19, 2010 4:58 am

question about cgwf

Post by chen » Mon Jun 06, 2011 4:59 pm

Hi there,

I have a question about the code in cgwf.F90 file. to compute the steepest decent direction, why the code does not use the vresid, but use the ghc which is <C|H|C> (right?). This seems to be inconsistent with the Eq 5.10 in M.C. Payen's paper titled "iterative minimization technique for ab initio total-energy calculations: molecule dynamics and conjugate gradient".

I have pasted part of the code here (in cgwf.F90)

Code: Select all

!          ======================================================================
!          =========== COMPUTE THE STEEPEST DESCENT DIRECTION ===================
!          ======================================================================

!          Compute the steepest descent direction
           if (gen_eigenpb) then
!            Store <G|H-lambda.S|C> in direc
!            $OMP PARALLEL DO PRIVATE(ipw) &
!            $OMP&SHARED(direc,npw,nspinor,vresid)
             do ipw=1,npw*nspinor
               direc(1,ipw)=vresid(1,ipw)
               direc(2,ipw)=vresid(2,ipw)
             end do
!            $OMP END PARALLEL DO
           else
!            Store <G|H|C> in direc
!            $OMP PARALLEL DO PRIVATE(ipw) &
!            $OMP&SHARED(direc,ghc,npw,nspinor)
             do ipw=1,npw*nspinor
               direc(1,ipw)=ghc(1,ipw)
               direc(2,ipw)=ghc(2,ipw)
             end do
!            $OMP END PARALLEL DO
           end if
           deallocate(vresid)



best
chen

User avatar
torrent
Posts: 127
Joined: Fri Aug 14, 2009 7:40 pm

Re: question about cgwf

Post by torrent » Wed Jun 08, 2011 11:59 am

Hi Chen,

There is a little subltelty ;) !
(it would be a big surprise to find the CG algorithm as buggy !, it is used for years...).

Let's consider we use norm-conserving pseudopotentials (without any overlap between WFs).

In Payne's paper, just try to mix Eq.5.10 and Eq.5.11...
...and you get:

Zeta_prime_i= =- ( H.Psi_i - Sum_j/=i [ <Psi_j| H.Psi_i>. Psi_j )


so, direc=ghc is correct !
Marc Torrent
CEA - Bruyères-le-Chatel
France

chen
Posts: 13
Joined: Mon Apr 19, 2010 4:58 am

Re: question about cgwf

Post by chen » Wed Jun 08, 2011 4:31 pm

Hi

thanks for your reply. But it is still confusing, since by mixing 5.11 and 5.10 in Payne's paper

I will get

Code: Select all

 Zeta_prime_i= =- ( H.Psi_i - <Psi_i| H.Psi_i>. Psi_i ) 


actually the lambda_i^m in Eq. 5.11 comes from the Lagrange multiplier due to the <psi_i|psi_i> = 1 constraint.

yes, I am also surprised that the code in cgwf.F90 looks different from the Payne's paper.

any ideas?

best
chen

Locked