File: systems.py

package info (click to toggle)
python-ase 3.21.1-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 13,936 kB
  • sloc: python: 122,428; xml: 946; makefile: 111; javascript: 47
file content (111 lines) | stat: -rw-r--r-- 3,844 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
from math import sin, cos, pi

from ase import Atoms
from ase.build import fcc111, fcc100, add_adsorbate
from ase.db import connect
from ase.constraints import FixAtoms
from ase.lattice.cubic import FaceCenteredCubic
from ase.cluster import wulff_construction

systems = []

cell = (5, 5, 5)
atoms = Atoms('H2', [(0, 0, 0), (0, 0, 1.4)], cell=cell)
atoms.center()
systems.append((atoms, 'Hydrogen molecule'))

#
atoms = FaceCenteredCubic(
    directions=[[1, -1, 0], [1, 1, 0], [0, 0, 1]],
    size=(2, 2, 2),
    symbol='Cu',
    pbc=(1, 1, 1))
atoms.rattle(stdev=0.1, seed=42)
systems.append((atoms, 'Shaken bulk copper'))

#
a = 2.70
c = 1.59 * a

slab = Atoms('2Cu', [(0., 0., 0.), (1 / 3., 1 / 3., -0.5 * c)],
             tags=(0, 1),
             pbc=(1, 1, 0))
slab.set_cell([(a, 0, 0),
               (a / 2, 3**0.5 * a / 2, 0),
               (0, 0, 1)])
slab.center(vacuum=3, axis=2)
mask = [a.tag == 1 for a in slab]
slab.set_constraint(FixAtoms(mask=mask))
systems.append((slab, 'Distorted Cu(111) surface'))

#
zpos = cos(134.3 / 2.0 * pi / 180.0) * 1.197
xpos = sin(134.3 / 2.0 * pi / 180.0) * 1.19
co = Atoms('CO', positions=[(-xpos + 1.2, 0, -zpos),
                            (-xpos + 1.2, -1.1, -zpos)])
slab = fcc111('Au', size=(2, 2, 2), orthogonal=True)
add_adsorbate(slab, co, 1.5, 'bridge')
slab.center(vacuum=6, axis=2)
slab.set_pbc((True, True, False))
constraint = FixAtoms(mask=[a.tag == 2 for a in slab])
slab.set_constraint(constraint)
systems.append((slab, 'CO on Au(111) surface'))

#
atoms = Atoms(symbols='C5H12',
              cell=[16.83752497, 12.18645905, 11.83462179],
              positions=[[5.90380523, 5.65545388, 5.91569796],
                         [7.15617518, 6.52907738, 5.91569796],
                         [8.41815022, 5.66384716, 5.92196554],
                         [9.68108996, 6.52891016, 5.91022362],
                         [10.93006206, 5.65545388, 5.91569796],
                         [5.00000011, 6.30002353, 5.9163716],
                         [5.88571848, 5.0122839, 6.82246859],
                         [5.88625613, 5.01308931, 5.01214155],
                         [7.14329342, 7.18115393, 6.81640316],
                         [7.14551332, 7.17200869, 5.00879027],
                         [8.41609966, 5.00661165, 5.02355167],
                         [8.41971183, 5.0251482, 6.83462168],
                         [9.69568096, 7.18645894, 6.8078633],
                         [9.68914668, 7.16663649, 5.00000011],
                         [10.95518898, 5.02163182, 6.8289018],
                         [11.83752486, 6.29836826, 5.90274952],
                         [10.94464142, 5.00000011, 5.01802495]])
systems.append((atoms, 'Pentane molecule'))

#
slab = fcc100('Cu', size=(2, 2, 2), vacuum=3.5)
add_adsorbate(slab, 'C', 1.5, 'hollow')
mask = [a.tag > 1 for a in slab]
constraint = FixAtoms(mask=mask)
slab.set_constraint(constraint)
systems.append((slab, 'C/Cu(100)'))

#
surfaces = [(1, 0, 0), (1, 1, 0), (1, 1, 1)]
esurf = [0.9151, 0.9771, 0.7953]  # Surface energies
size = 10  # number of atoms
atoms = wulff_construction('Al', surfaces, esurf, size, 'fcc',
                           rounding='above')
atoms.center(vacuum=6)
atoms.rattle(0.2)
systems.append((atoms, 'Alumninum cluster'))


def create_database():
    db = connect('systems.db', append=False)
    for atoms, description in systems:
        name = atoms.get_chemical_formula()
        db.write(atoms, description=description, name=name)

    if False:
        for atoms, description in systems:
            for seed in range(5):
                a = atoms.copy()
                a.rattle(0.1, seed=seed)
                name = a.get_chemical_formula() + '-' + str(seed)
                db.write(a, description=description, seed=seed, name=name)


if __name__ == '__main__':
    create_database()