Structure

class aimstools.structuretools.structure.Structure(geometry=None, **kwargs)[source]

Bases: ase.atoms.Atoms

Extends the ase.atoms.Atoms class with some specific functions.

Parameters:

geometry (str) – Path to structure file (.cif, .xyz ..) or atoms object.

Variables:
  • atoms (Atoms) – ASE atoms object.
  • sg (spacegroup) – Spglib spacegroup object.
  • lattice (str) – Description of Bravais lattice.
atoms

Returns ase.atoms.Atoms object.

copy()[source]

Return a copy.

find_fragments() → list[source]

See find_fragments()

find_periodic_axes() → dict[source]

See find_periodic_axes()

hexagonal_to_rectangular()[source]

See hexagonal_to_rectangular()

is_1d() → bool[source]

Evaluates if structure is qualitatively one-dimensional.

Note

A structure is considered 1D if two axes are non-periodic.

Returns:bool – 1-dimensional or not.
is_2d() → bool[source]

Evaluates if structure is qualitatively two-dimensional.

Note

A structure is considered 2D if only one axis is non-periodic.

Returns:bool – 2D or not to 2D, that is the question.
is_3d() → bool[source]

Evaluates if structure is qualitatively three-dimensional.

Note

A structure is considered 3D if all axes are periodic.

Returns:bool – 3-dimensional or not.
periodic_axes

Corresponds to ASE periodic boundary conditions pbc. Kept separate for transferability reasons within FHI-aims.

recenter() → None[source]

Recenters atoms to be in the unit cell, with vacuum on both sides.

The unit cell length c is always chosen such that it is larger than a and b.

Returns:atoms – modified atoms object.

Note

The ase.atoms.center() method is supposed to do that, but sometimes separates the layers. I didn’t find a good way to circumvene that.

standardize(to_primitive=True, symprec=0.0001, angle_tolerance=5) → None[source]

Wrapper of the spglib standardize() function with extra features.

For 2D systems, the non-periodic axis is enforced as the z-axis.

Parameters:
  • to_primitive (bool) – If True, primitive cell is obtained. If False, conventional cell is obtained.
  • symprec (float) – Precision to determine new cell.

Note

The combination of to_primitive=True and a larger value of symprec (1e-2) can be used to refine a structure.

view(viewer=None)[source]

Wrapper of ase.visualize.view() function.