Status of RootOf

105 views
Skip to first unread message

Kalevi Suominen

unread,
Feb 26, 2015, 7:02:18 AM2/26/15
to sy...@googlegroups.com
The RootOf class is explicitly defined as representing numerical complex roots of equations. The only possibility of dealing with roots of polynomials in other domains, e.g., in function fields, is by means of radicals. (Though this may not be a too big impediment in practise.)

However, there are situations where radicals do not suffice, for example, finite fields of prime power order. Their elements are algebraic over the prime field but cannot be represented in SymPy even by radicals. A more general RootOf class is called for.

Would it be possible to replace the current usage of RootOf() by something like rootof() and raise the status of the RootOf class to a more abstract level? (Or is it too late to change it now?)

Chris Smith

unread,
Feb 26, 2015, 9:14:07 PM2/26/15
to sy...@googlegroups.com
This is a little like what we ran into with changes in Matrix. I think we ended up introducing MatrixBase-sorts of classes. Could we do something like that instead of losing the current behavior of RootOf?

Aaron Meurer

unread,
Feb 26, 2015, 9:26:15 PM2/26/15
to sy...@googlegroups.com
Ideally it should be abstract. Can't we add a domain argument? Or make
it so that it stores a Poly instead of an Add?

Aaron Meurer
> --
> You received this message because you are subscribed to the Google Groups
> "sympy" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sympy+un...@googlegroups.com.
> To post to this group, send email to sy...@googlegroups.com.
> Visit this group at http://groups.google.com/group/sympy.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sympy/a3777481-59d8-4f6d-8b54-802308b86626%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Kalevi Suominen

unread,
Feb 27, 2015, 6:02:36 AM2/27/15
to sy...@googlegroups.com
It should not be necessary to lose any of the current functionality of RootOf. A call will now return a complex value.
It could be replaced with a call to rootof() which would do exactly the same.
(Some editing would be needed in solvers, of course.)

The field of complex numbers is special because its elements can be identified by their position in the complex plane. Hence it is possible to have them labelled. This is essentially what RootOf does now.

In other fields it is practically impossible to tell different roots apart by some inherent property. Algebraically they all
appear equivalent (at least if the polynomial is irreducible). Hence an object of the RootOf class could represent any
one of them. An algebraic field extension could be constructed by just adjoining a suitable object of RootOf class.
Note that this would be a new object, not one belonging to a pre-established domain.

(If, for some reason, it were necessary to have several roots one should divide the polynomial by the linear
factors  X - a, for all roots  a  found so far, and then take the RootOf of the remaining quotient or of a factor of it.)

Aaron Meurer

unread,
Feb 27, 2015, 12:24:07 PM2/27/15
to sy...@googlegroups.com
Couldn't we still just number the roots? Or would that lead to inconsistencies?

Aaron Meurer
> --
> You received this message because you are subscribed to the Google Groups
> "sympy" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sympy+un...@googlegroups.com.
> To post to this group, send email to sy...@googlegroups.com.
> Visit this group at http://groups.google.com/group/sympy.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sympy/01db05d9-689e-407c-bae3-1b369d2b753f%40googlegroups.com.

Kalevi Suominen

unread,
Feb 27, 2015, 2:19:45 PM2/27/15
to sy...@googlegroups.com

Couldn't we still just number the roots? Or would that lead to inconsistencies?

It would be fairly complicated to do in full generality. It is necessary to construct
one root at a time. (This is essentially so in the complex case, too.)
For each root one has to remove those that have already been constructed by the
process I described above:

> (If, for some reason, it were necessary to have several roots one should
> divide the polynomial by the linear
> factors  X - a, for all roots  a  found so far, and then take the RootOf of
> the remaining quotient or of a factor of it.)
  
So it can be done. However, the numbering of the roots will not always be unique
since a choice has to be made between the factors of remaining polynomial
if it happens to be reducible.

Fortunately it is seldom necessary to have a representation for all of the roots at once.
For example, for the construction of function field extensions, or even differential extensions,
just one root at a time will suffice in general.

The same is true for finite fields. It is enough to have one primitive element generating the
whole field.
 
Reply all
Reply to author
Forward
0 new messages