diff --git a/src/sage/combinat/root_system/cartan_matrix.py b/src/sage/combinat/root_system/cartan_matrix.py index 23da5ab2e4b..0a784548781 100644 --- a/src/sage/combinat/root_system/cartan_matrix.py +++ b/src/sage/combinat/root_system/cartan_matrix.py @@ -388,6 +388,14 @@ def _CM_init(self, cartan_type, index_set, cartan_type_check): sage: C = CartanMatrix(['A',1,1]) # indirect doctest # needs sage.graphs sage: TestSuite(C).run(skip=["_test_category", "_test_change_ring"]) # needs sage.graphs + + Check that :issue:`37979` is fixed:: + + sage: C = CartanMatrix([[2]], index_set=(4,)) + sage: C.index_set() + (4,) + sage: CartanType("A3").subtype((2,)) is CartanType("A1").relabel({1:2}) + True """ self._index_set = index_set self.set_immutable() @@ -396,6 +404,8 @@ def _CM_init(self, cartan_type, index_set, cartan_type_check): cartan_type = CartanType(cartan_type) elif self.nrows() == 1: cartan_type = CartanType(['A', 1]) + if index_set != (1,): + cartan_type = cartan_type.relabel({1: index_set[0]}) elif cartan_type_check: # Placeholder so we don't have to reimplement creating a # Dynkin diagram from a Cartan matrix