Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
sagemath
GitHub Repository: sagemath/sagesmc
Path: blob/master/src/sage/schemes/plane_quartics/quartic_constructor.py
8820 views
1
"""
2
Quartic curve constructor
3
"""
4
5
#*****************************************************************************
6
# Copyright (C) 2006 David Kohel <[email protected]>
7
# Distributed under the terms of the GNU General Public License (GPL)
8
# http://www.gnu.org/licenses/
9
#*****************************************************************************
10
11
from sage.schemes.projective.all import is_ProjectiveSpace, ProjectiveSpace
12
from sage.rings.polynomial.multi_polynomial_element import is_MPolynomial
13
14
from quartic_generic import QuarticCurve_generic
15
16
def QuarticCurve(F, PP=None, check=False):
17
"""
18
Returns the quartic curve defined by the polynomial F.
19
20
INPUT:
21
22
- F -- a polynomial in three variables, homogeneous of degree 4
23
24
- PP -- a projective plane (default:None)
25
26
- check -- whether to check for smoothness or not (default:False)
27
28
EXAMPLES::
29
30
sage: x,y,z=PolynomialRing(QQ,['x','y','z']).gens()
31
sage: QuarticCurve(x**4+y**4+z**4)
32
Quartic Curve over Rational Field defined by x^4 + y^4 + z^4
33
34
TESTS::
35
36
sage: QuarticCurve(x**3+y**3)
37
Traceback (most recent call last):
38
...
39
ValueError: Argument F (=x^3 + y^3) must be a homogeneous polynomial of degree 4
40
41
sage: QuarticCurve(x**4+y**4+z**3)
42
Traceback (most recent call last):
43
...
44
ValueError: Argument F (=x^4 + y^4 + z^3) must be a homogeneous polynomial of degree 4
45
46
sage: x,y=PolynomialRing(QQ,['x','y']).gens()
47
sage: QuarticCurve(x**4+y**4)
48
Traceback (most recent call last):
49
...
50
ValueError: Argument F (=x^4 + y^4) must be a polynomial in 3 variables
51
52
"""
53
if not is_MPolynomial(F):
54
raise ValueError("Argument F (=%s) must be a multivariate polynomial"%F)
55
P = F.parent()
56
if not P.ngens() == 3:
57
raise ValueError("Argument F (=%s) must be a polynomial in 3 variables"%F)
58
if not(F.is_homogeneous() and F.degree()==4):
59
raise ValueError("Argument F (=%s) must be a homogeneous polynomial of degree 4"%F)
60
61
if not PP is None:
62
if not is_ProjectiveSpace(PP) and PP.dimension == 2:
63
raise ValueError("Argument PP (=%s) must be a projective plane"%PP)
64
else:
65
PP = ProjectiveSpace(P)
66
67
if check:
68
raise NotImplementedError("Argument checking (for nonsingularity) is not implemented.")
69
70
return QuarticCurve_generic(PP, F)
71
72