18.11.2012 Views

ASE Manual Release 3.6.1.2825 CAMd - CampOS Wiki

ASE Manual Release 3.6.1.2825 CAMd - CampOS Wiki

ASE Manual Release 3.6.1.2825 CAMd - CampOS Wiki

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>ASE</strong> <strong>Manual</strong>, <strong>Release</strong> 3.6.1.2828<br />

We now add an adatom. Since the supercell is now declared as the unit cell for our atoms we can either add the<br />

atom using its cartesian coordinates in Angstrom or rescale the unit cell and use scaled coordinates. We try the<br />

latter:<br />

>>> from numpy import identity<br />

>>> from ase import Atom<br />

>>> xyzcell = identity(3) # The 3x3 unit matrix<br />

>>> atoms.set_cell(xyzcell, scale_atoms=True) # Set the unit cell and rescale<br />

>>> atoms.append(Atom(’Ni’, (1/6., 1/6., .1)))<br />

>>> atoms.set_cell(cell, scale_atoms=True) # Set the unit cell and scale back<br />

The structure now looks like this:<br />

>>> view(atoms)<br />

6.2.3 Using the spacegroup subpackage<br />

The most evident usage of the spacegroup subpackage is to set up an initial unit of a bulk structure. For this you<br />

only need to supply the unique atoms and their scaled positions, space group and lattice parameters.<br />

Examples of setting up bulk structures<br />

We start by showing some examples of how to set up some common or interesting bulk structures using<br />

ase.lattice.spacegroup.crystal(). This function takes a lot of arguments, of which the most important are:<br />

symbols [string | sequence of strings] Either a string formula or sequence of element symbols. E.g.<br />

‘NaCl’ and (‘Na’, ‘Cl’) are equivalent.<br />

basis [list of scaled coordinates] Coordinates of the non-equivalent sites in units of the lattice vectors.<br />

spacegroup [int | string | Spacegroup instance] Space group given either as its number in International<br />

Tables or as its Hermann-Mauguin (or international) symbol.<br />

setting [1 | 2] Space group setting.<br />

6.2. <strong>ASE</strong> 23

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!