symmetrizeConfiguration

symmetrizeConfiguration(configuration, tolerance, primitive=True, maximize_symmetry=False, use_detect=False, angle_tolerance=None)

Generates a new bulk configuration whose atomic positions and lattice vectors exactly obey the detected space group symmetries.

Parameters:
  • configuration (BulkConfiguration) – The configuation to symmetrize.

  • tolerance (PhysicalQuantity of type length) – The symmetry tolerance.

  • primitive (bool) – Whether to return a primitive or a standard configuration.
    Default: True (primitive).

  • maximize_symmetry (bool) – Explicitly use the highest symmetry Bravais lattice for the symmetrized configuration, which may not match the original Bravais lattice of the input configuration.
    Default: False.

  • use_detect (bool) – If spglib should be used to detect the symmetry. This parameter is mutually exclusive with maximize_symmetry.
    Default: False.

  • angle_tolerance (int) – The tolerance of the lattice angles.

Returns:

The symmetrized configuration. The number of atoms might change from the original. If primitive=True this configuration will be the primitive cell.

Return type:

BulkConfiguration

Usage Examples

Symmetrize a silicon structure that is close to FCC symmetry.

# Set up lattice
vector_a = [0.02, 2.69, 2.7153]*Angstrom
vector_b = [2.7153, 0.0, 2.7153]*Angstrom
vector_c = [2.7153, 2.7153, 0.01]*Angstrom
lattice = UnitCell(vector_a, vector_b, vector_c)

# Define elements
elements = [Silicon, Silicon]

# Define coordinates
fractional_coordinates = [[ 0.007025069439,  0.006459590918, -0.015020491416],
                          [ 0.248715281446,  0.28949668641 ,  0.238503614316]]

# Set up configuration
bulk_configuration = BulkConfiguration(
    bravais_lattice=lattice,
    elements=elements,
    fractional_coordinates=fractional_coordinates
    )

# The current bulk_configuration has lattice vectors and atomic positions 
# that do not obey FCC symetry. This function will produce a new configuration
# that is perfectly symmetric.
bulk_configuration = symmetrizeConfiguration(bulk_configuration, 0.5*Ang)

symmetrize.py

Notes

The returned configuration will always be the primitive crystal. This means that the number of atoms may change.

If the atomic positions or lattice vectors are significantly far away from their ideal positions, then the detected space group may not be correct. Increasing the tolerance to a large value (e.g. tolerance=0.5*Angstrom) may be useful.

The Bravais lattice type of the returned configuration will be the type with the highest possible symmetry. This means that if the initial Bravais lattice is the generic UnitCell the symmetrized configuration might be for example, FaceCenteredCubic.