Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
sagemath
GitHub Repository: sagemath/sagelib
Path: blob/master/sage/schemes/plane_quartics/quartic_constructor.py
4057 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.generic.all import is_ProjectiveSpace, ProjectiveSpace
12
from sage.rings.all import is_MPolynomial
13
14
from quartic_generic import QuarticCurve_generic
15
16
#from sage.rings.all import is_FiniteField, is_RationalField
17
18
def QuarticCurve(F,PP=None,check=False):
19
"""
20
Returns the quartic curve defined by F.
21
"""
22
if not PP is None:
23
if not is_ProjectiveSpace(PP) and PP.dimension == 2:
24
raise TypeError, "Argument PP (=%s) must be a projective plane"%PP
25
elif not is_MPolynomial(F):
26
raise TypeError, \
27
"Argument F (=%s) must be a homogeneous multivariate polynomial"%F
28
else:
29
if not F.is_homogeneous():
30
"Argument F (=%s) must be a homogeneous polynomial"%F
31
P = F.parent()
32
if P.ngens() != 3:
33
"Argument F (=%s) must be a homogeneous multivariate polynomial in 3 variables"%F
34
PP = ProjectiveSpace(P)
35
if check:
36
raise TypeError, "Argument checking (for nonsingularity) is not implemented."
37
return QuarticCurve_generic(PP, F)
38
39