On Jul 12, 10:20 am, Marco Streng marco.str...@gmail.com wrote:
Hi all,
I'm getting a bit confused about Parent objects and why
sage.schemes.generic.scheme.Scheme extends Parent.
Schemes are not really containers of anything, right? Calling
S.an_element() currently gives a NotImplementedError for most schemes,
and TestSuite(S).run() will give lots of failures for almost every
kind of scheme.
ProjectiveSpace does implement an_element, but that gives elements of
the coordinate ring instead of elements of the projective space
itself.
To make things even more confusing, the documentation for
sage.structure.parent.Parent.an_element() says Parent structures that
are should override _an_element_() instead. What does Parent
structures that are mean? When is a parent structure?
Thanks,
Marco
{{{
sage: Q.X,Y,Z = QQ[]
sage: P = ProjectiveSpace(Q)
sage: e = P.an_element(); e
X
sage: e.parent()
Multivariate Polynomial Ring in X, Y, Z over Rational Field
sage: S = Curve(X^2-Y^2+Z^2)
sage: S.an_element()
NotImplementedError: please implement _an_element_ for Projective
Curve over Rational Field defined by X^2 - Y^2 + Z^2
}}}
I was the one who switched schemes to Parent instead of Parent_old and
I definitely did notice that TestSuite does not run on them and in
general there are some confusing points. However I was not able to
completely fix everything and in particular not even all components
of the schemes framework are derived from new style classes. I would
argue that schemes are containers of their points, so there is nothing
wrong in deriving them from Parent, but the way how it is done may
require fixing and modification. If someone wants to do it, I beg
doing it after inclusion of all tickets upto #9245 because: 1) it may
be a bit difficult to rebase all patches in that sequence; 2) these
tickets add more complicated and more documented and doctested
ambient spaces and schemes, so it would be nice to have them in to
test the changes.
Thank you,
Andrey
--
To post to this group, send an email to sage-devel@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