#9094: is_square and sqrt for polynomials and fraction fields
------------------------------------------------+---------------------------
Reporter: robertwb | Owner: AlexGhitza
Type: enhancement | Status: needs_work
Priority: major | Milestone: sage-4.5.1
Component: algebra | Keywords:
Author: Robert Bradshaw, Maarten Derickx | Upstream: N/A
Reviewer: John Cremona, Marco Streng | Merged:
Work_issues: documentation, double code |
------------------------------------------------+---------------------------
Comment(by mstreng):
In the sage reference manual [http://www.sagemath.org/doc/reference/], you
can search for a class and then click on its base classes. It appears that
the least general common base class is
sage.structure.element.CommutativeRingElement, which in turn extends
sage.structure.element.RingElement. As your implementation is for domains
only, you should put it in CommutativeRingElement.
You can start your code by checking hasattr(self, 'is_square'). I don't
know how to check if the function self.is_square has a keyword argument
'root' other than using try. You should try to catch "TypeError:
is_square() got an unexpected keyword argument 'root'" and raise
NotImplementedError, "Please implement is_square with option 'root = True'
for objects of type %s" % type(self)
Most importantly, check if there is no subclass of CommutativeRingElement
that implements is_square by calling sqrt ;p
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/9094#comment:15>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
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.