Path: blob/master/src/sage/schemes/plane_quartics/quartic_generic.py
8820 views
"""1Plane quartic curves over a general ring. These are generic genus 3 curves,2as distinct from hyperelliptic curves of genus 3.34EXAMPLE:5sage: PP, (X,Y,Z) = ProjectiveSpace(2,QQ,'X,Y,Z').objgens()6sage: f = X^4 + Y^4 + Z^4 - 3*X*Y*Z*(X+Y+Z)7sage: C = QuarticCurve(f); C8Quartic Curve over Rational Field defined by X^4 + Y^4 - 3*X^2*Y*Z - 3*X*Y^2*Z - 3*X*Y*Z^2 + Z^49"""1011#*****************************************************************************12# Copyright (C) 2006 David Kohel <[email protected]>13# Distributed under the terms of the GNU General Public License (GPL)14# http://www.gnu.org/licenses/15#*****************************************************************************161718import sage.schemes.plane_curves.projective_curve as projective_curve1920def is_QuarticCurve(C):21"""22Checks whether C is a Quartic Curve2324EXAMPLES::2526sage: from sage.schemes.plane_quartics.quartic_generic import is_QuarticCurve27sage: x,y,z=PolynomialRing(QQ,['x','y','z']).gens()28sage: Q = QuarticCurve(x**4+y**4+z**4)29sage: is_QuarticCurve(Q)30True3132"""33return isinstance(C, QuarticCurve_generic)3435class QuarticCurve_generic(projective_curve.ProjectiveCurve_generic):36# DRK: Note that we should check whether the curve is3738def _repr_type(self):39"""40Return the representation of self4142EXAMPLES::4344sage: x,y,z=PolynomialRing(QQ,['x','y','z']).gens()45sage: Q = QuarticCurve(x**4+y**4+z**4)46sage: Q._repr_type()47'Quartic'48"""49return "Quartic"5051def genus(self):52"""53Returns the genus of self5455EXAMPLES::5657sage: x,y,z=PolynomialRing(QQ,['x','y','z']).gens()58sage: Q = QuarticCurve(x**4+y**4+z**4)59sage: Q.genus()60361"""62return 3636465