#5270: [with patch, with review, needs work] implement plotting of affine and
projective algebraic curves
--------------------------------+-------------------------------------------
Reporter: AlexGhitza | Owner: AlexGhitza
Type: enhancement | Status: new
Priority: minor | Milestone: sage-3.4.1
Component: algebraic geometry | Resolution:
Keywords: |
--------------------------------+-------------------------------------------
Changes (by cremona):
* summary: [with patch, needs review] implement plotting of affine and
projective algebraic curves => [with patch,
with review, needs work] implement plotting of
affine and projective algebraic curves
Comment:
Looks great -- I think this ability to plot the idfferent affine patches
of a projective curve is a very nice feature.
Patch applies fine to 3.3.rc0. I had doctest problems in
projective_curve.py:
{{{
sage -t "devel/sage-5270/sage/schemes/plane_curves/projective_curve.py"
**********************************************************************
File
"/home/john/sage-3.3.rc0/devel/sage-5270/sage/schemes/plane_curves/projective_curve.py",
line 208:
sage: C.plot(patch=0)
Exception raised:
Traceback (most recent call last):
File "/home/john/sage-3.3.rc0/local/bin/ncadoctest.py", line 1231,
in run_one_test
self.run_one_example(test, example, filename, compileflags)
File "/home/john/sage-3.3.rc0/local/bin/sagedoctest.py", line 38, in
run_one_example
OrigDocTestRunner.run_one_example(self, test, example, filename,
compileflags)
File "/home/john/sage-3.3.rc0/local/bin/ncadoctest.py", line 1172,
in run_one_example
compileflags, 1) in test.globs
File "<doctest __main__.example_4[5]>", line 1, in <module>
C.plot(patch=Integer(0))###line 208:
sage: C.plot(patch=0)
File "/home/john/sage-3.3.rc0/local/lib/python2.5/site-
packages/sage/schemes/plane_curves/projective_curve.py", line 232, in plot
return C.plot(*args, **kwds)
File "/home/john/sage-3.3.rc0/local/lib/python2.5/site-
packages/sage/schemes/plane_curves/affine_curve.py", line 206, in plot
return I.plot(*args, **kwds)
File "/home/john/sage-3.3.rc0/local/lib/python2.5/site-
packages/sage/rings/polynomial/multi_polynomial_ideal.py", line 2389, in
plot
roots =
f.subs({v:i}).univariate_polynomial().change_ring(RR).roots()
File "multi_polynomial_libsingular.pyx", line 3161, in
sage.rings.polynomial.multi_polynomial_libsingular.MPolynomial_libsingular.univariate_polynomial
(sage/rings/polynomial/multi_polynomial_libsingular.cpp:21299)
IndexError: list index out of range
**********************************************************************
File
"/home/john/sage-3.3.rc0/devel/sage-5270/sage/schemes/plane_curves/projective_curve.py",
line 222:
sage: C.plot()
Exception raised:
Traceback (most recent call last):
File "/home/john/sage-3.3.rc0/local/bin/ncadoctest.py", line 1231,
in run_one_test
self.run_one_example(test, example, filename, compileflags)
File "/home/john/sage-3.3.rc0/local/bin/sagedoctest.py", line 38, in
run_one_example
OrigDocTestRunner.run_one_example(self, test, example, filename,
compileflags)
File "/home/john/sage-3.3.rc0/local/bin/ncadoctest.py", line 1172,
in run_one_example
compileflags, 1) in test.globs
File "<doctest __main__.example_4[15]>", line 1, in <module>
C.plot()###line 222:
sage: C.plot()
File "/home/john/sage-3.3.rc0/local/lib/python2.5/site-
packages/sage/schemes/plane_curves/projective_curve.py", line 231, in plot
C = Curve(self.affine_patch(patch))
File "/home/john/sage-3.3.rc0/local/lib/python2.5/site-
packages/sage/schemes/plane_curves/constructor.py", line 135, in Curve
return Curve(F.defining_polynomials())
File "/home/john/sage-3.3.rc0/local/lib/python2.5/site-
packages/sage/schemes/plane_curves/constructor.py", line 139, in Curve
return Curve(F[0])
File "/home/john/sage-3.3.rc0/local/lib/python2.5/site-
packages/sage/schemes/plane_curves/constructor.py", line 185, in Curve
return ProjectiveCurve_generic(P2, F)
File "/home/john/sage-3.3.rc0/local/lib/python2.5/site-
packages/sage/schemes/plane_curves/projective_curve.py", line 44, in
__init__
Curve_generic_projective.__init__(self, A, [f])
File "/home/john/sage-3.3.rc0/local/lib/python2.5/site-
packages/sage/schemes/generic/algebraic_scheme.py", line 208, in __init__
G = self._validate(G)
File "/home/john/sage-3.3.rc0/local/lib/python2.5/site-
packages/sage/schemes/generic/algebraic_scheme.py", line 572, in _validate
"defining polynomials (= %s) must be homogeneous"%G
TypeError: defining polynomials (= -4*x0^5 + 30*x0^3 + x1^2 - 45*x0 +
22) must be homogeneous
**********************************************************************
File
"/home/john/sage-3.3.rc0/devel/sage-5270/sage/schemes/plane_curves/projective_curve.py",
line 223:
sage: C.plot(patch=0)
Exception raised:
Traceback (most recent call last):
File "/home/john/sage-3.3.rc0/local/bin/ncadoctest.py", line 1231,
in run_one_test
self.run_one_example(test, example, filename, compileflags)
File "/home/john/sage-3.3.rc0/local/bin/sagedoctest.py", line 38, in
run_one_example
OrigDocTestRunner.run_one_example(self, test, example, filename,
compileflags)
File "/home/john/sage-3.3.rc0/local/bin/ncadoctest.py", line 1172,
in run_one_example
compileflags, 1) in test.globs
File "<doctest __main__.example_4[16]>", line 1, in <module>
C.plot(patch=Integer(0))###line 223:
sage: C.plot(patch=0)
File "/home/john/sage-3.3.rc0/local/lib/python2.5/site-
packages/sage/schemes/plane_curves/projective_curve.py", line 231, in plot
C = Curve(self.affine_patch(patch))
File "/home/john/sage-3.3.rc0/local/lib/python2.5/site-
packages/sage/schemes/plane_curves/constructor.py", line 135, in Curve
return Curve(F.defining_polynomials())
File "/home/john/sage-3.3.rc0/local/lib/python2.5/site-
packages/sage/schemes/plane_curves/constructor.py", line 139, in Curve
return Curve(F[0])
File "/home/john/sage-3.3.rc0/local/lib/python2.5/site-
packages/sage/schemes/plane_curves/constructor.py", line 185, in Curve
return ProjectiveCurve_generic(P2, F)
File "/home/john/sage-3.3.rc0/local/lib/python2.5/site-
packages/sage/schemes/plane_curves/projective_curve.py", line 44, in
__init__
Curve_generic_projective.__init__(self, A, [f])
File "/home/john/sage-3.3.rc0/local/lib/python2.5/site-
packages/sage/schemes/generic/algebraic_scheme.py", line 208, in __init__
G = self._validate(G)
File "/home/john/sage-3.3.rc0/local/lib/python2.5/site-
packages/sage/schemes/generic/algebraic_scheme.py", line 572, in _validate
"defining polynomials (= %s) must be homogeneous"%G
TypeError: defining polynomials (= x0^2*x1^3 + 22*x1^5 - 45*x1^4 +
30*x1^2 - 4) must be homogeneous
**********************************************************************
File
"/home/john/sage-3.3.rc0/devel/sage-5270/sage/schemes/plane_curves/projective_curve.py",
line 224:
sage: C.plot(patch=1)
Exception raised:
Traceback (most recent call last):
File "/home/john/sage-3.3.rc0/local/bin/ncadoctest.py", line 1231,
in run_one_test
self.run_one_example(test, example, filename, compileflags)
File "/home/john/sage-3.3.rc0/local/bin/sagedoctest.py", line 38, in
run_one_example
OrigDocTestRunner.run_one_example(self, test, example, filename,
compileflags)
File "/home/john/sage-3.3.rc0/local/bin/ncadoctest.py", line 1172,
in run_one_example
compileflags, 1) in test.globs
File "<doctest __main__.example_4[17]>", line 1, in <module>
C.plot(patch=Integer(1))###line 224:
sage: C.plot(patch=1)
File "/home/john/sage-3.3.rc0/local/lib/python2.5/site-
packages/sage/schemes/plane_curves/projective_curve.py", line 231, in plot
C = Curve(self.affine_patch(patch))
File "/home/john/sage-3.3.rc0/local/lib/python2.5/site-
packages/sage/schemes/plane_curves/constructor.py", line 135, in Curve
return Curve(F.defining_polynomials())
File "/home/john/sage-3.3.rc0/local/lib/python2.5/site-
packages/sage/schemes/plane_curves/constructor.py", line 139, in Curve
return Curve(F[0])
File "/home/john/sage-3.3.rc0/local/lib/python2.5/site-
packages/sage/schemes/plane_curves/constructor.py", line 185, in Curve
return ProjectiveCurve_generic(P2, F)
File "/home/john/sage-3.3.rc0/local/lib/python2.5/site-
packages/sage/schemes/plane_curves/projective_curve.py", line 44, in
__init__
Curve_generic_projective.__init__(self, A, [f])
File "/home/john/sage-3.3.rc0/local/lib/python2.5/site-
packages/sage/schemes/generic/algebraic_scheme.py", line 208, in __init__
G = self._validate(G)
File "/home/john/sage-3.3.rc0/local/lib/python2.5/site-
packages/sage/schemes/generic/algebraic_scheme.py", line 572, in _validate
"defining polynomials (= %s) must be homogeneous"%G
TypeError: defining polynomials (= -4*x0^5 + 30*x0^3*x1^2 - 45*x0*x1^4
+ 22*x1^5 + x1^3) must be homogeneous
**********************************************************************
1 items had failures:
4 of 18 in __main__.example_4
***Test Failed*** 4 failures.
For whitespace errors, see the file
/home/john/sage-3.3.rc0/tmp/.doctest_projective_curve.py
[5.2 s]
exit code: 1024
}}}
I think these are all in the hyperelliptic example.
PS I wonder how the doctests run without all the graphs popping up!
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/5270#comment:2>
Sage <http://sagemath.org/>
Sage - Open Source Mathematical Software: Building the Car Instead of
Reinventing the Wheel
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---