[Pw_forum] possible bug in scatter_forw.f90

Alexander smogunov at sissa.it
Fri Oct 10 14:55:49 CEST 2008


Dear Manoj

On Friday 10 October 2008 05:20, Manoj Srivastava wrote:
> Any follow ups on the message below? Alexander?
>
> Regards,
> Manoj
>
> On Wed, 8 Oct 2008, Manoj Srivastava wrote:
> > Dear All,
> >  Is any body familiar with the scatter_forw.f90 subroutine of PWCOND? I
> > think there is a bug in this subroutine at the place where you calculate
> > intw2, which is z integration of nonlocal wavefunction with beta
> > function. I have looked up the necessary formulae in the Choi & Ihm's
> > paper (PRB 59, 2267, Jan 1999). In the paper, nonlocal wavefunction has 3
> > terms, one of which contains beta function, say W. The other two parts
> > dont have any W in them, rather they are just plane wave solution.
> > (Please have a look at equation 24 and 26 of the paper ). So, when we are
> > doing z integration of nonlocal wavefunction with beta function W, we
> > should have three terms, one of which should contain two W, but rest
> > should just have one W. On the other hand in the code all three terms
> > contain two beta functions!! (please have a look at line 228 of
> > scatter_forw.f90). I am wondering if my understanding is right?

Your understanding is wrong. On the line 228 you add to the integral ONLY
contribution with two beta functions (from the 1st term in the nonlocal 
function, see Eq. 24) but on the line 393 the contribution from the 2nd term 
is added too. There is no 3rd term since every step you rotate your local 
solutions \psi_n in such a way that b_{\lambda \alpha lm} vanish (see the 
paragraph after Eq. 37). 

 > > I have one more question in the later part of the same subroutine. What
> > does the lapack subroutine
> > ZGESV(2*n2d,2*n2d+norb*npol,amat,2*n2d,ipiv,xmat,2*n2d,info)
> > do?
> > I tried to look it up and i got the idea that it is trying to solve
> > amat*x=xmat, with amat and xmat known and x unknown, and at the end of
> > calculation it stores x in xmat.
> > so, basically it does--  x=[(amat)^(-1)]*xmat. Am i right? So, it changes
> > the structure of xmat from what is defined in 'constructs matrices'
> > part. Is it correct?

Here, you are right.

> > Also, afterwards in this code where  it 'rotates integrals' is not very
> > clear to me.
> > Could somebody please tell me in little detail, what is going on
> > here? 
As I explained before rotation means that every step (at each slab)
you make a linear combination of local solutions \psi_n with the 
transformation matrix  h_{nn'} (see the last paragraph on the p. 2270).
so that the new solutions have the property: 
b_{\lambda n} = \delta_{\lambda n} and the new nonlocal solutions have
b_{\lambda \alpha lm}=0. Doing this transformation of local and nonlocal
solutions you should also perform the corresponding transformations
of the integrals.

> > Also, is this subroutine written just on the basis of Choi and Ihm 
> > paper, or are there more reference to it? If yes, would someone mind
> > mentioning them?
Unfortunately, the paper of Choi and Ihm is very detail, and in the 
PWCOND code we followed it very closely, so no more references
are needed. In our papers we just extended those ideas to ultrasoft
pseudopotentials, magnetism, spin-orbit coupling and so on.
  
Hope this helped you,
regards, Alexander 

> >
> > Regards,
> > Manoj Srivastava
> > Physics Graduate Student
> > University of Florida,
> > Gainesville,FL, USA
>
> _______________________________________________
> Pw_forum mailing list
> Pw_forum at pwscf.org
> http://www.democritos.it/mailman/listinfo/pw_forum



More information about the users mailing list