From gianluca.giovannetti at gmail.com Wed Feb 3 19:39:51 2010 From: gianluca.giovannetti at gmail.com (Gianluca Giovannetti) Date: Wed, 3 Feb 2010 19:39:51 +0100 Subject: [Wannier] W90 outputs Message-ID: <7234ba151002031039va4229adk35e4ae95fda0a072@mail.gmail.com> Dear All, i`m starting using W90. i would like to have some informations about the output in w90. first of all. how one can get the value of spontaneous polarization? i have made non-spin polarized calculations for BaTiO3 in the non-ferroelectric (A) and ferroelectric phases (B). i get in seename.wout: (A) Final State WF centre and spread 1 ( 0.000000, 1.969243, 1.969243 ) 1.52416606 WF centre and spread 2 ( 0.000000, 1.969243, 1.969243 ) 1.16048539 WF centre and spread 3 ( 0.000000, 1.969243, 1.969243 ) 1.52416606 WF centre and spread 4 ( 1.969243, 1.969243, 0.000000 ) 1.16048539 WF centre and spread 5 ( 1.969243, 1.969243, 0.000000 ) 1.52416606 WF centre and spread 6 ( 1.969243, 1.969243, 0.000000 ) 1.52416606 WF centre and spread 7 ( 1.969243, 0.000000, 1.969243 ) 1.52416606 WF centre and spread 8 ( 1.969243, 0.000000, 1.969243 ) 1.52416606 WF centre and spread 9 ( 1.969243, 0.000000, 1.969243 ) 1.16048539 Sum of centres and spreads ( 11.815458, 11.815458, 11.815458 ) 12.62645255 (B) Final State WF centre and spread 1 ( 0.000000, 1.972500, 1.923259 ) 1.52037213 WF centre and spread 2 ( 0.000000, 1.972500, 1.929942 ) 1.18281587 WF centre and spread 3 ( 0.000000, 1.972500, 1.923678 ) 1.52764645 WF centre and spread 4 ( 1.972500, 1.972500, -0.113840 ) 1.16110148 WF centre and spread 5 ( 1.972500, 1.972500, -0.156873 ) 1.51465988 WF centre and spread 6 ( 1.972500, 1.972500, -0.156873 ) 1.51465988 WF centre and spread 7 ( 1.972500, 0.000000, 1.923259 ) 1.52037213 WF centre and spread 8 ( 1.972500, 0.000000, 1.923678 ) 1.52764645 WF centre and spread 9 ( 1.972500, 0.000000, 1.929942 ) 1.18281587 Sum of centres and spreads ( 11.834999, 11.834999, 11.126171 ) 12.65209014 is the electronic contribution Pele=2*(11.815458-11.126171)? (factor 2 only for non spin polarized calculations) what are the units? is e*Angst? i guess i must have to divide by unit cell volume. for the ionic contribution is fine. second of all. Using the flag write_r2mn=true one can get the hamiltonian matrix elements in the WF basis set. is the WF basis set consistent with the local set of axis? i read i can also rotate (using for example z=1,1,1 if i want my 3z2-r2 to be along the direction 1,1,1 of the unit cell) in order to get the hamiltonian matrix elements in the rotated WF basis set. How is the file written? probably it is enough to know in which part of the code this part works. :-) i thank you in advance. cheers, Gianluca -------------- next part -------------- An HTML attachment was scrubbed... URL: From gianluca.giovannetti at gmail.com Fri Feb 12 16:46:42 2010 From: gianluca.giovannetti at gmail.com (Gianluca Giovannetti) Date: Fri, 12 Feb 2010 16:46:42 +0100 Subject: [Wannier] xaxis Message-ID: <7234ba151002120746s3e6605ccr3779ef3162264ab4@mail.gmail.com> Dear All, i`m a beginner using W90. i`m working with FeSe. i have the following problem to understand how the flag xaxis works in the file ".win". i have a unit cell in the PW simulation with two Fe (o) sites as here (+ and - are Se sites): Y | --------------------- | | o1 + | | | | | | | | | - 2o | | --------------------- | |------------------------------ X X=1,0,0 Y=0,1,0 (Z=0,0,1 is pointing out of the plane) however i want to have printed the H(R) in the file "_hr.dat" such to have Wannier functions of Fe states with internal reference frame directed along the Fe-Fe bonds (then pointing along o1-----2o bonds). Formally, if we want to maintain that e_g orbitals are x^2 - y^2 and 3z^2 - r^2 and t_2g are xy, yz, zx then the above choice of coordinate system gives the correct e_g - t_2g splitting coming from the Se crystal field (e_g go lower in energy and t_2g higher). As my hamiltonian must be written in this set, my idea would be to set x'=1,-1,0 in the file ".win". The output and the WFs look ok. here the input file: ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- num_wann = 10 num_iter = 5000 dis_num_iter = 500 iprint = 3 !here we exclude all bands except the O2p bands exclude_bands : 1-16,27-50 !bands_plot_project : 1,2,3,4,5,6,7,8,9,10 write_r2mn=.true. hr_plot=.true. kmesh_tol=0.00001 begin atoms_cart ang Fe 2.82697500 0.94232500 2.74305000 Fe 0.94232500 2.82697500 2.74305000 Se 0.94232500 0.94232500 4.24459557 Se 2.82697500 2.82697500 1.24150443 end atoms_cart begin kpoint_path G 0.0000 0.0000 0.000 X 0.5000 0.0000 0.0000 X 0.5000 0.0000 0.000 M 0.5000 0.5000 0.000 M 0.5000 0.5000 0.000 Y 0.0000 0.5000 0.0000 Y 0.0000 0.5000 0.000 G 0.0000 0.0000 0.0000 G 0.0000 0.0000 0.000 Z 0.0000 0.0000 0.5000 end kpoint_path bands_plot =T !fermi_surface_plot = .true. !To plot the WF !wannier_plot = T !wannier_plot_supercell = 2 !wannier_plot_list = 1 2 3 4 5 6 7 8 9 10 !restart = plot guiding_centres = T begin projections Fe:dxy;dxz;dyz;dx2-y2;dz2:x=1,-1,0 end projections begin unit_cell_cart bohr 7.12294416914163 0.0 0.0 0.0 7.12294416914163 0.0 0.0 0.0 10.367225746512 end unit_cell_cart mp_grid : 12 12 8 begin kpoints (.....) end kpoints ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- is this correct? do i get what i want in this way? thank you. Gianluca -------------- next part -------------- An HTML attachment was scrubbed... URL: From jonathan.yates at materials.ox.ac.uk Sat Feb 13 00:38:32 2010 From: jonathan.yates at materials.ox.ac.uk (Jonathan Yates) Date: Fri, 12 Feb 2010 23:38:32 +0000 Subject: [Wannier] xaxis In-Reply-To: <7234ba151002120746s3e6605ccr3779ef3162264ab4@mail.gmail.com> References: <7234ba151002120746s3e6605ccr3779ef3162264ab4@mail.gmail.com> Message-ID: On 12 Feb 2010, at 15:46, Gianluca Giovannetti wrote: > however i want to have printed the H(R) in the file "_hr.dat" such > to have Wannier functions of Fe states with internal reference frame > directed along the Fe-Fe bonds (then pointing along o1-----2o bonds). > Formally, if we want to maintain that e_g orbitals are x^2 - y^2 and > 3z^2 - r^2 and t_2g are xy, yz, zx then the above choice of > coordinate system gives > the correct e_g - t_2g splitting coming from the Se crystal field > (e_g go lower in energy and t_2g higher). > > As my hamiltonian must be written in this set, my idea would be to > set x'=1,-1,0 in the file ".win". The global x,y,z axes are set by your pw code. Wannier90 can use a projection of the bloch states onto a local function times spherical harmonics as an initial guesses for the MLWF. For example a p_z function. You might want the local coordinate system of this function to be different from the global x,y,z - in otherwords to have the p_z point in an arbitary direction. For this reason we allowed the possibility to specify the orientation for each projection. So what you did to align your starting guess functions is sound. However, these functions are just starting guesses. The MLWF should be independent of these functions. No symmetry is imposed during the minimisation. Maybe the true MLWF do have the symmetry you want - in any case you can't automatically enforce that they have this symmetry. In practice the landscape can be complex, and you might find picking a 'good' starting guess helps to get to the true minimum. (if two different initial projections lead to different sets of WF, you can at least compare the spreads). It might be worth looking at Phys. Rev. B 65, 184422 (2002) Maximally localized Wannier functions in antiferromagnetic MnO within the FLAPW formalism In this situation the minimizing the spread was not sufficient to uniquely define the MLWF - and a further step was used to obtain MLWF with the desired symmetry. Jonathan -- Department of Materials, University of Oxford, Parks Road, Oxford, OX1 3PH, UK tel: +44 (0)1865 612797 http://users.ox.ac.uk/~oums0549/ From gianluca.giovannetti at gmail.com Sat Feb 13 07:01:08 2010 From: gianluca.giovannetti at gmail.com (Gianluca Giovannetti) Date: Sat, 13 Feb 2010 07:01:08 +0100 Subject: [Wannier] xaxis In-Reply-To: References: <7234ba151002120746s3e6605ccr3779ef3162264ab4@mail.gmail.com> Message-ID: <7234ba151002122201h7bec09a9s9e4398cac4ccf2d0@mail.gmail.com> Dear Jonathan (and All), as i understand the flag xaxis helps to converge the WFs function to the correct one but it doesn`t change the local and internal frame which is set from PW calculations. I had a look to the paper suggested. I get Wannier functions which have correct shape and they are the same starting from different starting guess. probably i`m in the correct minimum. Then the only solution is to rotate the unit cell in PW calculations such to have Wannier functions of Fe states with internal reference frame directed along the Fe-Fe bonds (then pointing along o1-----2o bonds) from: Y | --------------------- | | o1 + | | | | | | | | | - 2o | | --------------------- | |------------------------------ X to (rotating the unit cell of 45 degree): Y | | + | | o1 2o | | - | |------------------------------ X X=1,0,0 Y=0,1,0 (Z=0,0,1 is pointing out of the plane) Then i expect the Hlda(R)_n,m is written in the correct local frame. Is this way correct? thank you. Gianluca On Sat, Feb 13, 2010 at 12:38 AM, Jonathan Yates < jonathan.yates at materials.ox.ac.uk> wrote: > > On 12 Feb 2010, at 15:46, Gianluca Giovannetti wrote: > > however i want to have printed the H(R) in the file "_hr.dat" such > > to have Wannier functions of Fe states with internal reference frame > > directed along the Fe-Fe bonds (then pointing along o1-----2o bonds). > > Formally, if we want to maintain that e_g orbitals are x^2 - y^2 and > > 3z^2 - r^2 and t_2g are xy, yz, zx then the above choice of > > coordinate system gives > > the correct e_g - t_2g splitting coming from the Se crystal field > > (e_g go lower in energy and t_2g higher). > > > > As my hamiltonian must be written in this set, my idea would be to > > set x'=1,-1,0 in the file ".win". > > > The global x,y,z axes are set by your pw code. Wannier90 can use a > projection of the bloch states onto a local function times spherical > harmonics as an initial guesses for the MLWF. For example a p_z > function. You might want the local coordinate system of this function > to be different from the global x,y,z - in otherwords to have the p_z > point in an arbitary direction. For this reason we allowed the > possibility to specify the orientation for each projection. > So what you did to align your starting guess functions is sound. > > However, these functions are just starting guesses. The MLWF should be > independent of these functions. No symmetry is imposed during the > minimisation. Maybe the true MLWF do have the symmetry you want - in > any case you can't automatically enforce that they have this symmetry. > In practice the landscape can be complex, and you might find picking > a 'good' starting guess helps to get to the true minimum. (if two > different initial projections lead to different sets of WF, you can at > least compare the spreads). > > It might be worth looking at > Phys. Rev. B 65, 184422 (2002) > Maximally localized Wannier functions in antiferromagnetic MnO within > the FLAPW formalism > In this situation the minimizing the spread was not sufficient to > uniquely define the MLWF - and a further step was used to obtain MLWF > with the desired symmetry. > > > Jonathan > > > -- > Department of Materials, University of Oxford, Parks Road, Oxford, OX1 > 3PH, UK > tel: +44 (0)1865 612797 http://users.ox.ac.uk/~oums0549/ > > _______________________________________________ > Wannier mailing list > Wannier at quantum-espresso.org > http://www.democritos.it/mailman/listinfo/wannier > -------------- next part -------------- An HTML attachment was scrubbed... URL: From gianluca.giovannetti at gmail.com Wed Feb 24 10:03:37 2010 From: gianluca.giovannetti at gmail.com (Gianluca Giovannetti) Date: Wed, 24 Feb 2010 10:03:37 +0100 Subject: [Wannier] PW+W90 spin polarized calculations Message-ID: <7234ba151002240103n1070be8dwd9699230bbdc1e82@mail.gmail.com> Dear All, i`m performing PW+W90 spin polarized calculations. I first do a scf run: --------------------------------------------------------------------------------------- FeSe &control calculation = 'scf' restart_mode = 'from_scratch' prefix = 'fese' tprnfor = .true. pseudo_dir = './' outdir = './' iprint = 2 / &system ibrav = 8 celldm(1) = 10.0733642480265 celldm(2) = 1.00000000000000 celldm(3) = 1.0291721306383 nat = 8 ntyp = 5 ecutwfc = 25.0 ecutrho = 300.0 nbnd = 80 occupations = 'smearing' smearing = 'methfessel-paxton' degauss = 0.01 nspin = 2 starting_magnetization(1) = 1.0 starting_magnetization(2) = 1.0 starting_magnetization(3) = -1.0 starting_magnetization(4) = -1.0 starting_magnetization(5) = 0.0 lda_plus_u =.true. Hubbard_U(1) = 1.d-8 Hubbard_U(2) = 1.d-8 Hubbard_U(3) = 1.d-8 Hubbard_U(4) = 1.d-8 Hubbard_alpha(1) = 1.d-8 Hubbard_alpha(2) = 1.d-8 Hubbard_alpha(3) = 1.d-8 Hubbard_alpha(4) = 1.d-8 / &electrons conv_thr = 1.0d-8 diagonalization = 'cg' / ATOMIC_SPECIES Fe1 55.845 Fe.pbe-sp-van.UPF Fe2 55.845 Fe.pbe-sp-van.UPF Fe3 55.845 Fe.pbe-sp-van.UPF Fe4 55.845 Fe.pbe-sp-van.UPF Se 78.96 Se.pbe-van.UPF ATOMIC_POSITIONS { angstrom } Fe1 0.00000000 2.66529759 2.74305000 Fe2 0.00000000 0.00000000 2.74305000 Fe3 2.66529759 2.66529759 2.74305000 Fe4 2.66529759 0.00000000 2.74305000 Se 1.33264880 3.99794639 4.02515157 Se 3.99794639 3.99794639 1.46094843 Se 3.99794639 1.33264880 4.02515157 Se 1.33264880 1.33264880 1.46094843 K_POINTS {automatic} 12 12 8 0 0 0 --------------------------------------------------------------------------------------- then a nscf run: --------------------------------------------------------------------------------------- FeSe &control calculation = 'nscf' ! restart_mode = 'from_scratch' prefix = 'fese' tprnfor = .true. pseudo_dir = './' outdir = './' iprint = 2 wf_collect = .true. / &system ibrav = 8 celldm(1) = 10.0733642480265 celldm(2) = 1.00000000000000 celldm(3) = 1.0291721306383 nat = 8 ntyp = 5 ecutwfc = 25.0 ecutrho = 300.0 nbnd = 80 occupations = 'smearing' smearing = 'methfessel-paxton' degauss = 0.01 nspin = 2 starting_magnetization(1) = 1.0 starting_magnetization(2) = 1.0 starting_magnetization(3) = -1.0 starting_magnetization(4) = -1.0 starting_magnetization(5) = 0.0 lda_plus_u =.true. Hubbard_U(1) = 1.d-8 Hubbard_U(2) = 1.d-8 Hubbard_U(3) = 1.d-8 Hubbard_U(4) = 1.d-8 Hubbard_alpha(1) = 1.d-8 Hubbard_alpha(2) = 1.d-8 Hubbard_alpha(3) = 1.d-8 Hubbard_alpha(4) = 1.d-8 nosym=.true. noinv=.true. / &electrons conv_thr = 1.0d-8 diagonalization = 'cg' / ATOMIC_SPECIES Fe1 55.845 Fe.pbe-sp-van.UPF Fe2 55.845 Fe.pbe-sp-van.UPF Fe3 55.845 Fe.pbe-sp-van.UPF Fe4 55.845 Fe.pbe-sp-van.UPF Se 78.96 Se.pbe-van.UPF ATOMIC_POSITIONS { angstrom } Fe1 0.00000000 2.66529759 2.74305000 Fe2 0.00000000 0.00000000 2.74305000 Fe3 2.66529759 2.66529759 2.74305000 Fe4 2.66529759 0.00000000 2.74305000 Se 1.33264880 3.99794639 4.02515157 Se 3.99794639 3.99794639 1.46094843 Se 3.99794639 1.33264880 4.02515157 Se 1.33264880 1.33264880 1.46094843 K_POINTS crystal 1152 [...here i removed the list....] --------------------------------------------------------------------------------------- then i start with Wannier90. Let look only at the spin channel "up". I run at first: /work/aha/giovanne/ESPRESSO/espresso-4.0.5/W90/wannier90.x -pp FeSe_up the FeSe_up input file looks like: --------------------------------------------------------------------------------------- num_wann = 20 num_iter = 5000 dis_num_iter = 500 iprint = 3 exclude_bands : 1-32,53-80 write_r2mn=.true. hr_plot=.true. kmesh_tol=0.00001 spin = up begin atoms_cart ang Fe 0.00000000 2.66529759 2.74305000 Fe 0.00000000 0.00000000 2.74305000 Fe 2.66529759 2.66529759 2.74305000 Fe 2.66529759 0.00000000 2.74305000 Se 1.33264880 3.99794639 4.02515157 Se 3.99794639 3.99794639 1.46094843 Se 3.99794639 1.33264880 4.02515157 Se 1.33264880 1.33264880 1.46094843 end atoms_cart begin kpoint_path G 0.0000 0.0000 0.000 X 0.5000 0.0000 0.0000 X 0.5000 0.0000 0.000 M 0.5000 0.5000 0.000 M 0.5000 0.5000 0.000 Y 0.0000 0.5000 0.0000 Y 0.0000 0.5000 0.000 G 0.0000 0.0000 0.0000 G 0.0000 0.0000 0.000 Z 0.0000 0.0000 0.5000 end kpoint_path bands_plot =T !fermi_surface_plot = .true. !To plot the WF !wannier_plot = T !wannier_plot_supercell = 2 !wannier_plot_list = 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 !restart = plot guiding_centres = T begin projections Fe:dxy;dxz;dyz;dx2-y2;dz2 end projections begin unit_cell_cart bohr 10.0733642480265 0.0000 0.0000 0.0000 10.0733642480265 0.0000 0.0000 0.0000 10.3672257458371 end unit_cell_cart mp_grid : 12 12 8 begin kpoints [....] end kpoints --------------------------------------------------------------------------------------- then: mpirun -np 8 /work/aha/giovanne/ESPRESSO/espresso-4.0.5/bin/pw2wannier90.x < FeSe_up.pw2wan with FeSe_up.pw2wan: --------------------------------------------------------------------------------------- &inputpp outdir = './' prefix = 'fese' seedname = 'FeSe_up' spin_component = 'up' write_mmn = .true. write_amn = .true. write_unk = .true. / --------------------------------------------------------------------------------------- once i re-run W90 as: /work/aha/giovanne/ESPRESSO/espresso-4.0.5/W90/wannier90.x FeSe_up i get the following error: --------------------------------------------------------------------------------------- Found a mismatch in FeSe_up.eig Wanted band : 1 found band : 21 Wanted kpoint: 2 found kpoint: 1 A common cause of this error is using the wrong number of bands. Check your input files. If your pseudopotentials have shallow core states remember to account for these electrons. Exiting....... param_read: mismatch in FeSe_up.eig --------------------------------------------------------------------------------------- i think i should have 20 eigenvalues in FeSe_up.eig but they are 40. Could you please help me to understand it? thank you. Gianluca -------------- next part -------------- An HTML attachment was scrubbed... URL: From jonathan.yates at materials.ox.ac.uk Thu Feb 25 00:03:48 2010 From: jonathan.yates at materials.ox.ac.uk (Jonathan Yates) Date: Wed, 24 Feb 2010 23:03:48 +0000 Subject: [Wannier] PW+W90 spin polarized calculations In-Reply-To: <7234ba151002240103n1070be8dwd9699230bbdc1e82@mail.gmail.com> References: <7234ba151002240103n1070be8dwd9699230bbdc1e82@mail.gmail.com> Message-ID: > once i re-run W90 as: > > /work/aha/giovanne/ESPRESSO/espresso-4.0.5/W90/wannier90.x FeSe_up > > i get the following error: > > --------------------------------------------------------------------------------------- > Found a mismatch in FeSe_up.eig > Wanted band : 1 found band : 21 > Wanted kpoint: 2 found kpoint: 1 Gianluca, I have to admit I'm a bit confused by this error. From your input files I don't see anything wrong - and I repeated your calculation (reducing the number of planwaves and kpoints to speed things up) and didn't reproduce the problem. Here are a few things to check: After running wannier90 with the -pp option the nnkp file is created. Towards the end it should report begin exclude_bands 60 ... So you have 80 bands in your calculation, but 60 are excluded from the calculation of the overlaps. After running pw2wannier90 the head of the amn file should read Created on 24Feb2010 at 22:44:33 20 8 20 #bands #kpoints (8 in my case) and #projections And in the eig file 1 1 5.863971456939 2 1 6.677551952837 3 1 6.806925448330 where the first number is band (1-20) the second is kpoint, and the final one band energy. My tests were done with the latest releases of wannier90 (1.2) and pwscf (4.1.2). But I'm not aware of any changes that might cause the problem you describe. (still worth upgrading if you use older versions). One suggestion is to try to make a small test case that reproduces the problem. Then you can quickly try it out with other versions of the code (or send it to the developers in you get stuck - we appreciate small test cases!). Jonathan -- Department of Materials, University of Oxford, Parks Road, Oxford, OX1 3PH, UK tel: +44 (0)1865 612797 http://users.ox.ac.uk/~oums0549/ From rok.zitko at ijs.si Thu Feb 25 15:35:43 2010 From: rok.zitko at ijs.si (Rok Zitko) Date: Thu, 25 Feb 2010 15:35:43 +0100 Subject: [Wannier] Data grids in XSF files generated by Wannier90 Message-ID: <1267108543.24030.47.camel@auger> 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 > > > > > > > > From jonathan.yates at materials.ox.ac.uk Thu Feb 25 16:43:28 2010 From: jonathan.yates at materials.ox.ac.uk (Jonathan Yates) Date: Thu, 25 Feb 2010 15:43:28 +0000 Subject: [Wannier] Data grids in XSF files generated by Wannier90 In-Reply-To: <1267108543.24030.47.camel@auger> References: <1267108543.24030.47.camel@auger> Message-ID: <3F0F4774-DD5C-4ED4-8C9D-F88BC291AF2D@materials.ox.ac.uk> On 25 Feb 2010, at 14:35, Rok Zitko wrote: > 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. Rok, I agree that this is confusing topic - I keep meaning to add extra documentation into the code... But I disagree with some of what you say above. Firstly - proof by demonstration: It is often very helpful to increase 'number of units shown' - this means that you can see a periodic array of wannier functions. This can help to understand how they are orientated. When you do this you will see that Xcrysden puts them in the correct position (it is very easy to spot if there is an error in the xsf file!). So given it appears to do the correct thing we have to understand why. First, note that the WF do not live in a space with the periodicity of the unit cell. Rather they live in a super-cell of the unit cell (which depends in the k-grid used to construct them - a 5x5x5 k- sampling means the WF live in a 5x5x5 supercell). A key point is that the xsf data grid does not have to bare any relation to the unit cell. In fact we use this when we make a supercell in which to plot the WF. But the grid does not have to span an integer number of units cells (indeed as you have noticed for num_plot_supercell=1 our grid is slightly smaller than the unit cell). So our grid is a valid general grid. For a periodic quantity (such as charge density) this would not be the correct thing to do. But for our case it is fine. One can generate all the WF for the system by applying translations of the unit cell vectors. This is what happens when we increase "Number of units shown" (ie it redraws the general grid shifted to the new lattice sites) I suspect we are using xcrysden in a way that the author didn't originally envisage - but as far as I can tell it all works out fine. As Arash mentioned, streamlining the plotting routines is on our to- do list. Yours Jonathan -- Department of Materials, University of Oxford, Parks Road, Oxford, OX1 3PH, UK tel: +44 (0)1865 612797 http://users.ox.ac.uk/~oums0549/