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 />

get_spin_polarized()<br />

Is it a spin-polarized calculation?<br />

get_wannier_localization_matrix(nbands, dirG, kpoint, nextkpoint, G_I, spin)<br />

Calculate integrals for maximally localized Wannier functions.<br />

get_xc_functional()<br />

Return the XC-functional identifier.<br />

‘LDA’, ‘PBE’, ...<br />

initial_wannier(initialwannier, kpointgrid, fixedstates, edf, spin, nbands)<br />

Initial guess for the shape of wannier functions.<br />

Use initial guess for wannier orbitals to determine rotation matrices U and C.<br />

7.14.5 Building new calculators<br />

Adding an <strong>ASE</strong> interface to your favorite force-calculator can be very simple. Take a look at the Python wrapper<br />

we have in the <strong>ASE</strong> code for using the SIESTA code with <strong>ASE</strong>: ase/calculators/siesta.py. Here, a Siesta class<br />

is defined. An instance of this class will simply write the fdf input-file, start the SIESTA Fortran program, and<br />

finally read the energy, forces and stresses from the text output-file.<br />

7.14.6 Building neighbor-lists<br />

The EMT potential and the GPAW DFT calculator both make use of <strong>ASE</strong>’s built-in neighbor-list class:<br />

class ase.calculators.neighborlist.NeighborList(cutoffs, skin=0.3, sorted=False,<br />

self_interaction=True, bothways=False)<br />

Neighbor list object.<br />

cutoffs: list of float List of cutoff radii - one for each atom.<br />

skin: float If no atom has moved more than the skin-distance since the last call to the update() method,<br />

then the neighbor list can be reused. This will save some expensive rebuilds of the list, but extra<br />

neighbors outside the cutoff will be returned.<br />

self_interaction: bool Should an atom return itself as a neighbor?<br />

bothways: bool Return all neighbors. Default is to return only “half” of the neighbors.<br />

Example:<br />

nl = NeighborList([2.3, 1.7])<br />

nl.update(atoms)<br />

indices, offsets = nl.get_neighbors(0)<br />

build(atoms)<br />

Build the list.<br />

get_neighbors(a)<br />

Return neighbors of atom number a.<br />

A list of indices and offsets to neighboring atoms is returned. The positions of the neighbor atoms can<br />

be calculated like this:<br />

indices, offsets = nl.get_neighbors(42)<br />

for i, offset in zip(indices, offsets):<br />

print atoms.positions[i] + dot(offset, atoms.get_cell())<br />

Notice that if get_neighbors(a) gives atom b as a neighbor, then get_neighbors(b) will not return a as<br />

a neighbor - unless bothways=True was used.<br />

138 Chapter 7. Documentation for modules in <strong>ASE</strong>

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

Saved successfully!

Ooh no, something went wrong!