Skip to content

Hyperbolic Coxeter type classification added #40343

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 11 commits into
base: develop
Choose a base branch
from
33 changes: 31 additions & 2 deletions src/sage/combinat/root_system/coxeter_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
from sage.structure.sage_object import SageObject

lazy_import('sage.rings.universal_cyclotomic_field', 'UniversalCyclotomicField')
lazy_import('sage.combinat.root_system.type_hyperbolic', 'CoxeterType_Hyperbolic')


class CoxeterType(SageObject, metaclass=ClasscallMetaclass):
Expand All @@ -52,6 +53,9 @@
if isinstance(x, CoxeterType):
return x

if isinstance(x, list) and x[0] == "Hyp" or x[0] == "Hyperbolic":
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you need to add a pair of parentheses around the OR clause

return CoxeterType_Hyperbolic(*x)

try:
return CoxeterTypeFromCartanType(CartanType(x))
except (ValueError, TypeError):
Expand All @@ -63,7 +67,7 @@
raise NotImplementedError("Coxeter types not from Cartan types not yet implemented")

@classmethod
def samples(self, finite=None, affine=None, crystallographic=None):
def samples(self, finite=None, affine=None, crystallographic=None, hyperbolic=None):
"""
Return a sample of the available Coxeter types.

Expand All @@ -75,13 +79,15 @@

- ``crystallographic`` -- boolean or ``None`` (default: ``None``)

- ``hyperbolic`` -- boolean or ``None`` (default: ``None``)

The sample contains all the exceptional finite and affine
Coxeter types, as well as typical representatives of the
infinite families.

EXAMPLES::

sage: CoxeterType.samples()

Check failure on line 90 in src/sage/combinat/root_system/coxeter_type.py

View workflow job for this annotation

GitHub Actions / Conda (ubuntu, Python 3.12, new)

Failed example:

Failed example:: Got: [Coxeter type of ['A', 1], Coxeter type of ['A', 5], Coxeter type of ['B', 1], Coxeter type of ['B', 5], Coxeter type of ['C', 1], Coxeter type of ['C', 5], Coxeter type of ['D', 4], Coxeter type of ['D', 5], Coxeter type of ['E', 6], Coxeter type of ['E', 7], Coxeter type of ['E', 8], Coxeter type of ['F', 4], Coxeter type of ['H', 3], Coxeter type of ['H', 4], Coxeter type of ['I', 10], Coxeter type of ['A', 2, 1], Coxeter type of ['B', 5, 1], Coxeter type of ['C', 5, 1], Coxeter type of ['D', 5, 1], Coxeter type of ['E', 6, 1], Coxeter type of ['E', 7, 1], Coxeter type of ['E', 8, 1], Coxeter type of ['F', 4, 1], Coxeter type of ['G', 2, 1], Coxeter type of ['A', 1, 1], Coxeter type with Humphrey's datum (Page : 141, Column : 1, Row : 3), Coxeter type with Humphrey's datum (Page : 141, Column : 1, Row : 4), Coxeter type with Humphrey's datum (Page : 141, Column : 2, Row : 5), Coxeter type with Humphrey's datum (Page : 142, Column : 1, Row : 6), Coxeter type with Humphrey's datum (Page : 142, Column : 1, Row : 7), Coxeter type with Humphrey's datum (Page : 142, Column : 1, Row : 8), Coxeter type with Humphrey's datum (Page : 144, Column : 1, Row : 3)]
[Coxeter type of ['A', 1], Coxeter type of ['A', 5],
Coxeter type of ['B', 1], Coxeter type of ['B', 5],
Coxeter type of ['C', 1], Coxeter type of ['C', 5],
Expand Down Expand Up @@ -117,7 +123,7 @@
Coxeter type of ['E', 8, 1], Coxeter type of ['F', 4, 1],
Coxeter type of ['G', 2, 1], Coxeter type of ['A', 1, 1]]

sage: CoxeterType.samples(crystallographic=True)

Check failure on line 126 in src/sage/combinat/root_system/coxeter_type.py

View workflow job for this annotation

GitHub Actions / Conda (ubuntu, Python 3.12, new)

Failed example:

Failed example:: Got: [Coxeter type of ['A', 1], Coxeter type of ['A', 5], Coxeter type of ['B', 1], Coxeter type of ['B', 5], Coxeter type of ['C', 1], Coxeter type of ['C', 5], Coxeter type of ['D', 4], Coxeter type of ['D', 5], Coxeter type of ['E', 6], Coxeter type of ['E', 7], Coxeter type of ['E', 8], Coxeter type of ['F', 4], Coxeter type of ['A', 2, 1], Coxeter type of ['B', 5, 1], Coxeter type of ['C', 5, 1], Coxeter type of ['D', 5, 1], Coxeter type of ['E', 6, 1], Coxeter type of ['E', 7, 1], Coxeter type of ['E', 8, 1], Coxeter type of ['F', 4, 1], Coxeter type of ['G', 2, 1], Coxeter type of ['A', 1, 1], Coxeter type with Humphrey's datum (Page : 142, Column : 1, Row : 7), Coxeter type with Humphrey's datum (Page : 142, Column : 1, Row : 8), Coxeter type with Humphrey's datum (Page : 144, Column : 1, Row : 3)]
[Coxeter type of ['A', 1], Coxeter type of ['A', 5],
Coxeter type of ['B', 1], Coxeter type of ['B', 5],
Coxeter type of ['C', 1], Coxeter type of ['C', 5],
Expand All @@ -130,7 +136,7 @@
Coxeter type of ['E', 8, 1], Coxeter type of ['F', 4, 1],
Coxeter type of ['G', 2, 1], Coxeter type of ['A', 1, 1]]

sage: CoxeterType.samples(crystallographic=False)

Check failure on line 139 in src/sage/combinat/root_system/coxeter_type.py

View workflow job for this annotation

GitHub Actions / Conda (ubuntu, Python 3.12, new)

Failed example:

Failed example:: Got: [Coxeter type of ['H', 3], Coxeter type of ['H', 4], Coxeter type of ['I', 10], Coxeter type with Humphrey's datum (Page : 141, Column : 1, Row : 3), Coxeter type with Humphrey's datum (Page : 141, Column : 1, Row : 4), Coxeter type with Humphrey's datum (Page : 141, Column : 2, Row : 5), Coxeter type with Humphrey's datum (Page : 142, Column : 1, Row : 6)]
[Coxeter type of ['H', 3],
Coxeter type of ['H', 4],
Coxeter type of ['I', 10]]
Expand All @@ -148,6 +154,8 @@
result = [t for t in result if t.is_finite() == finite]
if affine is not None:
result = [t for t in result if t.is_affine() == affine]
if hyperbolic is not None:
result = [t for t in result if t.is_hyperbolic() == hyperbolic]
return result

@cached_method
Expand All @@ -161,7 +169,7 @@

EXAMPLES::

sage: CoxeterType._samples()

Check failure on line 172 in src/sage/combinat/root_system/coxeter_type.py

View workflow job for this annotation

GitHub Actions / Conda (ubuntu, Python 3.12, new)

Failed example:

Failed example:: Got: [Coxeter type of ['A', 1], Coxeter type of ['A', 5], Coxeter type of ['B', 1], Coxeter type of ['B', 5], Coxeter type of ['C', 1], Coxeter type of ['C', 5], Coxeter type of ['D', 4], Coxeter type of ['D', 5], Coxeter type of ['E', 6], Coxeter type of ['E', 7], Coxeter type of ['E', 8], Coxeter type of ['F', 4], Coxeter type of ['H', 3], Coxeter type of ['H', 4], Coxeter type of ['I', 10], Coxeter type of ['A', 2, 1], Coxeter type of ['B', 5, 1], Coxeter type of ['C', 5, 1], Coxeter type of ['D', 5, 1], Coxeter type of ['E', 6, 1], Coxeter type of ['E', 7, 1], Coxeter type of ['E', 8, 1], Coxeter type of ['F', 4, 1], Coxeter type of ['G', 2, 1], Coxeter type of ['A', 1, 1], Coxeter type with Humphrey's datum (Page : 141, Column : 1, Row : 3), Coxeter type with Humphrey's datum (Page : 141, Column : 1, Row : 4), Coxeter type with Humphrey's datum (Page : 141, Column : 2, Row : 5), Coxeter type with Humphrey's datum (Page : 142, Column : 1, Row : 6), Coxeter type with Humphrey's datum (Page : 142, Column : 1, Row : 7), Coxeter type with Humphrey's datum (Page : 142, Column : 1, Row : 8), Coxeter type with Humphrey's datum (Page : 144, Column : 1, Row : 3)]
[Coxeter type of ['A', 1], Coxeter type of ['A', 5],
Coxeter type of ['B', 1], Coxeter type of ['B', 5],
Coxeter type of ['C', 1], Coxeter type of ['C', 5],
Expand All @@ -186,7 +194,12 @@
['E', 7, 1], ['E', 8, 1], ['F', 4, 1],
['G', 2, 1], ['A', 1, 1]]]

return finite + affine
hyperbolic = [CoxeterType(t) for t in [['Hyp', (141, 1, 3)], ['Hyp', (141, 1, 4)],
['Hyp', (141, 2, 5)], ['Hyp', (142, 1, 6)],
['Hyp', (142, 1, 7)], ['Hyp', (142, 1, 8)],
['Hyp', (144, 1, 3)]]]

return finite + affine + hyperbolic

@abstract_method
def rank(self):
Expand Down Expand Up @@ -315,6 +328,22 @@
"""
return False

def is_hyperbolic(self):
"""
Return whether ``self`` is hyperbolic.

This returns ``False`` by default. Derived class should override this
appropriately.

EXAMPLES::

sage: CoxeterType(['A', 3]).is_hyperbolic()
False
sage: CoxeterType(['Hyp', (141, 1, 3)]).is_hyperbolic()
True
"""
return False

def is_simply_laced(self):
"""
Return whether ``self`` is simply laced.
Expand Down Expand Up @@ -663,7 +692,7 @@
EXAMPLES::

sage: ct = CoxeterType(['A',2])
sage: ct.relabel({1:-1, 2:-2})

Check failure on line 695 in src/sage/combinat/root_system/coxeter_type.py

View workflow job for this annotation

GitHub Actions / Conda (ubuntu, Python 3.12, new)

Failed example:

Failed example:: Exception raised: Traceback (most recent call last): File "/usr/share/miniconda/envs/sage-dev/lib/python3.12/site-packages/sage/doctest/forker.py", line 730, in _run self.compile_and_execute(example, compiler, test.globs) File "/usr/share/miniconda/envs/sage-dev/lib/python3.12/site-packages/sage/doctest/forker.py", line 1154, in compile_and_execute exec(compiled, globs) File "<doctest sage.combinat.root_system.coxeter_type.CoxeterTypeFromCartanType.relabel[1]>", line 1, in <module> ct.relabel({Integer(1):-Integer(1), Integer(2):-Integer(2)}) File "/usr/share/miniconda/envs/sage-dev/lib/python3.12/site-packages/sage/combinat/root_system/coxeter_type.py", line 698, in relabel return CoxeterType(self._cartan_type.relabel(relabelling)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "classcall_metaclass.pyx", line 321, in sage.misc.classcall_metaclass.ClasscallMetaclass.__call__ File "/usr/share/miniconda/envs/sage-dev/lib/python3.12/site-packages/sage/combinat/root_system/coxeter_type.py", line 56, in __classcall_private__ if isinstance(x, list) and x[0] == "Hyp" or x[0] == "Hyperbolic": ~^^^ TypeError: 'CartanType_finite_with_superclass' object is not subscriptable
Coxeter type of ['A', 2] relabelled by {1: -1, 2: -2}
"""
return CoxeterType(self._cartan_type.relabel(relabelling))
1 change: 1 addition & 0 deletions src/sage/combinat/root_system/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ py.install_sources(
'type_G.py',
'type_G_affine.py',
'type_H.py',
'type_hyperbolic.py',
'type_I.py',
'type_Q.py',
'type_affine.py',
Expand Down
Loading
Loading