#5551: [with patch, needs review] Permutation from a pair of standard tableaux
---------------------------+------------------------------------------------
Reporter: slabbe | Owner: slabbe
Type: enhancement | Status: assigned
Priority: major | Milestone: sage-3.4.1
Component: combinatorics | Keywords: robinson schensted
---------------------------+------------------------------------------------
Comment(by hivert):
> Did you forget the third one or is this a joke meaning you are of the
second type of mathematician?
Both !!! Every people doing combinatorics should know that he is of the
second type ! Do you know how to count the number of twin prime numbers ?
If not you are of the second type !
> Then, what should the input of from_tableaux say? Should it say simply a
pair of standard tableaux as robinson_shensted doc string says it returns
a pair of standard tableaux? Should it say that it handles a pair (p, q)
of tableaux where p is semi-standard (weigth 0 or 1) and q is standard?
Obviously you never tried the following one:
{{{
sage: p = Permutation([1,3,2,2,4,3])
sage: p.robinson_schensted()
[[[1, 2, 2, 3], [3, 4]], [[1, 2, 4, 5], [3, 6]]]
sage: permutation.from_tableaux(*_)
[1, 3, 2, 2, 4, 3]
}}}
Yes !!! Do it !!! Try It !!!
Does it answer your question ?
> There is a section in permutation.py containing functions constructing a
permutation from different objects :
> [...]
> The name from_tableaux was then natural. Also, I coded the function for
a colleague used to mathematica and he told me in mathematica they use
{{{TableauxToPermutation}}} and {{{PermutationToTableaux}}}. I don't mind
change it to robinson_schensted_inv or robinson_schensted_inverse(). Do I?
In MuPAD we had {{{schensted}}} and {{{schenstedInv}}}. I'd rather have
either {{{robinson_schensted_inv}}/{{{inverse()}}} of
{{{from_tableaux_pair}}}.
I think you should ask for a vote on sage-combinat-devel.
Finally, my third remark is that you should raise a {{{ValueError}}} with
a proper explanation of what is wrong if the two tableaux are not of the
same shape:
{{{
sage: permutation.from_tableaux(Tableau([[1,2,3]]), Tableau([[1,2]]))
---------------------------------------------------------------------------
KeyError Traceback (most recent call
last)
/home/averell/.sage/temp/tomahawk/7383/_home_averell__sage_init_sage_0.py
in <module>()
/usr/local/sage/sage/local/lib/python2.5/site-
packages/sage/combinat/permutation.pyc in from_tableaux(p, q)
3112 p = map(list, p)
3113 for n in range(size, 0, -1):
-> 3114 i,j = d[n]
3115 x = p[i][j]
3116 del p[i][j]
KeyError: 3
}}}
Cheers,
Florent
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/5551#comment:5>
Sage <http://sagemath.org/>
Sage - Open Source Mathematical Software: Building the Car Instead of
Reinventing the Wheel
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en
-~----------~----~----~----~------~----~------~--~---