GithubHelp home page GithubHelp logo

Comments (2)

QijingZheng avatar QijingZheng commented on July 20, 2024

Hi

In my code, there is no such assumption that the lattice should be orthogonal. In fact, the snippet you showed is just a rewrite of the Fortran version in VASP. Please refer to the VASP source code, e.g. vasp.5.4.4 main.F ln966-968. Moreover, the number of g-vectors generated by my code and VASP are consistent, otherwise there will be an error and the code will not proceed.

In your example, your estimation is correct about n <= 500. However, please note that Anorm is the norm of the real-space basis vectors other than the reciprocal-space ones.

Since you mentioned WaveTrans.f90, I have to tell you that the code calculates the real-space wavefunction in a very stupid way, i.e. the author just added all the plane-waves one by one, which is inefficient and takes a long time. On the other hand, the more efficient way is to use the FFT to do the transformation. I have seen someone used the wavetrans.f90 algorithm to plot the wavefunction and it took about 1 hour to get just one single KS orbital, while my code get the same orbital in just 1 second.

http://www.andrew.cmu.edu/user/feenstra/wavetrans/source/WaveTransPlot.f90

do iz=0,2*nb3max
   z=dble(iz)/dble(1+2*nb3max)
   xyz(3)=z
   csum=cmplx(0.,0.)
   do iplane=1,nplane
      ig=igall(:,iplane)
      wkpg=wk+ig
      csum=csum+coeff(iplane)* &
           cdexp(2.*pi*cmplx(0.,1.)*dot_product(wkpg,xyz))
   enddo
   csum=csum/dsqrt(Vcell)
!!$ output z*a3mag for units of Angstroms
   write(6,*) sngl(z),sngl(real(csum)),sngl(dimag(csum))
enddo

from vaspbandunfolding.

atbug avatar atbug commented on July 20, 2024

Thank you.

I am trying to port the code to julia. I now realize your code is indeed correct. Sorry for the interuption.

from vaspbandunfolding.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.