On Sat, Apr 18, 2009 at 6:04 PM, Maurizio <maurizio.gran...@gmail.com> wrote:
>> QQ is the rational numbers (fractions).  QQbar is the algebraic
>> closure of QQ; this means it includes every complex number which is
>> the root of a polynomial with rational coefficients.  So it includes
>> things like sqrt(2) (which is a root of x^2-2), and sqrt(-1) (a root
>> of x^2+1), as well as more exotic numbers like the roots of x^5-x-1,
>> which can't be expressed using radicals (roots).  (QQbar does not
>> include all complex numbers, though; for instance, it does not include
>> pi or e, which are transcendental rather than algebraic.)
>>
>
> I understand. This means (as I was kind of suspecting) that QQbar
> could have been a good candidate to try to work with (I am just trying
> to solve examples 1.4 and 1.5 of that web page). Unfortunately, QQbar
> doesn't provide resultant() yet, so it should jump in after the
> resultant has been calculated over QQ[]. I think that is not really an
> elegant solution (and probably very suboptimal...).

It's not elegant, but it's probably much more efficient... QQbar is
vastly less efficient than QQ, so it's definitely a good idea to stick
with QQ as long as possible before jumping to QQbar.  You can use
.roots(ring=QQbar) on a polynomial over QQ.

> if I don't define a ring containing x and z, how do I inject z into
> the workspace? certainly not as a symbolic variable, so what else? I
> know that at the very end this is a univariate polynomial ring root
> finding problem, I'm just wondering how to correctly manage it.

If you have a polynomial in a multivariate ring, but your actual
polynomial actually contains only one variable, you can get the
corresponding univariate polynomial with .univariate_polynomial().

> I understand, but let's consider the problem I'm coming from:
> indefinite integral. I'm not using polynomials because I'm well aware
> of the implications, rather because I found resultant() implemented
> there :)
> What I intended with my sentences was: imagine a polynomial like: x^2
> + a^2. The solutions of x^2 - a^2 = 0 with respect to x over any field
> wouldn't always coincide with +/- a? That is the kind of reasoning I
> would make to solve the indefinite integral, like when I work with
> symbolic variables that have a precise meaning (i.e. they are not
> really variables in the problem, it's just that I want to keep that
> degree of freedom with respect to the solution, especially if I want
> to see the effect of that value over the solution) into my problem.

I think it's going to be almost impossible to carry through the
algorithm with parameters... it's definitely not where you should be
starting :)

Consider x^5-x-a.  In general I don't know of a better description of
the roots of this polynomial as a function of a than "the roots of
x^5-x-a as a function of a" :)  (And if you want the distinct roots,
that's even worse.  The number of distinct roots will depend on the
values of the parameters.  Fortunately it probably doesn't matter
whether the roots are distinct, if you carefully adapt the
algorithm...)

>> > Finally, I still would like to know which is the best way to translate
>> > the output of a calculation with polynomial rings into a symbolic
>> > expression, that can be carried on with maxima or pynac. Can you help
>> > me?
>>
>> If p is a polynomial, then SR(p) is a symbolic expression.
>>
>
> Funny, the next minutes I spent, I recognized how to do that in this
> same way :) By the way, is there a SR equivalent for the new pynac
> symbolic? Something like NSR (new symbolic ring)? I can see that pynac
> already has gcd implemented, although I can already (unfortunately)
> see:
> RuntimeError: gcd: arguments must be polynomials over the rationals

There is an NSR, but it's not available on the command line by
default; you can get it with:

from sage.symbolic.ring import NSR

Carl

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to 
sage-devel-unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to