httk.atomistic.cellutils module

httk.atomistic.cellutils.angles_to_cosangles(angles)[source]
httk.atomistic.cellutils.basis_determinant(basis)[source]
httk.atomistic.cellutils.basis_to_niggli_and_orientation(basis)[source]
httk.atomistic.cellutils.cell_to_basis(cell)[source]
httk.atomistic.cellutils.get_primitive_to_conventional_basis_transform(basis, eps=0.0001)[source]

Figures out how the ‘likley’ transform of a primitive cell for getting to the conventional basis

This may not be foolproof, and mostly works for re-inverting cells generated by lengths_and_cosangles_to_conventional_basis. (It should only be used when getting something that isn’t really the conventional cell does not equal catastrophic failure, just, e.g., a non-optimal representation.)

httk.atomistic.cellutils.lattice_system_from_lengths_and_cosangles(lengths, cosangles, eps=0)[source]

Identifies lattice system from a list of cell axis lengths and cosine of angles between them Returns string: ‘cubic’, ‘tetragonal’, ‘orthorombic’, ‘hexagonal’, ‘monoclinic’, ‘rhombohedral’ or ‘triclinic’

Note: if axis order is not the standard one (e.g., gamma=120 for hexagonal), the lattice system will come out as triclinic. This way the outcome matches corresponding standard hall symbols, otherwise hall symbol and generated cells not technically match.

If you seek to re-order axes to the standard order, use standard_order_axes_transform on your basis matrix first.

httk.atomistic.cellutils.lattice_system_from_niggli(niggli_matrix, eps=0)[source]

Identifies lattice system from niggli matrix. Returns string: ‘cubic’, ‘tetragonal’, ‘orthorombic’, ‘hexagonal’, ‘monoclinic’, ‘rhombohedral’ or ‘triclinic’

Note: if axis order is not the standard one (e.g., gamma=120 for hexagonal), the lattice system will come out as triclinic. This way the outcome matches corresponding standard hall symbols, otherwise hall symbol and generated cells not technically match.

If you seek to re-order axes to the standard order, use standard_order_axes_transform on your basis matrix first.

httk.atomistic.cellutils.lengths_and_angles_to_niggli(lengths, angles)[source]
httk.atomistic.cellutils.lengths_and_cosangles_to_conventional_basis(lengths, cosangles, lattice_system=None, orientation=1, eps=0)[source]

Returns the conventional cell basis given a list of lengths and cosine of angles

Note: if your basis vector order does not follow the conventions for hexagonal and monoclinic cells, you get the triclinic conventional cell.

Conventions: in hexagonal cell gamma=120 degrees, i.e, cosangles[2]=-1/2, in monoclinic cells beta =/= 90 degrees.

httk.atomistic.cellutils.lengths_and_cosangles_to_niggli(lengths, cosangles)[source]
httk.atomistic.cellutils.main()[source]
httk.atomistic.cellutils.metric_to_niggli(cell)[source]
httk.atomistic.cellutils.niggli_scale_to_vol(niggli_matrix, scale)[source]
httk.atomistic.cellutils.niggli_to_basis(niggli_matrix, orientation=1)[source]
httk.atomistic.cellutils.niggli_to_conventional_basis(niggli_matrix, lattice_system=None, orientation=1, eps=0.0001)[source]

Returns the conventional cell given a niggli_matrix

Note: if your basis vector order does not follow the conventions for hexagonal and monoclinic cells, you get the triclinic conventional cell.

Conventions: in hexagonal cell gamma=120 degrees., in monoclinic cells beta =/= 90 degrees.

httk.atomistic.cellutils.niggli_to_lengths_and_angles(niggli_matrix)[source]
httk.atomistic.cellutils.niggli_to_lengths_and_trigangles(niggli_matrix)[source]
httk.atomistic.cellutils.niggli_to_metric(niggli)[source]
httk.atomistic.cellutils.scale_to_vol(basis, scale)[source]
httk.atomistic.cellutils.scaling_to_volume(basis, scaling)[source]
httk.atomistic.cellutils.standard_order_axes_transform(niggli_matrix, lattice_system, eps=0, return_identity_if_no_transform_needed=False)[source]

Returns the transform that re-orders the axes to standard order for each possible lattice system.

Note: returns None if no transform is needed, to make it easy to skip the transform in that case. If you want the identity matrix instead, set parameter return_identity_if_no_transform_needed = True,

httk.atomistic.cellutils.vol_to_scale(basis, vol)[source]