Solid state tools

These tools are used within OpenDFT to represent objects from solid state physics. They can be used for scripting within OpenDFT

class src.solid_state_tools.CrystalStructure(lattice_vectors, atoms, relative_coords=True, scale=1.0)

This class represents a crystal structure

Parameters:
  • lattice_vectors – a 3x3 numpy array with the lattice vectors as rows
  • atoms – a Nx4 numpy array the atomic positions in [:,:3] as either relative (crystal) or cartesion coordinates
  • relative_coords
  • scale – A scale of the whole unit cell. This parameter is only used to nicely format the lattice vectors. The lattice_vectors argument must still contain the correct unit vectors.
calc_absolute_coordinates(repeat=(1, 1, 1), offset=(0, 0, 0), edges=False)

Returns the cartesion coordinates

Parameters:
  • repeat – 3 element tuple which determines the number of repeated unit cells
  • offset – optional offset from (0,0,0)
  • edges – Determines whether atoms on the faces or edges should be plotted only ones (->False) or multiple times (->True)
Returns:

cartesian coordinates of the atoms

Return type:

Nx4 numpy array

find_bonds(abs_coords)

Searches for bonds between all atoms. This function uses literature values for the covalent bond radii.

Parameters:abs_coords – cartesion coordinates of the atoms (Nx4) as returned by calc_absolute_coordinates
Returns:Tuple of all bonds between the atoms by their index.
Return type:A tuple of two-tuples, e.g. ((3,5),(1,2))
class src.solid_state_tools.MolecularStructure(atoms, scale=1.0)

Represents a molecular structure :param atoms – a (Nx4) numpy array with [x,y,z,type] as rows. Type is an integer with the atomic number (H=1,He=2 etc.).

calc_absolute_coordinates(repeat=[1, 1, 1], edges=False)

Returns the cartesion coordinates

find_bonds(abs_coords)

Returns a list of bonds between atom i and j, i.e. ((i,j),…). The bonds are calculated according to covalent radii from the literature.

return bonds:a tuple of of two element tuples which represent the connections or bonds
symmetry_information()

Returns symmetry information of the molecule as for example its point group

Return info:a dictionary with symmetry informations