sagemath / sage

Main repository of SageMath
https://www.sagemath.org
Other
1.44k stars 481 forks source link

SymmetricGroup + Permutahedron #33997

Open thecaligarmo opened 2 years ago

thecaligarmo commented 2 years ago

For some reason on a Symmetric Group object, there's a method permutahedron, but when calling it, it fails since no fundamental weights are defined.

sage: S = SymmetricGroup(4)
sage: S.permutahedron()
---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
/sage/sagemath/local/var/lib/sage/venv-python3.10.3/lib/python3.10/site-packages/sage/structure/category_object.pyx in sage.structure.category_object.CategoryObject.getattr_from_category (build/cythonized/sage/structure/category_object.c:7158)()
    838         try:
--> 839             return self.__cached_methods[name]
    840         except KeyError:

KeyError: 'fundamental_weights'

During handling of the above exception, another exception occurred:

AttributeError                            Traceback (most recent call last)
<ipython-input-2-0bfe09fbe558> in <module>
----> 1 S.permutahedron()

/sage/sagemath/local/var/lib/sage/venv-python3.10.3/lib/python3.10/site-packages/sage/categories/finite_coxeter_groups.py in permutahedron(self, point, base_ring)
    738             """
    739             n = self.one().canonical_matrix().rank()
--> 740             weights = self.fundamental_weights()
    741             if point is None:
    742                 from sage.rings.integer_ring import ZZ

...

AttributeError: 'SymmetricGroup_with_category' object has no attribute 'fundamental_weights'

For now, I'm not sure the best way to approach this, but wanted to catalog it to get back to it later.

CC: @tscrim @stumpc5 @nthiery @jplab @darijgr @fchapoton

Component: combinatorics

Keywords: permutahedron, symmetric group

Issue created by migration from https://trac.sagemath.org/ticket/33997

kcrisman commented 2 years ago

Changed author from aram.dermenjian to none

kcrisman commented 2 years ago
comment:1

The symmetric group in Sage is a permutation group, but

S in CoxeterGroups.Finite()

gives True, correctly. So this connection apparently hasn't been fully implemented. See here and the current code for the weights. See in particular this comment, though I'm not sure if that class is the "correct" place to add it - you might want to ask people more conversant with that code, one of whom I've cc:ed.

Comment: Perhaps also connecting with the polytope.

tscrim commented 2 years ago
comment:2

It looks like the permutahedron() was just not fully tested (and probably my fault when doing the review (or implementation?)). One option is a version of what Karl-Dieter is suggesting: move the bilinear_form() and fundamental_weight[s]() up to the category level. Although I am a little worried about that forcing a specific choice of realization versus a more general framework. Now since none of the other implementations implements these, we might be safe. I am just worried about some subtle inconsistency.

I am cc-ing a few other people who might be able to comment on this.