[Wannier] Data grids in XSF files generated by Wannier90
Rok Zitko
rok.zitko at ijs.si
Thu Feb 25 15:35:43 CET 2010
Hi,
For reference, I'm posting this discussion of the format of XSF files as
generated by Wannier90.
Regards,
Rok
> Dear Arash,
>
> I think I understand: rather than writing the full "general grids",
> as expected in xcrysden, the code actually outputs "periodic grids"
> (i.e., it omits the redundant periodic replicas) and compensates for
> the difference by subtracting 1, i.e. rescales by (ngx-1)/ngx or,
> generally, (ngs*ngx-1)/ngx. So the output files strictly speaking do
> not
> conform to the XSF specification, but they are still correct
> as long as a single such cell is used. Of course, there is no need
> to ever increase "Number of units shown" from 1 in xcrysden, so there
> is
> no real problem in practice.
>
> One should be careful in calculations, though, since the distance
> between two points is a_1/(ngs*ngx)=dirl_1/(ngs*ngx-1), etc. This
> seems
> obvious to me now, but I don't think it is mentioned in the
> documentation.
>
> Thanks for help!
>
> Regards,
> Rok
>
> > Thanks for your email. The xsf plotting routines in plot.F90 are
> > somewhat legacy code that has not been updated for some time now. It
> is
> > on my list of things to do, so hopefully the next minor release
> will
> > have more transparent commenting and a more efficient implementation
> for
> > plotting just one unit cell rather than wannier_plot_supercell unit
> > cells in each direction.
> >
> > Regarding your specific question about the rescaling of the
> bounding
> > vectors in the DATAGRID block, I explain my understanding of this
> below.
> > I've cc'ed Jonathan Yates as he may be able to add more.
> >
> > Let's assume for simplicity that wannier_plot_supercell = ngs = 1.
> Then
> > the lattice vectors are rescaled as follows (lines 1247-1252 of
> plot.F90
> > in v1.2 of the code):
> >
> > fxcry(1)=real(ngs*ngx-1,dp)/real(ngx,dp)
> > fxcry(2)=real(ngs*ngy-1,dp)/real(ngy,dp)
> > fxcry(3)=real(ngs*ngz-1,dp)/real(ngz,dp)
> > do j=1,3
> > dirl(:,j)=fxcry(:)*real_lattice(:,j)
> > end do
> >
> > For further simplification, let's consider one dimension with ngx=5
> > gridpoints, in which case the above reduces to
> >
> > dirl = (4/5) * real_lattice
> >
> > ie, the lattice vector is scaled by a factor of 4/5 or (ngx-1)/ngx
> > (rather than (n+1)/n as you mention in your email). This is due to
> the
> > distinction between "periodic grids" and "standard grids", as
> explained
> > here:
> >
> > http://www.xcrysden.org/doc/XSF.html#__toc__12
> >
> > The scaled vector dirl takes you from, say, the origin to the last
> > unique point in that direction on the grid, whereas real_lattice
> takes
> > you to the origin in the neighbouring supercell. As xcrysden uses
> > standard grids, not periodic ones, the spanning vectors in the
> DATAGRID
> > block need to have this rescaling.
> >
> > Hope that helps.
> >
> > Best wishes,
> >
> > Arash
> >
> > :------------------------------------------------------------:
> > : Dr. Arash A. Mostofi :: a.mostofi at imperial.ac.uk :
> > : Lecturer and RCUK Fellow :: :
> > : Depts. of Materials & Physics :: :
> > : Imperial College London :: T +44 (0)207 594 8154 :
> > : London SW7 2AZ, United Kingdom :: F +44 (0)207 594 6757 :
> > :------- http://www.cmth.ph.ic.ac.uk/people/a.mostofi -------:
> >
> > Rok Zitko wrote:
> > > Dear dr. Mostofi,
> > >
> > > I am using the Wannier90 package for studying various
> surface-science
> > > problems. Recently I noticed that the lengths of spanning vectors
> in the
> > > generated XSF files (in the BEGIN_DATAGRID_3D_UNKNOWN) are
> rescaled by
> > > (Nx+1)/Nx, (Ny+1)/Ny, (Nz+1)/Nz along the different spatial
> directions.
> > > According to Tone Kralj, the author of xcrysden, the spanning
> vectors
> > > should be the same as the unit cell vectors (multiplied by the
> parameter
> > > wannier_plot_supercell, an integer). Unfortunately the source code
> file
> > > plot.F90 is rather sparsely commented, thus I am not able to
> understand
> > > the logic behind such rescaling. Are the data points also
> calculated at
> > > the same rescaled coordinates or are the spanning vectors simply
> wrong?
> > > Of course, for visualisation purposes this does not really matter
> since
> > > the change is rather small, but I also often postprocess the XSF
> files
> > > to compute various other quantities, thus the (Nx+1)/Nx factors do
> > > matter.
> > >
> > > Please feel free to forward my email to anyone who is familiar
> with the
> > > relevant code in plot.F90.
> > >
> > > Thank you in advance!
> > >
> > > Yours sincerely,
> > > Rok Zitko
> > >
> > >
>
>
More information about the Wannier
mailing list