Crystal Tools#

crystal_tools.get_cell(crystal, vol_per_atom, c_over_a=1.632993161855452, coord_type='fractional')#

Crystal utility function

This is a convenience function that returns the lattice vectors and ionic coordinates of simple crystal structures given the volume per atom in the cell and possibly the \(c/a\) ratio.

The crystal structures supported and their crystal arguments are as follows.

  • simple cubic -sc

  • body-centred cubic - bcc (primitive cell) or bcc-c (conventional cell)

  • face-centred cubic - fcc (primitive cell) or fcc-c (conventional cell)

  • diamond cubic - dc (primitive cell) or dc-c (conventional cell)

  • hexagonal close-packed - hcp

Parameters:
  • crystal (string) – Crystal structure

  • vol_per_atom (float) – Volume per atom of the cell

  • c_over_a (float) – \(c/a\) ratio

  • coord_type (string) – Whether the ionic coordinates returned are fractional (default) or cartesian coordinates

Returns:

Lattice vectors, Ionic coordinates

Return type:

torch.Tensor, torch.Tensor