I would like to acknowledge Bianca Eifert and Christian Heiliger, the authors of the package Crystallica.

This notebook is comprised of my work and I fully understand its content - González Alanís, Marcelo Alejandro
marcelo.gonzalezalanis@epfl.ch

A Basic and Fun introduction to Crystalline Structures

Introduction

Comments

The main idea of this Mathematica document was to teach the Basics about Crystalline Structures, which in my opinion is one of the most complicated things to see while talking about materials. Specially ceramics and some metals as well. The most interesting parts of Crystalline Structures are when you have a whole combination of atoms and they are in the interstitial sites or they are doped. However, I do not think that would be interesting enough if you do not have the basics, so this whole document tries to cover up the basics for most pure elements, which are commonly metals.

Visualization

This initial visualization is just to see how a crystalline structure works, the easiest one is the simple cubic structure. What we need to do first is call for the Crystallica package that would have to be installed in your personal directory. (This is the download link: http://library.wolfram.com/infocenter/MathSource/9372/) If you do not have the whole folder of the package installed in your own Mathematica, I do not think it is possible to observe the visualizations. In this case, the visualization can be have bonding, no bonding. It can also have different backgrounds and the number of unit cells repeated can also be different. All of these features make the visualization more user friendly, although in the video it was not possible to show all of them because of the time.

Needs["Crystallica`"];

Variables

latticevectors=1;

Manipulate[
CrystalPlot[{{latticevectors+separation,0,0},{0,latticevectors+separation,0},{0,0,latticevectors+separation}},{{0,0,0}},{1},AddQ-> True,Sysdim-> numberofrepetitions,Background-> color,AtomCol-> {"Firebrick"},CellLineStyle-> 2,BondStyle-> bond],
{{color,White,Style["Background",FontSize->14]},{White-> "White",Black->"Black",Blue->"Blue",Green->"Green"}},
{{bond,False,Style["Bonding",FontSize->14]},{False->"No",True->"Yes"}},
Delimiter,
{numberofrepetitions,6,1,1},{separation,0,1}]

Simple Cubic Lattice

Structure

For the structure of the Simple Cubic Lattice, there is no difference as for the example presented before. The only thing is that I eliminated two background options and I changed the color to gray because it is much more neutral and it looks better on a black background.

Manipulate[
CrystalPlot[{{latticevectors+separation,0,0},{0,latticevectors+separation,0},{0,0,latticevectors+separation}},{{0,0,0}},{1},AddQ-> True,Sysdim-> numberofrepetitions,Background-> color,AtomCol-> {"Gray"},CellLineStyle-> 2,BondStyle-> bond],
{{color,White,Style["Background",FontSize->14]},{White-> "White",Black->"Black"}},
{{bond,False,Style["Bonding",FontSize->14]},{False->"No",True->"Yes"}},Delimiter,
{numberofrepetitions,1,6,1},{separation,0,1}]

Coordination Number

For the coordination number, the function was a lot more difficult to create because the basic criteria that I found the easiest to repeat the unit cells was an option called “AddQ” which enabled to copy everything you did in 1 corner to all of the other corners. However, what you want to do to point out the coordination number is not that because you actually need different unit cells and not repeating, so you can point out which ones would be the nearest neighbors. This is the reason why the manipulate is a lot bigger, because each atom in the visualization had to be created separately and given a specific name and color.

Variables

latticevectors=1;
separation=2;

Manipulate[
CrystalPlot[{{latticevectors+separation,0,0},{0,latticevectors+separation,0},{0,0,latticevectors+separation}},{{latticevectors,0,0},{0,latticevectors,0},{0,0,latticevectors},{latticevectors,latticevectors,0},{latticevectors,latticevectors,latticevectors},{0,0,0},{0,latticevectors,latticevectors},{latticevectors,0,latticevectors},{0,latticevectors/2,0},{0,latticevectors/2,1},{0,0,latticevectors/2},{0,1,latticevectors/2},{1,latticevectors/2,0},{1,latticevectors/2,1},{1,0,latticevectors/2},{1,1,latticevectors/2},{latticevectors/2,latticevectors/2,0},{latticevectors/2,latticevectors/2,1},{latticevectors/2,0,latticevectors/2},{latticevectors/2,1,latticevectors/2},{0,latticevectors/2,latticevectors/2},{1,latticevectors/2,latticevectors/2},{latticevectors/2,latticevectors/2,latticevectors/2},{latticevectors/2,0,0},{latticevectors/2,1,1},{latticevectors/2,0,1},{latticevectors/2,1,0}},{1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,4,1,1,1,1},BondStyle-> bond],
{{bond,True,Style["Bonding",FontSize->14]},{False->"No",True->"Yes"}}
]

Clearer image of First Nearest Neighbors

Likewise, I thought it might look cleaner to look at the nearest neighboring atoms in a separate way, although it might create some confusion. This is why I left it out of the video but still showed it in the notebook.

CrystalPlot[{{latticevectors+2,0,0},{0,latticevectors+2,0},{0,0,latticevectors+2}},{{latticevectors/2,latticevectors/2,0},{latticevectors/2,latticevectors/2,1},{latticevectors/2,0,latticevectors/2},{latticevectors/2,1,latticevectors/2},{0,latticevectors/2,latticevectors/2},{1,latticevectors/2,latticevectors/2},{latticevectors/2,latticevectors/2,latticevectors/2}},{2,2,2,2,2,2,4},BondStyle-> True]

Atomic Packing Factor

For the atomic packing factor (APF), I always showed a visualization of the basis used to calculate the radius of the spheres in the unit cell. It is important to note that the radius of each atom is calculated assuming that the atoms are whole spheres, just for simplicity in the volume calculation. What I did was to create a function that used the number of atoms in the unit cell and the radius if this atoms to calculate the packing factor, which is independent of the length of the unit cell. In a particular problem, it would be important to know the atomic radius of the atoms to actually know the interatomic distance in between them. However, for this particular video and explanation is not necessary.

CrystalPlot[{{latticevectors,0,0},{0,latticevectors,0},{0,0,latticevectors}},{{latticevectors,0,0},{0,0,0}},{1,1},BondStyle-> False,AtomRad->0.5]

functionforAPF[numberofatoms_,radius_]:=
(numberofatoms*(4/3)*Pi*(radius^3))/(lengthoflattice^3)

functionforAPF[1,0.5lengthoflattice]

Examples

Just in case, this is alpha Polonium.

α-Po

Body Centered Cubic Lattice

Structure

For the structure of the Body Centered Cubic Lattice (BCC), the only difference was that for the corners there had to be an atom right in the middle of the unit cell, and that would repeat to all of the corners, using the AddQ option mentioned before. It is still the same as the one for a Simple Cubic Lattice, I eliminated the two background options of blue and green and I changed the color to gray because it is much more neutral and it looks better on a black background.

Manipulate[
CrystalPlot[{{latticevectors+separation,0,0},{0,latticevectors+separation,0},{0,0,latticevectors+separation}},{{0,0,0},{latticevectors/2,latticevectors/2,latticevectors/2}},{1,1},AddQ-> True,Sysdim-> numberofrepetitions,Background-> color,AtomCol-> {"Gray"},CellLineStyle-> 2,BondStyle-> bond],
{{color,White,Style["Background",FontSize->14]},{White-> "White",Black->"Black",Blue->"Blue",Green->"Green"}},
{{bond,False,Style["Bonding",FontSize->14]},{False->"No",True->"Yes"}}
,Delimiter,
{numberofrepetitions,1,6,1},{separation,0,1}]

Coordination Number

For the coordination number, the function was a lot more difficult to create because as mentioned before, it is not possible to use AddQ because of the colors. As before, this is the reason why the manipulate is a lot bigger, because each atom in the visualization had to be created separately and given a specific name and color and since the packing density is getting bigger well there are more atoms in the unit cell hence a bigger code. Actually, the bonding and no bonding function for the manipulate I decided to add it at this point because it was so hard to visualize all the atoms I needed to do something about it. Then I ended up adding it to all of the structures.

Manipulate[CrystalPlot[{{latticevectors+separation,0,0},{0,latticevectors+separation,0},{0,0,latticevectors+separation}},{{latticevectors,0,0},{0,latticevectors,0},{0,0,latticevectors},{latticevectors,latticevectors,0},{latticevectors,latticevectors,latticevectors},{0,0,0},{0,latticevectors,latticevectors},{latticevectors,0,latticevectors},{0,latticevectors/2,0},{0,latticevectors/2,1},{0,0,latticevectors/2},{0,1,latticevectors/2},{1,latticevectors/2,0},{1,latticevectors/2,1},{1,0,latticevectors/2},{1,1,latticevectors/2},{latticevectors/2,latticevectors/2,0},{latticevectors/2,latticevectors/2,1},{latticevectors/2,0,latticevectors/2},{latticevectors/2,1,latticevectors/2},{0,latticevectors/2,latticevectors/2},{1,latticevectors/2,latticevectors/2},{latticevectors/2,latticevectors/2,latticevectors/2},{latticevectors/2,0,0},{latticevectors/2,1,1},{latticevectors/2,0,1},{latticevectors/2,1,0},{latticevectors/4,latticevectors/4,latticevectors/4},{3 latticevectors/4,latticevectors/4,latticevectors/4},{latticevectors/4,3 latticevectors/4,latticevectors/4},{3 latticevectors/4,3 latticevectors/4,latticevectors/4},{latticevectors/4,latticevectors/4,3 latticevectors/4},{3 latticevectors/4,latticevectors/4,3 latticevectors/4},{latticevectors/4,3 latticevectors/4,3 latticevectors/4},{3 latticevectors/4,3 latticevectors/4,3 latticevectors/4}},{1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,4,1,1,1,1,2,2,2,2,2,2,2,2},BondStyle-> bond],
{{bond,True,Style["Bonding",FontSize->14]},{False->"No",True->"Yes"}}
]

Clearer image of Nearest Neighbors

In this case, for the clearer image of the nearest neighbors, it might also be a bit confusing if you do not have the other atoms because it just looks like a simple BCC lattice. However, it might still help some people out so this is why I left it in the code.

CrystalPlot[{{latticevectors+separation,0,0},{0,latticevectors+separation,0},{0,0,latticevectors+separation}},{{latticevectors/2,latticevectors/2,latticevectors/2},{latticevectors/4,latticevectors/4,latticevectors/4},{3 latticevectors/4,latticevectors/4,latticevectors/4},{latticevectors/4,3 latticevectors/4,latticevectors/4},{3 latticevectors/4,3 latticevectors/4,latticevectors/4},{latticevectors/4,latticevectors/4,3 latticevectors/4},{3 latticevectors/4,latticevectors/4,3 latticevectors/4},{latticevectors/4,3 latticevectors/4,3 latticevectors/4},{3 latticevectors/4,3 latticevectors/4,3 latticevectors/4}},{1,2,2,2,2,2,2,2,2},BondStyle-> True]

Atomic Packing Factor

For the atomic packing factor, as said before, I always showed a visualization of the basis used to calculate the radius of the spheres in the unit cell. It is important to note that the radius of each atom is calculated assuming that the atoms are whole spheres, just for simplicity in the volume calculation. I used the same function I created before to calculate the APF.

CrystalPlot[{{latticevectors,0,0},{0,latticevectors,0},{0,0,latticevectors}},{{latticevectors,latticevectors,latticevectors},{latticevectors/2,latticevectors/2,latticevectors/2},{0,0,0}},{1,1,1},AtomRad->0.44,BondStyle-> False]

functionforAPF[2,Sqrt[3]*lengthoflattice/4]//N

Examples

Just in case, these examples are Chromium, Tungsten, alpha-Iron, Tantalum and Molybdenum.

Cr, W, α-Fe, Ta, Mo

Face Centered Cubic Lattice

Structure

For the structure of the Face Centered Cubic Lattice (FCC), the only difference was that for the corners there had to be 3 atoms right in the middle of the three planes that define the unit cell, and that would repeat to all of the corners, using the AddQ option mentioned before. In this case it is not the same as the Simple Cubic Lattice, I decided to stay with the 4 background colors since it is a little more fun to play with an FCC lattice. Actually the separation here is very important because since it is more closely packed you might not see very clear with a very small separation.

Manipulate[
CrystalPlot[{{latticevectors+separation,0,0},{0,latticevectors+separation,0},{0,0,latticevectors+separation}},{{0,0,0},{latticevectors/2,latticevectors/2,0},{0,latticevectors/2,latticevectors/2},{latticevectors/2,0,latticevectors/2}},{1,1,1,1},AddQ-> True,Sysdim-> numberofrepetitions,Background-> color,AtomCol-> {"Gray"},CellLineStyle-> 2,BondStyle-> bond],
{{color,White,Style["Background",FontSize->14]},{White-> "White",Black->"Black",Blue->"Blue",Green->"Green"}},
{{bond,False,Style["Bonding",FontSize->14]},{False->"No",True->"Yes"}}
,Delimiter,
{numberofrepetitions,1,6,1},{separation,0,1}]

Coordination Number

For the coordination number, the function was a lot more difficult to create because as mentioned before, it is not possible to use AddQ because of the colors. As before, this is the reason why the manipulate is a lot bigger, because each atom in the visualization had to be created separately and given a specific name and color and since the packing density is getting bigger, more than in a BCC, well there are more atoms in the unit cell hence a bigger code

Manipulate[CrystalPlot[{{latticevectors+separation,0,0},{0, latticevectors+separation,0},{0,0,latticevectors+separation}},{{latticevectors,0,0},{0,latticevectors,0},{0,0,latticevectors},{latticevectors,latticevectors,0},{latticevectors,latticevectors,latticevectors},{0,0,0},{0,latticevectors,latticevectors},{latticevectors,0,latticevectors},{0,latticevectors/2,0},{0,latticevectors/2,1},{0,0,latticevectors/2},{0,1,latticevectors/2},{1,latticevectors/2,0},{1,latticevectors/2,1},{1,0,latticevectors/2},{1,1,latticevectors/2},{latticevectors/2,latticevectors/2,0},{latticevectors/2,latticevectors/2,1},{latticevectors/2,0,latticevectors/2},{latticevectors/2,1,latticevectors/2},{0,latticevectors/2,latticevectors/2},{1,latticevectors/2,latticevectors/2},{latticevectors/2,latticevectors/2,latticevectors/2},{latticevectors/2,0,0},{latticevectors/2,1,1},{latticevectors/2,0,1},{latticevectors/2,1,0},{0,latticevectors/4,latticevectors/4},{0,3 latticevectors/4,latticevectors/4},{0,latticevectors/4,3 latticevectors/4},{0,3 latticevectors/4,3 latticevectors/4},{1,latticevectors/4,latticevectors/4},{1,3 latticevectors/4,latticevectors/4},{1,latticevectors/4,3 latticevectors/4},{1,3 latticevectors/4,3 latticevectors/4},{latticevectors/2,latticevectors/4,latticevectors/4},{latticevectors/2,3 latticevectors/4,latticevectors/4},{latticevectors/2,latticevectors/4,3 latticevectors/4},{latticevectors/2,3 latticevectors/4,3 latticevectors/4},{latticevectors/4,0,latticevectors/4},{3 latticevectors/4,0,latticevectors/4},{latticevectors/4,0,3 latticevectors/4},{3 latticevectors/4,0,3 latticevectors/4},{latticevectors/4,1,latticevectors/4},{3 latticevectors/4,1,latticevectors/4},{latticevectors/4,1,3 latticevectors/4},{3 latticevectors/4,1,3 latticevectors/4},{latticevectors/4,latticevectors/2,latticevectors/4},{3 latticevectors/4,latticevectors/2,latticevectors/4},{latticevectors/4,latticevectors/2,3 latticevectors/4},{3 latticevectors/4,latticevectors/2,3 latticevectors/4},{latticevectors/4,latticevectors/4,0},
{3 latticevectors/4,latticevectors/4,0},{latticevectors/4,3 latticevectors/4,0},{3 latticevectors/4,3 latticevectors/4,0},{latticevectors/4,latticevectors/4,1},{3 latticevectors/4,latticevectors/4,1},{latticevectors/4,3 latticevectors/4,1},{3 latticevectors/4,3 latticevectors/4,1},{latticevectors/4,latticevectors/4,latticevectors/2},{3 latticevectors/4,latticevectors/4,latticevectors/2},{latticevectors/4,3 latticevectors/4,latticevectors/2},{3 latticevectors/4,3 latticevectors/4,latticevectors/2}},{1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,4,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2},BondStyle-> bond],
{{bond,True,Style["Bonding",FontSize->14]},{False->"No",True->"Yes"}}
]

Clearer way for Coordination number

In this case, it is actually nearly impossible to see the coordination number using 8 unit cells together, this is why I decided to make the clearer way and to leave all the others, because here it is actually the one I use to explain this concept in the video. Here, only using 2 unit cells you are able to see very clearly the coordination number.

Manipulate[CrystalPlot[{{(latticevectors+separation)/2,0,0},{0,(latticevectors+separation)/2,0},{0,0,latticevectors+separation}},{{latticevectors,0,0},{0,latticevectors,0},{0,0,latticevectors},{latticevectors,latticevectors,0},{latticevectors,latticevectors,latticevectors},{0,0,0},{0,latticevectors,latticevectors},{latticevectors,0,latticevectors},{0,0,latticevectors/2},{0,1,latticevectors/2},{1,0,latticevectors/2},{1,1,latticevectors/2},{latticevectors/2,latticevectors/2,latticevectors/2},{latticevectors/2,latticevectors/2,0},{latticevectors/2,latticevectors/2,1},{0,latticevectors/2,latticevectors/4},{1,latticevectors/2,latticevectors/4},{latticevectors/2,0,latticevectors/4},{latticevectors/2,1,latticevectors/4},{0,latticevectors/2,3latticevectors/4},{1,latticevectors/2,3latticevectors/4},{latticevectors/2,0,3latticevectors/4},{latticevectors/2,1,3latticevectors/4}},{1,1,1,1,1,1,1,1,4,4,4,4,3,1,1,4,4,4,4,4,4,4,4},BondStyle-> bond],
{{bond,True,Style["Bonding",FontSize->14]},{False->"No",True->"Yes"}},{separation,2,3}
]

Atomic Packing Factor

For the atomic packing factor, as said before, I always showed a visualization of the basis used to calculate the radius of the spheres in the unit cell. It is important to note that the radius of each atom is calculated assuming that the atoms are whole spheres, just for simplicity in the volume calculation. I used the same function I created before to calculate the APF.

CrystalPlot[{{latticevectors,0,0},{0,latticevectors,0},{0,0,latticevectors}},{{latticevectors,0,latticevectors},{latticevectors/2,0,latticevectors/2},{0,0,0}},{1,1,1},AtomRad->0.36,BondStyle-> False]

functionforAPF[4,Sqrt[2]*lengthoflattice/4]//N

Examples

Just in case it is necessary, these examples are Aluminum, Copper, Gold, Nickel, Platinum and Silver.

Al, Cu, Au, Ni, Pt, Ag