Functional programming

sisl provides simple functionality that may be used by various sisl objects.

Tip

All of these functional methods can automatically handle external classes. But only if sisl has an internal conversion of that object.

E.g. one can do:

from ase.build import bulk
import sisl as si

bulk_rotated = si.rotate(bulk("Au"), 30, [1, 1, 1])

Note that sisl will automatically convert the ase.Atoms object to a sisl.Geometry, and then do the rotation call.

There are a couple of scenarios:

  1. The sisl function returns the same object as the input. In the above case, a Geometry. When this is the case the method will try and convert it back to the input class. And if this succeeds, it will be returned. To forcefully return the sisl type, do si.rotate(..., ret_sisl=True).

  2. The sisl function returns something different from the input. In this case, the value is returned as-is, regardless of ret_sisl.

The functional methods will not allow Python built-in’s to convert. Since that can lead to ambiguous behaviour.

add())

Dispatcher for add

append()

Dispatcher for append

apply()

Dispatcher for apply

berry_curvature()

Dispatcher for berry_curvature

center())

Dispatcher for center

copy()

Dispatcher for copy

insert()

Dispatcher for insert

prepend()

Dispatcher for prepend

remove()

Dispatcher for remove

repeat()

Dispatcher for repeat

rotate(, atoms=None, rad=False, what=None))

Dispatcher for rotate

scale()

Dispatcher for scale

sort()

Dispatcher for sort

spin_berry_curvature()

Dispatcher for spin_berry_curvature

sub()

Dispatcher for sub

swap()

Dispatcher for swap

swapaxes()

Dispatcher for swapaxes

tile()

Dispatcher for tile

translate()

Dispatcher for translate

velocity()

Dispatcher for velocity

unrepeat()

Dispatcher for unrepeat

untile()

Dispatcher for untile

write()

Dispatcher for write