本文整理匯總了Python中sage.schemes.projective.projective_space.ProjectiveSpace._coordinate_ring方法的典型用法代碼示例。如果您正苦於以下問題:Python ProjectiveSpace._coordinate_ring方法的具體用法?Python ProjectiveSpace._coordinate_ring怎麽用?Python ProjectiveSpace._coordinate_ring使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類sage.schemes.projective.projective_space.ProjectiveSpace
的用法示例。
在下文中一共展示了ProjectiveSpace._coordinate_ring方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: __init__
# 需要導入模塊: from sage.schemes.projective.projective_space import ProjectiveSpace [as 別名]
# 或者: from sage.schemes.projective.projective_space.ProjectiveSpace import _coordinate_ring [as 別名]
def __init__(self, poly, ambient=None):
"""
Return the projective hypersurface in the space ambient
defined by the polynomial poly.
If ambient is not given, it will be constructed based on
poly.
EXAMPLES::
sage: P.<x, y, z> = ProjectiveSpace(ZZ, 2)
sage: ProjectiveHypersurface(x-y, P)
Projective hypersurface defined by x - y in Projective Space of dimension 2 over Integer Ring
::
sage: R.<x, y, z> = QQ[]
sage: ProjectiveHypersurface(x-y)
Projective hypersurface defined by x - y in Projective Space of dimension 2 over Rational Field
TESTS::
sage: H = ProjectiveHypersurface(x-y)
sage: H == loads(dumps(H))
True
"""
if not is_MPolynomial(poly):
raise TypeError, \
"Defining polynomial (=%s) must be a multivariate polynomial."%poly
if not poly.is_homogeneous():
raise TypeError, "Defining polynomial (=%s) must be homogeneous."%poly
if ambient == None:
R = poly.parent()
from sage.schemes.projective.projective_space import ProjectiveSpace
ambient = ProjectiveSpace(R.base_ring(), R.ngens()-1)
ambient._coordinate_ring = R
AlgebraicScheme_subscheme_projective.__init__(self, ambient, [poly])