Jeff,

I don't know any easy way to fix Sage's treatment of complex nested
types. I suppose that in it's current state Sage still does not
implement sufficiently generic definitions of operations like
'factor'. I do know that it is possible to do this via the
Axiom/FriCAS interface. E.g.

wsp...@debian:~/sage-3.4$ ./sage
----------------------------------------------------------------------
| Sage Version 3.4, Release Date: 2009-03-11                         |
| Type notebook() for the GUI, and license() for information.        |
----------------------------------------------------------------------
sage: S.<q>=QQ[];S
Univariate Polynomial Ring in q over Rational Field
sage: R.<x0,x1>=S[];R
Multivariate Polynomial Ring in x0, x1 over Univariate Polynomial Ring
in q over Rational Field
sage: f=(x0*x1+x1^2)/(x0+x1);f
(x0*x1 + x1^2)/(x0 + x1)
sage: f.parent()
Fraction Field of Multivariate Polynomial Ring in x0, x1 over
Univariate Polynomial Ring in q over Rational Field
sage: # This Axiom function performs a coercion
sage: axiom.eval('dmpFracUP(x) ==
x::DistributedMultivariatePolynomial([x0,x1],Fraction(UnivariatePolynomial(q,Integer)))');
sage: axiom(f).dmpFracUP()
x1
sage: g=(x0+q)*(x1-q);g
x0*x1 + (-q)*x0 + q*x1 - q^2
sage: axiom(g).dmpFracUP()

                         2
  x0 x1 - q x0 + q x1 - q
sage: axiom(g).dmpFracUP().factor()
(x1 - q)(x0 + q)
sage: h=(x0+q)*(x1-q)/q;h
1/q*x0*x1 - x0 + x1 - q
sage: hA=axiom(h).dmpFracUP();hA

  1
  - x0 x1 - x0 + x1 - q
  q
sage: hF=hA.factor();hF

  1
  - (x1 - q)(x0 + q)
  q
sage:

Regards,
Bill Page.

On Fri, Aug 14, 2009 at 11:53 AM, Jeff<jeffpferre...@gmail.com> wrote:
>
> I am working in the area of non-symmetric Macdonald polynomials,
> specifically, I am trying to write a function that implements formula
> 7 of "A Combinatorial formula for nonsymmetric Macdonald Polynomials"
> by Haglund, Haiman, and Loehr.  Currently, I am having difficulty
> factoring polynomials in sage.  Here are some examples of what works
> and what doesn't work:
>
> Factoring in a polynomial ring over a polynomial ring fails in sage:
>
> sage: S.<q>=QQ[];S
> Univariate Polynomial Ring in q over Rational Field
> sage: R.<x0,x1>=S[];R
> Multivariate Polynomial Ring in x0, x1 over Univariate Polynomial Ring
> in q over Rational Field
> sage: f=(x0*x1+x1^2)/(x0+x1);f
> (x0*x1 + x1^2)/(x0 + x1)
> sage: f.factor()
> TypeError: no conversion of this ring to a Singular ring defined
>
> Factoring in a polynomial ring over a fraction field works with
> positive coefficients in sage:
>
> sage: S.<q> = QQ[]; S
> Univariate Polynomial Ring in q over Rational Field
> sage: S = FractionField(S); S
> Fraction Field of Univariate Polynomial Ring in q over Rational Field
> sage: R.<x0,x1> = S[]; R
> Multivariate Polynomial Ring in x0, x1 over Fraction Field of
> Univariate Polynomial Ring in q over Rational Field
> sage:  f=(x0*x1+x1^2)/(x0+x1);f
> (x0*x1 + x1^2)/(x0 + x1)
> sage: f.factor()
> x1
>
> But when negative coefficients are used, sage doesn't want to factor:
>
> sage: S.<q>=QQ[];S
> Univariate Polynomial Ring in q over Rational Field
> sage: S=FractionField(S);S
> Fraction Field of Univariate Polynomial Ring in q over Rational Field
> sage: R.<x0,x1>=S[];R
> Multivariate Polynomial Ring in x0, x1 over Fraction Field of
> Univariate Polynomial Ring in q over Rational Field
> sage: f=(-x0*x1+x1^2)/(-x0+x1);f
> (-x0*x1 + x1^2)/(-x0 + x1)
> sage: f.factor()
> TypeError: Cannot multiply (-1) * x1 * (x0 - x1) and (1/(-1)) * (x0 -
> x1)^-1 because they cannot be coerced into a common universe
>
> My desired result:  I would like to be able to factor in polynomial
> rings over polynomial rings, like in example one above, regardless of
> coefficients.
>
> My question: Does anyone know of a quick and easy (I'm a newbie at
> sage) fix for these problems?  And does anyone know if sage will have
> support for such factoring in a later version?
>
> Thanks for your help.
> Jeff
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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