File: Cu2_Pt110.py

package info (click to toggle)
python-ase 3.26.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 15,484 kB
  • sloc: python: 148,112; xml: 2,728; makefile: 110; javascript: 47
file content (34 lines) | stat: -rw-r--r-- 951 bytes parent folder | download
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
from ase import Atom, Atoms
from ase.build import fcc110
from ase.calculators.emt import EMT
from ase.constraints import FixAtoms, Hookean
from ase.optimize.minimahopping import MinimaHopping

# Make the Pt 110 slab.
atoms = fcc110('Pt', (2, 2, 2), vacuum=7.0)

# Add the Cu2 adsorbate.
adsorbate = Atoms(
    [
        Atom('Cu', atoms[7].position + (0.0, 0.0, 2.5)),
        Atom('Cu', atoms[7].position + (0.0, 0.0, 5.0)),
    ]
)
atoms.extend(adsorbate)

# Constrain the surface to be fixed and a Hookean constraint between
# the adsorbate atoms.
constraints = [
    FixAtoms(indices=[atom.index for atom in atoms if atom.symbol == 'Pt']),
    Hookean(a1=8, a2=9, rt=2.6, k=15.0),
    Hookean(a1=8, a2=(0.0, 0.0, 1.0, -15.0), k=15.0),
]
atoms.set_constraint(constraints)

# Set the calculator.
calc = EMT()
atoms.calc = calc

# Instantiate and run the minima hopping algorithm.
hop = MinimaHopping(atoms, Ediff0=2.5, T0=4000.0)
hop(totalsteps=10)