Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
Added is_simply_laced() check on CartanMatrix and default folding for…
Browse files Browse the repository at this point in the history
… type A1.
  • Loading branch information
Travis Scrimshaw committed May 5, 2014
1 parent fc52070 commit 9a06866
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/sage/combinat/root_system/cartan_matrix.py
Expand Up @@ -521,6 +521,25 @@ def dual(self):
return CartanMatrix(self._cartan_type.dual())
return CartanMatrix(self.transpose())

def is_simply_laced(self):
"""
Implements :meth:`CartanType_abstract.is_simply_laced()`.
A Cartan matrix is simply-laced if all non diagonal entries are `0`
or `-1`.
EXAMPLES::
sage: cm = CartanMatrix([[2, -1, -1, -1], [-1, 2, -1, -1], [-1, -1, 2, -1], [-1, -1, -1, 2]])
sage: cm.is_simply_laced()
True
"""
for i in range(self.nrows()):
for j in range(i+1, self.ncols()):
if self[i, j] < -1 or self[j, i] < -1:
return False
return True

def is_crystallographic(self):
"""
Implements :meth:`CartanType_abstract.is_crystallographic`.
Expand Down
19 changes: 19 additions & 0 deletions src/sage/combinat/root_system/type_A_affine.py
Expand Up @@ -202,3 +202,22 @@ def dual(self):
"""
return self

def _default_folded_cartan_type(self):
"""
Return the default folded Cartan type.
In general, this just returns ``self`` in ``self`` with `\sigma` as
the identity map.
EXAMPLES::
sage: CartanType(['A',1,1])._default_folded_cartan_type()
['A', 1, 1] as a folding of ['A', 3, 1]
sage: CartanType(['A',3,1])._default_folded_cartan_type()
['A', 3, 1] as a folding of ['A', 3, 1]
"""
from sage.combinat.root_system.type_folded import CartanTypeFolded
if self.n == 1:
return CartanTypeFolded(self, ['A', 3, 1], [[0,2], [1,3]])
return CartanTypeFolded(self, self, [[i] for i in self.index_set()])

0 comments on commit 9a06866

Please sign in to comment.