From 3dcc315068d8f4cf2a7c0b367e86fff61f191256 Mon Sep 17 00:00:00 2001 From: Skip Garibaldi Date: Sun, 29 Sep 2024 07:08:50 -0700 Subject: [PATCH 1/7] Expose Coxeter number and dual Coxeter number --- src/sage/combinat/root_system/root_system.py | 50 ++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/src/sage/combinat/root_system/root_system.py b/src/sage/combinat/root_system/root_system.py index ac70314eae1..c177fb8e965 100644 --- a/src/sage/combinat/root_system/root_system.py +++ b/src/sage/combinat/root_system/root_system.py @@ -787,6 +787,56 @@ def coambient_space(self, base_ring=QQ): """ return self.dual.ambient_space(base_ring) + def coxeter_number(self): + """ + For an irreducible finite root system, reports the Coxeter number. + This function is a wrapper for the corresponding function in CartanType. + + EXAMPLES:: + + sage: rt = RootSystem(['C', 5]) + sage: rt.coxeter_number() + 10 + + .. SEEALSO:: :meth:`~sage.combinat.root_system.cartan_type.CartanType_standard_finite.coxeter_number` + """ + # Check if RootSystem is finite and irreducible + if self.is_finite() and self.is_irreducible(): + # Hand over to CartanType method + return self._cartan_type.coxeter_number() + else: + raise ValueError("Coxeter number is defined only for finite and irreducible root systems.") + + def dual_coxeter_number(self): + """ + For an irreducible finite root system, reports the dual Coxeter number, + which is defined to be 1 plus the sum of the coefficients of simple roots + in the highest short root of the dual root system. This function is a + wrapper for the corresponding function in CartanType. + + EXAMPLES:: + + sage: rt = RootSystem(['C', 5]) + sage: rt.dual_coxeter_number() + 6 + + The dual Coxeter number is not the same concept as the Coxeter number + of the dual root system:: + + sage: rt.dual + Dual of root system of type ['C', 5] + sage: rt.dual.coxeter_number() + 10 + + .. SEEALSO:: :meth:`~sage.combinat.root_system.cartan_type.CartanType_standard_finite.dual_coxeter_number` + """ + # Check if RootSystem is finite and irreducible + if self.is_finite() and self.is_irreducible(): + # Hand over to CartanType method + return self._cartan_type.dual_coxeter_number() + else: + raise ValueError("Dual Coxeter number is defined only for finite and irreducible root systems.") + def WeylDim(ct, coeffs): """ From 8a21b778475f2401f69c8795d92c017fee847b3e Mon Sep 17 00:00:00 2001 From: Skip G <57930547+skipgaribaldi@users.noreply.github.com> Date: Tue, 1 Oct 2024 18:41:28 -0700 Subject: [PATCH 2/7] Update src/sage/combinat/root_system/root_system.py Co-authored-by: Travis Scrimshaw --- src/sage/combinat/root_system/root_system.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/sage/combinat/root_system/root_system.py b/src/sage/combinat/root_system/root_system.py index c177fb8e965..40be7ff7cda 100644 --- a/src/sage/combinat/root_system/root_system.py +++ b/src/sage/combinat/root_system/root_system.py @@ -789,16 +789,17 @@ def coambient_space(self, base_ring=QQ): def coxeter_number(self): """ - For an irreducible finite root system, reports the Coxeter number. - This function is a wrapper for the corresponding function in CartanType. + Return the Coxeter number of an irreducible finite root system. + + .. SEEALSO:: + + :meth:`~sage.combinat.root_system.cartan_type.CartanType_standard_finite.coxeter_number`. EXAMPLES:: sage: rt = RootSystem(['C', 5]) sage: rt.coxeter_number() 10 - - .. SEEALSO:: :meth:`~sage.combinat.root_system.cartan_type.CartanType_standard_finite.coxeter_number` """ # Check if RootSystem is finite and irreducible if self.is_finite() and self.is_irreducible(): From cad203c53934ef71f8613b57421400834c5314b9 Mon Sep 17 00:00:00 2001 From: Skip G <57930547+skipgaribaldi@users.noreply.github.com> Date: Tue, 1 Oct 2024 18:42:04 -0700 Subject: [PATCH 3/7] Update src/sage/combinat/root_system/root_system.py Co-authored-by: Travis Scrimshaw --- src/sage/combinat/root_system/root_system.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/sage/combinat/root_system/root_system.py b/src/sage/combinat/root_system/root_system.py index 40be7ff7cda..0e53d7d8a8e 100644 --- a/src/sage/combinat/root_system/root_system.py +++ b/src/sage/combinat/root_system/root_system.py @@ -802,11 +802,10 @@ def coxeter_number(self): 10 """ # Check if RootSystem is finite and irreducible - if self.is_finite() and self.is_irreducible(): - # Hand over to CartanType method - return self._cartan_type.coxeter_number() - else: - raise ValueError("Coxeter number is defined only for finite and irreducible root systems.") + if not (self.is_finite() and self.is_irreducible()): + raise ValueError("the Coxeter number is defined only for finite and irreducible root systems") + # Hand over to CartanType method + return self._cartan_type.coxeter_number() def dual_coxeter_number(self): """ From 7347dd7ae95bc7ae602e6b8a27691334ace1214d Mon Sep 17 00:00:00 2001 From: Skip G <57930547+skipgaribaldi@users.noreply.github.com> Date: Tue, 1 Oct 2024 18:42:24 -0700 Subject: [PATCH 4/7] Update src/sage/combinat/root_system/root_system.py Co-authored-by: Travis Scrimshaw --- src/sage/combinat/root_system/root_system.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/sage/combinat/root_system/root_system.py b/src/sage/combinat/root_system/root_system.py index 0e53d7d8a8e..f4f93671dfe 100644 --- a/src/sage/combinat/root_system/root_system.py +++ b/src/sage/combinat/root_system/root_system.py @@ -809,10 +809,10 @@ def coxeter_number(self): def dual_coxeter_number(self): """ - For an irreducible finite root system, reports the dual Coxeter number, - which is defined to be 1 plus the sum of the coefficients of simple roots - in the highest short root of the dual root system. This function is a - wrapper for the corresponding function in CartanType. + Return the dual Coxeter number of a irreducible finite root system. + + The dual Coxeter number is equal to 1 plus the sum of the coefficients + of simple roots in the highest short root of the dual root system. EXAMPLES:: From a190248d13e05585389234063aaeb76b68ea7297 Mon Sep 17 00:00:00 2001 From: Skip G <57930547+skipgaribaldi@users.noreply.github.com> Date: Tue, 1 Oct 2024 18:43:25 -0700 Subject: [PATCH 5/7] Update src/sage/combinat/root_system/root_system.py Co-authored-by: Travis Scrimshaw --- src/sage/combinat/root_system/root_system.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/sage/combinat/root_system/root_system.py b/src/sage/combinat/root_system/root_system.py index f4f93671dfe..b59dd1aea8f 100644 --- a/src/sage/combinat/root_system/root_system.py +++ b/src/sage/combinat/root_system/root_system.py @@ -831,11 +831,10 @@ def dual_coxeter_number(self): .. SEEALSO:: :meth:`~sage.combinat.root_system.cartan_type.CartanType_standard_finite.dual_coxeter_number` """ # Check if RootSystem is finite and irreducible - if self.is_finite() and self.is_irreducible(): - # Hand over to CartanType method - return self._cartan_type.dual_coxeter_number() - else: - raise ValueError("Dual Coxeter number is defined only for finite and irreducible root systems.") + if not (self.is_finite() and self.is_irreducible()): + raise ValueError("the dual Coxeter number is defined only for finite and irreducible root systems") + # Hand over to CartanType method + return self._cartan_type.dual_coxeter_number() def WeylDim(ct, coeffs): From b4eeff6f22d5059b5d87425d1a73d7396d17c5f4 Mon Sep 17 00:00:00 2001 From: Skip G <57930547+skipgaribaldi@users.noreply.github.com> Date: Tue, 1 Oct 2024 18:47:09 -0700 Subject: [PATCH 6/7] Move SEE ALSO before EXAMPLES --- src/sage/combinat/root_system/root_system.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sage/combinat/root_system/root_system.py b/src/sage/combinat/root_system/root_system.py index b59dd1aea8f..0cb2d26c91e 100644 --- a/src/sage/combinat/root_system/root_system.py +++ b/src/sage/combinat/root_system/root_system.py @@ -814,6 +814,8 @@ def dual_coxeter_number(self): The dual Coxeter number is equal to 1 plus the sum of the coefficients of simple roots in the highest short root of the dual root system. + .. SEEALSO:: :meth:`~sage.combinat.root_system.cartan_type.CartanType_standard_finite.dual_coxeter_number` + EXAMPLES:: sage: rt = RootSystem(['C', 5]) @@ -827,8 +829,6 @@ def dual_coxeter_number(self): Dual of root system of type ['C', 5] sage: rt.dual.coxeter_number() 10 - - .. SEEALSO:: :meth:`~sage.combinat.root_system.cartan_type.CartanType_standard_finite.dual_coxeter_number` """ # Check if RootSystem is finite and irreducible if not (self.is_finite() and self.is_irreducible()): From 7da711f511d833efe427944b373939dd3e2a2a21 Mon Sep 17 00:00:00 2001 From: Skip Garibaldi Date: Tue, 1 Oct 2024 19:10:28 -0700 Subject: [PATCH 7/7] Delete trailing whitespace (W291) --- src/sage/combinat/root_system/root_system.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sage/combinat/root_system/root_system.py b/src/sage/combinat/root_system/root_system.py index 0cb2d26c91e..06210a749e7 100644 --- a/src/sage/combinat/root_system/root_system.py +++ b/src/sage/combinat/root_system/root_system.py @@ -834,7 +834,7 @@ def dual_coxeter_number(self): if not (self.is_finite() and self.is_irreducible()): raise ValueError("the dual Coxeter number is defined only for finite and irreducible root systems") # Hand over to CartanType method - return self._cartan_type.dual_coxeter_number() + return self._cartan_type.dual_coxeter_number() def WeylDim(ct, coeffs):