Merge lp:~jose-soler/siesta/unfolding into lp:siesta

Proposed by Jose M Soler
Status: Merged
Merged at revision: 782
Proposed branch: lp:~jose-soler/siesta/unfolding
Merge into: lp:siesta
Diff against target: 3206 lines (+3021/-5) (has conflicts)
26 files modified
Src/SiestaXC/makefile (+3/-1)
Src/meshsubs.F (+8/-4)
Util/Unfolding/Examples/C/Diamond/diamond.fdf (+62/-0)
Util/Unfolding/Examples/C/Graphene/Bilayer/bilayer.fdf (+339/-0)
Util/Unfolding/Examples/C/Graphene/Bilayer/meshgen.dat (+4/-0)
Util/Unfolding/Examples/C/Graphene/Divacancy/7X7/divacancy-7X7.STRUCT_IN (+100/-0)
Util/Unfolding/Examples/C/Graphene/Divacancy/7X7/divacancy-7X7.fdf (+173/-0)
Util/Unfolding/Examples/C/Graphene/Divacancy/7X7/meshgen.dat (+4/-0)
Util/Unfolding/Examples/C/Graphene/Divacancy/8X8/divacancy-8X8.STRUCT_IN (+130/-0)
Util/Unfolding/Examples/C/Graphene/Divacancy/8X8/divacancy-8X8.fdf (+197/-0)
Util/Unfolding/Examples/C/Graphene/Divacancy/8X8/meshgen.dat (+4/-0)
Util/Unfolding/Examples/README (+58/-0)
Util/Unfolding/Examples/Si/Amorphous/Si216/a-Si-216.coord.fdf (+218/-0)
Util/Unfolding/Examples/Si/Amorphous/Si216/a-Si-216.fdf (+73/-0)
Util/Unfolding/Examples/Si/Bulk/Si8/si8.fdf (+72/-0)
Util/Unfolding/Examples/Si/Defects/Vacancy/si7.fdf (+64/-0)
Util/Unfolding/README (+140/-0)
Util/Unfolding/Src/Makefile (+48/-0)
Util/Unfolding/Src/local_sys.f (+45/-0)
Util/Unfolding/Src/meshgen.c (+58/-0)
Util/Unfolding/Src/plotUandR.m (+187/-0)
Util/Unfolding/Src/plotdiff.m (+160/-0)
Util/Unfolding/Src/plotdos.m (+119/-0)
Util/Unfolding/Src/plotmesh.m (+90/-0)
Util/Unfolding/Src/unfold.F90 (+661/-0)
version.info (+4/-0)
Text conflict in version.info
To merge this branch: bzr merge lp:~jose-soler/siesta/unfolding
Reviewer Review Type Date Requested Status
Alberto Garcia Approve
Nick Papior Needs Fixing
Review via email: mp+363983@code.launchpad.net

Commit message

Implementation of a band unfolding utility in Util/Unfolding, based on the method descibed in S.G.Mayo and J.M.Soler, https://arxiv.org/abs/1812.03925. See Util/Unfolding/README for details.

Description of the change

Changes almost completely confined to new directory Util/Unfolding. Updated to trunk-762

To post a comment you must log in.
lp:~jose-soler/siesta/unfolding updated
759. By Jose M Soler

Merged with trunk-764

modified:
  Docs/siesta.tex
  Src/compute_dm.F
  Src/flook_siesta.F90
  Src/matel_registry.F90
  Src/normalize_dm.F90
  Src/read_options.F90
  Src/siesta_forces.F90
  Src/siesta_init.F
  Src/siesta_options.F90
  Src/write_subs.F

760. By Jose M Soler

Merged with SGM branch

added:
  Util/Unfolding/Src/meshgen.c
  Util/Unfolding/Src/plotmesh.m
modified:
  Util/Unfolding/README
  Util/Unfolding/Src/unfold.F90

761. By sara <email address hidden>

Fixed normalization constant in 'unfold.F90'.
Updated old-fashioned examples.
Improved plotting tools.

added:
  Util/Unfolding/Src/plotUandR.m
modified:
  Util/Unfolding/Examples/Al/Al.fdf
  Util/Unfolding/Examples/Si/Amorphous/Si216/a-si216.fdf
  Util/Unfolding/Examples/Si/Atom/FCC/si_atom.fdf
  Util/Unfolding/Examples/Si/Atom/SC/si_atom.fdf
  Util/Unfolding/Examples/Si/Bulk/Si2/si2.fdf
  Util/Unfolding/Examples/Si/Bulk/Si8/si8.fdf
  Util/Unfolding/Examples/Si/Defects/Vacancy/si7.fdf
  Util/Unfolding/Examples/Si/Surfaces/100/si100.2x4.fdf
  Util/Unfolding/README
  Util/Unfolding/Src/plotdiff.m*
  Util/Unfolding/Src/plotdos.m*
  Util/Unfolding/Src/plotmesh.m
  Util/Unfolding/Src/unfold.F90

762. By Jose M Soler

Merged with trunk-766

modified:
  Docs/siesta.bib
  Docs/siesta.tex
  Docs/tbtrans.tex
  Src/Makefile
  Src/atom.F
  Src/dhscf.F
  Src/fdf/fdf.F90
  Src/flook_siesta.F90
  Src/kpoint_convert.f90
  Src/m_mixing.F90
  Src/m_ts_electrode.F90
  Src/m_ts_electype.F90
  Src/m_ts_hartree.F90
  Src/m_ts_options.F90
  Src/m_ts_sparse_helper.F90
  Tests/flos_h2o_neb/neb.lua
  Util/TS/TBtrans/m_tbt_proj.F90
  Util/TS/TBtrans/m_tbt_save.F90
  Util/TS/TBtrans/m_tbt_sigma_save.F90
  Util/TS/TBtrans/m_tbt_trik.F90
  Util/TS/TBtrans/m_tbtrans.F90
  Util/TS/TBtrans/tbt_reinit.F90

Revision history for this message
Nick Papior (nickpapior) wrote :

Thanks for the MR.

I have left a few comments in-line below.

Would it be beneficial to change the fdf-block names like this:
UnfoldedBandLines -> BandLines.Unfolded
RefoldingLatticeVectors -> LatticeVectors.Refolding

I am being pedantic but in my mind it clarifies the relationship with the *original* inputs.
I don't have any objective to the older names, so if you prefer those I am perfectly fine with that.

review: Needs Fixing
lp:~jose-soler/siesta/unfolding updated
763. By Jose M Soler

Two small changes requested by N.Papior

modified:
  Src/meshsubs.F
  Util/Unfolding/Src/unfold.F90

764. By sara <email address hidden>

Fermi level is now read from '.EIG' file.

modified:
  Util/Unfolding/Src/unfold.F90

Revision history for this message
Jose M Soler (jose-soler) wrote :
Download full text (30.1 KiB)

Nick,
thanks for taking care of this. We have uploaded a new version with the
changes you requested, plus a new way to read the Fermi energy in
unfold.f90.
Regarding the names of the fdf variables, we rather prefer not to change
them because there are already a number of users that have been using
this branch for some time, and changing the names would bring issues of
back compatibility.
Best wishes,
Jose and Sara

El mié., 7 ago. 2019 a las 9:18, Nick Papior (<email address hidden>)
escribió:

> Review: Needs Fixing
>
> Thanks for the MR.
>
> I have left a few comments in-line below.
>
> Would it be beneficial to change the fdf-block names like this:
> UnfoldedBandLines -> BandLines.Unfolded
> RefoldingLatticeVectors -> LatticeVectors.Refolding
>
> I am being pedantic but in my mind it clarifies the relationship with the
> *original* inputs.
> I don't have any objective to the older names, so if you prefer those I am
> perfectly fine with that.
>
> Diff comments:
>
> >
> > === modified file 'Src/meshsubs.F'
> > --- Src/meshsubs.F 2019-02-12 14:37:15 +0000
> > +++ Src/meshsubs.F 2019-07-15 09:30:39 +0000
> > @@ -365,10 +369,12 @@
> >
> > ! Issue a warning if the mesh sizes are smaller than
> > ! the requested mesh cutoff
> > - if ( RealCutoff < G2max ) then
> > - call message("WARNING","Read mesh sizes give a smaller"
> > - $ // " cutoff than requested")
> > - end if
> > + if (RealCutoff<G2max .and. fdf_defined('MeshCutoff')) then
> > + if (IOnode) print'(/,a,/)',"meshsubs WARNING: "
>
> The print statement is not required since message will also write out
> (i.e. doubly information).
>
> > + $ //"Input MeshSizes too small for requested MeshCutoff"
> > + call message("WARNING","Read mesh sizes give a smaller"
> > + $ // " cutoff than requested")
> > + endif
> >
> > ! Check whether the resulting mesh sizes are multiples
> > ! of nsm.
> >
> > === added file 'Util/Unfolding/Src/unfold.F90'
> > --- Util/Unfolding/Src/unfold.F90 1970-01-01 00:00:00 +0000
> > +++ Util/Unfolding/Src/unfold.F90 2019-07-15 09:30:39 +0000
> > @@ -0,0 +1,649 @@
> > +! ---
> > +! Copyright (C) 1996-2016 The SIESTA group
> > +! This file is distributed under the terms of the
> > +! GNU General Public License: see COPYING in the top directory
> > +! or http://www.gnu.org/copyleft/gpl.txt .
> > +! See Docs/Contributors.txt for a list of contributors.
> > +! ---
> > +
> > +program unfold
> > +
> > +! Reads the .fdf, .ion, .HSX, .out and .psf files of a SIESTA
> calculation and
> > +! generates unfolded and refolded bands. See Util/Unfolding/README for
> details.
> > +! Ref: "Band unfolding made simple", S.G.Mayo and J.M.Soler, Dic.2018
> > +! arXiv:1812.03925 ( https://arxiv.org/abs/1812.03925 )
> > +! S.G.Mayo and J.M.Soler, Oct.2018
> > +
> > + use alloc, only: alloc_report, de_alloc, re_alloc
> > + use atmfuncs, only: lofio, mofio, nofis, rcut, rphiatm, zetafio
> > + use basis_types, only: nsp
> > + use basis_types, only: basis_parameters, initialize
> > + use basis_io, only: read_basis_ascii
> > + use...

Revision history for this message
Alberto Garcia (albertog) wrote :

I have a few comments:

Options 'SaveHS T' and 'COOP.Write T' are implied in the README file as being somewhat equivalent for the purposes of the Unfolding tool, but COOP.Write involves an extra further diagonalization in the whole BZ, which could potentially be expensive, apart from the extra writing of a potentially large wavefunction file. This might be noted in the README, or the mention to COOP.Write removed.

A short "guide to the examples" might be welcome. Some of Si examples appear to be the ones used in the paper, but the purposes or features of others (the "Atom" ones) are a bit mysterious.

Is it possible to merge this also in 4.1, or are there any specific features from 'trunk' used? The unfolding feature will get more exposure, as 4.1 is about to come out of beta.

Revision history for this message
Alberto Garcia (albertog) wrote :

Just to clarify: I agree to the merge as it is, but if it is possible and straightforward to do it in 4.1 first this MR would be formally superseded (and the unfolding feature would be carried over from 4.1 to trunk).

lp:~jose-soler/siesta/unfolding updated
765. By sara <email address hidden>

A guide of examples is included. Some of the previous examples
are substituted for more physically relevant ones.
Input format of 'meshgen.c' modified.

removed:
  Util/Unfolding/Examples/Al/
  Util/Unfolding/Examples/Al/Al.fdf
  Util/Unfolding/Examples/Si/Amorphous/Si216/a-si216.fdf
  Util/Unfolding/Examples/Si/Atom/
  Util/Unfolding/Examples/Si/Atom/FCC/
  Util/Unfolding/Examples/Si/Atom/FCC/si_atom.fdf
  Util/Unfolding/Examples/Si/Atom/SC/
  Util/Unfolding/Examples/Si/Atom/SC/si_atom.fdf
  Util/Unfolding/Examples/Si/Bulk/Si2/
  Util/Unfolding/Examples/Si/Bulk/Si2/si2.fdf
  Util/Unfolding/Examples/Si/Surfaces/
  Util/Unfolding/Examples/Si/Surfaces/100/
  Util/Unfolding/Examples/Si/Surfaces/100/Si4x2.8l.apwdata
  Util/Unfolding/Examples/Si/Surfaces/100/si100.2x4.bulk.fdf
  Util/Unfolding/Examples/Si/Surfaces/100/si100.2x4.fdf
  Util/Unfolding/Examples/Si/Surfaces/100/si100.2x4coord.fdf
  Util/Unfolding/Examples/Si/Surfaces/111/
  Util/Unfolding/Examples/Si/Surfaces/111/Si111.coordinates.fdf
added:
  Util/Unfolding/Examples/C/
  Util/Unfolding/Examples/C/Diamond/
  Util/Unfolding/Examples/C/Diamond/diamond.fdf
  Util/Unfolding/Examples/C/Graphene/
  Util/Unfolding/Examples/C/Graphene/Bilayer/
  Util/Unfolding/Examples/C/Graphene/Bilayer/bilayer.fdf
  Util/Unfolding/Examples/C/Graphene/Bilayer/meshgen.dat
  Util/Unfolding/Examples/C/Graphene/Divacancy/
  Util/Unfolding/Examples/C/Graphene/Divacancy/7X7/
  Util/Unfolding/Examples/C/Graphene/Divacancy/7X7/divacancy-7X7.STRUCT_IN
  Util/Unfolding/Examples/C/Graphene/Divacancy/7X7/divacancy-7X7.fdf
  Util/Unfolding/Examples/C/Graphene/Divacancy/7X7/meshgen.dat
  Util/Unfolding/Examples/C/Graphene/Divacancy/8X8/
  Util/Unfolding/Examples/C/Graphene/Divacancy/8X8/divacancy-8X8.STRUCT_IN
  Util/Unfolding/Examples/C/Graphene/Divacancy/8X8/divacancy-8X8.fdf
  Util/Unfolding/Examples/C/Graphene/Divacancy/8X8/meshgen.dat
  Util/Unfolding/Examples/README
  Util/Unfolding/Examples/Si/Amorphous/Si216/a-Si-216.coord.fdf
  Util/Unfolding/Examples/Si/Amorphous/Si216/a-Si-216.fdf
modified:
  Util/Unfolding/README
  Util/Unfolding/Src/meshgen.c

Revision history for this message
Jose M Soler (jose-soler) wrote :

Alberto, Nick,

we have removed the COOP.Write option and changed and documented the
examples, as suggested by Alberto.

Best wishes,
Jose

El lun., 19 ago. 2019 a las 1:59, Alberto Garcia (<email address hidden>)
escribió:

> Just to clarify: I agree to the merge as it is, but if it is possible and
> straightforward to do it in 4.1 first this MR would be formally superseded
> (and the unfolding feature would be carried over from 4.1 to trunk).
> --
> https://code.launchpad.net/~jose-soler/siesta/unfolding/+merge/363983
> You are the owner of lp:~jose-soler/siesta/unfolding.
>

Revision history for this message
Nick Papior (nickpapior) wrote :

Great. As for Alberto's comments. I don't think we should bother with taking it to 4.1. We should (hopefully) do a quick release of 4.2 with this in it. So that should be fine.

Revision history for this message
Alberto Garcia (albertog) wrote :

Approved. Will merge.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'Src/SiestaXC/makefile'
--- Src/SiestaXC/makefile 2017-09-29 11:10:46 +0000
+++ Src/SiestaXC/makefile 2019-09-12 09:33:19 +0000
@@ -45,7 +45,9 @@
45libSiestaXC.a: $(ALL_OBJS)45libSiestaXC.a: $(ALL_OBJS)
46 $(AR) $(ARFLAGS_EXTRA) cru libSiestaXC.a $(ALL_OBJS) 46 $(AR) $(ARFLAGS_EXTRA) cru libSiestaXC.a $(ALL_OBJS)
47 @if [ ! -z "$(MPI_INTERFACE)" ] ; then \47 @if [ ! -z "$(MPI_INTERFACE)" ] ; then \
48 $(AR) $(ARFLAGS_EXTRA) cru libSiestaXC.a ../MPI/*.o ; fi48 mkdir Tmp ; cd Tmp ; ar -x ../../MPI/libmpi_f90.a ; cd .. ;\
49 $(AR) $(ARFLAGS_EXTRA) cru libSiestaXC.a Tmp/*.o ;\
50 rm -rf Tmp ; fi
49 -$(RANLIB) libSiestaXC.a51 -$(RANLIB) libSiestaXC.a
50#52#
51OTHER_FILES=lib-makefile lib-arch.make mpi-makefile lib-00-README test-makefile53OTHER_FILES=lib-makefile lib-arch.make mpi-makefile lib-00-README test-makefile
5254
=== modified file 'Src/meshsubs.F'
--- Src/meshsubs.F 2019-02-12 14:37:15 +0000
+++ Src/meshsubs.F 2019-09-12 09:33:19 +0000
@@ -42,6 +42,7 @@
42 use siesta_cml42 use siesta_cml
43 use cellsubs, only : reclat ! Finds reciprocal unit cell43 use cellsubs, only : reclat ! Finds reciprocal unit cell
44 use cellsubs, only : volcel ! Finds unit cell volume44 use cellsubs, only : volcel ! Finds unit cell volume
45 use fdf, only : fdf_defined
45#ifdef MPI46#ifdef MPI
46 use mpi_siesta47 use mpi_siesta
47#endif48#endif
@@ -154,6 +155,8 @@
154 dvol = volume / ntp155 dvol = volume / ntp
155156
156C Output current mesh dimensions and cut-off157C Output current mesh dimensions and cut-off
158 if (fdf_defined('MeshSizes') .and. .not.fdf_defined('MeshCutoff'))
159 & G2max = 0._dp
157 if (Node.eq.0) then160 if (Node.eq.0) then
158 write(6,'(/,a,3(i6,a),i12)') 'InitMesh: MESH =',161 write(6,'(/,a,3(i6,a),i12)') 'InitMesh: MESH =',
159 & ntm(1),' x',ntm(2),' x',ntm(3),' =', ntp162 & ntm(1),' x',ntm(2),' x',ntm(3),' =', ntp
@@ -269,6 +272,7 @@
269 ! sampling size nsm.272 ! sampling size nsm.
270273
271 use precision, only : dp274 use precision, only : dp
275 use parallel, only : IOnode
272 use cellsubs, only : reclat ! Finds reciprocal unit cell276 use cellsubs, only : reclat ! Finds reciprocal unit cell
273 use m_chkgmx, only : chkgmx ! Checks planewave cutoff of a mesh277 use m_chkgmx, only : chkgmx ! Checks planewave cutoff of a mesh
274 use fft1d, only : nfft ! Finds allowed value for 1-D FFT278 use fft1d, only : nfft ! Finds allowed value for 1-D FFT
@@ -365,10 +369,10 @@
365369
366! Issue a warning if the mesh sizes are smaller than370! Issue a warning if the mesh sizes are smaller than
367! the requested mesh cutoff371! the requested mesh cutoff
368 if ( RealCutoff < G2max ) then372 if (RealCutoff<G2max .and. fdf_defined('MeshCutoff')) then
369 call message("WARNING","Read mesh sizes give a smaller"373 call message("WARNING","Read mesh sizes give a smaller"
370 $ // " cutoff than requested")374 & // " cutoff than requested")
371 end if375 endif
372376
373! Check whether the resulting mesh sizes are multiples377! Check whether the resulting mesh sizes are multiples
374! of nsm.378! of nsm.
375379
=== added directory 'Util/Unfolding'
=== added directory 'Util/Unfolding/Examples'
=== added directory 'Util/Unfolding/Examples/C'
=== added directory 'Util/Unfolding/Examples/C/Diamond'
=== added file 'Util/Unfolding/Examples/C/Diamond/diamond.fdf'
--- Util/Unfolding/Examples/C/Diamond/diamond.fdf 1970-01-01 00:00:00 +0000
+++ Util/Unfolding/Examples/C/Diamond/diamond.fdf 2019-09-12 09:33:19 +0000
@@ -0,0 +1,62 @@
1 SystemName diamond
2 SystemLabel diamond
3 NumberOfAtoms 2
4 NumberOfSpecies 1
5
6 %block ChemicalSpeciesLabel
7 1 6 C
8 %endblock ChemicalSpeciesLabel
9
10 LatticeConstant 3.57 Ang
11
12 %block LatticeVectors
13 0.000 0.500 0.500
14 0.500 0.000 0.500
15 0.500 0.500 0.000
16 %endblock LatticeVectors
17
18 AtomicCoordinatesFormat ScaledCartesian
19 %block AtomicCoordinatesAndAtomicSpecies
20 -0.125 -0.125 -0.125 1 C
21 0.125 0.125 0.125 1 C
22 %endblock AtomicCoordinatesAndAtomicSpecies
23
24 XC.functional GGA
25 XC.authors PBE
26
27 PAO.BasisSize DZP
28 DM.MixingWeight 0.15
29 DM.UseSaveDM .true.
30 DM.Tolerance 0.0001
31
32# MeshCutoff 300.0 Ry
33 %block MeshSizes
34 32 32 32
35 %endblock MeshSizes
36
37 %block kgrid.MonkhorstPack
38 8 0 0 0.5
39 0 8 0 0.5
40 0 0 8 0.5
41 %endblock kgrid.MonkhorstPack
42
43 BandLinesScale pi/a
44 SaveHS .true.
45
46 %block UnfoldedBandLines
47 500 -26.0 24.0 eV
48 1 -2.0 -2.0 -2.0 \Gamma
49 85 -1.0 -1.0 -1.0 L
50 85 0.0 0.0 0.0 \Gamma
51 100 2.0 0.0 0.0 X
52 35 2.0 0.5 0.5 U
53 105 2.0 2.0 2.0 \Gamma
54 %endblock UnfoldedBandLines
55
56 RefoldingGcutoff 20.0 Ry
57 %block RefoldingLatticeVectors
58 0.000 0.500 0.500
59 0.500 0.000 0.500
60 0.500 0.500 0.000
61 %endblock RefoldingLatticeVectors
62
063
=== added directory 'Util/Unfolding/Examples/C/Graphene'
=== added directory 'Util/Unfolding/Examples/C/Graphene/Bilayer'
=== added file 'Util/Unfolding/Examples/C/Graphene/Bilayer/bilayer.fdf'
--- Util/Unfolding/Examples/C/Graphene/Bilayer/bilayer.fdf 1970-01-01 00:00:00 +0000
+++ Util/Unfolding/Examples/C/Graphene/Bilayer/bilayer.fdf 2019-09-12 09:33:19 +0000
@@ -0,0 +1,339 @@
1
2SystemName 4_5 rotated graphene bilayer (angle=7.38 deg)
3SystemLabel Bilayer-4_5 # Short name for naming files
4
5# Species and atoms
6
7NumberOfSpecies 2
8NumberOfAtoms 244
9%block ChemicalSpeciesLabel
10 1 6 C
11 2 1 H
12%endblock ChemicalSpeciesLabel
13
14
15PAO.EnergyShift 200 meV
16PAO.BasisSize DZ
17PAO.SplitNorm 0.25
18
19
20LatticeConstant 1.000000 Ang
21%block LatticeVectors
22 19.314099 1.239000 0.000000
23 8.584044 17.346000 0.000000
24 0.000000 0.000000 20.000000
25%endblock LatticeVectors
26
27 # UNFOLDING options
28# BandLinesScale pi/a
29SaveHS .true.
30
31%include meshgen.fdf # Contains %block UnfoldedBandLines, see Src/meshgen.c
32
33RefoldingGcutoff 15.0 Ry
34%block RefoldingLatticeVectors
35 0.000019314099 0.000001239 0.0
36 0.000008584044 0.000017346 0.0
37 0.0 0.0 20.0
38%endblock RefoldingLatticeVectors
39
40
41%block k_grid_Monkhorst_Pack
42 40 0 0 0.0
43-40 40 0 0.0
44 0 0 1 0.0
45%endblock k_grid_Monkhorst_Pack
46
47Diag.ParallelOverK .true.
48
49#%block BandLines
50# 1 0.00000 0.000000 0.000000 \Gamma
51# 60 0.053473 -0.026462 0.000000 M
52# 60 0.038195 -0.057335 0.000000 K
53# 60 0.00000 0.000000 0.000000 \Gamma
54#%endblock BandLines
55
56
57XC.functional VDW # Exchange-correlation functional
58XC.authors BH
59
60SpinPolarized .false. # Logical parameters are: yes or no
61
62MeshCutoff 400. Ry # Mesh cutoff. real space mesh
63
64# SCF options
65MixHamiltonian .true.
66MaxSCFIterations 150 # Maximum number of SCF iter
67DM.MixingWeight 0.05 # New DM amount for next SCF cycle
68DM.Tolerance 2.5d-4 # Tolerance in maximum difference
69 # between input and output DM
70DM.UseSaveDM .true. # to use continuation files
71DM.NumberPulay 3
72
73SCFMustConverge .false.
74
75SolutionMethod diagon # OrderN or Diagon
76
77OccupationFunction MP
78OccupationMPOrder 2
79
80ElectronicTemperature 50. meV # Temp. for Fermi smearing
81
82# MD options
83
84MD.TypeOfRun cg # Type of dynamics:
85MD.NumCGsteps 0 # Number of CG steps for
86 # coordinate optimization
87MD.MaxCGDispl 0.05 Ang # Maximum atomic displacement
88 # in one CG step (Bohr)
89MD.MaxForceTol 0.02 eV/Ang # Tolerance in the maximum
90 # atomic force (Ry/Bohr)
91
92# Atomic coordinates
93AtomicCoordinatesFormat ScaledCartesian
94%block AtomicCoordinatesAndAtomicSpecies
95 10.014718 17.346000 0.000000 1
96 11.445392 17.346000 0.000000 1
97 12.160729 16.107000 0.000000 1
98 13.591403 16.107000 0.000000 1
99 14.306740 14.868000 0.000000 1
100 15.737414 14.868000 0.000000 1
101 16.452751 13.629000 0.000000 1
102 17.883425 13.629000 0.000000 1
103 18.598762 12.390000 0.000000 1
104 20.029436 12.390000 0.000000 1
105 20.744773 11.151000 0.000000 1
106 22.175446 11.151000 0.000000 1
107 22.890783 9.912000 0.000000 1
108 5.007359 8.673000 0.000000 1
109 5.722696 7.434000 0.000000 1
110 7.153370 7.434000 0.000000 1
111 7.868707 6.195000 0.000000 1
112 9.299381 6.195000 0.000000 1
113 10.014718 4.956000 0.000000 1
114 11.445392 4.956000 0.000000 1
115 12.160729 3.717000 0.000000 1
116 13.591403 3.717000 0.000000 1
117 14.306740 2.478000 0.000000 1
118 15.737414 2.478000 0.000000 1
119 16.452751 1.239000 0.000000 1
120 17.883425 1.239000 0.000000 1
121 27.182805 17.346000 0.000000 1
122 9.299381 16.107000 0.000000 1
123 10.014718 14.868000 0.000000 1
124 11.445392 14.868000 0.000000 1
125 12.160729 13.629000 0.000000 1
126 13.591403 13.629000 0.000000 1
127 14.306740 12.390000 0.000000 1
128 15.737414 12.390000 0.000000 1
129 16.452751 11.151000 0.000000 1
130 17.883425 11.151000 0.000000 1
131 18.598762 9.912000 0.000000 1
132 20.029436 9.912000 0.000000 1
133 20.744773 8.673000 0.000000 1
134 22.175446 8.673000 0.000000 1
135 3.576685 6.195000 0.000000 1
136 5.007359 6.195000 0.000000 1
137 5.722696 4.956000 0.000000 1
138 7.153370 4.956000 0.000000 1
139 7.868707 3.717000 0.000000 1
140 9.299381 3.717000 0.000000 1
141 10.014718 2.478000 0.000000 1
142 11.445392 2.478000 0.000000 1
143 12.160729 1.239000 0.000000 1
144 13.591403 1.239000 0.000000 1
145 22.890783 17.346000 0.000000 1
146 24.321457 17.346000 0.000000 1
147 25.036794 16.107000 0.000000 1
148 26.467468 16.107000 0.000000 1
149 7.868707 13.629000 0.000000 1
150 9.299381 13.629000 0.000000 1
151 10.014718 12.390000 0.000000 1
152 11.445392 12.390000 0.000000 1
153 12.160729 11.151000 0.000000 1
154 13.591403 11.151000 0.000000 1
155 14.306740 9.912000 0.000000 1
156 15.737414 9.912000 0.000000 1
157 16.452751 8.673000 0.000000 1
158 17.883425 8.673000 0.000000 1
159 18.598762 7.434000 0.000000 1
160 20.029436 7.434000 0.000000 1
161 20.744773 6.195000 0.000000 1
162 2.861348 4.956000 0.000000 1
163 3.576685 3.717000 0.000000 1
164 5.007359 3.717000 0.000000 1
165 5.722696 2.478000 0.000000 1
166 7.153370 2.478000 0.000000 1
167 7.868707 1.239000 0.000000 1
168 9.299381 1.239000 0.000000 1
169 18.598762 17.346000 0.000000 1
170 20.029436 17.346000 0.000000 1
171 20.744773 16.107000 0.000000 1
172 22.175446 16.107000 0.000000 1
173 22.890783 14.868000 0.000000 1
174 24.321457 14.868000 0.000000 1
175 25.036794 13.629000 0.000000 1
176 7.153370 12.390000 0.000000 1
177 7.868707 11.151000 0.000000 1
178 9.299381 11.151000 0.000000 1
179 10.014718 9.912000 0.000000 1
180 11.445392 9.912000 0.000000 1
181 12.160729 8.673000 0.000000 1
182 13.591403 8.673000 0.000000 1
183 14.306740 7.434000 0.000000 1
184 15.737414 7.434000 0.000000 1
185 16.452751 6.195000 0.000000 1
186 17.883425 6.195000 0.000000 1
187 18.598762 4.956000 0.000000 1
188 20.029436 4.956000 0.000000 1
189 1.430674 2.478000 0.000000 1
190 2.861348 2.478000 0.000000 1
191 3.576685 1.239000 0.000000 1
192 5.007359 1.239000 0.000000 1
193 14.306740 17.346000 0.000000 1
194 15.737414 17.346000 0.000000 1
195 16.452751 16.107000 0.000000 1
196 17.883425 16.107000 0.000000 1
197 18.598762 14.868000 0.000000 1
198 20.029436 14.868000 0.000000 1
199 20.744773 13.629000 0.000000 1
200 22.175446 13.629000 0.000000 1
201 22.890783 12.390000 0.000000 1
202 24.321457 12.390000 0.000000 1
203 5.722696 9.912000 0.000000 1
204 7.153370 9.912000 0.000000 1
205 7.868707 8.673000 0.000000 1
206 9.299381 8.673000 0.000000 1
207 10.014718 7.434000 0.000000 1
208 11.445392 7.434000 0.000000 1
209 12.160729 6.195000 0.000000 1
210 13.591403 6.195000 0.000000 1
211 14.306740 4.956000 0.000000 1
212 15.737414 4.956000 0.000000 1
213 16.452751 3.717000 0.000000 1
214 17.883425 3.717000 0.000000 1
215 18.598762 2.478000 0.000000 1
216 0.715337 1.239000 0.000000 1
217 1.418947 0.182803 3.248000 1
218 2.837894 0.365607 3.248000 1
219 12.289724 16.574164 3.248000 1
220 13.708671 16.756967 3.248000 1
221 14.576457 15.619525 3.248000 1
222 15.995404 15.802328 3.248000 1
223 16.863190 14.664885 3.248000 1
224 18.282137 14.847689 3.248000 1
225 19.149923 13.710246 3.248000 1
226 20.568870 13.893049 3.248000 1
227 21.436656 12.755607 3.248000 1
228 22.855603 12.938410 3.248000 1
229 23.723389 11.800967 3.248000 1
230 5.828237 10.744770 3.248000 1
231 6.696023 9.607328 3.248000 1
232 8.114970 9.790131 3.248000 1
233 8.982756 8.652689 3.248000 1
234 10.401703 8.835492 3.248000 1
235 11.269489 7.698049 3.248000 1
236 12.688436 7.880852 3.248000 1
237 13.556222 6.743410 3.248000 1
238 14.975169 6.926213 3.248000 1
239 15.842955 5.788770 3.248000 1
240 17.261902 5.971574 3.248000 1
241 18.129688 4.834131 3.248000 1
242 19.548635 5.016934 3.248000 1
243 20.416421 3.879492 3.248000 1
244 2.521270 2.823295 3.248000 1
245 3.389056 1.685852 3.248000 1
246 4.808003 1.868656 3.248000 1
247 5.675789 0.731213 3.248000 1
248 7.094736 0.914016 3.248000 1
249 16.546565 17.122574 3.248000 1
250 17.965512 17.305377 3.248000 1
251 18.833298 16.167934 3.248000 1
252 20.252245 16.350738 3.248000 1
253 21.120031 15.213295 3.248000 1
254 22.538978 15.396098 3.248000 1
255 23.406764 14.258656 3.248000 1
256 24.825711 14.441459 3.248000 1
257 6.379399 12.065016 3.248000 1
258 7.798346 12.247820 3.248000 1
259 8.666132 11.110377 3.248000 1
260 10.085079 11.293180 3.248000 1
261 10.952865 10.155738 3.248000 1
262 12.371812 10.338541 3.248000 1
263 13.239598 9.201098 3.248000 1
264 14.658545 9.383902 3.248000 1
265 15.526331 8.246459 3.248000 1
266 16.945278 8.429262 3.248000 1
267 17.813064 7.291820 3.248000 1
268 19.232011 7.474623 3.248000 1
269 20.099797 6.337180 3.248000 1
270 21.518744 6.519984 3.248000 1
271 3.072431 4.143541 3.248000 1
272 4.491378 4.326344 3.248000 1
273 5.359164 3.188902 3.248000 1
274 6.778111 3.371705 3.248000 1
275 7.645897 2.234262 3.248000 1
276 9.064844 2.417066 3.248000 1
277 9.932630 1.279623 3.248000 1
278 11.351577 1.462426 3.248000 1
279 20.803407 17.670984 3.248000 1
280 22.222354 17.853787 3.248000 1
281 23.090140 16.716344 3.248000 1
282 24.509087 16.899148 3.248000 1
283 25.376873 15.761705 3.248000 1
284 7.481721 14.705508 3.248000 1
285 8.349507 13.568066 3.248000 1
286 9.768454 13.750869 3.248000 1
287 10.636240 12.613426 3.248000 1
288 12.055187 12.796230 3.248000 1
289 12.922973 11.658787 3.248000 1
290 14.341920 11.841590 3.248000 1
291 15.209706 10.704148 3.248000 1
292 16.628653 10.886951 3.248000 1
293 17.496439 9.749508 3.248000 1
294 18.915386 9.932311 3.248000 1
295 19.783172 8.794869 3.248000 1
296 21.202119 8.977672 3.248000 1
297 22.069905 7.840230 3.248000 1
298 4.174754 6.784033 3.248000 1
299 5.042539 5.646590 3.248000 1
300 6.461487 5.829393 3.248000 1
301 7.329272 4.691951 3.248000 1
302 8.748220 4.874754 3.248000 1
303 9.616005 3.737311 3.248000 1
304 11.034952 3.920115 3.248000 1
305 11.902738 2.782672 3.248000 1
306 13.321685 2.965475 3.248000 1
307 14.189471 1.828033 3.248000 1
308 15.608418 2.010836 3.248000 1
309 25.060248 18.219393 3.248000 1
310 26.479195 18.402197 3.248000 1
311 8.032883 16.025754 3.248000 1
312 9.451830 16.208557 3.248000 1
313 10.319616 15.071115 3.248000 1
314 11.738563 15.253918 3.248000 1
315 12.606348 14.116475 3.248000 1
316 14.025296 14.299279 3.248000 1
317 14.893081 13.161836 3.248000 1
318 16.312029 13.344639 3.248000 1
319 17.179814 12.207197 3.248000 1
320 18.598762 12.390000 3.248000 1
321 19.466547 11.252557 3.248000 1
322 20.885495 11.435361 3.248000 1
323 21.753280 10.297918 3.248000 1
324 23.172228 10.480721 3.248000 1
325 4.725915 8.104279 3.248000 1
326 6.144862 8.287082 3.248000 1
327 7.012648 7.149639 3.248000 1
328 8.431595 7.332443 3.248000 1
329 9.299381 6.195000 3.248000 1
330 10.718328 6.377803 3.248000 1
331 11.586114 5.240361 3.248000 1
332 13.005061 5.423164 3.248000 1
333 13.872847 4.285721 3.248000 1
334 15.291794 4.468525 3.248000 1
335 16.159580 3.331082 3.248000 1
336 17.578527 3.513885 3.248000 1
337 18.446313 2.376443 3.248000 1
338 19.865260 2.559246 3.248000 1
339%endblock AtomicCoordinatesAndAtomicSpecies
0340
=== added file 'Util/Unfolding/Examples/C/Graphene/Bilayer/meshgen.dat'
--- Util/Unfolding/Examples/C/Graphene/Bilayer/meshgen.dat 1970-01-01 00:00:00 +0000
+++ Util/Unfolding/Examples/C/Graphene/Bilayer/meshgen.dat 2019-09-12 09:33:19 +0000
@@ -0,0 +1,4 @@
1 301 -6.187431 -2.187431
2 60 -0.04 0.10
3 44 -0.49 -0.59
4
05
=== added directory 'Util/Unfolding/Examples/C/Graphene/Divacancy'
=== added directory 'Util/Unfolding/Examples/C/Graphene/Divacancy/7X7'
=== added file 'Util/Unfolding/Examples/C/Graphene/Divacancy/7X7/divacancy-7X7.STRUCT_IN'
--- Util/Unfolding/Examples/C/Graphene/Divacancy/7X7/divacancy-7X7.STRUCT_IN 1970-01-01 00:00:00 +0000
+++ Util/Unfolding/Examples/C/Graphene/Divacancy/7X7/divacancy-7X7.STRUCT_IN 2019-09-12 09:33:19 +0000
@@ -0,0 +1,100 @@
1 17.398450429 0.000000000 0.000000000
2 8.699225143 15.067500000 0.000000000
3 0.000000000 0.000000000 28.700000000
4 96
5 1 6 0.003531601 -0.003474544 0.500000068
6 1 6 0.051257991 0.044385577 0.500000054
7 1 6 0.003201398 0.139638278 0.500000015
8 1 6 0.048601348 0.189719699 0.499999952
9 1 6 0.000252817 0.285054829 0.499999906
10 1 6 0.045521941 0.335322021 0.499999880
11 1 6 -0.003802934 0.430711154 0.499999893
12 1 6 0.044315088 0.478151545 0.499999880
13 1 6 -0.005847446 0.573172185 0.499999910
14 1 6 0.045338773 0.619277112 0.499999892
15 1 6 -0.002009089 0.713903252 0.499999926
16 1 6 0.049482387 0.760053322 0.499999953
17 1 6 0.002160267 0.854677573 0.499999998
18 1 6 0.051632471 0.901516929 0.500000047
19 1 6 0.146725201 -0.002095354 0.500000049
20 1 6 0.191984666 0.048171774 0.500000001
21 1 6 0.143604832 0.143538832 0.499999943
22 1 6 0.189051025 0.193584594 0.499999879
23 1 6 0.141003640 0.288834355 0.499999844
24 1 6 0.188794922 0.336669442 0.499999836
25 1 6 0.140831903 0.431670940 0.499999838
26 1 6 0.190303073 0.478511789 0.499999826
27 1 6 0.142983922 0.573119390 0.499999846
28 1 6 0.194431358 0.619277594 0.499999891
29 1 6 0.147122707 0.713892178 0.499999950
30 1 6 0.198286780 0.759990250 0.500000011
31 1 6 0.148152088 0.855033210 0.500000049
32 1 6 0.196180772 0.902512270 0.500000066
33 1 6 0.286862517 0.002313558 0.500000008
34 1 6 0.331100047 0.052989849 0.499999964
35 1 6 0.283861647 0.147467007 0.499999902
36 1 6 0.331988710 0.194920665 0.499999877
37 1 6 0.284668475 0.289590582 0.499999838
38 1 6 0.333502542 0.336669935 0.499999847
39 1 6 0.286601138 0.431665127 0.499999848
40 1 6 0.336618313 0.478144050 0.499999865
41 1 6 0.291695091 0.573178232 0.499999893
42 1 6 0.344045535 0.619206361 0.499999945
43 1 6 0.296672019 0.713955525 0.500000008
44 1 6 0.348194202 0.760538064 0.500000049
45 1 6 0.293082832 0.855821890 0.500000067
46 1 6 0.336604953 0.906673734 0.500000055
47 1 6 0.425684716 0.007539893 0.499999991
48 1 6 0.474822476 0.052986234 0.499999960
49 1 6 0.427547102 0.147464834 0.499999915
50 1 6 0.476272147 0.193568957 0.499999933
51 1 6 0.429095813 0.288835564 0.499999906
52 1 6 0.478090494 0.335308863 0.499999922
53 1 6 0.432122967 0.430681499 0.499999896
54 1 6 0.482326942 0.477358836 0.499999919
55 1 6 0.442166767 0.572638574 0.499999925
56 1 6 0.498677964 0.617718919 0.499999973
57 1 6 0.449785766 0.715480414 0.500000037
58 1 6 0.494385334 0.769319880 0.500000058
59 1 6 0.431366548 0.862184225 0.500000063
60 1 6 0.471905005 0.915079842 0.500000041
61 1 6 0.569724146 0.002325491 0.499999985
62 1 6 0.618718836 0.048158207 0.499999994
63 1 6 0.571744689 0.143496415 0.499999982
64 1 6 0.620554830 0.189682491 0.500000008
65 1 6 0.573596488 0.285040705 0.499999970
66 1 6 0.622610280 0.330874632 0.499999954
67 1 6 0.576692016 0.426531120 0.499999931
68 1 6 0.626969661 0.471000058 0.499999891
69 1 6 0.597108451 0.563891672 0.499999929
70 1 6 0.595139263 0.769332786 0.500000039
71 1 6 0.565342318 0.862201778 0.500000035
72 1 6 0.615627186 0.906694788 0.500000004
73 1 6 0.714232512 -0.002128076 0.500000008
74 1 6 0.763222407 0.044338762 0.500000045
75 1 6 0.716032230 0.139584441 0.500000050
76 1 6 0.764758326 0.185679656 0.500000036
77 1 6 0.717523253 0.280160459 0.499999965
78 1 6 0.766650729 0.325621425 0.499999895
79 1 6 0.720399187 0.418097753 0.499999831
80 1 6 0.760957343 0.470987350 0.499999863
81 1 6 0.697858639 0.563874091 0.499999914
82 1 6 0.742445588 0.617713218 0.499999969
83 1 6 0.693559893 0.715488264 0.500000012
84 1 6 0.750089458 0.760566418 0.499999992
85 1 6 0.710006707 0.855847543 0.499999988
86 1 6 0.760242222 0.902491704 0.499999979
87 1 6 0.858830468 -0.003496108 0.500000042
88 1 6 0.907639752 0.043572359 0.500000073
89 1 6 0.860308868 0.138230988 0.500000055
90 1 6 0.908388783 0.185715184 0.500000012
91 1 6 0.861217935 0.280169778 0.499999925
92 1 6 0.905435052 0.330865176 0.499999895
93 1 6 0.855733945 0.426509237 0.499999873
94 1 6 0.899302027 0.477355080 0.499999913
95 1 6 0.844073207 0.572640025 0.499999954
96 1 6 0.895660074 0.619209241 0.499999953
97 1 6 0.848247610 0.713983517 0.499999963
98 1 6 0.900659482 0.760002767 0.499999946
99 1 6 0.855769487 0.855042236 0.499999965
100 1 6 0.905847350 0.901478603 0.499999993
0101
=== added file 'Util/Unfolding/Examples/C/Graphene/Divacancy/7X7/divacancy-7X7.fdf'
--- Util/Unfolding/Examples/C/Graphene/Divacancy/7X7/divacancy-7X7.fdf 1970-01-01 00:00:00 +0000
+++ Util/Unfolding/Examples/C/Graphene/Divacancy/7X7/divacancy-7X7.fdf 2019-09-12 09:33:19 +0000
@@ -0,0 +1,173 @@
1
2SystemName divacancy in graphene
3SystemLabel divacancy-7X7 # Short name for naming files
4
5NumberOfSpecies 2
6NumberOfAtoms 96
7%block ChemicalSpeciesLabel
8 1 6 C
9 2 -6 GC
10%endblock ChemicalSpeciesLabel
11
12LatticeConstant 1.435 Ang
13%block LatticeVectors
14 12.1243557 0.00 0.00
15 6.0621778 10.50 0.00
16 0.0000000 0.00 20.00
17%endblock LatticeVectors
18
19XC.functional GGA
20XC.authors revPBE
21PAO.BasisSize DZP
22MeshCutoff 250. Ry
23
24%block k_grid_Monkhorst_Pack
25 30 0 0 0.0
26 30 -30 0 0.0
27 0 0 1 0.0
28%endblock k_grid_Monkhorst_Pack
29Diag.ParallelOverK .true.
30
31 # --- UNFOLD ---
32SaveHS .true.
33RefoldingGcutoff 15.0 Ry
34
35%include meshgen.fdf # Contains %block UnfoldedBandLines. See Src/meshgen.c
36
37%block RefoldingLatticeVectors
38 1.732050808 0.0 0.0
39 0.866025404 1.5 0.0
40 0.0 0.0 20.0
41%endblock RefoldingLatticeVectors
42
43
44PAO.Filter
45VNA.Filter
46FilterCutoff 250 Ry
47
48SpinPolarized .false.
49
50# --- SCF options
51MaxSCFIterations 20 # Maximum number of SCF iter
52DM.MixingWeight 0.05 # New DM amount for next SCF cycle
53DM.Tolerance 2.5d-5 # Tolerance in maximum difference
54 # between input and output DM
55DM.UseSaveDM .true. # to use continuation files
56DM.NumberPulay 3
57
58SCFMustConverge .false.
59SolutionMethod diagon # OrderN or Diagon
60
61OccupationFunction MP
62OccupationMPOrder 2
63ElectronicTemperature 100. meV # Temp. for Fermi smearing
64
65# --- MD options
66MD.TypeOfRun cg # Type of dynamics:
67MD.NumCGsteps 20 # Number of CG steps for coordinate optimization
68MD.MaxCGDispl 0.04 Ang # Maximum atomic displacement in one CG step (Bohr)
69MD.MaxForceTol 0.02 eV/Ang # Tolerance in the maximum atomic force (Ry/Bohr)
70MD.UseStructFile .true. # Uses .STRUCT_IN file
71
72# Atomic coordinates
73AtomicCoordinatesFormat ScaledCartesian
74%block AtomicCoordinatesAndAtomicSpecies
75
76 -0.00421303 0.02154761 10.00000050 1 1 C
77 0.86089996 0.52683713 10.00000102 1 2 C
78 0.85855228 1.52646837 10.00000021 1 3 C
79 1.72690388 2.02682620 9.99999887 1 4 C
80 1.72478833 3.02592623 9.99999688 1 5 C
81 2.59839346 3.52270413 9.99999636 1 6 C
82 2.59854717 4.52040774 9.99999654 1 7 C
83 3.47811353 5.01404493 9.99999651 1 8 C
84 3.48226579 6.01119589 9.99999845 1 9 C
85 4.36829423 6.50130688 9.99999795 1 10 C
86 4.36840175 7.49838233 9.99999960 1 11 C
87 5.25278665 7.98850731 9.99999991 1 12 C
88 5.23633269 8.98606019 10.00000150 1 13 C
89 6.10916140 9.48171630 10.00000271 1 14 C
90 1.72972973 0.03214410 10.00000054 1 21 C
91 2.59809361 0.53152007 10.00000037 1 22 C
92 2.59807191 1.52919151 9.99999929 1 23 C
93 3.46917696 2.02699528 9.99999808 1 24 C
94 3.47186259 3.02598014 9.99999653 1 25 C
95 4.34679401 3.52126305 9.99999611 1 26 C
96 4.35475382 4.52041666 9.99999539 1 27 C
97 5.23618233 5.01397803 9.99999544 1 28 C
98 5.25279877 6.01135642 9.99999591 1 29 C
99 6.14579206 6.50140797 9.99999651 1 30 C
100 6.14560118 7.49807425 9.99999884 1 31 C
101 7.03424383 7.98683868 10.00000050 1 32 C
102 6.99318597 8.98758934 10.00000238 1 33 C
103 7.85544351 9.48811886 10.00000109 1 34 C
104 3.46645886 0.03215510 9.99999984 1 41 C
105 4.33546033 0.52675144 9.99999894 1 42 C
106 4.33743972 1.52651439 9.99999830 1 43 C
107 5.20864848 2.02182789 9.99999753 1 44 C
108 5.21599971 3.02159669 9.99999667 1 45 C
109 6.09159337 3.51772909 9.99999692 1 46 C
110 6.10887184 4.51797330 9.99999603 1 47 C
111 6.99306435 5.01207214 9.99999684 1 48 C
112 7.03452648 6.01285344 9.99999660 1 49 C
113 7.94090561 6.50065622 9.99999872 1 50 C
114 7.94098138 7.49897614 10.00000042 1 51 C
115 8.84053570 7.98992417 10.00000203 1 52 C
116 8.74271947 8.99233839 10.00000140 1 53 C
117 9.57444730 9.52583366 9.99999983 1 54 C
118 5.20063688 0.02143841 9.99999863 1 61 C
119 6.06958412 0.51408829 9.99999872 1 62 C
120 6.07320033 1.51498541 9.99999815 1 63 C
121 6.94294453 2.00884604 9.99999851 1 64 C
122 6.95446790 3.01213202 9.99999829 1 65 C
123 7.82781223 3.50687253 9.99999912 1 66 C
124 7.85527278 4.51120912 9.99999841 1 67 C
125 8.74242790 5.00726839 9.99999873 1 68 C
126 8.84010557 6.00976520 9.99999910 1 69 C
127 9.79517375 6.48526099 10.00000102 1 70 C
128 9.79548794 7.51407034 10.00000235 1 71 C
129 10.65814214 8.08106319 10.00000203 1 72 C
130 10.44985510 9.05677427 10.00000118 1 73 C
131 11.25850880 9.61215100 10.00000202 1 74 C
132 6.92943517 0.00061564 9.99999958 1 81 C
133 7.79682738 0.49226732 10.00000001 1 82 C
134 7.80048738 1.49319148 9.99999981 1 83 C
135 8.66924325 1.98328354 10.00000114 1 84 C
136 8.67909554 2.98418973 10.00000019 1 85 C
137 9.54810619 3.46987454 9.99999842 1 86 C
138 9.57413246 4.47387901 9.99999742 1 87 C
139 10.44966766 4.94294675 9.99999615 1 88 C
140 10.65786814 5.91853160 9.99999883 1 89 C
141 11.85856828 8.08122880 10.00000120 1 90 C
142 12.06701354 9.05687070 10.00000185 1 91 C
143 12.94234409 9.52596821 10.00000200 1 92 C
144 8.65665935 -0.02216853 10.00000078 1 99 C
145 9.52428252 0.46751152 10.00000212 1 100 C
146 9.52418963 1.46471730 10.00000303 1 101 C
147 10.39042888 1.95056923 10.00000241 1 102 C
148 10.38986123 2.94093355 9.99999847 1 103 C
149 11.25817552 3.41756390 9.99999478 1 104 C
150 11.25832860 4.38765616 9.99999396 1 105 C
151 12.06685776 4.94299702 9.99999676 1 106 C
152 11.85862456 5.91861108 9.99999975 1 107 C
153 12.72133941 6.48545644 10.00000107 1 108 C
154 12.72121875 7.51425605 10.00000014 1 109 C
155 13.67624348 7.98993110 9.99999814 1 110 C
156 13.77389834 8.99237518 9.99999862 1 111 C
157 14.66122561 9.48807205 9.99999734 1 112 C
158 10.38955121 -0.03450602 10.00000119 1 119 C
159 11.25844474 0.46095074 10.00000318 1 120 C
160 11.25842609 1.45434598 10.00000348 1 121 C
161 12.12617077 1.95066029 10.00000194 1 122 C
162 12.12649167 2.94111316 9.99999756 1 123 C
163 12.96822074 3.47019776 9.99999752 1 124 C
164 12.94230149 4.47411786 9.99999806 1 125 C
165 13.77411768 5.00766760 10.00000162 1 126 C
166 13.67641169 6.01006185 10.00000258 1 127 C
167 14.57595779 6.50099406 10.00000251 1 128 C
168 14.57596490 7.49923453 9.99999877 1 129 C
169 15.48263499 7.98738708 9.99999699 1 130 C
170 15.52385437 8.98801051 9.99999528 1 131 C
171 16.40816221 9.48191110 9.99999520 1 132 C
172#
173 %endblock AtomicCoordinatesAndAtomicSpecies
0174
=== added file 'Util/Unfolding/Examples/C/Graphene/Divacancy/7X7/meshgen.dat'
--- Util/Unfolding/Examples/C/Graphene/Divacancy/7X7/meshgen.dat 1970-01-01 00:00:00 +0000
+++ Util/Unfolding/Examples/C/Graphene/Divacancy/7X7/meshgen.dat 2019-09-12 09:33:19 +0000
@@ -0,0 +1,4 @@
1 100 -5.31 -2.3
2 40 0.66 0.88
3 40 -0.11 0.11
4
05
=== added directory 'Util/Unfolding/Examples/C/Graphene/Divacancy/8X8'
=== added file 'Util/Unfolding/Examples/C/Graphene/Divacancy/8X8/divacancy-8X8.STRUCT_IN'
--- Util/Unfolding/Examples/C/Graphene/Divacancy/8X8/divacancy-8X8.STRUCT_IN 1970-01-01 00:00:00 +0000
+++ Util/Unfolding/Examples/C/Graphene/Divacancy/8X8/divacancy-8X8.STRUCT_IN 2019-09-12 09:33:19 +0000
@@ -0,0 +1,130 @@
1 19.883943327 0.000000000 0.000000000
2 9.941971592 17.220000000 0.000000000
3 0.000000000 0.000000000 28.700000000
4 126
5 1 6 0.001777507 -0.001669156 0.500000084
6 1 6 0.041883886 0.041777885 0.500000023
7 1 6 -0.000046373 0.125201780 0.500000020
8 1 6 0.040121917 0.168606270 0.499999955
9 1 6 -0.002121747 0.252051211 0.499999936
10 1 6 0.039435165 0.294071227 0.499999890
11 1 6 -0.002962075 0.377281333 0.499999939
12 1 6 0.039953986 0.418334258 0.499999897
13 1 6 -0.002226676 0.501283724 0.499999949
14 1 6 0.041994141 0.541812593 0.499999911
15 1 6 0.000464710 0.624742187 0.499999942
16 1 6 0.044627386 0.665321924 0.499999974
17 1 6 0.002383742 0.748301217 0.500000006
18 1 6 0.045125468 0.789491060 0.500000053
19 1 6 0.002632147 0.872738339 0.500000065
20 1 6 0.044078357 0.914866982 0.500000056
21 1 6 0.124961320 0.001181494 0.499999957
22 1 6 0.164887555 0.044725054 0.499999927
23 1 6 0.123312328 0.127869159 0.499999919
24 1 6 0.164941468 0.169850742 0.499999877
25 1 6 0.123287665 0.252956564 0.499999841
26 1 6 0.165726611 0.294311342 0.499999799
27 1 6 0.124219181 0.377447986 0.499999808
28 1 6 0.167552600 0.418341451 0.499999792
29 1 6 0.126744397 0.501324828 0.499999845
30 1 6 0.171288578 0.541875079 0.499999880
31 1 6 0.129763939 0.624778519 0.499999970
32 1 6 0.173979478 0.665338558 0.500000035
33 1 6 0.129600658 0.748611607 0.500000058
34 1 6 0.171256764 0.790284597 0.500000029
35 1 6 0.127712775 0.873932801 0.500000003
36 1 6 0.167300130 0.917710051 0.499999954
37 1 6 0.247791668 0.004268076 0.499999955
38 1 6 0.289827915 0.045672826 0.499999955
39 1 6 0.248480277 0.128551333 0.499999898
40 1 6 0.290824114 0.169758382 0.499999882
41 1 6 0.249493962 0.252909911 0.499999822
42 1 6 0.292245792 0.294008950 0.499999836
43 1 6 0.251507613 0.377258383 0.499999803
44 1 6 0.295057550 0.418155346 0.499999835
45 1 6 0.256094775 0.501407765 0.499999876
46 1 6 0.301566286 0.541842136 0.499999961
47 1 6 0.259943233 0.624924796 0.500000035
48 1 6 0.304642657 0.665774881 0.500000049
49 1 6 0.255964080 0.749269690 0.500000026
50 1 6 0.293870074 0.793777049 0.500000006
51 1 6 0.250257397 0.877463449 0.499999967
52 1 6 0.288982802 0.921680607 0.499999990
53 1 6 0.373307982 0.004083591 0.500000022
54 1 6 0.415879573 0.044396435 0.500000003
55 1 6 0.374419881 0.127621855 0.499999950
56 1 6 0.416895411 0.168334055 0.499999947
57 1 6 0.375817127 0.251829314 0.499999906
58 1 6 0.418458018 0.292795889 0.499999935
59 1 6 0.378397911 0.376450863 0.499999902
60 1 6 0.422045021 0.417500649 0.499999919
61 1 6 0.387133273 0.501006051 0.499999951
62 1 6 0.436447646 0.540537190 0.499999985
63 1 6 0.393521964 0.626200637 0.500000041
64 1 6 0.432229394 0.673387947 0.500000054
65 1 6 0.376736304 0.754698110 0.500000050
66 1 6 0.412098815 0.800913670 0.500000095
67 1 6 0.371631958 0.881835856 0.500000071
68 1 6 0.414631894 0.921435006 0.500000089
69 1 6 0.499320627 0.000700346 0.500000020
70 1 6 0.541803083 0.041293011 0.500000017
71 1 6 0.500412955 0.124782467 0.500000008
72 1 6 0.542894933 0.165393828 0.500000040
73 1 6 0.501857612 0.248929928 0.499999987
74 1 6 0.544548890 0.289213304 0.499999933
75 1 6 0.504481824 0.372948410 0.499999896
76 1 6 0.548314984 0.411959006 0.499999861
77 1 6 0.522503956 0.493283337 0.499999925
78 1 6 0.519497029 0.673253063 0.500000066
79 1 6 0.493721987 0.754518686 0.500000107
80 1 6 0.537663328 0.793384633 0.500000079
81 1 6 0.497606232 0.877044920 0.500000094
82 1 6 0.540378666 0.917216825 0.500000036
83 1 6 0.625356240 -0.002160600 0.500000026
84 1 6 0.667777883 0.038639037 0.500000088
85 1 6 0.626354094 0.121838717 0.500000092
86 1 6 0.668768770 0.162346450 0.500000065
87 1 6 0.627508823 0.244946855 0.499999944
88 1 6 0.670358419 0.284733079 0.499999865
89 1 6 0.629949511 0.365627171 0.499999808
90 1 6 0.665248891 0.411917412 0.499999875
91 1 6 0.609715852 0.493194111 0.499999951
92 1 6 0.648439212 0.540435297 0.500000036
93 1 6 0.605525573 0.626052069 0.500000034
94 1 6 0.654976760 0.665453829 0.499999989
95 1 6 0.620113333 0.748855582 0.499999978
96 1 6 0.663885826 0.789831719 0.499999903
97 1 6 0.623769540 0.873423643 0.499999952
98 1 6 0.666477717 0.914362084 0.499999945
99 1 6 0.751306262 -0.003220765 0.500000096
100 1 6 0.793525403 0.038165703 0.500000155
101 1 6 0.752161250 0.121018676 0.500000123
102 1 6 0.794136916 0.162533663 0.500000069
103 1 6 0.752941157 0.245128169 0.499999937
104 1 6 0.791630593 0.289412237 0.499999934
105 1 6 0.748052377 0.373058079 0.499999925
106 1 6 0.785982193 0.417558210 0.500000030
107 1 6 0.737398918 0.500954975 0.500000074
108 1 6 0.782231197 0.541711516 0.500000079
109 1 6 0.740644814 0.624740720 0.499999993
110 1 6 0.786275902 0.665101312 0.499999920
111 1 6 0.747290653 0.748332152 0.499999848
112 1 6 0.790863900 0.789218037 0.499999847
113 1 6 0.750044613 0.872442270 0.499999903
114 1 6 0.792681011 0.913659467 0.499999992
115 1 6 0.877038830 -0.003001351 0.500000140
116 1 6 0.918610355 0.039039988 0.500000152
117 1 6 0.876982304 0.122219063 0.500000119
118 1 6 0.916890726 0.165795393 0.500000047
119 1 6 0.874572980 0.249250023 0.499999992
120 1 6 0.914230513 0.292996517 0.499999976
121 1 6 0.870731528 0.376569557 0.500000030
122 1 6 0.912550143 0.418135545 0.500000040
123 1 6 0.868239250 0.501340623 0.500000075
124 1 6 0.912620857 0.541814010 0.500000018
125 1 6 0.871124283 0.624687733 0.499999957
126 1 6 0.915716627 0.665241080 0.499999925
127 1 6 0.874864158 0.748207340 0.499999892
128 1 6 0.918100300 0.789211887 0.499999954
129 1 6 0.876481412 0.872353973 0.499999996
130 1 6 0.918760669 0.913857524 0.500000071
0131
=== added file 'Util/Unfolding/Examples/C/Graphene/Divacancy/8X8/divacancy-8X8.fdf'
--- Util/Unfolding/Examples/C/Graphene/Divacancy/8X8/divacancy-8X8.fdf 1970-01-01 00:00:00 +0000
+++ Util/Unfolding/Examples/C/Graphene/Divacancy/8X8/divacancy-8X8.fdf 2019-09-12 09:33:19 +0000
@@ -0,0 +1,197 @@
1
2SystemName divacancy in graphene
3SystemLabel divacancy-8X8 # Short name for naming files
4
5NumberOfSpecies 2
6NumberOfAtoms 126
7%block ChemicalSpeciesLabel
8 1 6 C
9 2 -6 GC
10%endblock ChemicalSpeciesLabel
11
12LatticeConstant 1.435 Ang
13%block LatticeVectors
14 13.8564065 0.00 0.00
15 6.9282032 12.00 0.00
16 0.0000000 0.00 20.00
17%endblock LatticeVectors
18
19%block k_grid_Monkhorst_Pack
20 30 0 0 0.0
21 30 -30 0 0.0
22 0 0 1 0.0
23%endblock k_grid_Monkhorst_Pack
24Diag.ParallelOverK .true.
25
26 # --- UNFOLD ---
27SaveHS .true.
28RefoldingGcutoff 15.0 Ry
29
30%include meshgen.fdf # Contains %block UnfoldedBandLines. See Src/meshgen.c
31
32%block RefoldingLatticeVectors
33 1.732050808 0.00 0.00
34 0.866025404 1.50 0.00
35 0.00 0.00 20.00
36%endblock RefoldingLatticeVectors
37
38XC.functional GGA # Exchange-correlation functional
39XC.authors revPBE
40PAO.BasisSize DZP
41
42SpinPolarized .false. # Logical parameters are: yes or no
43MeshCutoff 250. Ry # Mesh cutoff. real space mesh
44
45 # SCF options
46MaxSCFIterations 25 #20 # Maximum number of SCF iter
47DM.MixingWeight 0.05 # New DM amount for next SCF cycle
48DM.Tolerance 0.005 #2.5d-5 # Tolerance in max diff between in and out DM
49DM.UseSaveDM .true. # to use continuation files
50DM.NumberPulay 3
51
52SCFMustConverge .false.
53SolutionMethod diagon # OrderN or Diagon
54
55OccupationFunction MP
56OccupationMPOrder 2
57ElectronicTemperature 100. meV # Temp. for Fermi smearing
58
59 # MD options
60MD.TypeOfRun cg # Type of dynamics:
61MD.NumCGsteps 25 #100 # Number of CG steps for coord optimization
62MD.MaxCGDispl 0.04 Ang # Max atomic displacement in one CG step (Bohr)
63MD.MaxForceTol 0.05 eV/Ang # Tolerance in the maximum atomic force (Ry/Bohr)
64MD.UseStructFile .true. # Uses .STRUCT_IN file
65
66# Atomic coordinates
67AtomicCoordinatesFormat ScaledCartesian
68%block AtomicCoordinatesAndAtomicSpecies
69 0.00000000 0.00000000 10.00000000 1 1 C
70 0.86600000 0.50000000 10.00000000 1 2 C
71 0.86600000 1.50000000 10.00000000 1 3 C
72 1.73210000 2.00000000 10.00000000 1 4 C
73 1.73210000 3.00000000 10.00000000 1 5 C
74 2.59810000 3.50000000 10.00000000 1 6 C
75 2.59810000 4.50000000 10.00000000 1 7 C
76 3.46410000 5.00000000 10.00000000 1 8 C
77 3.46410000 6.00000000 10.00000000 1 9 C
78 4.33010000 6.50000000 10.00000000 1 10 C
79 4.33010000 7.50000000 10.00000000 1 11 C
80 5.19620000 8.00000000 10.00000000 1 12 C
81 5.19620000 9.00000000 10.00000000 1 13 C
82 6.06220000 9.50000000 10.00000000 1 14 C
83 6.06220000 10.50000000 10.00000000 1 15 C
84 6.92820000 11.00000000 10.00000000 1 16 C
85 1.73210000 0.00000000 10.00000000 1 21 C
86 2.59810000 0.50000000 10.00000000 1 22 C
87 2.59810000 1.50000000 10.00000000 1 23 C
88 3.46410000 2.00000000 10.00000000 1 24 C
89 3.46410000 3.00000000 10.00000000 1 25 C
90 4.33010000 3.50000000 10.00000000 1 26 C
91 4.33010000 4.50000000 10.00000000 1 27 C
92 5.19620000 5.00000000 10.00000000 1 28 C
93 5.19620000 6.00000000 10.00000000 1 29 C
94 6.06220000 6.50000000 10.00000000 1 30 C
95 6.06220000 7.50000000 10.00000000 1 31 C
96 6.92820000 8.00000000 10.00000000 1 32 C
97 6.92820000 9.00000000 10.00000000 1 33 C
98 7.79420000 9.50000000 10.00000000 1 34 C
99 7.79420000 10.50000000 10.00000000 1 35 C
100 8.66030000 11.00000000 10.00000000 1 36 C
101 3.46410000 0.00000000 10.00000000 1 41 C
102 4.33010000 0.50000000 10.00000000 1 42 C
103 4.33010000 1.50000000 10.00000000 1 43 C
104 5.19620000 2.00000000 10.00000000 1 44 C
105 5.19620000 3.00000000 10.00000000 1 45 C
106 6.06220000 3.50000000 10.00000000 1 46 C
107 6.06220000 4.50000000 10.00000000 1 47 C
108 6.92820000 5.00000000 10.00000000 1 48 C
109 6.92820000 6.00000000 10.00000000 1 49 C
110 7.79420000 6.50000000 10.00000000 1 50 C
111 7.79420000 7.50000000 10.00000000 1 51 C
112 8.66030000 8.00000000 10.00000000 1 52 C
113 8.66030000 9.00000000 10.00000000 1 53 C
114 9.52630000 9.50000000 10.00000000 1 54 C
115 9.52630000 10.50000000 10.00000000 1 55 C
116 10.39230000 11.00000000 10.00000000 1 56 C
117 5.19620000 0.00000000 10.00000000 1 61 C
118 6.06220000 0.50000000 10.00000000 1 62 C
119 6.06220000 1.50000000 10.00000000 1 63 C
120 6.92820000 2.00000000 10.00000000 1 64 C
121 6.92820000 3.00000000 10.00000000 1 65 C
122 7.79420000 3.50000000 10.00000000 1 66 C
123 7.79420000 4.50000000 10.00000000 1 67 C
124 8.66030000 5.00000000 10.00000000 1 68 C
125 8.66030000 6.00000000 10.00000000 1 69 C
126 9.52630000 6.50000000 10.00000000 1 70 C
127 9.52630000 7.50000000 10.00000000 1 71 C
128 10.39230000 8.00000000 10.00000000 1 72 C
129 10.39230000 9.00000000 10.00000000 1 73 C
130 11.25830000 9.50000000 10.00000000 1 74 C
131 11.25830000 10.50000000 10.00000000 1 75 C
132 12.12440000 11.00000000 10.00000000 1 76 C
133 6.92820000 0.00000000 10.00000000 1 81 C
134 7.79420000 0.50000000 10.00000000 1 82 C
135 7.79420000 1.50000000 10.00000000 1 83 C
136 8.66030000 2.00000000 10.00000000 1 84 C
137 8.66030000 3.00000000 10.00000000 1 85 C
138 9.52630000 3.50000000 10.00000000 1 86 C
139 9.52630000 4.50000000 10.00000000 1 87 C
140 10.39230000 5.00000000 10.00000000 1 88 C
141 10.39230000 6.00000000 10.00000000 1 89 C
142# 11.25830000 6.50000000 10.00000000 1 90 C
143# 11.25830000 7.50000000 10.00000000 1 91 C
144 12.12440000 8.00000000 10.00000000 1 92 C
145 12.12440000 9.00000000 10.00000000 1 93 C
146 12.99040000 9.50000000 10.00000000 1 94 C
147 12.99040000 10.50000000 10.00000000 1 95 C
148 13.85640000 11.00000000 10.00000000 1 96 C
149 8.66030000 0.00000000 10.00000000 1 101 C
150 9.52630000 0.50000000 10.00000000 1 102 C
151 9.52630000 1.50000000 10.00000000 1 103 C
152 10.39230000 2.00000000 10.00000000 1 104 C
153 10.39230000 3.00000000 10.00000000 1 105 C
154 11.25830000 3.50000000 10.00000000 1 106 C
155 11.25830000 4.50000000 10.00000000 1 107 C
156 12.12440000 5.00000000 10.00000000 1 108 C
157 12.12440000 6.00000000 10.00000000 1 109 C
158 12.99040000 6.50000000 10.00000000 1 110 C
159 12.99040000 7.50000000 10.00000000 1 111 C
160 13.85640000 8.00000000 10.00000000 1 112 C
161 13.85640000 9.00000000 10.00000000 1 113 C
162 14.72240000 9.50000000 10.00000000 1 114 C
163 14.72240000 10.50000000 10.00000000 1 115 C
164 15.58850000 11.00000000 10.00000000 1 116 C
165 10.39230000 0.00000000 10.00000000 1 121 C
166 11.25830000 0.50000000 10.00000000 1 122 C
167 11.25830000 1.50000000 10.00000000 1 123 C
168 12.12440000 2.00000000 10.00000000 1 124 C
169 12.12440000 3.00000000 10.00000000 1 125 C
170 12.99040000 3.50000000 10.00000000 1 126 C
171 12.99040000 4.50000000 10.00000000 1 127 C
172 13.85640000 5.00000000 10.00000000 1 128 C
173 13.85640000 6.00000000 10.00000000 1 129 C
174 14.72240000 6.50000000 10.00000000 1 130 C
175 14.72240000 7.50000000 10.00000000 1 131 C
176 15.58850000 8.00000000 10.00000000 1 132 C
177 15.58850000 9.00000000 10.00000000 1 133 C
178 16.45450000 9.50000000 10.00000000 1 134 C
179 16.45450000 10.50000000 10.00000000 1 135 C
180 17.32050000 11.00000000 10.00000000 1 136 C
181 12.12440000 0.00000000 10.00000000 1 141 C
182 12.99040000 0.50000000 10.00000000 1 142 C
183 12.99040000 1.50000000 10.00000000 1 143 C
184 13.85640000 2.00000000 10.00000000 1 144 C
185 13.85640000 3.00000000 10.00000000 1 145 C
186 14.72240000 3.50000000 10.00000000 1 146 C
187 14.72240000 4.50000000 10.00000000 1 147 C
188 15.58850000 5.00000000 10.00000000 1 148 C
189 15.58850000 6.00000000 10.00000000 1 149 C
190 16.45450000 6.50000000 10.00000000 1 150 C
191 16.45450000 7.50000000 10.00000000 1 151 C
192 17.32050000 8.00000000 10.00000000 1 152 C
193 17.32050000 9.00000000 10.00000000 1 153 C
194 18.18650000 9.50000000 10.00000000 1 154 C
195 18.18650000 10.50000000 10.00000000 1 155 C
196 19.05260000 11.00000000 10.00000000 1 156 C
197 %endblock AtomicCoordinatesAndAtomicSpecies
0198
=== added file 'Util/Unfolding/Examples/C/Graphene/Divacancy/8X8/meshgen.dat'
--- Util/Unfolding/Examples/C/Graphene/Divacancy/8X8/meshgen.dat 1970-01-01 00:00:00 +0000
+++ Util/Unfolding/Examples/C/Graphene/Divacancy/8X8/meshgen.dat 2019-09-12 09:33:19 +0000
@@ -0,0 +1,4 @@
1 100 -5.24 -2.22
2 40 0.66 0.88
3 40 -0.11 0.11
4
05
=== added file 'Util/Unfolding/Examples/README'
--- Util/Unfolding/Examples/README 1970-01-01 00:00:00 +0000
+++ Util/Unfolding/Examples/README 2019-09-12 09:33:19 +0000
@@ -0,0 +1,58 @@
1 --- GUIDE OF EXAMPLES ---
2
3 This folder contains a number of example systems to test the unfolding tool.
4 Run SIESTA to generate the .EIG, .HSX and .ion files, then run unfold to obtain
5 the fully unfolded or refolded bands.
6
7 Some Matlab routines are available in Src/ to plot the outputs (notice that examples
8 of graphene generate a collection of files to be plotted with 'plotmesh.m').
9
10 A brief description of the examples can be found below. For further details
11 see: https://arxiv.org/abs/1812.03925
12
13 * Si:
14
15 FCC bulk: cubic supercell with 8 atoms. The example is trivial, refolding recovers
16 the FCC bands. As the result is a density of states, band degeneracies are
17 reflected in the plot.
18
19 vacancy: one atom is removed from the trivial supercell. A comparison with the
20 bulk bands reveals changes in the states.
21
22 amorphous: extreme case of disorder. Full unfolding yields the effect of atomic
23 potential in the free e- dispersion relation. Refolding into the FCC
24 vectors, a resemblance in the degeneracy distribution appears.
25 ( a-Si coordinates ref:
26 Igram et at., J. Non-Cryst. Solids 2018, 492, 27-32 )
27
28 * C:
29
30 diamond: analogous to Si FCC bulk.
31
32 graphene(**):
33
34 585 divacancy: different supercell sizes yield very different conventional bands,
35 whereas refolding into graphene lattice vectors reveals qualitatively
36 equivalent band behaviour.
37
38 rotated graphene bilayer: the fully unfolded bands show the interaction between
39 the states of both sublattices, their positions being rotated one
40 with respect to the other. In particular, a saddle point emerges
41 from the interaction between the Dirac cones.
42 Refolding is meaningless, as there are two periodicities in the
43 system and neither is prevalent over the other. However, the
44 RefoldingLatticeVector is present in the .fdf file as:
45 A1*1e-5
46 A2*1e-5
47 A3
48 then A1, A2 << => B1, B2 >>, so, in practice, the refolding vectors
49 in the x and y directions will be excluded by the RefoldingGcutoff.
50 Vector A3 is unaltered, which means that we refold over the periodic
51 images of the bilayer that were artificially introduced to perform
52 the DFT calculation. The actual fully unfolded bands will be those
53 stored in the .RefoldedBands files.
54
55
56
57 (**) To test these examples, compile and run 'meshgen.c' before running unfold.
58
059
=== added directory 'Util/Unfolding/Examples/Si'
=== added directory 'Util/Unfolding/Examples/Si/Amorphous'
=== added directory 'Util/Unfolding/Examples/Si/Amorphous/Si216'
=== added file 'Util/Unfolding/Examples/Si/Amorphous/Si216/a-Si-216.coord.fdf'
--- Util/Unfolding/Examples/Si/Amorphous/Si216/a-Si-216.coord.fdf 1970-01-01 00:00:00 +0000
+++ Util/Unfolding/Examples/Si/Amorphous/Si216/a-Si-216.coord.fdf 2019-09-12 09:33:19 +0000
@@ -0,0 +1,218 @@
1%block AtomicCoordinatesAndAtomicSpecies
215.588956 6.754473 12.646411 1 Si
33.574065 10.591036 11.247465 1 Si
45.948511 6.177946 12.272045 1 Si
59.197466 7.080198 10.111310 1 Si
60.428452 2.162412 4.503134 1 Si
70.125021 6.441942 0.101075 1 Si
86.232593 6.723453 0.437514 1 Si
90.239362 8.257014 1.455119 1 Si
102.057517 13.286268 0.795680 1 Si
1113.223806 8.339178 6.628192 1 Si
125.774796 10.399489 12.131933 1 Si
1311.268743 4.378954 10.129402 1 Si
1410.887114 12.687332 9.662014 1 Si
154.850501 7.039846 7.171760 1 Si
160.836141 7.277747 7.783790 1 Si
170.492234 0.353605 8.716329 1 Si
184.639431 1.517291 8.196668 1 Si
195.718367 11.028184 3.558979 1 Si
2010.960264 10.286392 1.103246 1 Si
2112.024508 4.721230 1.623715 1 Si
220.078339 15.408694 12.481285 1 Si
238.223407 1.388930 14.835752 1 Si
244.432014 10.489295 6.976107 1 Si
257.249525 12.758640 4.246118 1 Si
2615.165838 7.602823 14.829987 1 Si
272.300901 1.613387 11.547367 1 Si
287.354468 12.958500 6.652052 1 Si
299.151397 6.607083 2.713409 1 Si
3015.663368 6.750789 5.583343 1 Si
315.330712 6.853852 2.627945 1 Si
322.679006 6.488012 6.604848 1 Si
337.522149 10.854777 9.289098 1 Si
349.284980 5.050482 4.416305 1 Si
3514.405555 8.749013 2.215123 1 Si
3610.896860 5.736893 6.006857 1 Si
3712.956195 14.981008 14.831348 1 Si
383.500445 3.564754 11.102434 1 Si
391.154953 0.748474 0.959500 1 Si
401.003224 1.120006 13.419032 1 Si
412.081402 5.374562 11.098609 1 Si
426.153343 0.668767 14.040793 1 Si
438.941397 3.151217 0.973984 1 Si
443.128419 14.124622 7.759558 1 Si
4514.495336 5.475302 9.008142 1 Si
466.908721 5.988583 7.127572 1 Si
477.824917 12.932060 14.247202 1 Si
481.906536 3.901688 3.942003 1 Si
4914.115412 10.761481 10.386171 1 Si
5010.879523 0.526527 5.673049 1 Si
510.145974 10.296900 10.574347 1 Si
5213.294566 1.649325 8.463991 1 Si
531.325146 13.271758 9.171471 1 Si
544.315386 1.180880 15.481661 1 Si
5515.219873 9.112258 5.752547 1 Si
5611.431241 6.832704 2.440164 1 Si
5710.789382 14.554866 2.501252 1 Si
582.381641 6.415709 15.813044 1 Si
595.228366 8.312517 15.294547 1 Si
601.275038 9.293237 8.778104 1 Si
6112.964615 14.079804 3.182163 1 Si
625.147357 3.462346 1.864600 1 Si
636.110368 14.420548 0.040131 1 Si
6410.709975 8.623701 11.240443 1 Si
652.175966 10.238155 3.527734 1 Si
662.018696 0.511609 5.000983 1 Si
6711.420456 2.600056 2.627034 1 Si
685.438847 4.749964 3.816955 1 Si
691.295361 3.136864 0.535697 1 Si
7010.430712 3.828788 12.306155 1 Si
714.910686 7.858418 9.353243 1 Si
725.652629 10.474028 15.912961 1 Si
739.128244 15.733536 11.292202 1 Si
745.844050 11.901138 8.070432 1 Si
7511.147043 11.934960 11.941042 1 Si
7610.384088 13.199617 6.273663 1 Si
7711.640084 2.282076 7.003046 1 Si
783.167284 6.611286 1.733126 1 Si
7914.334541 3.866960 14.991470 1 Si
802.779968 8.665334 12.403954 1 Si
819.702374 4.981790 14.229473 1 Si
829.794975 7.243883 14.801569 1 Si
8314.575364 4.952351 6.724092 1 Si
849.986159 15.291332 7.291296 1 Si
853.894621 6.918424 11.261081 1 Si
862.211106 13.994233 14.804054 1 Si
8712.457310 9.237755 9.692870 1 Si
881.784556 7.914429 3.124134 1 Si
8913.210214 0.945653 11.858755 1 Si
907.887876 3.744514 15.203746 1 Si
918.363999 3.119510 11.554388 1 Si
928.761153 1.403933 10.004214 1 Si
9310.640399 14.958636 14.645428 1 Si
943.117914 4.323725 7.316241 1 Si
9514.913162 11.894002 14.086736 1 Si
967.294663 8.510226 9.527879 1 Si
9716.013526 9.809854 14.473319 1 Si
984.764574 11.430269 1.481430 1 Si
990.342303 11.647026 3.772568 1 Si
1000.479198 10.388531 6.903591 1 Si
1014.222516 3.447802 14.765991 1 Si
1027.622148 15.196280 7.280799 1 Si
10310.197667 12.831110 13.843528 1 Si
1042.771893 0.066885 8.344453 1 Si
1052.984224 8.338196 14.726432 1 Si
10611.904159 7.514925 4.772869 1 Si
10715.817556 3.050406 13.324700 1 Si
1085.884220 8.852199 6.202583 1 Si
1096.305743 14.694431 13.637899 1 Si
1106.813153 16.035677 1.631296 1 Si
11110.920713 11.171641 3.291509 1 Si
1129.273735 11.769024 7.867364 1 Si
1138.574000 9.202510 14.067257 1 Si
11414.055600 15.307144 12.816401 1 Si
11513.451976 3.607126 9.839430 1 Si
1167.852312 8.191610 7.292330 1 Si
11713.370100 6.529682 11.816823 1 Si
11814.646288 1.245323 3.577626 1 Si
1190.825932 4.971585 13.039240 1 Si
1200.380265 13.678750 2.509921 1 Si
1217.504193 2.580513 6.115795 1 Si
12216.267519 14.924502 10.164685 1 Si
1233.583733 13.793105 11.305893 1 Si
1241.737601 12.162480 11.268461 1 Si
1257.915444 10.603397 15.993795 1 Si
1266.351217 2.023217 12.117249 1 Si
1270.516261 5.597191 9.308455 1 Si
1285.653219 11.769447 14.003987 1 Si
1296.147093 8.738147 3.898774 1 Si
13014.072198 13.466152 7.336551 1 Si
1315.129560 3.957750 12.709572 1 Si
1329.278496 3.055121 3.288671 1 Si
1333.902534 14.650813 3.472322 1 Si
13410.301331 9.368484 4.628985 1 Si
1353.894269 3.510270 5.209238 1 Si
1362.103662 4.319813 14.930831 1 Si
13712.458228 12.085810 6.395548 1 Si
1384.246007 13.590861 13.565446 1 Si
1397.378176 14.158689 11.471968 1 Si
1403.796456 11.316593 4.894486 1 Si
1418.861915 9.242545 1.256117 1 Si
1429.446722 10.335190 12.188991 1 Si
14314.201999 4.852564 2.441695 1 Si
1445.296599 1.684878 5.957633 1 Si
14511.606187 1.989869 13.131468 1 Si
1464.843920 1.153744 1.562019 1 Si
14712.472999 2.469811 15.239670 1 Si
1486.833388 0.016831 5.305392 1 Si
1493.538593 9.733564 9.025752 1 Si
1507.225306 4.709679 5.265536 1 Si
15110.830225 6.161193 8.520521 1 Si
1527.963306 2.765592 8.335466 1 Si
15312.570944 4.109118 5.864549 1 Si
1541.446038 9.527378 16.103771 1 Si
1558.831588 0.814968 0.780691 1 Si
15611.921340 10.032896 7.534624 1 Si
15714.158498 6.885041 3.636541 1 Si
15814.666340 10.407838 3.842892 1 Si
1596.718743 4.580340 8.953082 1 Si
1604.809314 13.567716 9.264781 1 Si
16113.257260 10.927942 12.557549 1 Si
1629.839907 0.463402 13.361084 1 Si
1633.403733 16.061076 10.651448 1 Si
16413.230918 12.707696 9.412024 1 Si
1652.173725 0.110949 15.197140 1 Si
1660.602141 13.185862 13.187210 1 Si
1671.084175 3.598585 8.264959 1 Si
1683.106038 13.479330 5.400234 1 Si
16913.645996 12.990536 15.844236 1 Si
17014.604775 14.152245 1.507523 1 Si
17112.130917 7.664731 15.037995 1 Si
17212.964544 7.193911 8.674995 1 Si
1732.844307 0.381883 2.748328 1 Si
17410.077617 13.880082 0.398765 1 Si
17510.862629 3.950116 16.071553 1 Si
17611.083077 0.474014 1.587226 1 Si
17712.410896 8.452775 0.999140 1 Si
17815.026478 0.259479 1.411165 1 Si
17915.932798 3.055454 6.492909 1 Si
1808.422124 8.659501 3.457144 1 Si
18116.147873 12.487490 7.538698 1 Si
1829.620212 13.041132 3.973792 1 Si
1838.566846 7.040928 0.489751 1 Si
18411.382391 12.084770 15.881583 1 Si
1850.563570 2.161756 10.081314 1 Si
1866.257331 14.837193 3.625571 1 Si
1879.711832 9.654580 6.855569 1 Si
1888.807664 1.220834 4.676988 1 Si
18914.593478 15.431096 5.976807 1 Si
19012.608183 16.228362 9.858567 1 Si
1910.278489 15.178491 4.519750 1 Si
1927.947682 12.889427 0.331137 1 Si
1932.474339 11.006727 1.296937 1 Si
1940.424843 8.853483 12.376129 1 Si
1957.705609 5.347842 10.903666 1 Si
1962.888477 4.244022 1.876444 1 Si
1975.826895 4.461613 16.124396 1 Si
1985.563236 0.686114 10.234928 1 Si
1996.593177 15.054077 9.436078 1 Si
2004.528871 3.710397 9.008907 1 Si
2017.666372 11.727597 11.412897 1 Si
20213.998143 14.502457 10.591096 1 Si
2034.274447 13.679478 1.380517 1 Si
2040.811292 13.097898 5.518548 1 Si
20512.927414 11.908472 4.136074 1 Si
20615.136543 1.001528 7.266685 1 Si
20715.587500 4.338240 0.654426 1 Si
20812.553647 8.600014 12.845995 1 Si
20913.480424 5.951451 14.167403 1 Si
21013.016468 0.484879 0.097882 1 Si
21112.931744 16.036412 4.523297 1 Si
21210.613799 15.047169 9.582958 1 Si
21314.835568 2.518375 11.312123 1 Si
21410.239568 2.762102 8.804011 1 Si
2156.455371 8.346903 13.292245 1 Si
21613.323099 3.177276 3.819723 1 Si
2171.457653 6.151753 4.635015 1 Si
218%endblock AtomicCoordinatesAndAtomicSpecies
0219
=== added file 'Util/Unfolding/Examples/Si/Amorphous/Si216/a-Si-216.fdf'
--- Util/Unfolding/Examples/Si/Amorphous/Si216/a-Si-216.fdf 1970-01-01 00:00:00 +0000
+++ Util/Unfolding/Examples/Si/Amorphous/Si216/a-Si-216.fdf 2019-09-12 09:33:19 +0000
@@ -0,0 +1,73 @@
1 SystemName a-Si with 216 atoms
2 SystemLabel a-Si-216
3 NumberOfAtoms 216
4 NumberOfSpecies 1
5
6 %block ChemicalSpeciesLabel
7 1 14 Si
8 %endblock ChemicalSpeciesLabel
9
10 LatticeConstant 16.2813 Ang
11 %block LatticeVectors
12 1.000 0.000 0.000
13 0.000 1.000 0.000
14 0.000 0.000 1.000
15 %endblock LatticeVectors
16
17 AtomicCoordinatesFormat Ang
18 %include a-Si-216.coord.fdf
19
20 XC.functional GGA
21 XC.authors PBE
22 PAO.BasisSize DZ
23
24 MaxSCFIterations 200
25 DM.MixingWeight 0.02
26 DM.NumberPulay 3
27 DM.Tolerance 0.0001
28 DM.UseSaveDM .true.
29 ElectronicTemperature 0.15 eV
30
31# MeshCutoff 300.0 Ry
32 %block MeshSizes
33 180 180 180
34 %endblock MeshSizes
35
36 %block kgrid.MonkhorstPack
37 2 0 0 0.5
38 0 2 0 0.5
39 0 0 2 0.5
40 %endblock kgrid.MonkhorstPack
41
42 BandLinesScale pi/a
43 SaveHS .true.
44
45 %block UnfoldedBandLines
46 700 -20.0 15.0 eV
47 1 -6.0 -6.0 -6.0 \Gamma # Labels refer to positions
48 86 -3.0 -3.0 -3.0 L # in the FCC lattice
49 86 0.0 0.0 0.0 \Gamma
50 100 6.0 0.0 0.0 X
51 35 6.0 1.5 1.5 U
52 106 6.0 6.0 6.0 \Gamma
53 %endblock UnfoldedBandLines
54
55# %block UnfoldedBandLines
56# 700 -20.0 15.0 eV
57# 1 -12.0 -12.0 -12.0 L
58# 86 -8.0 -8.0 -8.0 \Gamma
59# 86 -4.0 -4.0 -4.0 L
60# 86 0.0 0.0 0.0 \Gamma
61# 100 8.0 0.0 0.0 X
62# 100 16.0 0.0 0.0 \Gamma
63# 100 24.0 0.0 0.0 X
64# %endblock UnfoldedBandLines
65
66 RefoldingGcutoff 18.0 Ry
67 %block RefoldingLatticeVectors
68 0.000 0.166666667 0.166666667 # FCC vectors scaled to
69 0.166666667 0.000 0.166666667 # the a-Si LatticeConstant
70 0.166666667 0.166666667 0.000
71 %endblock RefoldingLatticeVectors
72
73
074
=== added directory 'Util/Unfolding/Examples/Si/Bulk'
=== added directory 'Util/Unfolding/Examples/Si/Bulk/Si8'
=== added file 'Util/Unfolding/Examples/Si/Bulk/Si8/si8.fdf'
--- Util/Unfolding/Examples/Si/Bulk/Si8/si8.fdf 1970-01-01 00:00:00 +0000
+++ Util/Unfolding/Examples/Si/Bulk/Si8/si8.fdf 2019-09-12 09:33:19 +0000
@@ -0,0 +1,72 @@
1SystemName Si 8 atoms-cubic supercell
2SystemLabel si8
3NumberOfAtoms 8
4NumberOfSpecies 1
5
6%block ChemicalSpeciesLabel
7 1 14 Si
8%endblock ChemicalSpeciesLabel
9
10LatticeConstant 5.430 Ang
11
12%block LatticeVectors
13 1.000 0.000 0.000
14 0.000 1.000 0.000
15 0.000 0.000 1.000
16%endblock LatticeVectors
17
18AtomicCoordinatesFormat ScaledCartesian
19
20%block AtomicCoordinatesAndAtomicSpecies
21 0.000 0.000 0.000 1 Si
22 0.500 0.500 0.000 1 Si
23 0.500 0.000 0.500 1 Si
24 0.000 0.500 0.500 1 Si
25 0.250 0.250 0.250 1 Si
26 0.750 0.750 0.250 1 Si
27 0.750 0.250 0.750 1 Si
28 0.250 0.750 0.750 1 Si
29%endblock AtomicCoordinatesAndAtomicSpecies
30
31PAO.BasisSize DZP
32
33%block MeshSizes
34 40 40 40
35%endblock MeshSizes
36
37%block kgrid.MonkhorstPack
38 0 4 4 0.5
39 4 0 4 0.5
40 4 4 0 0.5
41%endblock kgrid.MonkhorstPack
42
43%block BandLines
44 1 1.0 1.0 1.0 L
45 20 0.0 0.0 0.0 \Gamma
46 25 2.0 0.0 0.0 X
47 30 2.0 2.0 2.0 \Gamma
48%endblock BandLines
49
50 ### Unfold options:
51
52BandLinesScale pi/a
53SaveHS .true.
54RefoldingGcutoff 15.0 Ry
55
56%block UnfoldedBandLines
57 250 -20.0 40.0 eV
58 1 1.0 1.0 1.0 L
59 20 0.0 0.0 0.0 \Gamma
60 25 2.0 0.0 0.0 X
61 30 2.0 2.0 2.0 \Gamma
62%endblock UnfoldedBandLines
63
64%block RefoldingLatticeVectors
65 0.000 0.500 0.500
66 0.500 0.000 0.500
67 0.500 0.500 0.000
68%endblock RefoldingLatticeVectors
69
70AllocReportLevel 2
71AllocReportThreshold 0
72
073
=== added directory 'Util/Unfolding/Examples/Si/Defects'
=== added directory 'Util/Unfolding/Examples/Si/Defects/Vacancy'
=== added file 'Util/Unfolding/Examples/Si/Defects/Vacancy/si7.fdf'
--- Util/Unfolding/Examples/Si/Defects/Vacancy/si7.fdf 1970-01-01 00:00:00 +0000
+++ Util/Unfolding/Examples/Si/Defects/Vacancy/si7.fdf 2019-09-12 09:33:19 +0000
@@ -0,0 +1,64 @@
1SystemName Vacancy in Si cubic supercell
2SystemLabel si7
3NumberOfAtoms 7
4NumberOfSpecies 1
5
6%block ChemicalSpeciesLabel
7 1 14 Si
8%endblock ChemicalSpeciesLabel
9
10LatticeConstant 5.430 Ang
11
12%block LatticeVectors
13 1.000 0.000 0.000
14 0.000 1.000 0.000
15 0.000 0.000 1.000
16%endblock LatticeVectors
17
18AtomicCoordinatesFormat ScaledCartesian
19
20%block AtomicCoordinatesAndAtomicSpecies
21 0.500 0.500 0.000 1 Si
22 0.500 0.000 0.500 1 Si
23 0.000 0.500 0.500 1 Si
24 0.250 0.250 0.250 1 Si
25 0.750 0.750 0.250 1 Si
26 0.750 0.250 0.750 1 Si
27 0.250 0.750 0.750 1 Si
28%endblock AtomicCoordinatesAndAtomicSpecies
29
30PAO.BasisSize DZP
31
32%block kgrid.MonkhorstPack
33 0 8 8 0.5
34 8 0 8 0.5
35 8 8 0 0.5
36%endblock kgrid.MonkhorstPack
37
38%block BandLines
39 1 1.0 1.0 1.0 L
40 20 0.0 0.0 0.0 \Gamma
41 25 2.0 0.0 0.0 X
42 30 2.0 2.0 2.0 \Gamma
43%endblock BandLines
44
45 ### Unfold options:
46
47BandLinesScale pi/a
48SaveHS .true.
49RefoldingGcutoff 15.0 Ry
50
51%block UnfoldedBandLines
52 250 -20.0 40.0 eV
53 1 1.0 1.0 1.0 L
54 20 0.0 0.0 0.0 \Gamma
55 25 2.0 0.0 0.0 X
56 30 2.0 2.0 2.0 \Gamma
57%endblock UnfoldedBandLines
58
59%block RefoldingLatticeVectors
60 0.000 0.500 0.500
61 0.500 0.000 0.500
62 0.500 0.500 0.000
63%endblock RefoldingLatticeVectors
64
065
=== added file 'Util/Unfolding/README'
--- Util/Unfolding/README 1970-01-01 00:00:00 +0000
+++ Util/Unfolding/README 2019-09-12 09:33:19 +0000
@@ -0,0 +1,140 @@
1Directory Util/Unfolding contains a band-unfolding utility,
2written by Sara G. Mayo and Jose M. Soler, Oct.2018
3
4Ref: "Band unfolding made simple",
5 S.G.Mayo, F.Yndurain and J.M.Soler, Dic.2018 (v2: Jun.2019)
6 arXiv:1812.03925 ( https://arxiv.org/abs/1812.03925 )
7
8Compile with
9$ cd Obj
10$ make (see siesta manual for siesta compilation)
11$ cd ../Util/Unfolding/Src
12$ make
13
14Sample serial run (for serial compilation according to Obj/arch.make):
15$ cd ../Examples/Si/Bulk/Si8
16$ ../../../../../../Obj/siesta < si8.fdf > si8.out
17$ ../../../../Src/unfold < si8.fdf > si8.unfold.out
18
19Sample parallel run:
20$ cd ../Examples/Si/Bulk/Si8
21$ mpirun -np 16 ../../../../../../Obj/siesta < si8.fdf > si8.out
22$ mpirun -np 4 ../../../../Src/unfold < si8.fdf > si8.unfold.out
23
24The unfolding/refolding specifications are given by two extra fdf blocks
25in the same datafile used by siesta. For example:
26------------
27LatticeConstant 5.430 Ang # used by siesta and unfold
28BandLinesScale pi/a # used in BandLines and UnfoldedBandLines blocks
29
30%block LatticeVectors # simulation cell used by siesta and unfold
31 1.000 0.000 0.000 # this is an 8-atom Si supercell
32 0.000 1.000 0.000
33 0.000 0.000 1.000
34%endblock LatticeVectors
35
36SaveHS true # makes siesta write the .HSX file used by unfold
37
38%block UnfoldedBandLines
39 320 -20.0 60 eV # numEnergies, Emin, Emax, Eunit
40 1 3.0 3.0 3.0 # mustBeOne, first_qVector (in units of BandLinesScale)
41 100 0.0 0.0 0.0 # numQ_in_line, endLine_qVector
42 120 6.0 0.0 0.0 # add as many lines as required
43%endblock UnfoldedBandLines
44
45RefoldingGcutoff 25 Ry # Cutoff for (the square of) refolding G vectors
46
47%block RefoldingLatticeVectors
48 0.000 0.500 0.500 # primitive Si unit cell, in units of LatticeConstant
49 0.500 0.000 0.500
50 0.500 0.500 0.000
51%endblock RefoldingLatticeVectors
52-----------
53
54The UnfoldedBandLines block has the same format as BandLines, except for the first
55line, which specifies the energy mesh for the density of states in q space (qDOS).
56Also, it allows several q paths to be specified consecutively, each beginning with a
57single point. This allows a q-line to not begin at the end of previous one, e.g.
58
59%block UnfoldedBandLines
60 320 -20.0 60 eV # numEnergyIntervals, Emin, Emax, Eunit
61 1 1.0 1.0 1.0 # mustBeOne, first_qVector (in units of BandLinesScale)
62 100 0.0 0.0 0.0 \Gamma # line_numq, endLine_qVector, q_label
63 120 2.0 0.0 0.0 # add as many path lines as required
64 1 0.0 0.0 0.0 # new path (begins with a single point)
65 100 4.0 4.0 0.0
66%endblock UnfoldedBandLines
67
68As in BandLines, a label can be added at the end of a q-line with the name
69of the specified q-point.
70
71The unfolded and refolded bands calculated by unfold are written in files
72SYSLABEL.unfoldedBands and SYSLABEL.refoldedBands (where SYSLABEL=si8 in
73previous example). The first one contains the fully-unfolded bands and
74the second one contains the refolded bands. Both have the same format:
75----------
76nq, ne, Emin, Emax, Fermi (in energy units given in UnfoldedBandLines)
77 qVector(ixyz=1:3,iq=1), iLine, label (q in Bohr^-1, line to which it belongs)
78qDOS(ie=1,iq=1)
79qDOS(2,1)
80...
81qDOS(ne,1)
82 qVector(1:3,2), iLine, label
83qDOS(1,2)
84...
85qDOS(ne,2)
86 ...
87 qVector(1:3,nq), iLine, label
88qDOS(1,2)
89...
90qDOS(ne,nq)
91----------
92where nq=1+100+120=221 is the total number of q vectors in q-path and
93ne=numEnergyIntervals+1=321 is the number of energies, in previous example.
94
95If several q paths are given in UnfoldedBandLines, the bands of each one
96are written in different output files, with suffixes .path1, .path2, etc.
97Also, for spin polarized systems, the two spin bands are written in two
98separate files with suffixes .spinUp and .spinDn
99
100If RefoldingLatticeVectors is not present in the fdf datafile, only the
101fully-unfolded bands are calculated and written. If UnfoldedBandLines
102is not present, RefoldingLatticeVectors has no effect: nothing is calculated
103nor written by unfold.
104
105The UnfoldedBandLines and RefoldingLatticeVectors blocks are compatible with, and
106independent of, the BandLines block. The latter is read and processed by siesta,
107while the first two are read and processed by unfold.
108
109The simulation cell will usually be a supercell of the unit cell, but this is not
110required by unfold. I.e. bands can be unfolded and then refolded to any Brillouin
111zone, not necessarily commensurate with the simulation cell used by siesta.
112Notice, however, that this requires a new diagonalization for each q+G vector,
113what may be very expensive in terms of CPU time.
114
115The refolded G vectors are those with G^2<RefoldingGcutoff. Therefore,
116RefoldingGcutoff largely determines the accuracy (and CPU time) for refolding.
117Its default value is 50 ry.
118
119The CPU time used by unfold is proportional to the number of q vectors, but it
120does not increase with the energy resolution of the qDOS mesh (the size of the
121output files is proportional to the number of energies, though). Since the
122parallelization over q vectors is almost perfect, execution wall-clock time
123is inversely proportional to the number of MPI nodes, provided they are less
124than the number of q points in UnfoldedBandLines.
125
126Final note: in a supercell calculation, to not break artificially the translational
127crystal symmetry, one should use an integration mesh commensurate with the unit cell.
128This can be ensured by setting explicitly the MeshSizes block. For example, for an
129FCC unit cell with lattice vectors a=a0/2*{(0,1,1),(1,0,1),(1,1,0)}, and a
1304-unit-cell supercell calculation, with A=a0/2*{(2,0,0),(0,2,0),(0,0,2)},
131it suffices that all MeshSizes are even. For a n-layer (111) slab with
132A=a0/2*{(0,1,1),(1,0,1),(n,n,0)}, the mesh size of third vector should be a
133multiple of n. In general, a necessary and sufficient condition is that matrix
134inv(Amesh)*a is integer. Here, a is the matrix of unit cell vectors, Amesh is the
135matrix of supercell mesh vectors (both in columns), and inv(Amesh) is its inverse.
136The ith mesh vector is Amesh(:,i)=A(:,i)/MeshSize(i). Notice that all MeshSizes
137must also be multiples of the MeshSubDivisions parameter (equal to 2 by default).
138In a slab calculation, construct the simulation cell by removing atoms from
139a bulk supercell, so that the simulation-cell lattice vectors make an exact
140supercell of the crystal unit cell.
0141
=== added directory 'Util/Unfolding/Src'
=== added file 'Util/Unfolding/Src/Makefile'
--- Util/Unfolding/Src/Makefile 1970-01-01 00:00:00 +0000
+++ Util/Unfolding/Src/Makefile 2019-09-12 09:33:19 +0000
@@ -0,0 +1,48 @@
1# ---
2# Copyright (C) 1996-2016 The SIESTA group
3# This file is distributed under the terms of the
4# GNU General Public License: see COPYING in the top directory
5# or http://www.gnu.org/copyleft/gpl.txt .
6# See Docs/Contributors.txt for a list of contributors.
7# ---
8#
9# Makefile for stand-alone unfold
10#
11
12.SUFFIXES:
13.SUFFIXES: .f .F .o .a .f90 .F90
14
15default: unfold
16
17WDIR=$(shell pwd)
18VPATH=../../../Src
19OBJDIR=../../../Obj
20HSXDIR=../../HSX
21ARCH_MAKE=$(OBJDIR)/arch.make
22include $(ARCH_MAKE)
23
24SIESTA_LIB=libSiestaForces.a
25FDF=libfdf.a
26XMLPARSER=libxmlparser.a
27WXML=libwxml.a
28XC=libSiestaXC.a
29ALL_LIBS= $(SIESTA_LIB) $(FDF) $(WXML) $(XMLPARSER) $(XC) \
30 $(MPI_INTERFACE) $(COMP_LIBS) $(LIBS)
31
32libs_collected:
33 (cd $(OBJDIR) ; \
34 make libSiestaForces.a ; \
35 cp -f *.a *.mod $(WDIR) )
36 cp -f $(HSXDIR)/hsx_m.f90 $(WDIR)
37 touch libs_collected
38
39unfold.o: unfold.F90 hsx_m.f90 libs_collected
40 $(FC) -c $(FFLAGS_DEBUG) $(INCFLAGS) $(FPPFLAGS) $(FPPFLAGS_free_F) hsx_m.f90 unfold.F90
41
42unfold: libs_collected unfold.o
43 $(FC) $(LDFLAGS) -o unfold hsx_m.o unfold.o $(ALL_LIBS)
44
45clean:
46 @echo "==> Cleaning object, library, and executable files"
47 rm -f unfold *.o *.a *.mod libs_collected
48
049
=== added file 'Util/Unfolding/Src/local_sys.f'
--- Util/Unfolding/Src/local_sys.f 1970-01-01 00:00:00 +0000
+++ Util/Unfolding/Src/local_sys.f 2019-09-12 09:33:19 +0000
@@ -0,0 +1,45 @@
1! ---
2! Copyright (C) 1996-2016 The SIESTA group
3! This file is distributed under the terms of the
4! GNU General Public License: see COPYING in the top directory
5! or http://www.gnu.org/copyleft/gpl.txt .
6! See Docs/Contributors.txt for a list of contributors.
7! ---
8
9 module sys
10!
11! Termination and messaging routines, MPI aware
12!
13 implicit none
14
15 public :: die ! Prints an error message and calls MPI_Abort
16 private
17
18 CONTAINS
19
20!--------------------------------------------------
21 subroutine die(str)
22
23 character(len=*), intent(in), optional :: str
24
25 if (present(str)) then
26 write(6,'(a)') trim(str)
27 write(0,'(a)') trim(str)
28 endif
29
30 stop
31 end subroutine die
32
33 end module sys
34
35! Stand-alone copy
36 subroutine die(str)
37
38 character(len=*), intent(in) :: str
39
40 write(6,'(a)') trim(str)
41 write(0,'(a)') trim(str)
42
43 stop
44 end subroutine die
45
046
=== added file 'Util/Unfolding/Src/meshgen.c'
--- Util/Unfolding/Src/meshgen.c 1970-01-01 00:00:00 +0000
+++ Util/Unfolding/Src/meshgen.c 2019-09-12 09:33:19 +0000
@@ -0,0 +1,58 @@
1// Generates the UnfoldedBandLines block for a squared 2D
2// q-point mesh. Reads the input from the 'meshgen.dat'
3// file, with format:
4// ne emin emax
5// nx x0 xend
6// ny y0 yend
7// and writes the formated output 'meshgen.fdf'.
8// After running unfold, plot the output files with
9// 'plotmesh.m'.
10//
11// April 2019
12
13#include <stdlib.h>
14#include <stdio.h>
15#include <math.h>
16#define PI 3.14159265
17
18int main() {
19
20FILE *dat;
21dat = fopen("meshgen.dat","r");
22
23FILE *fdf;
24fdf = fopen("meshgen.fdf","w");
25
26int ne, nx, ny;
27double emin, emax;
28double x0, xend, y0, yend;
29
30int i;
31double xi, dx;
32
33fscanf(dat, "%d %lf %lf", &ne, &emin, &emax);
34fscanf(dat, "%d %lf %lf", &nx, &x0, &xend);
35fscanf(dat, "%d %lf %lf", &ny, &y0, &yend);
36
37xi = x0;
38dx = (xend - x0)/(nx - 1.0);
39ny = ny - 1;
40
41fprintf(fdf, "%%block UnfoldedBandLines\n");
42fprintf(fdf, " %d\t%lf\t%lf\t eV\n", ne, emin, emax);
43
44i = 0;
45for ( i=0; i<nx; i++ ) {
46 xi = xi + dx;
47 fprintf(fdf, " 1\t%lf\t%lf\t0.0\n", xi, y0);
48 fprintf(fdf, " %d\t%lf\t%lf\t0.0\n", ny, xi, yend);
49}
50fprintf(fdf, "%%endblock UnfoldedBandLines\n");
51printf("'meshgen.fdf' written\n");
52
53fclose(dat);
54fclose(fdf);
55
56return 0;
57}
58
059
=== added file 'Util/Unfolding/Src/plotUandR.m'
--- Util/Unfolding/Src/plotUandR.m 1970-01-01 00:00:00 +0000
+++ Util/Unfolding/Src/plotUandR.m 2019-09-12 09:33:19 +0000
@@ -0,0 +1,187 @@
1% plotUandR.m
2% Plots fully-unfolded and refolded qLDOS written by unfold.F90
3% SGM & JMS, Oct.2018 (mod. May 2019)
4
5clear all
6wdir = './path_to_file/';
7syslabel = 'systemLabel';
8fnameA = [wdir,syslabel,'.unfoldedBands']; % .path, .spin
9fnameB = [wdir,syslabel,'.refoldedBands'];
10
11fileA = fopen(fnameA); % Read DOS
12datA = fscanf(fileA,'%d %d %f %f %f',5);
13 nq = datA(1);
14 ne = datA(2);
15 emin = datA(3);
16 emax = datA(4);
17 efermi = datA(5);
18fileB = fopen(fnameB);
19datB = fscanf(fileB,'%d %d %f %f %f',5);
20
21q = zeros(3,nq);
22dosA = zeros(nq,ne);
23dosB = zeros(nq,ne);
24label = string(zeros(nq,1));
25for iq = 1:nq
26 q(:,iq) = fscanf(fileA,'%f %f %f',3);
27 iline(iq) = fscanf(fileA,'%i',1);
28 label(iq) = fscanf(fileA,'%10c',1);
29 dosA(iq,:) = fscanf(fileA,'%f',ne);
30 fscanf(fileB,'%f %f %f',3);
31 fscanf(fileB,'%i',1);
32 fscanf(fileB,'%10c',1);
33 dosB(iq,:) = fscanf(fileB,'%f',ne);
34end
35fclose(fileA);
36fclose(fileB);
37
38% set zero at Fermi level
39emin = emin - efermi;
40emax = emax - efermi;
41
42% adjust labels to MATLAB style
43for iq=1:nq
44 if (label(iq)==' Gamma ')
45 label(iq)='\Gamma';
46 elseif (label(iq)==' '' '' ')
47 label(iq)=' ';
48 else
49 label(iq)=strtrim(label(iq));
50 end
51end
52
53if nq==1
54 qpath = 0;
55else
56 for ix=1:3
57 dq(ix,:) = diff(q(ix,:));
58 end
59 dq = sqrt(sum(dq.^2));
60 qpath = [0,cumsum(dq)];
61end
62de = (emax-emin)/(ne-1);
63e = emin:de:emax;
64[qpath,e] = ndgrid(qpath,e);
65
66% --------- Plot of the density --------- figure size:
67% [x0, y0, w, h]
68 set(gcf,'Units','Normalized','OuterPosition',[0.55, 0.05, 0.45, 0.9]);
69
70if nq==1 % gamma point only
71 subplot(2,1,1)
72 plot(e,dosA)
73 xlabel('Energy'); ylabel('DOS');
74
75 subplot(2,1,2)
76 plot(e,dosB)
77 xlabel('Energy'); ylabel('DOS');
78 grid on
79
80else
81
82% NORMAL scale: PlotLog == 0
83% LOG scale: PlotLog == 1
84
85 PlotLogA = 1;
86 PlotLogB = 0;
87
88 % --- Full unfolding ---
89 subplot(2,1,1)
90
91 zlim = max(dosA(:));
92 zsat = zlim*1.0e-3; % saturation for log scale
93
94 %emax = 10.0;
95 %emin = -15.0;
96
97 if PlotLogA == 0 % normal
98 sA = surf(qpath',e',dosA');
99 axis([qpath(1),qpath(end),emin,emax,0,zlim])
100 caxis([0,zlim]);
101 else % log
102 sA = surf(qpath',e',max(dosA,zsat)');
103 set(gca,'colorscale','log');
104 axis([qpath(1),qpath(end),emin,emax,zsat,zlim])
105 caxis([zsat,zlim]); %caxis('auto');
106 end
107
108 sA.EdgeColor = 'none';
109 set(gca,'FontSize',13);
110 ylabel('Energy (eV)');
111 zlabel('LDOS');
112
113 view(2);
114 colormap(flipud(bone));
115 h = colorbar;
116 h.TickLength = 0.05;
117 set(get(h,'label'),'string',' LDOS (eV^{-1})');
118
119 % line edges and fermi level
120 hold on
121 cpl = [0.8,0.7,0.75]; cfl = [0.92,0.59,0.59];
122
123 lineEnd = find(iline(1:nq-1)<iline(2:nq));
124 for jl = 1:numel(lineEnd)
125 il = lineEnd(jl);
126 plot3(qpath(il)*[1,1],[emin,emax],[zlim,zlim],'Color',cpl,'LineStyle',':')
127 end
128 plot3(qpath(end)*[1,1],[emin,emax],[zlim,zlim],'Color',cpl,'LineStyle',':')
129
130 plot3([qpath(1),qpath(end)],0*[1,1],[zlim,zlim],'Color',cfl,'LineStyle',':','LineWidth',0.5)
131
132 xticks( [qpath((lineEnd(1:1:numel(lineEnd)))),qpath(end)] );
133 xticklabels( [ label(lineEnd(1:1:numel(lineEnd))); label(nq) ] );
134 hold off
135
136
137 % --- Refolding ---
138 subplot(2,1,2)
139
140 zlim = max(dosB(:));
141 zsat = zlim*1.0e-2; % saturation for log scale
142
143 %emax = 10.0;
144 %emin = -15.0;
145
146 if PlotLogB == 0 % normal
147 sB = surf(qpath',e',dosB');
148 axis([qpath(1),qpath(end),emin,emax,0,zlim])
149 caxis([0,zlim]);
150 else % log
151 sB = surf(qpath',e',max(dosB,zsat)');
152 set(gca,'colorscale','log');
153 axis([qpath(1),qpath(end),emin,emax,zsat,zlim])
154 caxis([zsat,zlim]); %caxis('auto');
155 end
156
157 sB.EdgeColor = 'none';
158 set(gca,'FontSize',13);
159 ylabel('Energy (eV)');
160 zlabel('LDOS');
161
162 view(2);
163 colormap(flipud(bone));
164 h = colorbar;
165 h.TickLength = 0.05;
166 set(get(h,'label'),'string',' LDOS (eV^{-1})');
167
168% line edges and fermi level
169 hold on
170 cpl = [0.8,0.7,0.75]; cfl = [0.92,0.59,0.59];
171
172 lineEnd = find(iline(1:nq-1)<iline(2:nq));
173 for jl = 1:numel(lineEnd)
174 il = lineEnd(jl);
175 plot3(qpath(il)*[1,1],[emin,emax],[zlim,zlim],'Color',cpl,'LineStyle',':')
176 end
177 plot3(qpath(end)*[1,1],[emin,emax],[zlim,zlim],'Color',cpl,'LineStyle',':')
178
179 plot3([qpath(1),qpath(end)],0*[1,1],[zlim,zlim],'Color',cfl,'LineStyle',':','LineWidth',0.5)
180
181 xticks( [qpath((lineEnd(1:1:numel(lineEnd)))),qpath(end)] );
182 xticklabels( [ label(lineEnd(1:1:numel(lineEnd))); label(nq) ] );
183 hold off
184
185end
186
187% --------------------------------------------
0188
=== added file 'Util/Unfolding/Src/plotdiff.m'
--- Util/Unfolding/Src/plotdiff.m 1970-01-01 00:00:00 +0000
+++ Util/Unfolding/Src/plotdiff.m 2019-09-12 09:33:19 +0000
@@ -0,0 +1,160 @@
1% plotdiff.m
2% Plots the difference between qDOS of two systems written by unfold
3% in order to highlight the differences between them.
4% Useful for visualizing changes in the bands of a defective system
5% with respect to the crystaline reference system.
6% In the plot, new states arising from the defects are depicted in
7% red, while states that vanish appear in blue.
8%
9% (!) Both systems must have identical 'UnfoldedBandLines' blocks in
10% their fdf files (that is, same energies and q sampling points).
11%
12% SGM & JMS, Oct.2018 (mod. May 2019)
13
14clear all
15wdir = './path_to_file/';
16syslabelA = 'systemA'; % System A : non-defective
17syslabelB = 'systemB'; % System B : defective
18fnameA = [wdir,syslabelA,'.refoldedBands']; % '.refoldedBands' or
19fnameB = [wdir,syslabelB,'.refoldedBands']; %.path1 % '.unfoldedBands'.
20
21% read DOS
22fileA = fopen(fnameA);
23datA = fscanf(fileA,'%d %d %f %f %f',5);
24 nq = datA(1);
25 ne = datA(2);
26 emin = datA(3);
27 emax = datA(4);
28 efermiA = datA(5);
29fileB = fopen(fnameB);
30datB = fscanf(fileB,'%d %d %f %f %f',5); % nq,ne,emin,emax read from fileA
31 efermiB = datB(5);
32
33q = zeros(3,nq);
34dosA = zeros(nq,ne);
35dosB = zeros(nq,ne);
36label = string(zeros(nq,1));
37for iq = 1:nq
38 q(:,iq) = fscanf(fileA,'%f %f %f',3);
39 iline(iq) = fscanf(fileA,'%i',1);
40 label(iq) = fscanf(fileA,'%10c',1);
41 dosA(iq,:) = fscanf(fileA,'%f',ne);
42 fscanf(fileB,'%f %f %f',3);
43 fscanf(fileB,'%i',1);
44 fscanf(fileB,'%10c',1);
45 dosB(iq,:) = fscanf(fileB,'%f',ne);
46end
47fclose(fileA);
48fclose(fileB);
49
50% set zero at efermiA (non-defective)
51emin = emin - efermiA;
52emax = emax - efermiA;
53
54% labels in MATLAB style
55for iq=1:nq
56 if (label(iq)==' Gamma ')
57 label(iq)='\Gamma';
58 elseif (label(iq)==' '' '' ')
59 label(iq)=' ';
60 else
61 label(iq)=strtrim(label(iq));
62 end
63end
64
65if nq==1
66 qpath = 0;
67else
68 for ix=1:3
69 dq(ix,:) = diff(q(ix,:));
70 end
71 dq = sqrt(sum(dq.^2));
72 qpath = [0,cumsum(dq)];
73end
74de = (emax-emin)/(ne-1);
75e = emin:de:emax;
76[qpath,e] = ndgrid(qpath,e);
77
78% align spectra if necessary (displaces an integer number of pixels)
79plim = 15; dmin = 333333;
80
81for ip = -plim:plim
82 ipmin = 1+plim; ipmax = ne-plim;
83 pdiff = sum(sum( abs((dosA(:,ipmin:ipmax)-dosB(:,ipmin+ip:ipmax+ip))) ));
84 if pdiff < dmin
85 dmin = pdiff;
86 ipopt = ip;
87 end
88end
89if (ipopt>0)
90 dosB(:,1+ipopt:ne-ipopt)=dosB(:,1+ipopt+ipopt:ne);
91else
92 dosB(:,1:ne+ipopt)=dosB(:,1-ipopt:ne);
93end
94
95% convolution with a gaussian (smooth minor changes, highlight relevants)
96a = 0;
97b = 0.10;
98x = -5:0.1:5;
99f = exp(-((x-a).^2)/(2*(b^2))) / (sqrt(2*pi*(b^2)));
100f = f/trapz(f);
101
102dos_dif = dosB - dosA;
103
104maxdif = max(abs(dos_dif(:))); % keep max unaltered after conv
105if nq==1
106 dos_dif = conv(f,dos_dif,'same');
107else
108 dos_dif = conv2(f,f,dos_dif,'same');
109end
110dos_dif = dos_dif*maxdif/max(abs(dos_dif(:)));
111
112% --------- Plot of the density --------- figure size:
113% [x0, y0, w, h]
114set(gcf,'Units','Normalized','OuterPosition',[0.4, 0.3, 0.55, 0.65]);
115
116 % emax = 2.0;
117 % emin = -2.0;
118 zlimit = max(abs(dos_dif(:)));
119
120if nq==1 % if Gamma point only
121 plot(e,dos_dif)
122 xlabel('Energy')
123 ylabel('DOS')
124 grid on
125
126else
127 s = surf(qpath',e',dos_dif');
128 s.EdgeColor = 'none';
129 axis([qpath(1),qpath(end),emin,emax,-zlimit,zlimit])
130 caxis([-zlimit,zlimit])
131
132 view(2);
133 colormap jet;
134 set(gca,'FontSize',14);
135 ylabel('Energy (eV)');
136 zlabel('LDOS');
137 h = colorbar;
138 set(get(h,'label'),'string','LDOS_{bulk} - LDOS_{defect} (eV^{-1})');
139
140 % Plot line edges and Fermi levels
141 hold on
142 clr = [0.85,0.325,0.098];
143
144 lineEnd = find(iline(1:nq-1)<iline(2:nq));
145 for jl = 1:numel(lineEnd)
146 il = lineEnd(jl);
147 plot3(qpath(il)*[1,1],[emin,emax],[zlimit,zlimit],'Color',clr,'LineStyle',':')
148 end
149 plot3(qpath(end)*[1,1],[emin,emax],[zlimit,zlimit],'Color',clr,'LineStyle',':')
150
151 plot3([qpath(1),qpath(end)],0*[1,1],[zlimit,zlimit],'Color','k') % Fermi A (non-def)
152 plot3([qpath(1),qpath(end)],(efermiB-efermiA)*[1,1],[zlimit,zlimit],'Color','r') % Fermi B (defective)
153
154 xticks( [qpath((lineEnd(1:1:numel(lineEnd)))),qpath(end)] );
155 xticklabels( [ label(lineEnd(1:1:numel(lineEnd))); label(nq) ] );
156
157 hold off
158end
159
160% -------------------------------------------------------------------------
0161
=== added file 'Util/Unfolding/Src/plotdos.m'
--- Util/Unfolding/Src/plotdos.m 1970-01-01 00:00:00 +0000
+++ Util/Unfolding/Src/plotdos.m 2019-09-12 09:33:19 +0000
@@ -0,0 +1,119 @@
1% plotdos.m
2% Plots a DOS file written by unfold.F90
3% SGM & JMS, Oct.2018 (mod. May 2019)
4
5clear all
6wdir = '../path_to_file/';
7syslabel = 'SystemLabel';
8fname = [wdir,syslabel,'.refoldedBands']; % .path, .spin
9
10file = fopen(fname); % Read DOS files
11dat = fscanf(file,'%d %d %f %f %f',5);
12 nq = dat(1);
13 ne = dat(2);
14 emin = dat(3);
15 emax = dat(4);
16 Fermi = dat(5);
17
18q = zeros(3,nq);
19dos = zeros(nq,ne);
20label = string(zeros(nq,1));
21for iq = 1:nq
22 q(:,iq) = fscanf(file,'%f %f %f',3);
23 iline(iq) = fscanf(file,'%i',1);
24 label(iq) = fscanf(file,'%10c',1);
25 dos(iq,:) = fscanf(file,'%f',ne);
26end
27fclose(file);
28
29% adjust labels to MATLAB style
30for iq=1:nq
31 if (label(iq)==' Gamma ')
32 label(iq)='\Gamma';
33 elseif (label(iq)==' '' '' ')
34 label(iq)=' ';
35 else
36 label(iq)=strtrim(label(iq));
37 end
38end
39
40
41for ix=1:3
42 dq(ix,:) = diff(q(ix,:));
43end
44dq = sqrt(sum(dq.^2));
45qpath = [0,cumsum(dq)];
46
47emin = emin - Fermi;
48emax = emax - Fermi;
49de = (emax-emin)/(ne-1);
50e = emin:de:emax;
51[qpath,e] = ndgrid(qpath,e);
52
53
54% convolution with a gaussian (smooth)
55a = 0;
56b = 0.03;
57x = -5:0.1:5;
58f = exp(-((x-a).^2)/(2*(b^2))) / (sqrt(2*pi*(b^2)));
59f = f/trapz(f);
60dos = conv2(f,f,dos,'same');
61
62% --------- Plot of the density --------- figure size:
63figure(1) % [x0, y0, w, h]
64set(gcf,'Units','Normalized','OuterPosition',[0.40, 0.05, 0.6, 0.7]);
65
66PlotLog = 0;
67zlim = max(dos(:));
68zsat = zlim*1.0e-3; % saturation for log scale
69
70% emax = 1.5;
71% emin = -1.5;
72
73
74if PlotLog == 0 % normal
75 s = surf(qpath',e',dos');
76 s.EdgeColor = 'none';
77 axis([qpath(1),qpath(end),emin,emax,0,zlim])
78 caxis([0,zlim]);
79else % log
80 s = surf(qpath',e',max(dos,zsat)');
81 set(gca,'colorscale','log');
82 axis([qpath(1),qpath(end),emin,emax,zsat,zlim])
83 caxis([zsat,zlim]);
84end
85
86s.EdgeColor = 'none';
87set(gca,'FontSize',14);
88ylabel('Energy (eV)');
89zlabel('LDOS');
90
91view(2);
92colormap(flipud(bone));
93h = colorbar;
94h.TickLength = 0.03;
95set(get(h,'label'),'string',' LDOS (eV^{-1})');
96
97% line edges and fermi level
98hold on
99cpl = [0.8,0.7,0.75];
100cfl = [0.92,0.59,0.59];
101
102lineEnd = find(iline(1:nq-1)<iline(2:nq));
103for jl = 1:numel(lineEnd)
104 il = lineEnd(jl);
105 plot3(qpath(il)*[1,1],[emin,emax],[zlim,zlim],'Color',cpl,'LineStyle',':')
106end
107plot3(qpath(end)*[1,1],[emin,emax],[zlim,zlim],'Color',cpl,'LineStyle',':')
108
109plot3([qpath(1),qpath(end)],0*[1,1],[zlim,zlim],'Color',cfl,'LineStyle',':','LineWidth',0.5)
110
111xticks( [qpath((lineEnd(1:1:numel(lineEnd)))),qpath(end)] );
112xticklabels( [ label(lineEnd(1:1:numel(lineEnd))); label(nq) ] );
113hold off
114
115% To specify labels:
116% xticklabels({'\Gamma\color{gray}(000)','X','L'});
117
118% ----------------------------------------------------------
119
0120
=== added file 'Util/Unfolding/Src/plotmesh.m'
--- Util/Unfolding/Src/plotmesh.m 1970-01-01 00:00:00 +0000
+++ Util/Unfolding/Src/plotmesh.m 2019-09-12 09:33:19 +0000
@@ -0,0 +1,90 @@
1% plotmesh.m
2% Plot a surface of qDOS writen by unfold in a 2D mesh of
3% q points. Reads a colection of .pathN files written by
4% unfold. The UnfoldedBandLines block can be generated with
5% the program meshgen.
6% SGM & JMS, April 2019
7
8clear all
9ry = 13.60580; % one ry in eV
10wmin = 1.e-4;
11
12% Change this:
13 npaths = 25; % number of files to read
14 wdir = '../path_to_files/'; % path to files
15 syslabel = 'SystemLabel'; % Siesta label
16 flabel = '.refoldedBands.path'; % unfolded or refolded
17
18for ipath=1:npaths
19 spath = num2str(ipath); % turns number into string
20 fname = [wdir,syslabel,flabel,spath];
21
22 file = fopen(fname);
23 dat = fscanf(file,'%d %d %f %f %f',5);
24 nq = dat(1); ne = dat(2);
25 emin = dat(3); emax = dat(4);
26 Fermi = dat(5);
27
28 if ipath==1
29 q = zeros(3,nq,npaths);
30 dos = zeros(nq,npaths,ne); % label = string(zeros(nq,1,npaths));
31 end
32
33 for iq = 1:nq
34 q(:,iq,ipath) = fscanf(file,'%f %f %f',3);
35 fscanf(file,'%i',1); % iline(iq,ipath) =
36 fscanf(file,'%10c',1); % label(iq) =
37 dos(iq,ipath,:) = fscanf(file,'%f',ne);
38 end
39 fclose(file);
40end
41
42emin = emin - Fermi;
43emax = emax - Fermi;
44de = (emax-emin)/(ne-1);
45emesh = emin:de:emax;
46
47qx(:) = q(1,1,:);
48qy(:) = q(2,:,1);
49[qx,qy,emesh] = ndgrid(qx,qy,emesh);
50
51dos = permute(dos,[2,1,3]);
52
53dos = dos+1e-30;
54ie = 2:ne-1;
55dos2(:,:, 1,2) = dos(:,:,1); % unfold splits dos in two ie
56dos2(:,:,ne,1) = dos(:,:,ne);
57dos2(:,:,ie,1) = dos(:,:,ie).*dos(:,:,ie-1)./(dos(:,:,ie-1)+dos(:,:,ie+1));
58dos2(:,:,ie,2) = dos(:,:,ie).*dos(:,:,ie+1)./(dos(:,:,ie-1)+dos(:,:,ie+1));
59ie = 1:ne-1;
60w(:,:,ie) = (dos2(:,:,ie,2)+dos2(:,:,ie+1,1));
61e(:,:,ie) = (emesh(:,:,ie).*dos2(:,:,ie,2)+...
62 emesh(:,:,ie+1).*dos2(:,:,ie+1,1))./w(:,:,ie);
63ne = ne-1;
64e(:,:,ie+1)=e(:,:,ie);
65w(:,:,ie+1)=w(:,:,ie);
66
67% Select points with some significant weight
68iqe = find(w(:)>wmin);
69qx = qx(iqe);
70qy = qy(iqe);
71e = e(iqe);
72w = w(iqe);
73w = w/max(w);
74
75[~,iw] = sort(w);
76w = w(iw);
77qx = qx(iw);
78qy = qy(iw);
79e = e(iw);
80nqe = numel(e);
81
82ptsize = 75; % size of dots
83scatter3(qx,qy,e,ptsize*w.^1.1,w,'filled');
84
85colormap(flipud(bone));
86xlabel('k_y')
87xlabel('k_x')
88zlabel('Energy')
89
90
091
=== added file 'Util/Unfolding/Src/unfold.F90'
--- Util/Unfolding/Src/unfold.F90 1970-01-01 00:00:00 +0000
+++ Util/Unfolding/Src/unfold.F90 2019-09-12 09:33:19 +0000
@@ -0,0 +1,661 @@
1! ---
2! Copyright (C) 1996-2016 The SIESTA group
3! This file is distributed under the terms of the
4! GNU General Public License: see COPYING in the top directory
5! or http://www.gnu.org/copyleft/gpl.txt .
6! See Docs/Contributors.txt for a list of contributors.
7! ---
8
9program unfold
10
11! Reads the .fdf, .ion, .HSX, .EIG and .psf files of a SIESTA calculation and
12! generates unfolded and refolded bands. See Util/Unfolding/README for details.
13! Ref: "Band unfolding made simple", S.G.Mayo and J.M.Soler, Dic.2018
14! arXiv:1812.03925 ( https://arxiv.org/abs/1812.03925 )
15! S.G.Mayo and J.M.Soler, Oct.2018
16
17 use alloc, only: alloc_report, de_alloc, re_alloc
18 use atmfuncs, only: lofio, mofio, nofis, rcut, rphiatm, zetafio
19 use basis_types, only: nsp
20 use basis_types, only: basis_parameters, initialize
21 use basis_io, only: read_basis_ascii
22 use cellsubs, only: reclat, volcel
23 use fdf, only: block_fdf, fdf_bintegers, fdf_bline, fdf_block, &
24 fdf_bmatch, fdf_bnames, fdf_bnnames, fdf_bnvalues, &
25 fdf_bvalues, fdf_convfac, fdf_get, fdf_init, &
26 fdf_parallel, parsed_line
27 use hsx_m, only: hsx_t, read_hsx_file
28 use m_array, only: array_copy
29 use m_get_kpoints_scale, &
30 only: get_kpoints_scale
31 use m_io, only: io_assign, io_close
32 use m_mpi_utils, only: broadcast
33#ifdef MPI
34 use m_diag_option,only: ParallelOverK, diag_serial=>Serial
35 use mpi_siesta, only: MPI_Comm_Rank, MPI_Comm_Size, MPI_Comm_World, &
36 MPI_double_precision, MPI_Init, MPI_Finalize, &
37 MPI_Reduce, MPI_Sum
38#endif
39 use m_radfft, only: radfft
40 use m_timer, only: timer_init, timer_report, timer_start, timer_stop
41 use parallel, only: Nodes, Node
42 use precision, only: dp, sp
43 use spher_harm, only: lofilm, rlylm
44 use siesta_geom, only: ucell, xa, isa ! unit cell, atomic coords and species
45 use sys, only: die
46
47
48 implicit none
49
50 ! Internal parameters
51 character(len=*),parameter:: myName = 'unfold '
52 integer, parameter :: nr = 4096 ! number of radial points for basis orbitals
53 integer, parameter :: maxl = 5 ! max angular momentum
54 integer, parameter :: maxpaths = 150 ! max number of unfolded band paths
55 integer, parameter :: maxnq = 22000 ! max number of q sampling points
56 real(dp),parameter :: g2c = 50_dp ! default refolding G cutoff (ry)
57 real(dp),parameter :: qc = 50_dp ! cutoff for FT of atomic orbitals (bohr^-1)
58 logical, parameter :: writeOrbitals = .false. ! write atomic orbital files?
59 real(dp),parameter :: tolSuperCell = 5.e-5 ! tolerance for comparing cell and supercell
60 integer, parameter :: allocReportLevelDefault = 2 ! default allocation report level
61
62 ! Internal variables
63 integer :: i, i1, i2, i3, ia, iao, ib, ic, ie, ierr, ig, ij, &
64 io, ios, iostat, iou, ipath, iq, iq1, iq2, iqNode, iqx(3), &
65 ir, irq, iscf, isp, ispin, itag, iu, j, je, jk, jlm, jo, jos, jou, &
66 kdsc(3,3), kscell(3,3), l, lastq(0:maxpaths), level, ll, lmax, &
67 m, maxig(3), maxorb, myNode, na, nbands, ne, ng, nh, nlm, nn, &
68 nNodes, nos, nou, npaths, nq, nqline, nrq, nspin, ntmp, nw, t, z
69 real(dp) :: alat, c0, cdos, cellRatio(3,3), ddos, de, dek, dq, dqpath(3), &
70 dqx(3), dr, drq, dscell(3,3), emax, emin, efermi, &
71 gcut, gnew(3), gnorm, gq(3), grad, gylm(3,maxl*maxl), &
72 kq(3), kxij, pi, &
73 qmod, qcell(3,3), qg(3), qline(3), qmax, qx(3), &
74 r, rc, rcell(3,3), refoldCell(3,3), refoldBcell(3,3), rmax, rq, &
75 scell(3,3), threshold, vol, we, wq, xmax, ylm(maxl*maxl)
76 complex(dp) :: ck, ii, phase, phi, psik, ukg
77 logical :: found, gamma, notSuperCell, refolding
78 character(len=50):: eunit, fname, formatstr, iostr, isstr, numstr, slabel
79 character(len=20):: labelfis, symfio
80 character(len=200):: line
81 character(len=10):: label(maxnq), string
82 character(len=80):: dumm
83 type(block_fdf) :: bfdf
84 type(hsx_t) :: hsx
85
86 integer :: nx
87 real(dp):: dg, drmin, dx, g0(3), gmod, gvec(3), normphiq, normphir, x(3), wr, xmod
88
89 ! Allocatable arrays and pointers
90 integer, pointer:: iline(:)=>null()
91 real(dp), pointer:: eb(:,:)=>null(), &
92 phir(:,:,:)=>null(), phiq(:,:,:)=>null(), &
93 rdos(:,:,:)=>null(), udos(:,:,:)=>null(), &
94 tmp1(:)=>null(), tmp2(:)=>null()
95 real(dp), pointer:: g(:,:)=>null(), q(:,:)=>null()
96 complex(dp), pointer:: h(:,:)=>null(), psi(:,:,:)=>null(), s(:,:)=>null()
97 logical, pointer:: cc(:,:,:)=>null()
98 type(parsed_line),pointer:: pline=>null()
99
100!--------------------
101
102! Initialize MPI
103#ifdef MPI
104 call MPI_Init( ierr )
105 call MPI_Comm_Rank( MPI_Comm_World, Node, ierr )
106 call MPI_Comm_Size( MPI_Comm_World, Nodes, ierr )
107 myNode = Node
108 nNodes = Nodes
109#else
110 myNode = 0
111 nNodes = 1
112#endif
113
114 ! Initialize input
115#ifdef MPI
116 if (.not.fdf_parallel()) &
117 call die('unfold ERROR: FDF has no parallel support')
118#endif
119 call fdf_init( fileOutput='unfold.fdflog', unitInput=5 )
120
121 ! Initialize timer
122 threshold = fdf_get('TimerReportThreshold', 0._dp)
123 call timer_report( file='unfold.times', threshold=threshold )
124 call timer_init()
125 call timer_start(myName//'init')
126
127 ! Set allocation report parameters
128 level = fdf_get( 'AllocReportLevel', AllocReportLevelDefault )
129 threshold = fdf_get( 'AllocReportThreshold', 0._dp )
130 call alloc_report( level, file='unfold.alloc', printNow=.false., threshold=threshold )
131
132 ! Read Fermi level from SystemLabel.out file
133! if (myNode==0) then
134! call system('grep ''Fermi = '' *out -h > fermi')
135! open(8181,file='fermi',action='read')
136! read(8181,'(a)') dumm
137! ic = index(dumm,'=')
138! read(dumm(ic+1:),*) efermi
139! print*,'unfold: Fermi = ',efermi
140! call system('rm fermi')
141! close(8181)
142! endif
143
144 ! Read Fermi level from SystemLabel.EIG file
145 slabel = fdf_get('SystemLabel','unknown')
146 if (myNode==0) then
147 fname = trim(slabel)//'.EIG'
148 open(8181,file=fname,action='read')
149 read(8181,*) efermi
150 print*,'unfold: Fermi = ',efermi
151 endif
152
153 ! Read atomic basis
154 if (myNode==0) then
155 print*,'unfold: reading atomic orbitals'
156 allocate(basis_parameters(nsp))
157 do isp=1,nsp
158 call initialize(basis_parameters(isp))
159 enddo
160 call read_basis_ascii(nsp)
161 endif
162 call broadcast(nsp)
163 call broadcast_basis()
164
165 ! Allocate arrays for atomic orbitals
166 maxorb = 0 ! max. number of orbitals in any atom
167 do isp=1,nsp
168 maxorb = max(maxorb,nofis(isp))
169 enddo
170 call re_alloc( phir, 0,nr, 1,nsp, 1,maxorb, myName//'phir' )
171 call re_alloc( phiq, 0,nr, 1,nsp, 1,maxorb, myName//'phiq' )
172
173 ! Find cutoffs of atomic orbitals
174 lmax = 0
175 rmax = 0
176 do isp = 1,nsp ! species index
177 do io = 1,nofis(isp) ! orbital index within species
178 rmax = max(rmax,rcut(isp,io))
179 lmax = max(lmax,lofio(isp,io))
180 enddo ! io
181 enddo ! isp
182 if (myNode==0) print*, 'lmax,rmax=',lmax,rmax
183
184 ! Find atomic orbitals in real space
185 pi = acos(-1._dp)
186 nq = nr
187 dq = qc/nr ! radial interval in reciprocal space
188 dr = pi/qc ! radial interval in real space
189 rc = nr*dr ! radial cutoff in real space
190 do isp = 1,nsp ! species index
191 do io = 1,nofis(isp) ! orbital index within species
192! write(6,*) "# Orbital (#, l, z, m, rc):", &
193! lofio(isp,io), zetafio(isp,io), mofio(isp,io), rcut(isp,io)
194 do ir=0,nr
195 r = dr*ir
196 call rphiatm(isp,io,r,phir(ir,isp,io),grad)
197 enddo
198 enddo ! io
199 enddo ! isp
200 if (myNode==0) then
201 print*,'unfold: nr,dr,rc=',nr,dr,rc
202 print*,'unfold: nq,dq,qc=',nq,dq,qc
203 if (nq .gt. maxnq) &
204 call die('unfold ERROR: parameter maxnq is too small')
205 print'(a,/,(2i4,f12.6))','unfold: isp,io,rc=', &
206 ((isp,io,rcut(isp,io),io=1,nofis(isp)),isp=1,nsp)
207 endif
208
209 ! Fourier transform atomic orbitals
210 if (myNode==0) print*,'unfold: Fourier-transforming atomic orbitals'
211 do isp = 1,nsp
212 do io = 1,nofis(isp)
213 call radfft(lofio(isp,io),nr,rc,phir(:,isp,io),phiq(:,isp,io))
214 enddo
215 enddo
216
217 ! Write radial dependence of atomic orbitals in real and reciprocal space
218 if (myNode==0 .and. writeOrbitals) then
219 do isp = 1,nsp
220 do io = 1,nofis(isp)
221 write(isstr,*) isp
222 write(iostr,*) io
223 fname = 'species'//trim(adjustl(isstr))//'orbital'//trim(adjustl(iostr))//'.r'
224 call io_assign(iu)
225 open(iu,file=fname,status='unknown',form='formatted',action='write')
226 write(iu,'(2f12.6)') (ir*dr,phir(ir,isp,io),ir=0,nr)
227 call io_close(iu)
228 fname = 'species'//trim(adjustl(isstr))//'orbital'//trim(adjustl(iostr))//'.q'
229 open(iu,file=fname,status='unknown',form='formatted',action='write')
230 write(iu,'(2f12.6)') (iq*dq,phiq(iq,isp,io),iq=0,nq)
231 call io_close(iu)
232 enddo
233 enddo
234 endif
235
236 ! Find norm of atomic orbitals in real space, as a check
237! gcut = sqrt( fdf_get('RefoldingGcutoff',g2c,'ry') )
238! xmax = rmax+1
239! dx = pi/gcut
240! nx = ceiling(xmax/dx)
241! if (myNode==0) print*,'unfold: dx,nx=',dx,nx
242! do isp = 1,nsp ! species index
243! do io = 1,nofis(isp) ! orbital index within species
244! l = lofio(isp,io)
245! m = mofio(isp,io)
246! jlm = l*(l+1) + m+1 !! ilm(l,m)
247! normphir = 0
248! do i3 = -nx,nx
249! do i2 = -nx,nx
250! do i1 = -nx,nx
251! x = (/i1,i2,i3/)*dx
252! xmod = sqrt(sum(x**2))+1.e-15_dp
253! ir = ceiling(xmod/dr)
254! wr = (ir*dr-xmod)/dr
255! if (ir<=nr) then
256! phi = phir(ir-1,isp,io)*(1-wr) + phir(ir,isp,io)*wr
257! call rlylm(l,x/xmod,ylm,gylm)
258! phi = phi*ylm(jlm)
259! normphir = normphir + abs(phi)**2*dx**3
260! endif
261! enddo
262! enddo
263! enddo
264! if (myNode==0) print*,'ulfold: isp,io,norm(phi(r))=',isp,io,normphir
265! enddo
266! enddo
267
268 ! Find norm of atomic orbitals in reciprocal space, as a check
269! dg = 2*pi/(2*xmax)
270! ng = ceiling(gcut/dg)
271! if (myNode==0) print*,'unfold: dg,ng=',dg,ng
272! do isp = 1,nsp ! species index
273! do io = 1,nofis(isp) ! orbital index within species
274! l = lofio(isp,io)
275! m = mofio(isp,io)
276! jlm = l*(l+1) + m+1 !! ilm(l,m)
277! normphiq = 0
278! do i3 = -ng,ng
279! do i2 = -ng,ng
280! do i1 = -ng,ng
281! gvec = (/i1,i2,i3/)*dg
282! gmod = sqrt(sum(gvec**2))+1.e-15_dp
283! iq = ceiling(gmod/dq)
284! wq = (iq*dq-gmod)/dq
285! if (iq<=nq) then
286! phi = phiq(iq-1,isp,io)*(1-wq) + phiq(iq,isp,io)*wq
287! call rlylm(l,gvec/gmod,ylm,gylm)
288! phi = phi*ylm(jlm)
289! normphiq = normphiq + abs(phi)**2*dg**3
290! endif
291! enddo
292! enddo
293! enddo
294! if (myNode==0) print*,'ulfold: isp,io,norm(phi(q))=',isp,io,normphiq
295! enddo
296! enddo
297
298 ! Find unit cell and initialize atomic coords
299 if (myNode==0) print'(a,/,(3f12.6))','unfold: reading system geometry'
300 alat = fdf_get('LatticeConstant',1._dp,'bohr')
301 call coor(na,ucell) ! atomic coordinates xa stored in module siesta_geom
302 vol = volcel(ucell) ! unit cell volume
303 call reclat(ucell,rcell,1) ! rcell = reciprocal cell vectors
304 if (myNode==0) then
305 print'(a,/,(2i6,3f12.6))','unfold: ia,ispecies,xa (bohr) =', &
306 (ia,isa(ia),xa(:,ia),ia=1,na)
307 print'(a,f20.6,/,(3f21.15))','unfold: vol, unit_cell (bohr) =',vol,ucell
308 print'(a,/,(3f21.15))','unfold: reciprocal_cell (1/bohr) =',rcell
309 endif
310
311 ! Read HSX file with H, S, and xij matrices
312! slabel = fdf_get('SystemLabel','unknown')
313 fname = trim(slabel)//'.HSX'
314 if (myNode==0) then
315 call read_hsx_file(hsx,fname)
316 if (hsx%nspecies/=nsp) call die('unfold ERROR: hsx%nspecies/=nsp')
317 if (hsx%na_u/=na) call die('unfold ERROR: hsx%na_u/=na')
318 endif
319 call broadcast(hsx%nspecies)
320 call broadcast(hsx%na_u)
321 call broadcast(hsx%no_u)
322 call broadcast(hsx%no_s)
323 call broadcast(hsx%nspin)
324 call broadcast(hsx%nh)
325 nou = hsx%no_u
326 nos = hsx%no_s
327 nh = hsx%nh
328 nspin = hsx%nspin
329 if (myNode/=0) then
330 call re_alloc(hsx%iaorb, 1,nou, myName//'hsx%iaorb')
331 call re_alloc(hsx%iphorb, 1,nou, myName//'hsx%iphorb')
332 call re_alloc(hsx%numh, 1,nou, myName//'hsx%numh')
333 call re_alloc(hsx%listhptr, 1,nou, myName//'hsx%listhptr')
334 call re_alloc(hsx%listh, 1,nh, myName//'hsx%listh')
335 call re_alloc(hsx%indxuo, 1,nos, myName//'hsx%indxuo')
336 call re_alloc(hsx%hamilt, 1,nh, 1,nspin, myName//'hsx%hamilt')
337 call re_alloc(hsx%Sover, 1,nh, myName//'hsx%Sover')
338 call re_alloc(hsx%xij, 1,3, 1,nh, myName//'hsx%xij')
339 endif
340 call broadcast(hsx%iaorb)
341 call broadcast(hsx%iphorb)
342 call broadcast(hsx%numh)
343 call broadcast(hsx%listhptr)
344 call broadcast(hsx%listh)
345 call broadcast(hsx%indxuo)
346 call broadcast(hsx%hamilt)
347 call broadcast(hsx%Sover)
348 call broadcast(hsx%xij)
349
350 ! Read fdf block UnfoldedBandLines
351 if (myNode==0) print*,'unfold: reading UnfoldedBandLines block'
352 call get_kpoints_scale('BandLinesScale',qcell,ierr)
353 if (ierr/=0) &
354 call die('unfold: ERROR calling get_kpoints_scale')
355 found = fdf_block('UnfoldedBandLines',bfdf)
356 if (.not.found) &
357 call die('unfold ERROR: fdf block UnfoldedBandLines not found')
358 if (.not.(fdf_bline(bfdf,pline).and.fdf_bmatch(pline,'ivvs'))) &
359 call die('unfold ERROR: wrong format in fdf block UnfoldedBandLines')
360 ne = fdf_bintegers(pline,1)
361 eunit = fdf_bnames(pline,1) ! energy unit
362 emin = fdf_bvalues(pline,1,after=1)
363 emax = fdf_bvalues(pline,2,after=1)
364 npaths = 0
365 nq = 0
366 lastq(0) = 0
367 label = ' '
368
369 do while( fdf_bline(bfdf,pline) ) ! bline and pline refer to text lines, not q lines
370
371 nn = fdf_bnnames(pline)
372
373 if (fdf_bmatch(pline,'ivvv').or.fdf_bmatch(pline,'ivvvs')) then
374 nqline = fdf_bintegers(pline,1) ! number of q points in line
375 qline = qcell(:,1)*fdf_bvalues(pline,1,after=1) &
376 + qcell(:,2)*fdf_bvalues(pline,2,after=1) &
377 + qcell(:,3)*fdf_bvalues(pline,3,after=1)
378
379 if (nqline==1) then
380 npaths = npaths+1
381 if (npaths>maxpaths) &
382 call die('unfold ERROR: parameter maxpaths is too small')
383 nq = nq+1
384 call re_alloc( q, 1,3, 1,nq, myName//'q' )
385 call re_alloc( iline, 1,nq, myName//'iline' )
386 q(:,nq) = qline
387 iline(nq) = 1
388 if(nn .gt. 0) label(nq) = fdf_bnames(pline,1) ! q label for plot
389 else
390 call re_alloc( q, 1,3, 1,nq+nqline, myName//'q' )
391 call re_alloc( iline, 1,nq+nqline, myName//'iline' )
392 do iq = 1,nqline
393 q(:,nq+iq) = q(:,nq) + (qline-q(:,nq))*iq/nqline
394 iline(nq+iq) = iline(nq)+1
395 enddo
396 nq = nq+nqline
397 if(nn .gt. 0) label(nq) = fdf_bnames(pline,1)
398 endif
399
400 lastq(npaths) = nq
401 else
402 call die('unfold ERROR: wrong format in fdf block UnfoldedBandLines')
403 endif
404 enddo
405
406 ! Read fdf block RefoldingLatticeVectors
407 if (myNode==0) print*,'unfold: reading RefoldingLatticeVectors block'
408 gcut = sqrt( fdf_get('RefoldingGcutoff',g2c,'ry') )
409 refolding = fdf_block('RefoldingLatticeVectors',bfdf)
410 if (refolding) then
411 if (myNode==0) print*,'unfold: block RefoldingLatticeVectors found'
412 do j = 1,3
413 if (.not.(fdf_bline(bfdf,pline).and.fdf_bmatch(pline,'vvv'))) &
414 call die('unfold ERROR: wrong format in fdf block RefoldingLatticeVectors')
415 do i = 1,3
416 refoldCell(i,j) = fdf_bvalues(pline,i)*alat
417 enddo
418 enddo
419 call reclat(refoldCell,refoldBcell,1)
420 maxig = ceiling(gcut*sqrt(sum(refoldCell**2,dim=1))/(2*pi))
421 ng = 0
422 do i3 = -maxig(3),maxig(3)
423 do i2 = -maxig(2),maxig(2)
424 do i1 = -maxig(1),maxig(1)
425 gnew = refoldBcell(:,1)*i1 + refoldBcell(:,2)*i2 + refoldBcell(:,3)*i3
426 gnorm = sqrt(sum(gnew**2))
427 if (gnorm<gcut) then
428 ng = ng+1
429 call re_alloc( g, 1,3, 1,ng, myName//'g', copy=.true. )
430 g(:,ng) = gnew
431 endif
432 enddo
433 enddo
434 enddo
435 else
436 refoldCell = 0
437 refoldBcell = 0
438 ng = 1
439 call re_alloc( g, 1,3, 1,ng, myName//'g' )
440 g(:,1) = 0
441 endif
442 if (myNode==0) print'(a,/,(3f12.6))','unfold: refoldCell=',refoldCell
443 if (myNode==0) print'(a,/,(3f12.6))','unfold: refoldBcell=',refoldBcell
444 if (myNode==0) print*,'unfold: alat,gcut,ng=',alat,gcut,ng
445
446 ! Find if simulation cell is a supercell of refold cell
447 cellRatio = matmul(transpose(refoldBcell),ucell)/(2*pi)
448 notSuperCell = .not.all(abs(cellRatio-nint(cellRatio))<tolSuperCell)
449 if (myNode==0) print'(a,l,a,/,(3f12.6))', &
450 'unfold: notSuperCell= ',notSuperCell,' cellRatio=',cellRatio
451
452 ! Set some constants
453 ii = cmplx(0,1,dp)
454 nlm = (lmax+1)**2
455 c0 = (2*pi)**1.5_dp / vol
456 de = (emax-emin)/ne
457 cdos = 1.0 ! 1/(2*pi)**3
458 ParallelOverK = .true.
459 diag_serial = .true.
460 nbands = nou
461 iscf = 1
462 call re_alloc( h, 1,nou, 1,nou, myName//'h' )
463 call re_alloc( s, 1,nou, 1,nou, myName//'s' )
464 call re_alloc( psi, 1,nou, 1,nou, 1,nspin, myName//'psi' )
465 call re_alloc( eb, 1,nou, 1,nspin, myName//'eb' )
466
467 ! Main loops on unfolded band paths and q vectors along them
468 call timer_stop(myName//'init')
469 call timer_start(myName//'main loop')
470 if (myNode==0) print*,'unfold: main loop'
471 do ipath = 1,npaths
472 if (myNode==0) print*,'unfold: ipath',ipath,'of',npaths
473 iq1 = lastq(ipath-1)+1
474 iq2 = lastq(ipath)
475 call re_alloc( udos, iq1,iq2, 0,ne, 1,nspin, myName//'udos', &
476 copy=.false., shrink=.true. )
477 if (refolding) &
478 call re_alloc( rdos, iq1,iq2, 0,ne, 1,nspin, myName//'rdos', &
479 copy=.false., shrink=.true. )
480 udos = 0
481 do iq = iq1,iq2
482 iqNode = mod((iq-1),nNodes)
483 if (myNode==iqNode) then
484 do ig = 1,ng
485 gnorm = sqrt(sum(g(:,ig)**2))
486 qg = q(:,iq)+g(:,ig) ! note: this is a refolding g, not a superlattice G
487 if (ig==1 .or. notSuperCell) then
488 qx = matmul(qg,ucell)/(2*pi) ! qg in mesh coords: qg=matmul(rcell,qx)
489 kq = matmul(rcell,qx-nint(qx)) ! q+g translated to FBZ of SC, i.e. kq=k+g-G
490 endif
491 gq = qg-kq ! supercell G vector
492 do ispin = 1,nspin
493
494 if (ig==1 .or. notSuperCell) then
495 call timer_start(myName//'diag')
496 h = 0
497 s = 0
498 do iou = 1,nou
499 do j = 1,hsx%numh(iou)
500 ij = hsx%listhptr(iou) + j
501 jos = hsx%listh(ij)
502 jou = hsx%indxuo(jos)
503 kxij = sum(kq*hsx%xij(:,ij))
504 phase = exp(ii*kxij)
505 s(iou,jou) = s(iou,jou) + hsx%Sover(ij)*phase
506 h(iou,jou) = h(iou,jou) + hsx%hamilt(ij,ispin)*phase
507 enddo
508 enddo
509 call cdiag(h,s,nou,nou,nou,eb(:,ispin),psi(:,:,ispin), &
510 nbands,iscf,ierr,-1)
511 if (ierr/=0) print*,'unfold: ERROR in cdiag'
512 eb(:,ispin) = eb(:,ispin)*fdf_convfac('ry',eunit) ! from Ry to eunit
513 call timer_stop(myName//'diag')
514 endif
515
516 call timer_start(myName//'g sum')
517 qmod = sqrt(sum(qg**2))+1.e-15_dp
518 call rlylm( lmax, qg/qmod, ylm, gylm )
519 do ib = 1,nbands
520 je = floor((eb(ib,ispin)-emin)/de)
521 dek = emin + (je+1)*de - eb(ib,ispin)
522 we = dek/de
523 ukg = 0
524 if (je>=-1 .and. je<=ne) then ! select energies
525 do io = 1,nou
526 ia = hsx%iaorb(io)
527 isp = isa(ia)
528 iao = hsx%iphorb(io)
529 l = lofio(isp,iao)
530 m = mofio(isp,iao)
531 jlm = l*(l+1) + m+1 ! ilm(l,m)
532 irq = floor(qmod/dq)
533 drq = (irq+1)*dq-qmod
534 wq = drq/dq
535 phi = phiq(irq,isp,iao)*wq + phiq(irq+1,isp,iao)*(1-wq)
536 phi = (-ii)**l * ylm(jlm) * phi
537 psik = c0*psi(io,ib,ispin)*phi*exp(-ii*sum(gq*xa(:,ia)))
538 ukg = ukg + psik
539 enddo ! io
540 ddos = cdos*vol*abs(ukg)**2
541 if (gnorm<1.e-12_dp) then
542 if (je>=0 .and. je<=ne) &
543 udos(iq,je,ispin) = udos(iq,je,ispin) + ddos*we
544 if (je>=-1 .and. je<ne) &
545 udos(iq,je+1,ispin) = udos(iq,je+1,ispin) + ddos*(1-we)
546 endif
547 if (refolding) then
548 if (je>=0 .and. je<=ne) &
549 rdos(iq,je,ispin) = rdos(iq,je,ispin) + ddos*we
550 if (je>=-1 .and. je<ne) &
551 rdos(iq,je+1,ispin) = rdos(iq,je+1,ispin) + ddos*(1-we)
552 endif
553 endif
554 enddo ! ib
555 call timer_stop(myName//'g sum')
556 enddo ! ispin
557 enddo ! ig
558 endif ! (myNode==iqNode)
559 enddo ! iq
560
561if (myNode==0) print*,'unfold: end of main loop'
562
563#ifdef MPI
564 ntmp = (iq2-iq1+1)*(ne+1)*nspin
565 call re_alloc( tmp1, 1,ntmp, myName//'tmp1', copy=.false., shrink=.true. )
566 call re_alloc( tmp2, 1,ntmp, myName//'tmp2', copy=.false., shrink=.true. )
567! tmp1 = reshape(udos,(/ntmp/))
568 call array_copy([1,1,1],[iq2-iq1+1,ne+1,nspin],udos, 1,ntmp,tmp1)
569 tmp2 = 0
570 call MPI_reduce(tmp1,tmp2,ntmp,MPI_double_precision,MPI_sum,0, &
571 MPI_COMM_WORLD,ierr)
572! udos(iq1:iq2,0:ne,:) = reshape(tmp2,(/iq2-iq1+1,ne+1,nspin/))
573 call array_copy(1,ntmp,tmp2, [1,1,1],[iq2-iq1+1,ne+1,nspin],udos)
574 if (refolding) then
575! tmp1 = reshape(rdos,(/ntmp/))
576 call array_copy([1,1,1],[iq2-iq1+1,ne+1,nspin],rdos, 1,ntmp,tmp1)
577 tmp2 = 0
578 call MPI_reduce(tmp1,tmp2,ntmp,MPI_double_precision,MPI_sum,0, &
579 MPI_COMM_WORLD,ierr)
580! rdos(iq1:iq2,0:ne,:) = reshape(tmp2,(/iq2-iq1+1,ne+1,nspin/))
581 call array_copy(1,ntmp,tmp2, [1,1,1],[iq2-iq1+1,ne+1,nspin],rdos)
582 endif
583#endif
584
585if (myNode==0) print*,'unfold: writing output files'
586
587 if (myNode==0) then
588 do ispin = 1,nspin
589 call io_assign(iu)
590 fname = trim(slabel)//'.unfoldedBands'
591 if (nspin==2 .and. ispin==1) then
592 fname = trim(fname)//'.spinUp'
593 elseif (nspin==2 .and. ispin==2) then
594 fname = trim(fname)//'.spinDn'
595 endif
596 if (npaths>1) then
597 write(numstr,*) ipath
598 fname = trim(fname)//'.path'//adjustl(numstr)
599 endif
600 open(iu,file=fname,status='unknown',form='formatted',action='write')
601 write(iu,'(2(i6),2(f10.3),f13.6)') &
602 lastq(ipath)-lastq(ipath-1),ne+1,emin,emax,efermi
603 do iq = iq1,iq2
604 if (label(iq) .eq. ' ') then
605 string = " "
606 else
607 string = ""//trim(label(iq))//""
608 endif
609 write(iu,'(3(f13.8),i5,a12)') q(:,iq), iline(iq), string
610 do j = 0,ne
611 write(iu,'(e15.6)') udos(iq,j,ispin)
612 enddo
613 enddo ! iq
614 call io_close(iu)
615
616 if (refolding) then
617 fname = trim(slabel)//'.refoldedBands'
618 if (nspin==2 .and. ispin==1) then
619 fname = trim(fname)//'.spinUp'
620 elseif (nspin==2 .and. ispin==2) then
621 fname = trim(fname)//'.spinDn'
622 endif
623 if (npaths>1) then
624 write(numstr,*) ipath
625 fname = trim(fname)//'.path'//adjustl(numstr)
626 endif
627 open(iu,file=fname,status='unknown',form='formatted',action='write')
628 write(iu,'(2(i6),2(f10.3),f13.6)') &
629 lastq(ipath)-lastq(ipath-1),ne+1,emin,emax,efermi
630 do iq = iq1,iq2
631 if (label(iq) .eq. ' ') then
632 string = "' '"
633 else
634 string = ""//trim(label(iq))//""
635 endif
636 write(iu,'(3(f13.8),i5,a12)') q(:,iq), iline(iq), string
637 do j = 0,ne
638 write(iu,'(e15.6)') rdos(iq,j,ispin)
639 enddo
640 enddo ! iq
641 call io_close(iu)
642 endif ! (refolding)
643 enddo ! ispin
644 endif ! (myNode==0)
645 enddo ! ipath
646 call timer_stop(myName//'main loop')
647
648 ! Write allocation report
649 call alloc_report( printNow=.true. )
650
651 ! Write timer report
652 call timer_report( printNow=.true. )
653
654if(myNode==0) print*,'Job completed.'
655
656#ifdef MPI
657 call MPI_finalize(ierr)
658#endif
659
660end program unfold
661
0662
=== modified file 'version.info'
--- version.info 2019-09-04 13:09:45 +0000
+++ version.info 2019-09-12 09:33:19 +0000
@@ -1,1 +1,5 @@
1<<<<<<< TREE
1trunk-7812trunk-781
3=======
4trunk-766-unfolding-47
5>>>>>>> MERGE-SOURCE

Subscribers

People subscribed via source and target branches