[ase-users] Miller Indices for Lattice Module
Baichuan.Sun at data61.csiro.au
Baichuan.Sun at data61.csiro.au
Wed May 31 11:49:08 CEST 2017
Dear Professor Jakob,
This is amazing! Thanks so much!
Sincerely yours,
Baichuan Sun, PhD
________________________________________
From: Jakob Schiøtz <schiotz at fysik.dtu.dk>
Sent: Tuesday, May 30, 2017 9:30 PM
To: Sun, Baichuan (Data61, Docklands GS)
Cc: ase users; Jens Jørgen Mortensen
Subject: Re: [ase-users] Miller Indices for Lattice Module
Dear Baicuan Sun,
> On 17 May 2017, at 3:42, Baichuan.Sun--- via ase-users <ase-users at listserv.fysik.dtu.dk> wrote:
>
> Dear ASE Users,
>
> Currently we are using ASE.Lattice to generate crystal structures and surfaces, however we encountered 2 issues:
>
> 1. RuntimeWarning in certain miller includes specifications
> There appears to be an unhandled warning when miller indices are provided with a cross product of zero. Rather than raising an exception, ASE appears to halt the python kernel completely, stopping any further compute:
>
> Miller Indices
> [
> [1, 1, 0],
> [1, 1, 0],
> [0, 0, 1]
> ]
>
> packages/ase/lattice/bravais.py:443: RuntimeWarning: divide by zero encountered in floor_divide
Thank you very much for reporting this bug. ASE does indeed enter an infinite loop if two miller indices are identical. I have fixed this so it raises a ValueError instead. The bug fix will soon be merged into the master branch, you can follow it here: https://gitlab.com/ase/ase/merge_requests/513
> 2. Hexagonal Structure Miller Indices
> What we are looking for is a set of miller indicies (and in fact, complete example using miller indices) that are suitable for the hexagonal crystal structure. We have attempted to create a hexagonal structure with the following specification:
>
> Miller Indices
> [
> [1, -1, 0, 0],
> [1, 0, -1, 0],
> [0, 1, -1, 0]
> ]
>
> Lattice Constants
> 'a': 2.0
> 'c': 2.0
>
> This specification yields a warning like the RuntimeWarning above. However the cross product check of the hexagonal indices above appears to be fine.
This specification does not work, since the three miller indices are linearly dependent (they are all three in the basal plane).
The lattice modules allow you to specify the directions in two different ways, either by giving the directions of the desired unit cells (directions=…) or by giving the miller indices of the surfaces of the unit cell (miller=…). For cubic lattices both work, but it looks like the miller=… specification is totally broken for hexagonal lattices. So I have disabled it for now, until it is fixed and gives the correct result. You will need to use directions=… instead.
> Is there a code sample available which uses miller indices in a hexagonal crystal structure?
Here is an example. I agree the documentation for these modules should be rewritten.
atoms = HexagonalClosedPacked(symbol="Mg",
directions=[[1,-1,0,0],[1,0,-1,0],[0,0,0,1]])
print(atoms.get_cell())
Best regards
Jakob
--
Jakob Schiøtz, professor, Ph.D.
Department of Physics
Technical University of Denmark
DK-2800 Kongens Lyngby, Denmark
http://www.fysik.dtu.dk/~schiotz/
More information about the ase-users
mailing list