principia_materia.representation.base_representation module
- class principia_materia.representation.base_representation.BaseRepresentation(rdim, tol=1e-06)
Bases:
object
The abstract class for representations
As a abstract class for all different representations to derive from, this class contains the most core functionalities for representation, including the group elements, computing characters, decomposing irreducible representations, projecting irreducible basis, etc.
All derived representation classes need to implement following methods to be usable:
__init__
,_set_group_elements
and_set_basis
.- property G
The matrix representation of the group elements.
- property basis
The name of the basis of the representation.
This is the original basis of the representation before symmetrization.
- Returns:
basis – List of names of basis.
- Return type:
list of tuple or str
- property chi
The characters of the representation.
- Returns:
chi – The characters of the representation.
- Return type:
array of int, length of number of classes in the group
- construct_irreducible_basis(seeds=None, identity_only=False)
Construct irreducible basis using projection operators for all instances of existing irreducible representations
- irrvec_dict
A dictionary contains irreducible basis of every instances of existing irreducible basis.
- Type:
dict with keys of tuple(str, int) and values of array of float or complex (same type as self.G) shape(dim of irrep, self.rdim)
- construct_irrep_matrices(use_Cornwell=True)
Construct the representation matrices for irreps with dimension greater than 1.
These are only unique up to a unitary transformation, but we will pick a particular convention.
- irrep_matr
A nested dictionary with each multi-dimensional irreducible representation, a dictionary of the irrep matrices of each group element.
- Type:
dict with keys of str and values of dict
- get_integer_irrvec(irrep_instance, max_number=500)
Computes interger form of the irreducible basis.
Attempts to compute the integer form of the given irreducible basis, if not successful, attempts make as many matrix elements into integer form as possible.
\[\vec{v} \times \sqrt{n} | n \in [1, max\_number]\]- Returns:
irrvec – The integer form of a irreducible basis.
- Return type:
array of float or complex (same type as self.G), shape(dim of irrep, rdim)
- has_multi_dim_irrep()
- property irreducible_basis_rowname
The names of the rows for the irreducible basis.
- Returns:
irreducible_basis_rowname – The name of the rows for the irreducible basis as tuple (irrep instance tuple, row number)
- Return type:
list of tuple(str, int), shape(self.rdim, )
- property irrep_counter
The dictionary of the irreducible representations and the number of instances.
- Returns:
irrep_counter – The dictionary of the irreducible representations as keys and the number of instances as values.
- Return type:
dict with keys of str and values of int
- property irreps
A list of irreducible representations and it’s instance number.
This can be used to distinguish between different irreps as well as different instances of the same irrep.
- Returns:
irreps – Instances of irreducible representations as tuple(irrep name, instance number)
- Return type:
list of tuple(str, int), shape(number of irreps, )
- property irrvec
The matrix form of irreducible basis.
- Returns:
irrvec – Irreducible basis matrix.
- Return type:
array of float or complex (same type as self.G)
- orthogonalize_modes(vectors)
Orthogonalize modes against input vectors
The vectors can only be first rows of the existing irreps in the decomposition, the rest of the rows from each multi-dimensional irrep will be projected out.
- Parameters:
vectors (array of dtype, shape(N, self.rdim)) – The vectors to orthogonlize against.
- project_irrep(irrep, other=[], seeds=None, check_projection=True, without_irrep_matrices=False)
Contruct irreducible basis of a given irreducible representation from the given representation.
The routine will consider if there are already irreps of that it needs to avoid. We will simply return a matrix of dimension (dim_irrep,dim_rep).
- Parameters:
irrep (str) – Name of irrep to project.
other (array of float, shape(n, dim of basis)) – Basis of other existing instances of the irrep.
- Returns:
vec_irrep – A matrix of basis vector(s) of the irrep.
- Return type:
array of float, shape(dim of irrep, dim of basis)
- property rdim
Dimension of the representations
- principia_materia.representation.base_representation.kronecker_product(a, b)
Kronecker product of 2 2-D arrays.