Hi,

About your bug, I don't know if someone is looking after
SchubertPolynomialRing, from what I see it is mostly sent to symmetrica. I
see what is causing the problem, when creating an element, the index is
sent to Permutation_class which doesn't check if the list is a valid
permutation.

When I try :

sage: perm = Permutation([1,2,1])
sage: perm
[1, 2, 1]

Sage is not saying anything. But, there seem to be a fix in sage-combinat :

sage: perm = Permutation([1,2,1])
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
...
ValueError: the list l (=[1, 2, 1]) must contain each integer of {1,...,n}
one time

Nevertheless, SchubertPolynomialRing is using directly Permutation_class
which doesn't check anything.

sage: from sage.combinat.permutation import Permutation_class
sage: perm = Permutation_class([1,2,1])

So, the fix is in 2 steps :

- find what patch is fixing Permutation in sage-combinat and see if it is
reviewed / accepted when it is due into Sage.
- use Permutation instead of Permutation_class inside SchubertPolynomialRing

Also, just to let you know, there is also another object you can use to
work with Schubert polynomials.

sage: A = AbstractPolynomialRing(QQ)
sage: Schub = A.schubert_basis_on_vectors()
sage: pol = Schub[2,0,1]
sage: pol.expand()
x(2, 1, 0) + x(2, 0, 1)

elements are indexed by lehmer code. I'm don't know SchubertPolynomialRing
so I'm not sure what are the exact differences in terms of functionalities.
But this other object contains many bases of the polynomial ring and makes
it easy to work with divided differences. You need to install sage-combinat
to use it as it is not yet in Sage.. There are some worksheet on my webpage
: http://www-igm.univ-mlv.fr/~pons/en/research.php

If you're interested in this, please let me know and send me all your
feedbacks / questions.

Best regards

Viviane


2012/3/1 Leandro Vendramin <nicolas.thi...@u-psud.fr>

> Hi,
>
> I already reported this bug but maybe it is worthwhile to mention the
> problem here since this bug crashes Sage (console).
>
> I am using Sage Version 4.8, Release Date: 2012-01-20 compiled from
> sources (linux). I found a problem related to the computation of Schubert
> Polynomials.
> Suppose that I want to make some computations with these polynomials. What
> I do is the following:
>
> >sage: S = SchubertPolynomialRing(ZZ)
>
> Then if I want to compute the polynomial associated to the permutation,
> say, [3,2,1], I do the following:
> > sage: S([3,2,1]).expand()
>
> But if I make a mistake and enter [1,2,1], which of course is not a
> permutation, console Sage crashes.
> This is the output:
>
> >sage: S([1,2,1]).expand()
> >function: mult_apply_integer(2)
> >python:
>
> Maybe it is important to mention that when I use the Sage notebook this
> problem seems to be overlooked. No error messages, no answers...
> I tested the same code with Sage Version 4.6, Release Date: 2010-10-30,
> compiled from sources, and the same problem appears.
>
> Best,
> Leandro
>
>  --
> To post to this group, send an email to sage-de...@googlegroups.com
> To unsubscribe from this group, send an email to
> sage-devel+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/sage-devel
> URL: http://www.sagemath.org
>
> --
> You received this message because you are subscribed to the Google Groups
> "sage-combinat-devel" group.
> To post to this group, send email to sage-combinat-devel@googlegroups.com.
> To unsubscribe from this group, send email to
> sage-combinat-devel+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/sage-combinat-devel?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-combinat-devel" group.
To post to this group, send email to sage-combinat-devel@googlegroups.com.
To unsubscribe from this group, send email to 
sage-combinat-devel+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sage-combinat-devel?hl=en.

Reply via email to