Вы находитесь на странице: 1из 16

Familiarization with and visualization of

crystallographic structures
Andersson, Gustav Ls, Johan Strandberg, Rickard
941223-1939 910228-5856 880215-0618
gustand@kth.se johanlaa@kth.se rstran@kth.se

Project in Modern Physics (SH1012) - VT2015

1
Contents
1 Intro 3

2 Theory 4
2.1 Crystals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.2 Structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.2.1 Simple cubic . . . . . . . . . . . . . . . . . . . . . . . 5
2.2.2 Body-centered cubic . . . . . . . . . . . . . . . . . . . 5
2.2.3 Face-centered cubic . . . . . . . . . . . . . . . . . . . . 5
2.2.4 Hexagonal Close-packed . . . . . . . . . . . . . . . . . 5
2.2.5 Rock salt . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.2.6 Flourite . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.3 Defects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.4 Calculating the packing factor . . . . . . . . . . . . . . . . . . 8

3 Programming 10
3.1 Type of files . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
3.1.1 Custom file . . . . . . . . . . . . . . . . . . . . . . . . 11
3.1.2 POSCAR file . . . . . . . . . . . . . . . . . . . . . . . 12
3.1.3 .xyz file . . . . . . . . . . . . . . . . . . . . . . . . . . 13

4 Discussion 15

5 Sources 16

2
1 Intro
For our course in Modern Physics, we were asked to choose and work on
one of many projects presented to us. We chose Familiarization with and
visualization of crystallographic not only because we wanted to know more
about crystals, but also to brush up on our programming.

The purpose of this specific project was twofold; to begin with, develop
a basic understanding regarding crystallography. Secondly, to expand an
existing script in python, written by our instructor Antoine Claisse, which
makes drawing crystals an easy task.

3
2 Theory
In this section, the essential theory of crystals will be addressed. This in-
cludes the definition of one, some of the different structures it may have and
also a few words regarding defects that may occur. Most of this information
is taken from the book Introduction to Solid State Physics [1].

2.1 Crystals
All matter is made up of atoms - and matter can either be crystalline or not.
When we speak of matter in this sense, were referring to solid material.
What defines a crystal is the periodic array of its atoms; a highly ordered
structure. An ideal one would be constructed by the repetition of identical
structural units in space; a simple example of this would be copper, where
this unit is made up of one single atom.

This can, of course, be described mathematically. By defining three fun-


damental translation vectors (a, b and c), one can construct a so-called
lattice - a regular periodic arrangement of points in space. If

r0 = r + n1 a + n2 b + n3 c

where n1 , n2 and n3 are integers and the arrangement looks the same when
viewed from both r0 and r, the lattice is defined by these sets of points.

This doesnt, however, result in a crystal by itself, it only specifies, as men-


tioned, points in space. By introducing what is called a basis of atoms, and
putting these at each of the lattice points, a crystal structure is formed.

2.2 Structures
When we speak of different structures of crystals, were actually referring
to different types of lattices - and we will focus on those that are three-
dimensional. These can be visualized by observing a unit cell, the (not
always, but the most obvious - also called the conventional unit cell) small-
est unit that the crystal is built from. There are quite a few, and we will not
address all of them.

Another interesting piece of information would be the packing factor of a


crystal. It is given by VVunitcell
atoms
, where Vatoms is the volume in a unit cell that
are occupied by atoms, and Vunitcell its total volume. This will be included
for some of the crystal structures discussed, and an example how to calculate
it will be given further on.

4
2.2.1 Simple cubic
A great place to start is with the easiest one - simple cubic. It is composed
of eight atoms residing in the corners of a cube. This is basically positioning
single atoms on a lattice with points that are equally spaced in all directions.
The fundamental translation vectors must be orthogonal, and this, of course,
applies to all the cubic types. An example of an element with this kind of
structure would be Polonium [2]. Assuming all atoms are of the same size,
the packing factor will be 0.52.

2.2.2 Body-centered cubic


With the abbriviation BBC, the body-centered cubic structure is made up
of eight atoms residing in the corners of a cube, and one (doesnt have to be
the same) in the middle. If it is, however, all the same, the packing factor
can easily be calculated to about 0.68. This is actually, as mentioned, the
conventional unit cell - it may be described with far less atoms. There are
quite a few of these appearing in nature, such as Lithium, Sodium and Iron
[2].

2.2.3 Face-centered cubic


Face-centered cubic (FCC ) unit cells houses fourteen atoms in a cube - eight
in the corners and one on each face. This structure is also common, with
elements such as Calcium and Silver [2]. The packing factor, if only one
element is present, would be 0.74, which actually is the maximum value.
The three examples, fig. 1-3, are all drawn with the script.

Figure 1: Simple cubic Figure 2: BCC Figure 3: FCC

2.2.4 Hexagonal Close-packed


Referred to as HCP, hexagonal close-packed types of crystals are made of
alternating layers of atoms over each other as seen in fig. 4.

5
Figure 4: HCP, picture credit: [3]

This is the most volume efficient way of stacking spheres (along with the
FCC structure) with a packing factor of about 0.74, and this is, of course,
calculated for the case when all the atoms are of the same size. FCCs and
HCPs are based on the same way of arrangement, the difference is in how
the sheets of atoms are stacked.

2.2.5 Rock salt


The rock salt structure is a bit more complicated. One might say that its
as if two face-centered cubic crystals merged together. An example of this
would be NaCl - also known as common salt, fig. 5.

Figure 5: NaCl, picture credit: [4]

For this structure, the packing factor isnt as easy to calculate, since there
are more than one type of atom present. For NaCl, however, it is 0.65.

2.2.6 Flourite
The structure of flourite is also quite special. Its unit cell could be described
as a face-centered cubic type with a smaller simple cubic residing inside of
it - at least thats what it looks like from the positions of the atoms. See fig.
6.

6
Figure 6: Flourite, picture credit: [5]

An example of this would be UO2 , with a packing factor of 0.588.

2.3 Defects
Weve learnt that the atoms or molecules in a crystal occur in ordered struc-
tures. However, in nature, most of these arent perfect - defects may occur.
There are a few different kinds of these, point defects, line defects, planar
defects, and so on. We will be focusing almost solely on the first mentioned.

Point defects are, as one might figure, an abnormality at or around a single


point of the lattice. Typically, these only involve a limited amount of atoms,
and are sometimes spoken of as centers. There are times when a lattice
point, which in a perfect crystal would be occupied by an atom, is empty.
This is called a vacancy defect. Sometimes, a neighbouring atom will fill this
space, and the vacancy will move.

If an atom resides somewhere in the crystal where there usually arent any,
its an intersitial defect. These two types of defects may happen simultane-
ously - if an atom moves from its original position to an interstitial site (a
site where an atom may fit), a vacancy is made. These are often referred to
as a Frenkel pair or Frenkel defect.

For a crystal to be perfect, it would have to be grown in a controlled en-


vironment. This, basically, doesnt happen very often besides perhaps in
a laboratory, or some other (very) solitary place. Impurities are bound to
occur. When a different (from what in the crystal is ordinary) kind of atom
has been placed at a regular atomic site, it is called a substitutional defect.
These atoms can be smaller or larger than the ones they substitute, and
might affect the equilibrium positions of those around it.

Another interesting defect apart from the ones discussed above are grain
boundaries - a type of planar defect. These usually form when two indepen-

7
dently growing crystals meet and are quite noticeable because of the sudden
change in direction of the lattice.

2.4 Calculating the packing factor


So, how does one actually calculate the packing factor? Weve already men-
tioned that its the ratio between by atoms taken up space in an unit cell
and its total volume:
Vatoms
packing f actor =
Vunitcell
The atoms are approximated to be hard spheres, and we need to keep in mind
that all of the pictured examples given so far have been made in such a way
so that individual atoms can be easily be recognized. However, in reality,
they are basically touching each other. Lets use a face-centered cubic unit
cell and calculate the packing factor.

Figure 7: FCC, picture credit: [6]

To find out the volume taken up by the atoms, we must first figure out how
many atoms fit in this cell. By analysing this picture, this isnt very hard
at all. If youd puzzle all the pieces together, there would be four whole
spheres. Four atoms (of the same size) take up the volume
4 16
Vatoms = 4 r3 = r3
3 3
where r denotes their individual radius. Now weve got to calculate the
volume of the cell, and to do this, we want to find length of one of its sides.
The diagonal distance across a face will be four atomic radii in length, which
means that

a2 + b2 = c2 , b = a, c = 4r 2a2 = 16r2 a = 8r

Vunitcell = a3 = ( 8r)3 = 8 8r3 = 16 2r3

8
Thereby, we get
16
3 r3
packing f actor = = ' 0.74
16 2r3 3 2
Basically, this is how its done. However, if there more than one type of atom
in the structure, it can be a bit harder. Also, weve mentioned before that
a face-centered cubic structure packs atoms in the most efficient way, which
means with the highest packing factor. Even though its not that simple,
looking at the picture used here, this fact becomes a bit more intuitive.

9
3 Programming
After we had gone through all the necessary theory, we started to focus on
the task of expanding said python script. In the original version given to
us, one could get drawn representations of crystals by specifying things like
structural type, placement of atoms, colors and sizes of these, links between
them and so on, in a text document. Our job was to allow the program to
read from other type of files. Since this project was done in a limited amount
of time, we could only make this possible for a few.

To get a basic understanding of how to proceed with this matter, we be-


gun with creating a custom input file which we chose the layout of. More
information on this and the other type of files will be discussed further on.
At first, we figured the best way to make this file readable by the program
was to have a function interpreting and converting its content into the right
type of information - one that the script may use to draw the crystals. This
was easily acquired by analysing the existing code.

While working on this, we got an even better idea. By creating classes


(templates for objects) describing crystals, atoms and links (between atoms),
we were able to create objects of these with all the necessary information
stored within. An atom-object contains data about an atoms position, color
and size and the link-objects the starting and ending position (with some
tweaking, one could also include color and thickness) of a link. These are
then included in a crystal-object, that besides these, can have a certain type
and/or size.

Now, this still requires certain functions reading certain files in the correct
way. The thing is, however, that with an object, one can create methods
doing all sorts of things - which is especially easy when all information is
available from the same place. Aside from our draw-method, which returns
the necessary information to draw a crystal with the script, weve got, for
example, the repeat-method. It simply repeats the crystal in a given direc-
tion.

Another, perhaps the most important one, is the connect_atoms-method.


It is supposed to, with the sole information about atoms and their positions,
decide on how they should be connected. Since there are a lot of different
criteria on where these links should be drawn, and with the limited time of
this project, the method isnt perfect. What it does is connecting all atoms
with their closest neighbour in the a-, b- and c-planes (remember, these de-
note the fundamental translation vectors, but in the case of cubic crystals,
one might as well call these x, y and z) but also with the one(s) that arent
in the same plane that are even closer.

10
If one would look at BCC structure (with a single atom residing in the
middle), one would understand that this works quite well. However, with
more complex crystals, it might not. Keep in mind - this method isnt even
needed (but can obviously be used) for crystals described in our custom file;
one could just specify where all the links are supposed to go. It becomes
much more obvious when we look at the other two files we chose imple-
ment support for - .xyz and POSCAR. These are common types used when
describing crystals, and of course, can be read by other software.

3.1 Type of files


To make reading other types of files possible, we had to do some research on
what kind of information they stored, but also in what way. Obviously, with
our custom file mentioned, we chose for ourselves, and this is where well
begin.

3.1.1 Custom file


To explain the layout of this file, an example is presented below.

The first line tells us which kind of crystal it is - in this case its a BBC,
but it might as well be FCC, CUBIC, and so on. The second line specifies
the size. Each number represents the length of the sides of the crystal, and,
weirdly enough, in cartesian coordinates, these are in the case of cubic types
actually in the order of x, z, y (= a, b, c) - this is decided by the original
script.

The third line can be used to decide on how many times one would like
to repeat the crystal (the integers) and the letters denote which direction
this is done. This means that in this case, it would repeat the unit cell once
in the a-direction. On the fourth line, information about the number, size
and color of the atoms are given. This is done in plain text, and different
types are separated by a comma.

11
The rest is a description on where the atoms are supposed to go, and how
they are connected. On each row, the first three numbers denote its coor-
dinates (a, b, c). If there is a colon followed by other coordinates (which
may be more than one, separated by commas) one the same line, this tells
us which atom(s) this one is supposed to connect to. Its important to note
that the atoms will be done in order - if its specified like it is in our example,
the first eight coordinates will be given to first eight blue atoms, and so on.
If we let the program draw this example, itll look like this:

3.1.2 POSCAR file


As mentioned before, this type of file is commonly used to describe crystals
- which is why wed like to be able to read and draw it with our script. An
example of its layout is as follows.

The first line is treated as a comment line - it is not used for anything (in our
case). The second line denotes something called the universal scaling factor.
It is, however, not used. The following three lines defines the unit cell by
describing the three lattice vectors a, b and c. When reading a POSCAR
file with our script, these should be set like in the example above.

The sixth line specifies how the number of atoms, where a separation in-
dicates a different kind. These will then be assigned in order, just like for

12
our custom file. The seventh line should always say direct, and this is not
used when drawing the crystal. All that follows after this are coordinates
of the atoms. As one might notice, there is no information about how links
should be drawn - this is where our connect_atoms-method comes in handy.
This particular example would result in the following crystal.

This would be a face-centered cubic type of crystal, with two vacancy defects.
Whether or not the green atoms are supposed to be linked, currently, the
method will draw it anyway - it could need some improvement.

3.1.3 .xyz file


This file is also common when describing crystals, but is often used for
different kinds of molecules as well. There exists several variations of this
format, but a typical one may look like this:

The number on the first line tells us how many atoms that are present - this
and the second line, for comments, arent used in our xyz-reading function.
The following lines contain information about the element and position of
each atom. Weve made it so that if there are more than one element present,
they will be differently coloured. Drawn, its a simple cubic crystal with a
substitutional defect.

13
The coordinates are sometimes given in ngstroms, and they may be negative
as well. This is countered by the function reading the file by finding the
biggest negative coordinate on each of the three axis, and moving it such
that these become zero (and thereby, everything else positive).

14
4 Discussion
There are, of course, a few things in the code that could really need an im-
provement. Especially the drawing criteria included in the connect_atoms-
method - it works fine for some types of crystals, but absolutely not for all.
However, in such a limited time, a flawless, complete program werent ex-
pected of us either.

The strength of our code, wed argue, lies within the different classes. This
makes everything so much easier - write a custom function reading and ex-
tracting data from a certain file, store this in objects, and operate on them
using methods. Like for example, our repeat-method. First of all, it needs
all information regarding atoms and links to properly duplicate itself in the
direction chosen by the user. It also needs to store all those newly appointed
coordinates of atoms and links to be able to draw it later on.

We were supposed to, if time allowed (which it didnt) to have the pro-
gram be able to read complex defects from a separate file, and then repeat it
if so wished. Now, this is actually possible with what weve done, using our
custom file format. Since it allows for anything (well, atoms and links) to be
specified, one could include any kind of defect, within the limitations of what
the original script is able to draw, in a crystal or by itself, and then repeat it.

Wed say, though, that were pretty pleased with what weve accomplished
and what weve learnt working on this project. We hope this experience will
aid us in further studies - again encountering the field of crystallography is
most probable.

15
5 Sources
[1] Kittel, Charles. (1968) Introduction to Solid State Physics.
[2] http://periodictable.com/Properties/A/CrystalStructure.html
[3] http://mathworld.wolfram.com/HexagonalClosePacking.html
[4] http://bilbo.chm.uri.edu/CHM401/Image1350.gif
[5] http://cnx.org/resources/af7b2706ae0ae9289b91e5e4d255909e/graphics6.jpg
[6] http://people.clarkson.edu/isuni/Chap-3.pdf

16

Вам также может понравиться