symmetr.symmetrize module

symmetr.symmetrize.even_odd(Xs)[source]

Finds whether the first part of the response tensor is even or odd

Parameters:
  • op1 – the operator types

  • op2 – the operator types

  • op3 – the operator types

  • Returns – either (‘even’,’odd’) or (‘odd’,’even’)

class symmetr.symmetrize.params_trans(op1, op2, op3, l, T=None, sym_format='findsym')[source]

Bases: object

__dict__ = mappingproxy({'__module__': 'symmetr.symmetrize', '__firstlineno__': 124, '__init__': <function params_trans.__init__>, '__static_attributes__': ('T', 'l', 'op1', 'op2', 'op3', 'sym_format'), '__dict__': <attribute '__dict__' of 'params_trans' objects>, '__weakref__': <attribute '__weakref__' of 'params_trans' objects>, '__doc__': None, '__annotations__': {}})
__firstlineno__ = 124
__init__(op1, op2, op3, l, T=None, sym_format='findsym')[source]
__module__ = 'symmetr.symmetrize'
__static_attributes__ = ('T', 'l', 'op1', 'op2', 'op3', 'sym_format')
symmetr.symmetrize.symmetr(syms, X, trans_func, params, opt=None)[source]

This symmetrizes a tensor X given a list of symmetries and a transformation function.

This function should be quite general and is now used for all symmetrizing.

Parameters:
  • syms – list of symmetry operations

  • X – tensor - must be a tensor class

  • trans_func – function that transforms the tensor X using symmetry sym trans_func must work in the following way: X_trans = trans_func(X,sym,params) If trans_func returns None then the symmetry operation is ignored

  • params – parameters to be sent to function trans_func

Returns:

the symmetry restricted form of tensor X

Return type:

X_trans

symmetr.symmetrize.symmetr_AB(syms, X, atom1, atom2, round_prec=None)[source]

Tries to transform the tensor projected on one atom to a different atom

Parameters:
  • syms – The symmmetry operations. Format as outputted by read.py

  • X – The input tensor.

  • op1 – The first operator.

  • op2 – The second operator.

  • atom1 – The atom on which X is projected.

  • atom2 – The atom on which X is transformed.

  • T (Optional[matrix]) – Coordinate transformation matrix. If it is set, the symmetry operations will be transformed by this matrix. Symmetry operations are given in basis A. T transforms from A to B, ie Tx_A = x_B.

Returns:

The transformed tensor.

Return type:

X_trans

symmetr.symmetrize.symmetrize_same_op(X, s_opt=None)[source]
symmetr.symmetrize.symmetrize_sym_inds(X, sym_inds, asym_inds, T_sym_inds, T_asym_inds, s_opt=None)[source]