Skip to content
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

weak order of permutations broken #27467

Closed
tscrim opened this issue Mar 11, 2019 · 32 comments
Closed

weak order of permutations broken #27467

tscrim opened this issue Mar 11, 2019 · 32 comments

Comments

@tscrim
Copy link
Collaborator

tscrim commented Mar 11, 2019

From https://groups.google.com/forum/#!topic/sage-support/6kuvliWzi84:

sage: for w in Permutations(3):
....:     w, w.weak_covers()
....:
([1, 2, 3], [])
([1, 3, 2], [[1, 2, 3]])
([2, 1, 3], [[1, 2, 3]])
([2, 3, 1], [[3, 2, 1]])
([3, 1, 2], [[3, 2, 1]])
([3, 2, 1], [[3, 1, 2], [2, 3, 1]])

The fourth and fifth lines of the output are incorrect.
The correct values should be

([2, 3, 1], [[2, 1, 3]])
([3, 1, 2], [[1, 3, 2]])

This manifests also in creating the weak order poset:

sage: Permutations(3).weak_poset()
...
ValueError: Hasse diagram contains cycles

This is a left-vs-right issue and Permutation multiplication being a little strange with respect to that. We also remove the multiplication argument and convention effects from has_*_descent.

CC: @sagetrac-sage-combinat @nthiery @fchapoton @darijgr @sagetrac-jeremy-l-martin

Component: combinatorics

Keywords: Coxeter group

Author: Travis Scrimshaw

Branch/Commit: fa0450e

Reviewer: Frédéric Chapoton, Darij Grinberg

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

@tscrim tscrim added this to the sage-8.7 milestone Mar 11, 2019
@tscrim

This comment has been minimized.

@tscrim
Copy link
Collaborator Author

tscrim commented Mar 11, 2019

comment:2

The problem is the multiplication for a permutation seems to have the oppose effect (by default):

sage: W = Permutations(3)
sage: w = W([2,3,1])
sage: w.reduced_word()
[1, 2]
sage: w.descents(side='right')
[2]
sage: w.apply_simple_reflection_right(2)
[3, 2, 1]

So we need to override apply_simple_reflection_* for Permutation.

@tscrim
Copy link
Collaborator Author

tscrim commented Mar 12, 2019

@tscrim
Copy link
Collaborator Author

tscrim commented Mar 12, 2019

Author: Travis Scrimshaw

@tscrim
Copy link
Collaborator Author

tscrim commented Mar 12, 2019

comment:3

So the only way forward that I could see to make this work is to gut out the multiplication option for has_*_descent. With this, I do not think anything for Coxeter combiantorics now uses the multiplication convention.


New commits:

2273223Making apply_simple_reflection_* and has_*_descent not use the permutation multiplication convention.

@tscrim
Copy link
Collaborator Author

tscrim commented Mar 12, 2019

Commit: 2273223

@tscrim

This comment has been minimized.

@embray
Copy link
Contributor

embray commented Mar 25, 2019

comment:5

Moving all blocker/critical issues from 8.7 to 8.8.

@embray embray modified the milestones: sage-8.7, sage-8.8 Mar 25, 2019
@tscrim
Copy link
Collaborator Author

tscrim commented May 24, 2019

comment:6

Can someone review this?

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented May 24, 2019

Changed commit from 2273223 to c54aef5

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented May 24, 2019

Branch pushed to git repo; I updated commit sha1. New commits:

c822b3fMerge branch 'public/combinat/fix_weak_order_permutations-27467' of git://trac.sagemath.org/sage into public/combinat/fix_weak_order_permutations-27467
c54aef5Updating docstring based on comments by Darij.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented May 24, 2019

Branch pushed to git repo; I updated commit sha1. New commits:

295c517Fixing Yokonuma-Hecke algebras.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented May 24, 2019

Changed commit from c54aef5 to 295c517

@tscrim
Copy link
Collaborator Author

tscrim commented May 25, 2019

comment:9

Green patchbot.

@fchapoton
Copy link
Contributor

comment:10
  • deprecation should appear in doctests, no ?

  • "switching the entries i and i+1" (remove "equal" ?) in the doc of apply_simple_reflection_right

  • I am worried that this seems to be a source of incoherence.. But maybe the situation gets no worse than what it is right now ?

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jun 5, 2019

Branch pushed to git repo; I updated commit sha1. New commits:

0af471bAdding deprecation doctest and fixing docstring.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jun 5, 2019

Changed commit from 295c517 to 0af471b

@tscrim
Copy link
Collaborator Author

tscrim commented Jun 5, 2019

comment:12

Replying to @fchapoton:

  • deprecation should appear in doctests, no ?

Added.

  • "switching the entries i and i+1" (remove "equal" ?) in the doc of apply_simple_reflection_right

Fixed.

  • I am worried that this seems to be a source of incoherence.. But maybe the situation gets no worse than what it is right now ?

It is at least no worse than what it is currently, but I think this makes it more consistent overall. Plus it fixes a definite bug.

@fchapoton
Copy link
Contributor

comment:13

ok, then.

One should suggest somewhere loudly to use SymmetricGroup(n) instead of Permutations(n) when doing Coxeter-related work.

@fchapoton
Copy link
Contributor

Reviewer: Frédéric Chapoton

@tscrim
Copy link
Collaborator Author

tscrim commented Jun 5, 2019

comment:14

Replying to @fchapoton:

ok, then.

Thank you.

One should suggest somewhere loudly to use SymmetricGroup(n) instead of Permutations(n) when doing Coxeter-related work.

Also referencing CoxeterGroup or WeylGroup as well. Another ticket.

I am adding Darij as a reviewer since he gave me some comments on the ticket.

@tscrim
Copy link
Collaborator Author

tscrim commented Jun 5, 2019

Changed reviewer from Frédéric Chapoton to Frédéric Chapoton, Darij Grinberg

@vbraun
Copy link
Member

vbraun commented Jun 5, 2019

comment:15

Possibly due to #27899, I'm getting

sage -t --warn-long 57.2 src/sage/combinat/dyck_word.py
**********************************************************************
File "src/sage/combinat/dyck_word.py", line 1997, in sage.combinat.dyck_word.DyckWord_complete.to_312_avoiding_permutation
Failed example:
    p = DyckWord([1,1,0,1,0,0,1,1,0,1,0,1,0,0]).to_312_avoiding_permutation(); p
Expected:
    [2, 3, 1, 5, 6, 7, 4]
Got:
    [3, 1, 2, 7, 4, 5, 6]
**********************************************************************
File "src/sage/combinat/dyck_word.py", line 2007, in sage.combinat.dyck_word.DyckWord_complete.to_312_avoiding_permutation
Failed example:
    all(pi.avoids([3,1,2]) for pi in PD)
Expected:
    True
Got:
    False
**********************************************************************
File "src/sage/combinat/dyck_word.py", line 2197, in sage.combinat.dyck_word.DyckWord_complete.to_permutation
Failed example:
    D.to_permutation(map="Bandlow-Killpatrick")
Expected:
    [3, 4, 2, 1]
Got:
    [4, 3, 1, 2]
**********************************************************************
2 items had failures:
   2 of   9 in sage.combinat.dyck_word.DyckWord_complete.to_312_avoiding_permutation
   1 of   7 in sage.combinat.dyck_word.DyckWord_complete.to_permutation
    [581 tests, 3 failures, 1.27 s]
----------------------------------------------------------------------
sage -t --warn-long 57.2 src/sage/combinat/dyck_word.py  # 3 doctests failed
----------------------------------------------------------------------

@fchapoton
Copy link
Contributor

comment:16

Yes, probably correlated to this replacement in #27899 :

         n = self.semilength()
         area = self.to_area_sequence()
-        from sage.groups.perm_gps.permgroup_named import SymmetricGroup
-        pi = SymmetricGroup(n).one()
+        pi = Permutations(n).one()
         for j in range(n):
             for i in range(area[j]):
-                pi = pi.apply_simple_reflection(j-i)
-        return Permutation(~pi)
+                pi = pi.apply_simple_reflection(j - i)
+        return ~pi

@tscrim
Copy link
Collaborator Author

tscrim commented Jun 6, 2019

comment:17

I concur, and it should just be a matter of swapping the left/right convention (which I guess should just mean returning pi instead of ~pi). I can do this tomorrow.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jun 10, 2019

Branch pushed to git repo; I updated commit sha1. New commits:

25f8655Merge branch 'public/combinat/fix_weak_order_permutations-27467' of git://trac.sagemath.org/sage into public/combinat/fix_weak_order_permutations-27467

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jun 10, 2019

Changed commit from 0af471b to 25f8655

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jun 10, 2019

Branch pushed to git repo; I updated commit sha1. New commits:

fa0450eFixing left-right convention difference.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jun 10, 2019

Changed commit from 25f8655 to fa0450e

@tscrim
Copy link
Collaborator Author

tscrim commented Jun 10, 2019

comment:20

Sorry, I got sidetracked from this and forgot to do this last week. This is now fixed (although unfortunately we might have missed the next release cutoff...). Volker, it would be really nice if this could slip in to 8.8 since this is a relatively big bug in the combinatorics code.

@fchapoton
Copy link
Contributor

comment:21

set to positive again

@vbraun
Copy link
Member

vbraun commented Jun 12, 2019

Changed branch from public/combinat/fix_weak_order_permutations-27467 to fa0450e

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants