Affine n space over a ring.

sage.schemes.generic.affine_space.AffineSpace(n, R=None, names='x')

Return affine space of dimension n over the ring R.

EXAMPLES: The dimension and ring can be given in either order.

sage: AffineSpace(3, QQ, 'x')
Affine Space of dimension 3 over Rational Field
sage: AffineSpace(5, QQ, 'x')
Affine Space of dimension 5 over Rational Field
sage: A = AffineSpace(2, QQ, names='XY'); A
Affine Space of dimension 2 over Rational Field
sage: A.coordinate_ring()
Multivariate Polynomial Ring in X, Y over Rational Field

Use the divide operator for base extension.

sage: AffineSpace(5, names='x')/GF(17)
Affine Space of dimension 5 over Finite Field of size 17

The default base ring is \ZZ.

sage: AffineSpace(5, names='x')
Affine Space of dimension 5 over Integer Ring

There is also an affine space associated to each polynomial ring.

sage: R = GF(7)['x,y,z']
sage: A = AffineSpace(R); A
Affine Space of dimension 3 over Finite Field of size 7
sage: A.coordinate_ring() is R
True
class sage.schemes.generic.affine_space.AffineSpace_generic(n, R, names)

Affine space of dimension n over the ring R.

EXAMPLES:

sage: X.<x,y,z> = AffineSpace(3, QQ)
sage: X.base_scheme()
Spectrum of Rational Field
sage: X.base_ring()
Rational Field
sage: X.structure_morphism ()
Scheme morphism:
  From: Affine Space of dimension 3 over Rational Field
  To:   Spectrum of Rational Field
  Defn: Structure map

Loading and saving:

sage: loads(X.dumps()) == X
True

We create several other examples of affine spaces.

sage: AffineSpace(5, PolynomialRing(QQ, 'z'), 'Z')
Affine Space of dimension 5 over Univariate Polynomial Ring in z over Rational Field
sage: AffineSpace(RealField(), 3, 'Z')
Affine Space of dimension 3 over Real Field with 53 bits of precision
sage: AffineSpace(Qp(7), 2, 'x')
Affine Space of dimension 2 over 7-adic Field with capped relative precision 20

Even 0-dimensional affine spaces are supported.

sage: AffineSpace(0)
Affine Space of dimension 0 over Integer Ring
__cmp__(right)

EXAMPLES:

sage: AffineSpace(QQ, 3, 'a') == AffineSpace(ZZ, 3, 'a')
False
sage: AffineSpace(ZZ,1, 'a') == AffineSpace(ZZ, 0, 'a')
False
sage: loads(AffineSpace(ZZ, 1, 'x').dumps()) == AffineSpace(ZZ, 1, 'x')
True
__init__(n, R, names)

EXAMPLES:

sage: AffineSpace(3, Zp(5), 'y')
Affine Space of dimension 3 over 5-adic Ring with capped relative precision 20
__iter__()

Return iterator over the elements of this affine space when defined over a finite field.

EXAMPLES:

sage: FF = FiniteField(3)
sage: AA = AffineSpace(FF, 0)
sage: [ x for x in AA ]
[()]
sage: AA = AffineSpace(FF, 1, 'Z')
sage: [ x for x in AA ]
[(0), (1), (2)]
sage: AA.<z,w> = AffineSpace(FF, 2)
sage: [ x for x in AA ]
[(0, 0), (1, 0), (2, 0), (0, 1), (1, 1), (2, 1), (0, 2), (1, 2), (2, 2)]

AUTHOR:

  • David Kohel
__pow__(m)

EXAMPLES:

sage: A = AffineSpace(1, QQ, 'x')
sage: A^5
Affine Space of dimension 5 over Rational Field
_check_satisfies_equations(v)

Return True if v defines a point on the scheme self; raise a TypeError otherwise.

EXAMPLES:

sage: A = AffineSpace(3, ZZ)
sage: A._check_satisfies_equations([1, 1, 0])
True
sage: A._check_satisfies_equations((0, 1, 0))
True
sage: A._check_satisfies_equations([0, 0, 0])
True
sage: A._check_satisfies_equations([1, 2, 3, 4, 5])
...
TypeError: The list v=[1, 2, 3, 4, 5] must have 3 components
sage: A._check_satisfies_equations([1/2, 1, 1])
...
TypeError: The components of v=[1/2, 1, 1] must be elements of Integer Ring
sage: A._check_satisfies_equations(5)
...
TypeError: The argument v=5 must be a list or tuple
_constructor(*args, **kwds)
_homset_class(*args, **kwds)
_latex_()

Return a LaTeX representation of this affine space.

EXAMPLES:

sage: print latex(AffineSpace(1, ZZ, 'x'))
\mathbf{A}_{\Bold{Z}}^1

TESTS:

sage: AffineSpace(3, Zp(5), 'y')._latex_()
'\\mathbf{A}_{\\ZZ_{5}}^3'
_latex_generic_point(v=None)

Return a LaTeX representation of the generic point corresponding to the list of polys on this affine space.

If polys is None, the representation of the generic point of the affine space is returned.

EXAMPLES:

sage: A.<x, y> = AffineSpace(2, ZZ)
sage: A._latex_generic_point([y-x^2])
'\left(- x^{2} + y\right)'
sage: A._latex_generic_point()
'\left(x, y\right)'
_point_class(*args, **kwds)
_point_morphism_class(*args, **kwds)
_repr_()

Return a string representation of this affine space.

EXAMPLES:

sage: AffineSpace(1, ZZ, 'x')
Affine Space of dimension 1 over Integer Ring

TESTS:

sage: AffineSpace(3, Zp(5), 'y')._repr_()
'Affine Space of dimension 3 over 5-adic Ring with capped relative precision 20'
_repr_generic_point(polys=None)

Return a string representation of the generic point corresponding to the list of polys on this affine space.

If polys is None, the representation of the generic point of the affine space is returned.

EXAMPLES:

sage: A.<x, y> = AffineSpace(2, ZZ)
sage: A._repr_generic_point([y-x^2])
'(-x^2 + y)'
sage: A._repr_generic_point()
'(x, y)'
_validate(v)

Return a valid tuple of polynomial functions on self given by v. Raise an error if v does not consist of valid functions.

EXAMPLES:

sage: A.<x, y, z> = AffineSpace(3, ZZ)
sage: A._validate([x*y-z, 1])
(x*y - z, 1)
sage: A._validate([x, y, 1/3*z])
...
ValueError: The arguments [x, y, 1/3*z] are not valid polynomial functions on this affine space
coordinate_ring()

Return the coordinate ring of this scheme, if defined.

EXAMPLES:

sage: R = AffineSpace(2, GF(9,'alpha'), 'z').coordinate_ring(); R
Multivariate Polynomial Ring in z0, z1 over Finite Field in alpha of size 3^2
sage: AffineSpace(3, R, 'x').coordinate_ring()
Multivariate Polynomial Ring in x0, x1, x2 over Multivariate Polynomial Ring in z0, z1 over Finite Field in alpha of size 3^2
ngens()

Return the number of generators of self, i.e. the number of variables in the coordinate ring of self.

EXAMPLES:

sage: AffineSpace(3, QQ).ngens()
3
sage: AffineSpace(7, ZZ).ngens()
7
projective_embedding(i=None, PP=None)

Returns a morphism from this space into an ambient projective space of the same dimension.

INPUT:

  • i - integer (default: dimension of self = last coordinate) determines which projective embedding to compute. The embedding is that which has a 1 in the i-th coordinate, numbered from 0.
  • PP - (default: None) ambient projective space, i.e., codomain of morphism; this is constructed if it is not given.

EXAMPLES:

sage: AA = AffineSpace(2, QQ, 'x')
sage: pi = AA.projective_embedding(0); pi
Scheme morphism:
  From: Affine Space of dimension 2 over Rational Field
  To:   Projective Space of dimension 2 over Rational Field
  Defn: Defined on coordinates by sending (x0, x1) to
        (1 : x0 : x1)
sage: z = AA(3,4)
sage: pi(z)
(1/4 : 3/4 : 1)
sage: pi(AA(0,2))
(1/2 : 0 : 1)
sage: pi = AA.projective_embedding(1); pi
Scheme morphism:
  From: Affine Space of dimension 2 over Rational Field
  To:   Projective Space of dimension 2 over Rational Field
  Defn: Defined on coordinates by sending (x0, x1) to
        (x0 : 1 : x1)
sage: pi(z)
(3/4 : 1/4 : 1)
sage: pi = AA.projective_embedding(2)
sage: pi(z)
(3 : 4 : 1)
rational_points(F=None)

Return the list of F-rational points on the affine space self, where F is a given finite field, or the base ring of self.

EXAMPLES:

sage: A = AffineSpace(1, GF(3))
sage: A.rational_points()
[(0), (1), (2)]
sage: A.rational_points(GF(3^2, 'b'))
[(0), (2*b), (b + 1), (b + 2), (2), (b), (2*b + 2), (2*b + 1), (1)]

sage: AffineSpace(2, ZZ).rational_points(GF(2))
[(0, 0), (1, 0), (0, 1), (1, 1)]

TESTS:

sage: AffineSpace(2, QQ).rational_points()
...
TypeError: Base ring (= Rational Field) must be a finite field.
sage: AffineSpace(1, GF(3)).rational_points(ZZ)
...
TypeError: Second argument (= Integer Ring) must be a finite field.
subscheme(X)

Return the closed subscheme defined by X.

INPUT:

  • X - a list or tuple of equations

EXAMPLES:

sage: A.<x,y> = AffineSpace(QQ, 2)
sage: X = A.subscheme([x, y^2, x*y^2]); X
Closed subscheme of Affine Space of dimension 2 over Rational Field defined by:
  x
  y^2
  x*y^2
sage: X.defining_polynomials ()
(x, y^2, x*y^2)
sage: I = X.defining_ideal(); I
Ideal (x, y^2, x*y^2) of Multivariate Polynomial Ring in x, y over Rational Field
sage: I.groebner_basis()
[y^2, x]
sage: X.dimension()
0
sage: X.base_ring()
Rational Field
sage: X.base_scheme()
Spectrum of Rational Field
sage: X.structure_morphism()
Scheme morphism:
  From: Closed subscheme of Affine Space of dimension 2 over Rational Field defined by:
  x
  y^2
  x*y^2
  To:   Spectrum of Rational Field
  Defn: Structure map
sage: X.dimension()
0
sage.schemes.generic.affine_space.is_AffineSpace(x)

Returns True if x is an affine space, i.e., an ambient space \mathbb{A}^n_R, where R is a ring and n\geq 0 is an integer.

EXAMPLES:

sage: from sage.schemes.generic.affine_space import is_AffineSpace
sage: is_AffineSpace(AffineSpace(5, names='x'))
True
sage: is_AffineSpace(AffineSpace(5, GF(9,'alpha'), names='x'))
True
sage: is_AffineSpace(Spec(ZZ))
False

Previous topic

Ambient Spaces

Next topic

Projective n space over a ring.

This Page