# Symmetries

module to define the Symmetry operations. Contains a general class for Rotation, Mirror, and also some pre-defined shortcuts:

• Identity =Symmetry( np.eye(3))

• Inversion=Symmetry(-np.eye(3))

• TimeReversal=Symmetry( np.eye(3),True)

• Mx=Mirror([1,0,0])

• My=Mirror([0,1,0])

• Mz=Mirror([0,0,1])

• C2z=Rotation(2,[0,0,1])

• C3z=Rotation(3,[0,0,1])

• C4x=Rotation(4,[1,0,0])

• C4y=Rotation(4,[0,1,0])

• C4z=Rotation(4,[0,0,1])

• C6z=Rotation(6,[0,0,1])

• C2x=Rotation(2,[1,0,0])

• C2y=Rotation(2,[0,1,0])

class wannierberri.symmetry.Mirror(axis=[0, 0, 1])[source]

Bases: Symmetry

mirror plane perpendicular to axis

Parameters:

axis (Iterable of 3 float numbers) – the normal of the mirror plane in Cartesian coordinates. Length of vector does not matter, but should not be zero

class wannierberri.symmetry.Rotation(n, axis=[0, 0, 1])[source]

Bases: Symmetry

n-fold rotation around the axis

Parameters:
• n (int) – 1,2,3,4 or 6. Defines the rotation angle $$2\pi/n$$

• axis (Iterable of 3 float numbers) – the rotation axis in Cartesian coordinates. Length of vector does not matter, but should not be zero.

class wannierberri.symmetry.Symmetry(R, TR=False)[source]

Bases: object

Symmetries that acts on reciprocal space objects, in Cartesian coordinates. A k-point vector k transform as self.iTR * self.iInv * (sym.R @ k).

Parameters:
• R ((3, 3) ndarray) – Rotation matrix. det(R) = 1 or -1.

• TR (bool) – True if symmetry involves time reversal.

R

Proper rotation matrix. Always satisfy det(R) = 1.

Type:

(3, 3) ndarray

TR

True if symmetry involves time reversal.

Type:

bool

Inv

True if symmetry involves spatial inversion. (i.e. if on input det(R) was -1)

Type:

bool

class wannierberri.symmetry.Group(generator_list=[], recip_lattice=None, real_lattice=None)[source]

Bases: object

Class to store a symmetry point group.

Parameters:
• generator_list (list of Symmetry or str) – The generators of the symmetry group.

• recip_lattice (~numpy.array) – 3x3 array with rows giving the reciprocal lattice basis

• real_lattice (~numpy.array) – 3x3 array with rows giving the real lattice basis

Notes

• need to provide either recip_lattice or real_latice, not both

• if you only want to generate a symmetric tensor, or to find independent components, recip_lattice and real_latice, are not needed

check_basis_symmetry(basis, tol=1e-06, rel_tol=None)[source]

returns True if the basis is symmetric

gen_symmetric_tensor(rank, TRodd, Iodd)[source]

generates a random tensor, which respects the given symmetry pointgroup. May be used to get an idea, what components of the tensr are allowed by the symmetry.

Parameters:
• rank (int) – rank of the tensor

• TRodd (bool) – True if the tensor is odd under time-reversal, False otherwise

• Iodd (bool) – True if the tensor is odd under inversion, False otherwise

Returns:

$$3 \times 3\times \ldots$$ array respecting the symmetry

Return type:

numpy.array(float)

get_symmetric_components(rank, TRodd, Iodd)[source]

writes which components of a tensor nonzero, and which are equal (or opposite)

Parameters:
• rank (int) – rank of the tensor

• TRodd (bool) – True if the tensor is odd under time-reversal, False otherwise

• Iodd (bool) – True if the tensor is odd under inversion, False otherwise

Returns:

list of eualities, e.g. [‘0=xxy=xxz=…’, ‘xxx=-xyy=-yxy=-yyx’, ‘xyz=-yxz’, ‘xzy=-yzx’, ‘zxy=-zyx’]

Return type:

a list of str

class wannierberri.symmetry.Transform(factor=1, conj=False, transpose_axes=None)[source]

Bases: object

Describes transformation of a tensor under inversion or time-reversal

Parameters:
• factor (int) – mu,tiplication fuctor (+1 or -1)

• conj (bool) – apply complex conjugation

• transpose_axes (tuple) – how to permute the axes of the tensor.

Note

• Pre-defined transforms are :
• transform_ident = Transform()

• transform_odd = Transform(factor=-1)

• transform_trans = Transform(transpose_axes=(1,0))

class wannierberri.symmetry.TransformProduct(transform_list)[source]

Bases: Transform

Constructs a Transform from a list of Transform