exercise 01 :: hop on

Aims of the exercise is to introduce linux software platform used for the exercises, get familiar with the linux command line environment, basics of bash scripting and python programming languge, and atomistic simulation environment (ASE).

TASK 01

  1. open command line terminal and create folder aluminium, change working directory to the aluminium folder, create and edit a file Al_ase.py within the aluminium folder

mkdir aluminium
cd aluminium
nano Al_ase.py

Save the file content with the “Hello world” program should look like:

#!/usr/bin/python
print('Hello, world!')
  1. create a copy of the file Al_ase.py named Si_ase.py and move it to the new folder silicon (the meaning of the following steps are: change folder to parent folder, create folder silicon, change working folder to silicon, copy file Al_ase.py to Si_ase.py)

cd …
mkdir silicon
cd silicon
cp …/aluminium/Al_ase.py Si_ase.py

TASK 02

  1. run the “Hello world” python program saved in file Al_ase.py

python3 Al_ase.py

  1. create the file Po_ase.py of the following content
#!/usr/bin/python

import ase
import ase.io as io
from ase import Atoms, Atom
from ase.lattice.cubic import SimpleCubic
from ase.visualize import view

polonium = SimpleCubic(directions=[[1,0,0], [0,1,0], [0,0,1]], symbol='Po', latticeconstant = 3.359)
view(polonium)

#write output for crystal visualization (use e.g. VESTA)
struct = polonium
ase.io.write("Po_ase.cif", struct, "cif")

Run the script

python3 Po_ase.py

which uses ASE to generate a simple cubic crystal of polonium, and writes cif structure file for further visualization, e.g., using VESTA program

VESTA Po_ase.cif

  1. create slab extending in <111> direction made of GaAs in zincblende structure
#!/usr/bin/python

import numpy as np
import ase.io as io
from ase.spacegroup import crystal
from ase.visualize import view

a = 5.6533
X = 'Ga'
Y = 'As'

# basis is defined in terms of the unit vectors
system = crystal([X, Y], basis = [(0.0, 0.0, 0.0), (0.25, 0.25,0.25)], spacegroup=216, cellpar=[a, a, a, 90, 90, 90], size = (1,1,4))

view(system)
  1. create unit cell of InSb in wurtzite crystal structure
#!/usr/bin/python

from ase import *
from math import *
from ase.build import bulk
from ase.visualize import view

a = 4.5712
c = 7.5221
ca = c/a
epsilon = -0.00097
ua=3/8.+epsilon

atoms = Atoms([Atom('Sb', (2/3., 1/3.,    0)),
               Atom('Sb', (1/3., 2/3., 1/2.)),
               Atom('In', (2/3., 1/3., ua)),
               Atom('In', (1/3., 2/3., 1/2.+ua))])
cell = [(a*sqrt(3)/2, -a/2, 0),
        (          0,    a, 0),
        (          0,    0, c)]
atoms.set_cell(cell, scale_atoms=True)

view(atoms)

Note: for more python info see reference card or python cheat sheet

TASK 03

  1. use ASE to generate structure of bulk Aluminium (space group #225, FCC structure)
  2. use ASE to generate structure of bulk Silicon (space group #227, diamond crystal structure)

Note 1: for lattice constants see also https://periodictable.com/Properties/A/LatticeConstants.html
Note 2: for more crystallographic data see Bilbao Crystallographic Server



Martin Gmitra :: martin.gmitra@upjs.sk
Creative Commons License This work is licensed under a Creative Commons Attribution 4.0 International License.