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).
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!')
cd …
mkdir silicon
cd silicon
cp …/aluminium/Al_ase.py Si_ase.py
python3 Al_ase.py
#!/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
#!/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)
#!/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
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
This work is licensed under a Creative Commons Attribution 4.0 International License.