symmetry Package

symmetry Package

The symmetry package implements symmetry tools, e.g., spacegroup determination, etc.

bandstructure Module

Created on March 25, 2013

@author: geoffroy

class HighSymmKpath(structure, symprec=0.01, angle_tolerance=5)[source]

Bases: object

This class looks for path along high symmetry lines in the Brillouin Zone. It is based on Setyawan, W., & Curtarolo, S. (2010). High-throughput electronic band structure calculations: Challenges and tools. Computational Materials Science, 49(2), 299-312. doi:10.1016/j.commatsci.2010.05.010 The symmetry is determined by spglib through the SymmetryFinder class

Args:
structure:
Structure object
symprec:
Tolerance for symmetry finding
angle_tolerance:
Angle tolerance for symmetry finding.
bcc()[source]
bctet1(c, a)[source]
bctet2(c, a)[source]
cubic()[source]
fcc()[source]
get_kpath_plot()[source]

Gives the plot (as a matplotlib object) of the symmetry line path in the Brillouin Zone.

get_kpoints(line_density=20)[source]
Returns:
the kpoints along the paths in cartesian coordinates together with the labels for symmetry points -Wei
hex()[source]
kpath[source]
Returns:
The symmetry line path in reciprocal space
mcl(b, c, alpha)[source]
mclc1(a, b, c, alpha)[source]
mclc2(a, b, c, alpha)[source]
mclc3(a, b, c, alpha)[source]
mclc4(a, b, c, alpha)[source]
mclc5(a, b, c, alpha)[source]
orc()[source]
orcc(a, b, c)[source]
orcf1(a, b, c)[source]
orcf2(a, b, c)[source]
orcf3(a, b, c)[source]
orci(a, b, c)[source]
rhl1(alpha)[source]
rhl2(alpha)[source]
structure[source]
Returns:
The standardized primitive structure
tet()[source]
tria()[source]
trib()[source]

finder Module

An interface to the excellent spglib library by Atsushi Togo (http://spglib.sourceforge.net/) for pymatgen.

v1.0 - Now works with both ordered and disordered structure.

Note

Not all spglib functions are implemented.

class SymmetryFinder(structure, symprec=1e-05, angle_tolerance=5)[source]

Bases: object

Takes a pymatgen.core.structure.Structure object and a symprec. Uses pyspglib to perform various symmetry finding operations.

Args:
structure:
Structure object
symprec:
Tolerance for symmetry finding
angle_tolerance:
Angle tolerance for symmetry finding.
find_primitive()[source]

Find a primitive version of the unit cell.

Returns:
A primitive cell in the input cell is searched and returned as an Structure object. If no primitive cell is found, None is returned.
get_conventional_standard_structure()[source]

Gives a structure with a conventional cell according to certain standards. The standards are defined in Setyawan, W., & Curtarolo, S. (2010). High-throughput electronic band structure calculations: Challenges and tools. Computational Materials Science, 49(2), 299-312. doi:10.1016/j.commatsci.2010.05.010 They basically enforce as much as possible norm(a1)<norm(a2)<norm(a3)

Returns:
The structure in a conventional standardized cell
get_crystal_system()[source]

Get the crystal system for the structure, e.g., (triclinic, orthorhombic, cubic, etc.).

Returns:
Crystal system for structure.
get_hall()[source]

Returns Hall symbol for structure.

get_ir_kpoints(kpoints, is_time_reversal=True)[source]

Irreducible k-points are searched from the input kpoints.

Args:
kpoints:
Input kpoints as a (Nx3) array.
is_time_reversal:
Set to True to impose time reversal symmetry.
Returns:
A set of irreducible kpoints.
get_ir_kpoints_mapping(kpoints, is_time_reversal=True)[source]

Irreducible k-points are searched from the input kpoints. The result is returned as a map of numbers. The array index of map corresponds to the reducible k-point numbering. After finding irreducible k-points, the indices of the irreducible k-points are mapped to the elements of map, i.e., number of unique values in map is the number of the irreducible k-points.

Args:
kpoints:
Input kpoints as a (Nx3) array.
is_time_reversal:
Set to True to impose time reversal symmetry.
Returns:
Numbering of reducible kpoints. Equivalent kpoints will have the same number. The number of unique values is the number of the irreducible kpoints.
get_ir_reciprocal_mesh(mesh=(10, 10, 10), shift=(0, 0, 0), is_time_reversal=True)[source]

k-point mesh of the Brillouin zone generated taken into account symmetry.The method returns the irreducible kpoints of the mesh and their weights

Args:
mesh:
The number of kpoint for the mesh needed in each direction
shift:
A shift of the kpoint grid. For instance, Monkhorst-Pack is [0.5,0.5,0.5]
is_time_reversal:
Set to True to impose time reversal symmetry.
Returns:
A list of irreducible kpoints and their weights as a list of tuples [(ir_kpoint, weight)], with ir_kpoint given in fractional coordinates
get_lattice_type()[source]

Get the lattice for the structure, e.g., (triclinic, orthorhombic, cubic, etc.).This is the same than the crystal system with the exception of the hexagonal/rhombohedral lattice

Returns:
Crystal system for structure.
get_point_group()[source]

Get the point group associated with the structure.

Returns:
Pointgroup for structure.
get_primitive_standard_structure()[source]

Gives a structure with a primitive cell according to certain standards the standards are defined in Setyawan, W., & Curtarolo, S. (2010). High-throughput electronic band structure calculations: Challenges and tools. Computational Materials Science, 49(2), 299-312. doi:10.1016/j.commatsci.2010.05.010

Returns:
The structure in a primitive standardized cell
get_refined_structure()[source]

Get the refined structure based on detected symmetry. The refined structure is a conventional cell setting with atoms moved to the expected symmetry positions.

Returns:
Refined structure.
get_spacegroup()[source]

Return space group in international table symbol and number as a string.

get_spacegroup_number()[source]

Get the international spacegroup number (e.g., 62) for structure.

Returns:
International spacegroup number for structure.
get_spacegroup_symbol()[source]

Get the spacegroup symbol (e.g., Pnma) for structure.

Returns:
Spacegroup symbol for structure.
get_symmetrized_structure()[source]

Get a symmetrized structure. A symmetrized structure is one where the sites have been grouped into symmetrically equivalent groups.

Returns:
pymatgen.symmetry.structure.SymmetrizedStructure object.
get_symmetry_dataset()[source]

Returns the symmetry dataset as a dict.

Returns:
number:
International space group number
international:
International symbol
hall:
Hall symbol
transformation_matrix:
Transformation matrix from lattice of input cell to Bravais lattice L^bravais = L^original * Tmat
origin shift:
Origin shift in the setting of “Bravais lattice”
rotations, translations:
Rotation matrices and translation vectors. Space group operations are obtained by [(r,t) for r, t in zip(rotations, translations)]
wyckoffs:
Wyckoff letters
get_symmetry_operations(cartesian=False)[source]

Return symmetry operations as a list of SymmOp objects. By default returns fractional coord symmops. But cartesian can be returned too.

get_point_group(rotations)[source]

Return point group in international table symbol and number. The symbols are mapped to the numbers as follows: 1 “1 ” 2 “-1 ” 3 “2 ” 4 “m ” 5 “2/m ” 6 “222 ” 7 “mm2 ” 8 “mmm ” 9 “4 ” 10 “-4 ” 11 “4/m ” 12 “422 ” 13 “4mm ” 14 “-42m ” 15 “4/mmm” 16 “3 ” 17 “-3 ” 18 “32 ” 19 “3m ” 20 “-3m ” 21 “6 ” 22 “-6 ” 23 “6/m ” 24 “622 ” 25 “6mm ” 26 “-62m ” 27 “6/mmm” 28 “23 ” 29 “m-3 ” 30 “432 ” 31 “-43m ” 32 “m-3m “

pointgroup Module

This module implements a point group assigner for a molecule.

class PointGroup(sch_symbol, operations, tol=0.1)[source]

Bases: list

Defines a point group, which is essentially a sequence of symmetry operations.

sch_symbol

Schoenflies symbol of the point group.

Args:
sch_symbol:
The schoenflies symbol of the point group.
operations:
An initial set of symmetry operations. It is sufficient to provide only just enough operations to generate the full set of symmetries.
tol:
Tolerance to generate the full set of symmetry operations.
PointGroupAnalyzer(*args, **kwargs)[source]

A class to analyze the point group of a molecule. The general outline of the algorithm is as follows:

  1. Center the molecule around its center of mass.

  2. Compute the inertia tensor and the eigenvalues and eigenvectors.

  3. Handle the symmetry detection based on eigenvalues.

    1. Linear molecules have one zero eigenvalue. Possible symmetry operations are C*v or D*v
    2. Asymetric top molecules have all different eigenvalues. The maximum rotational symmetry in such molecules is 2
    3. Symmetric top molecules have 1 unique eigenvalue, which gives a unique rotation axis. All axial point groups are possible except the cubic groups (T & O) and I.
    4. Spherical top molecules have all three eigenvalues equal. They have the rare T, O or I point groups.
sch_symbol

Schoenflies symbol of the detected point group.

cluster_sites(mol, tol)[source]

Cluster sites based on distance and species type.

Args:
mol:
Molecule (should be centered at center of mass).
tol:
Tolerance to use.
Returns:
(origin_site, clustered_sites). origin_site is a site at the center of mass (None if there are no origin atoms). clustered_sites is a dict of {(avg_dist, species_and_occu): [list of sites]}
generate_full_symmops(symmops, tol)[source]

Recursive algorithm to permute through all possible combinations of the initially supplied symmetry operations to arrive at a complete set of operations mapping a single atom to all other equivalent atoms in the point group. This assumes that the initial number already uniquely identifies all operations.

Args:
symmops:
Initial set of symmetry operations.
Returns:
Full set of symmetry operations.

spacegroup Module

This module implements a basic Spacegroup class

class Spacegroup(int_symbol, int_number, symmops)[source]

Bases: object

Represents a space group, which is a collection of symmetry operations

Args:
int_symbol:
The international symbol of the spacegroup.
int_number:
The international number of the spacegroup.
symmops:
The symmetry operations associated with the spacegroup.
are_symmetrically_equivalent(sites1, sites2, symm_prec=0.001)[source]

Given two sets of PeriodicSites, test if they are actually symmetrically equivalent under this space group. Useful, for example, if you want to test if selecting atoms 1 and 2 out of a set of 4 atoms are symmetrically the same as selecting atoms 3 and 4, etc.

One use is in PartialRemoveSpecie transformation to return only symmetrically distinct arrangements of atoms.

Args:
sites1:
1st set of sites
sites2:
2nd set of sites
symm_prec:
The tolerance in atomic distance to test if atoms are symmetrically similar.
Returns:
Boolean indicating whether the two sets of sites are symmetrically equivalent.

structure Module

This module implements symmetry-related structure forms.

class SymmetrizedStructure(refined_structure, spacegroup, equivalent_positions)[source]

Bases: pymatgen.core.structure.Structure

This class represents a symmetrized structure, i.e. a structure where the spacegroup and symmetry operations are defined.

equivalent_sites[source]

All the sites grouped by symmetry equivalence in the form of [[sites in group1], [sites in group2], ...]

find_equivalent_sites(site)[source]

Finds all symmetrically equivalent sites for a particular site

Args:
site:
A site in the structure
Returns:
A list of all symmetrically equivalent sites.

Table Of Contents

This Page