Path: blob/master/src/sage/schemes/plane_quartics/quartic_constructor.py
8820 views
"""1Quartic curve constructor2"""34#*****************************************************************************5# Copyright (C) 2006 David Kohel <[email protected]>6# Distributed under the terms of the GNU General Public License (GPL)7# http://www.gnu.org/licenses/8#*****************************************************************************910from sage.schemes.projective.all import is_ProjectiveSpace, ProjectiveSpace11from sage.rings.polynomial.multi_polynomial_element import is_MPolynomial1213from quartic_generic import QuarticCurve_generic1415def QuarticCurve(F, PP=None, check=False):16"""17Returns the quartic curve defined by the polynomial F.1819INPUT:2021- F -- a polynomial in three variables, homogeneous of degree 42223- PP -- a projective plane (default:None)2425- check -- whether to check for smoothness or not (default:False)2627EXAMPLES::2829sage: x,y,z=PolynomialRing(QQ,['x','y','z']).gens()30sage: QuarticCurve(x**4+y**4+z**4)31Quartic Curve over Rational Field defined by x^4 + y^4 + z^43233TESTS::3435sage: QuarticCurve(x**3+y**3)36Traceback (most recent call last):37...38ValueError: Argument F (=x^3 + y^3) must be a homogeneous polynomial of degree 43940sage: QuarticCurve(x**4+y**4+z**3)41Traceback (most recent call last):42...43ValueError: Argument F (=x^4 + y^4 + z^3) must be a homogeneous polynomial of degree 44445sage: x,y=PolynomialRing(QQ,['x','y']).gens()46sage: QuarticCurve(x**4+y**4)47Traceback (most recent call last):48...49ValueError: Argument F (=x^4 + y^4) must be a polynomial in 3 variables5051"""52if not is_MPolynomial(F):53raise ValueError("Argument F (=%s) must be a multivariate polynomial"%F)54P = F.parent()55if not P.ngens() == 3:56raise ValueError("Argument F (=%s) must be a polynomial in 3 variables"%F)57if not(F.is_homogeneous() and F.degree()==4):58raise ValueError("Argument F (=%s) must be a homogeneous polynomial of degree 4"%F)5960if not PP is None:61if not is_ProjectiveSpace(PP) and PP.dimension == 2:62raise ValueError("Argument PP (=%s) must be a projective plane"%PP)63else:64PP = ProjectiveSpace(P)6566if check:67raise NotImplementedError("Argument checking (for nonsingularity) is not implemented.")6869return QuarticCurve_generic(PP, F)707172