Building structures
The atomli.build module follows ASE’s structure-building vocabulary. Names,
default cells, and geometries match ase.build, so a script keeps its atom
count and its energy when the import changes.
Molecules
Section titled “Molecules”from atomli.build import molecule
water = molecule("H2O")benzene = molecule("C6H6")ethanol = molecule("CH3CH2OH")Geometries come from the G2/97 set, the same data ASE ships, so
molecule("H2O") is the same structure in both packages. Every G2 name works,
along with ASE’s extras (Be2, C7NH5, BDA, biphenyl, C60) and a few
plain-English aliases such as water, ethanol, and benzene. Call
molecule_names() for the full list; an unknown name raises with that list in
the message.
vacuum= centers the molecule in a padded cell, as in ASE:
water = molecule("H2O", vacuum=5.0)Bulk crystals
Section titled “Bulk crystals”from atomli.build import bulk
silicon = bulk("Si", "diamond", a=5.43) # 2 atoms, primitivecopper = bulk("Cu", "fcc", a=3.6) # 1 atom, primitivecopper_cubic = bulk("Cu", "fcc", a=3.6, cubic=True) # 4 atomsbulk returns the primitive cell by default, exactly as ASE does. Pass
cubic=True for the conventional cubic cell or orthorhombic=True for the
orthorhombic one. A prototype that has no such cell (a cubic hcp, for
instance) raises rather than quietly returning a different shape.
Prototypes: sc, fcc, bcc, hcp, diamond, rocksalt, zincblende,
cesiumchloride, fluorite, wurtzite, plus rutile and perovskite, which
ASE does not carry. hcp and wurtzite take covera= or c=, and wurtzite
takes u=. With no crystalstructure and no a, the element’s reference
phase and lattice constant are used, again matching ASE.
The structures ASE builds from a basis or from extra lattice constants
(tetragonal, bct, rhombohedral, orthorhombic, mcl) raise
NotImplementedError.
Surfaces and adsorbates
Section titled “Surfaces and adsorbates”from atomli.build import add_adsorbate, fcc111, molecule
slab = fcc111("Pt", size=(2, 2, 3), vacuum=8.0)co = molecule("CO")add_adsorbate(slab, co, height=1.8, position="ontop")Inspect the resulting cell, periodicity, composition, and minimum image distances before starting a calculation.