principia_materia.translation_group.crystal module

class principia_materia.translation_group.crystal.Crystal(vec, atoms, orbitals=None, lattice_coordinate=True, pg=None, tol=1e-06)

Bases: Lattice, Cluster

A crystal structure.

Parameters:
  • vec (array of float, shape(dim, dim)) – The lattice vectors.

  • atoms (dict of str as keys and array of float as values) – A dictionary of names of atoms and their positions. The positions are in lattice coordinate if lattice_coordinate == True, otherwise they are in cartesian coordinate.

  • orbitals (str or array of str) – Orbital names to assign to the atoms.

  • lattice_coordinate (bool, optional, default to True) – If True, the coordinate in input variable atoms is in Cartesian coordinates.

  • pg (str or a PointGroup object) – The point group of the lattice.

  • tol (float, optional, default to 1.0E-6) – Tolerance.

copy()

Return a copy of the object.

Returns:

new – A copy of the object itself.

Return type:

Crystal

get_subcell(supa)

Get the subcell that can transform to the current cell with the supercell matrix.

Sometimes, the crystal at hand is not the primitive cell, this method will help obtain the primitive cell once the supercell matrix is found.

Parameters:

supa (array of int) – The supercell matrix.

Returns:

subcell – The subcell.

Return type:

Crystal

property positions_cartesian

The Cartesian coordinates of the atoms.

The posision attribute now returns the direct coodinates of the atoms.

rotate_atoms(rotation)

Return the rotated positions of atoms.

Parameters:

rotation (arrat of floats, shape(dim, dim)) – The rotation matrix in column convention

to_dict()

Return a dictionary containing key information about the crystal.

principia_materia.translation_group.crystal.get_crystal_io_wrapper(title='Crystal')

YAML data wrapper for Crystal class.

It’s a sum of Lattice wrapper and Cluster wrapper.