bsym.symmetry_operation

class bsym.symmetry_operation.SymmetryOperation(matrix, label=None)[source]

Bases: object

SymmetryOperation class.

as_vector(count_from_zero=False)[source]

Return a vector representation of this symmetry operation

Parameters:count_from_zero (default = False) (bool) – set to True if the vector representation counts from zero
Returns:a vector representation of this symmetry operation (as a list)
character()[source]

Return the character of this symmetry operation (the trace of self.matrix).

Parameters:none
Returns:np.trace( self.matrix )
classmethod from_vector(vector, count_from_zero=False, label=None)[source]

Initialise a SymmetryOperation object from a vector of site mappings.

Parameters:
  • vector (list) – vector of integers defining a symmetry operation mapping.
  • count_from_zero (default = False) (bool) – set to True if the site index counts from zero.
  • label (default=None) (str) – optional string label for this SymmetryOperation object.
Returns:

a new SymmetryOperation object

invert(label=None)[source]

Invert this SymmetryOperation object.

Parameters:None
Returns:A new SymmetryOperation object corresponding to the inverse matrix operation.
operate_on(configuration)[source]

Return the Configuration generated by appliying this symmetry operation

Parameters:configuration (Configuration) – the configuration / occupation vector to operate on
Returns:the new configuration obtained by operating on configuration with this symmetry operation.
Return type:(Configuration)
pprint()[source]

Pretty print for this symmetry operation

Parameters:None
Returns:None
set_label(label)[source]

Set the label for this symmetry operation.

Parameters:label – label to set for this symmetry operation
Returns:self
similarity_transform(s, label=None)[source]

Generate the SymmetryOperation produced by a similarity transform S^{-1}.M.S

Parameters:
  • s – the symmetry operation or matrix S.
  • label (str, optional) – the label to assign to the new SymmetryOperation. Defaults to None.
Returns:

the SymmetryOperation produced by the similarity transform

bsym.symmetry_operation.is_permutation_matrix(m)[source]

Test whether a numpy array is a `permutation matrix`_.

Parameters:m (mp.matrix) – The matrix.
Returns:True | False.
Return type:(bool)
bsym.symmetry_operation.is_square(m)[source]

Test whether a numpy matrix is square.

Parameters:m (np.matrix) – The matrix.
Returns:True | False.
Return type:(bool)