Lie algebra modules

Lie algebra modules with weight decomposition and their BGG cohomology

Provides functionality to construct weight modules with a Lie algebra action. Given a BGG complex, it can subsequently compute the cohomology of the module. See the tutorial notebook for example usage.

class bggcohomology.la_modules.LieAlgebraCompositeModule(factory, components, component_dic)[source]

Class encoding a Lie algebra weight module.

Parameters:
  • factory (ModuleFactory) – Factory object encoding the building blocks for the lie algebra module
  • components (List[List[tuple(str, int, str)]]) – list of lists of triples e.g. of form [[(‘g’, 2, ‘sym’),(‘n’, 3, ‘wedge’)]] to denote the module \(\mathrm{Sym}^2\mathfrak g\otimes \wedge^3\mathfrak n\). Or [[(‘g’,1,’sym’)],[(‘u’,1,’sym’)]] to denote \(\mathfrak g\oplus\mathfrak u\).
  • component_dic (dict[str, ModuleComponent]) – dictionary mapping keys like ‘g’ or ‘n’ to their respective lie algebra component
Variables:
  • components (List[List[tuple(str, int, str)]]) –
  • component_dic (dict[str, ModuleComponent]) –
  • factory (ModuleFactory) –
  • weight_dic (Dict[int, np.array[np.int32]]) – Dictionary mapping the basis indices to the weights of the Lie algebra elements, encoded as vector with length given by rank of Lie algebra.
  • modules (Dict[str, np.array[np.int32]]) – Dictionary mapping module keys (e.g. ‘g’ or ‘n’) to a matrix list of integer indices of its basis
  • len_basis (int) – Number of different indices occuring in the bases of any module
  • max_index (int) – Largest index that occurs in the basis of any module
  • weight_components (dict[tuple[int], tuple(int,np.ndarray[np.int32, np.int32])]) – dictionary mapping a weight tuple to a pair (i, basis) where i is an integer indexing the direct sum component, and basis is basis of the weight component in same format as output of self.compute_weight_components.
  • dimensions (dict[str, int]) – Dictionary containing the total dimension of each weight component
  • total_dimension (int) – Total dimension of the entire module
  • dimensions_components (list[dict[str, int]]) – For each direct sum component seperately, a dictionary containing the total dimension of each weight component
  • weight_comp_index_numbers (dict[str, dict[tuple(int), int]]) – For each weight give a dictionary that maps a tuple encoding the a basis element together with an index encoding in which direct sum component it lies, to an index encoding this basis element as basis element of the weight component.
  • weight_comp_direct_sum_index_numbers (dict[str, dict[tuple(int), int]]) – For each weight give a dictionary that maps a tuple encoding the a basis element together with an index encoding in which direct sum component it lies, to an index encoding this basis element as basis element of the direct sum component of the weight component.
  • type_lists (list[list[str]]) – Gives the type of the lie_algebra for each tensor component. For example for [[(‘g’,2,’sym’),(‘u’,1,’sym’)],[(‘n’,2,’wedge’)]] this gives [[‘g’,’g’,’u’],[‘n’,’n’]].
  • slice_lists (list[list[tuple(str,int,int,int)]]) – For each direct sum component, store a list which gives a slice for the entire tensor component for each individual tensor slot.
  • action_tensor_dic (dict[str, np.array[np.int32, np.int32, np.int32]]) – For each Lie algebra type, give the order 3 tensor encoding the structure coefficients of the action.
compute_weight_components(direct_sum_component)[source]

Construct the weight components of the module.

Parameters:direct_sum_component (np.ndarray[np.int32, np.in32]) – output of self.construct_component
Returns:dictionary mapping a weight tuple to a subset of the input basis.
Return type:dict[tuple[int], np.ndarray[np.int32, np.int32]]
display_action(BGG, arrow, dominant_weight)[source]

Display the action on a basis. Mainly for debugging purposes.

Parameters:
  • BGG (BGGComplex) –
  • arrow (tuple(str, str)) – Pair of strings ecndoing an edge in the Bruhat graph
  • dominant_weight (tuple[int]) – The dominant weight for which to compute the BGG complex
get_action_tensor(component)[source]

Compute a tensor encoding the action for a given tensor component.

Parameters:component (ModuleComponent) – Typically a value of self.component_dic
Returns:The shape of the tensor is (dim(n)+m, max_ind, 3), where m is some (typically small integer), dim(n) is the dimension of the lie algebra n<g, max_ind is the largest index occurring in the tensor component. The last axis stores a triple (s, k, C_ijk) for each pair i,j. If i<dim(n), then C_ijk is the structure coefficient, similarly for k. If C_ijk is zero for all k, then the tuple is (0,0,0). For some i,j there are multiple non-zero C_ijk. If this happens, then s gives the row of the next non-zero C_ijk (the column is still j). If s = -1 then there are no further non-zero structure coefficients. The integer m is then the smallest such that the tensor is big enough.
Return type:np.ndarray[int, int ,int]
initialize_weight_components()[source]

Compute a basis for each direct sum component and weight component.

Returns:dictionary mapping a weight tuple to a pair (i, basis) where i is an integer indexing the direct sum component, and basis is basis of the weight component in same format as output of self.compute_weight_components.
Return type:dict[tuple[int], tuple(int,np.ndarray[np.int32, np.int32])]
class bggcohomology.la_modules.BGGCohomology(BGG, weight_module=None, coker=None, pbars=None)[source]

Class for computing the BGG cohomology of a module.

Parameters:
  • BGG (BGGComplex) –
  • weight_module (LieAlgebraCompositeModule or None) – The weight module to compute the cohomology of. If None, this class offers limited functionality.
  • coker (Dict[tuple(int), matrix] or None (default: None)) – Dictionary giving a basis of a cokernel for each weight component The matrix is in the ordered basis of the weight component given by the LieAlgebraCompositeModule. If None, or if a key is not present in the dicitonary, the entire weight component is used as normal and no reduction is performed.
  • pbars (iterable(tqdm) or None (default: None)) – Progress bars to send updates to. If None, this feature is disabled. Up to two progress bars are supported for more detailed information.
Variables:
  • BGG (BGGComplex) –
  • has_coker (bool) – True if self.coker is not None
  • coker (Dict[tuple(int), matrix] or None) –
  • weight_set (WeightSet) –
  • weight_module (LieAlgebraCompositeModule) –
  • weights (list(tuple(int))) – list of all the weights occuring in the weight module
  • num_components (int) – the number of direct sum components
  • regular_weights (list(tuple[tuple(int), tuple(int), int])) – list of triples consisting of dot-regular weight, associated dominant, and the length of the Weyl group element making the weight dominant under the dot action.
betti_number(cohomology)[source]

Compute Betti number from list of dominant weights and multiplicities.

Parameters:cohomology (list[tuple(tuple(int), int)]) – List of pairs (weight, multiplicity), typically output of self.cohomology.
Returns:The Betti number (total dimension)
Return type:int
cohom_to_latex(cohom, compact=False)[source]

Represent output of self.cohomology by a LaTeX string.

Parameters:
  • cohom (list[tuple(tuple(int), int)]) – List of pairs of dominant weight and multiplicity, typically output of self.cohomology
  • compact (bool (default: False)) – Whether or not to use more compact notation
cohomology(i, mu=None)[source]

Compute full block of cohomology.

This is done by computing BGG_i(mu) for all dot-regular mu appearing in the weight module of length i. For a given weight mu, if there are no other weights of length i +/- 1 with the same associated dominant, then the weight component mu is isolated and the associated cohomology is the entire weight module.

Parameters:
  • i (int) – Degree in which to compute cohomology
  • mu (tuple(int) or None (default: None)) – Optionally restrict computation to a particular weight, for example if computing for all weights is not interesting or not computationally feasible.
Returns:

List of pairs (weight, multiplicity), where multiplicity is always non-zero, and weight is a dominant weight. This gives the mutliplicity of each highest weight rep in the cohomology. If list is empty, the cohomology in this degree is trivial.

Return type:

list[tuple(tuple(int), int)]

cohomology_LaTeX(i=None, mu=None, complex_string='', only_non_zero=True, print_betti=False, print_modules=True, only_strings=False, compact=False, skip_zero=False)[source]

Compute cohomology, and display it in a pretty way using LaTeX.

Parameters:
  • i (int or None (defualt: None)) – degree to compute cohomology. If none, compute in all degrees
  • mu (tuple(int) or None (default: None)) – weight for which to compute cohomoly, if None compute for all
  • complex_string (str (default: "")) – an optional string to print cohomology as H^i(complex_string) = …
  • only_non_zero (bool (default: True)) – If True, print nothing if the cohomology is trivial / 0
  • print_betti (bool (default: False)) – Print the Betti numbers
  • print_modules (bool (default: True)) – Print a string to represent the dominant weights occuring
  • only_strings (bool (default: False)) – Don’t print anything, just return a string
  • compact (bool (default : False)) – Use more compact notation for the dominant weights
  • skip_zero (bool (default: False)) – Skip the zeroth degree of cohomology if i is None
cohomology_component(mu, i)[source]

Compute cohomology BGG_i(mu).

Parameters:
  • mu (tuple(int)) – Dominant weight used in the BGG complex
  • i (int) – Degree in which to compute cohomology, equivalently the column in the BGG complex taken.
Returns:

The dimension of the cohomology

Return type:

int

tuple_to_latex(tup, compact=False)[source]

Get LaTeX string representing a tuple of highest weight vector and it’s multiplicity.

Parameters:
  • tup ((tuple(int), int)) – Pair of dominant weight and its associated multiplicity
  • compact (bool (default False)) – Whether or not to use more compact notation
Returns:

LaTeX string representing the highest weight module with multiplicity

Return type:

str

class bggcohomology.la_modules.ModuleComponent(basis, action, factory)[source]

Class encoding a building-block for lie algebra modules.

This class is a data container.

Parameters:
  • basis (list[int]) – List of integers indexing the basis of a Lie algebra.
  • action (dict[tuple(int,int), dict[int, int]]) – Dictionary encoding the structure coefficients \(C^k_{i,j}\). This is encoded by mapping (i,j) to {k: Cijk if Cijk !=0}.
  • factory (ModuleFactory) – The ModuleFactory that created this instance of ModuleComponent
class bggcohomology.la_modules.ModuleFactory(lie_algebra)[source]

A factory class making ModuleComponent.

It can create modules for (co)adjoint actions on parabolic subalgebras of the input Lie algebra.

Parameters:

lie_algebra (LieAlgebra) – The input lie algebra, typically created as LieAlgebra(QQ, cartan_type=root_system). The Lie algebra is assumed to be simple.

Variables:
  • lie_algebra (LieAlgebra) –
  • lattice (RootSpace) – The root lattice associated the the simple Lie algebra
  • rank (int) – Rank of the Lie algebra / root system
  • lie_algebra_basis (dict[RootSpace.element_class, LieAlgebra.element_class]) – Dictionary mapping roots in the rootspace to basis elements of the Lie algebra
  • sorted_basis (list[RootSpace.element_class]) – Elements of the root lattice indexing the basis, sorted such that this list starts with the negative roots.
  • root_to_index (dict[RootSpace.element_class, int]) – Dictionary mapping elements of root lattice to their index in self.sorted_basis.
  • g_basis (List[int]) – sorted list of indices corresponding to a basis of the entire Lie algebra
  • index_to_lie_algebra (dict[int, LieAlgebra.element_class]) – Dictionary mapping basis indices to their corresponding basis element of the Lie algebra
  • f_roots (List[RootSpace.element_class]) – List of negative roots
  • e_roots (List[RootSpace.element_class]) – List of positive roots
  • h_roots (List[RootSpace.element_class]) – List of roots belonging to Cartan subalgebra
  • basis (Dict[str, List[int]]) – Dictionary with keys {‘u’,’n’,’h’,’b’,b+’} and values the list of indices corresponding to the subalgebra’s of the Lie algebra.
  • dual_root_dict (Dict[int, int]) – Dictionary mapping negative roots to their corresponding positive roots and vice versa, where the roots are represented by their integer indices. Indices corresponding to the Cartan subalgebra are mapped to themselves.
  • weight_dic (Dict[int, np.array[np.int32]]) – Dictionary mapping the basis indices to the weights of the Lie algebra elements, encoded as vector with length given by rank of Lie algebra.
adjoint_action_tensor(lie_algebra, module)[source]

Compute structure coefficients of the adjoint action of subalgebra on a module.

Parameters:
  • lie_algbera (List[int]) – List of indices corresponding to the Lie subalgebra
  • module (List[int]) – List of indices curresponding to a module (i.e. a subspace of the Lie algebra that is fixed under the adjoint action of the subalgebra)
Returns:

Dictionary mapping (i,j) to a dictionary index->coeffcient encoding the non-zero structure coefficients \(C^k_{i,j}\).

Return type:

dict[tuple(int, int), Dict[int,int]]

build_component(subalgebra, action_type='ad', subset=None, acting_lie_algebra='n')[source]

Build a ModuleComponent.

Parameters:
  • subalgebra ({'g','n','u','b','b+','p'}) – Character indicating the type of subalgebra. Here ‘g’ is full Lie algbera, ‘n’ corresponds to negative roots, ‘u’ to positive roots, ‘b’ to (negative) Borel, ‘b+’ to positive Borel, and ‘p’ to (negative) parabolic.
  • action_type ({'ad', 'coad'} (default: 'ad')) – Whether to use adjoint action (‘ad’) or coadjoint action (‘coad’)
  • subset (List[int] or None (default: None)) – Subset indicating parabolic subalgebra. If None, use non-parabolic.
  • acting_lie_algebra ({'g','n','u','b','b+','p'}, (default: 'n')) – The Lie (sub)algebra which acts on subalgebra. subset has no effect on this subalgebra, and therefore ‘p’ and ‘b’ are equivalent.
Returns:

The ModuleComponent storing the data for this module.

Return type:

ModuleComponent

coadjoint_action_tensor(lie_algebra, module)[source]

Compute structure coefficients of the coadjoint action of subalgebra on a module.

Parameters:
  • lie_algbera (List[int]) – List of indices corresponding to the Lie subalgebra
  • module (List[int]) – List of indices curresponding to a module (i.e. a linear subspace of the Lie algebra)
Returns:

Dictionary mapping (i,j) to a dictionary index->coeffcient encoding the non-zero structure coefficients \(C^k_{i,j}\).

Return type:

dict[tuple(int, int), Dict[int,int]]

static dic_to_vec(dic, rank)[source]

Turn dict encoding sparse vector into dense vector.

Parameters:
  • dic (Dict[int, int]) – Dictionary index->coefficient of non-zero entries
  • rank (int) – Lenght of the vector (i.e. rank of Lie algebra / root system)
Returns:

Dense vector of length rank.

Return type:

np.array[int]

parabolic_n_basis(subset=None)[source]

Give parabolic n subalgebra.

Parameters:subset (List[int] or None (default: None)) – Parabolic subset. If None, returns non-parabolic.
Returns:list of basis indices corresponding to this subalgebra. It is spanned by all negative roots whose components are not entirely contained entirely in subset.
Return type:List[int]
parabolic_p_basis(subset=None)[source]

Give parabolic p subalgebra.

Parameters:subset (List[int] or None (default: None)) – Parabolic subset. If None, returns non-parabolic.
Returns:list of basis indices corresponding to this subalgebra. It is spanned by the subalgebra b and the positive whose components lie entirely in subset.
Return type:List[int]
parabolic_u_basis(subset=None)[source]

Give parabolic u subalgebra.

Parameters:subset (List[int] or None (default: None)) – Parabolic subset. If None, returns non-parabolic.
Returns:list of basis indices corresponding to this subalgebra. It is spanned by all positive roots whose components are not entirely contained entirely in subset.
Return type:List[int]
root_to_latex(root)[source]

Convert a root to a latex expression.

Parameters:root (RootSpace.element_class) –
Returns:String containing LaTeX expression for this root.
Return type:str