diff --git a/src/sage/combinat/root_system/cartan_matrix.py b/src/sage/combinat/root_system/cartan_matrix.py index 0ef6e7ce79d..4d95fa0f4e6 100644 --- a/src/sage/combinat/root_system/cartan_matrix.py +++ b/src/sage/combinat/root_system/cartan_matrix.py @@ -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`. diff --git a/src/sage/combinat/root_system/type_A_affine.py b/src/sage/combinat/root_system/type_A_affine.py index dbd6a1913da..494e473c57e 100644 --- a/src/sage/combinat/root_system/type_A_affine.py +++ b/src/sage/combinat/root_system/type_A_affine.py @@ -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()]) +