Set of homomorphisms between two affine schemes

For schemes \(X\) and \(Y\), this module implements the set of morphisms \(Hom(X,Y)\). This is done by SchemeHomset_generic.

As a special case, the Hom-sets can also represent the points of a scheme. Recall that the \(K\)-rational points of a scheme \(X\) over \(k\) can be identified with the set of morphisms \(Spec(K) \to X\). In Sage the rational points are implemented by such scheme morphisms. This is done by SchemeHomset_points and its subclasses.

Note

You should not create the Hom-sets manually. Instead, use the Hom() method that is inherited by all schemes.

AUTHORS:

  • William Stein (2006): initial version.
class sage.schemes.affine.affine_homset.SchemeHomset_points_affine(X, Y, category=None, check=True, base=Integer Ring)

Bases: sage.schemes.generic.homset.SchemeHomset_points

Set of rational points of an affine variety.

INPUT:

See SchemeHomset_generic.

EXAMPLES:

sage: from sage.schemes.affine.affine_homset import SchemeHomset_points_affine
sage: SchemeHomset_points_affine(Spec(QQ), AffineSpace(ZZ,2))
Set of rational points of Affine Space of dimension 2 over Rational Field
points(**kwds)

Return some or all rational points of an affine scheme.

Over a finite field, all points are returned. Over an infinite field, all points satisfying the bound are returned. For a zero-dimensional subscheme, all points are returned regardless of whether the field is infinite or not.

For number fields, this uses the Doyle-Krumm algorithm 4 (algorithm 5 for imaginary quadratic) for computing algebraic numbers up to a given height [Doyle-Krumm].

The algorithm requires floating point arithmetic, so the user is allowed to specify the precision for such calculations. Additionally, due to floating point issues, points slightly larger than the bound may be returned. This can be controlled by lowering the tolerance.

INPUT:

  • bound - a real number
  • tolerance - a rational number in (0,1] used in doyle-krumm algorithm-4
  • precision - the precision to use for computing the elements of bounded height of number fields.

OUTPUT:

  • a list of rational points of a affine scheme

EXAMPLES: The bug reported at #11526 is fixed:

sage: A2 = AffineSpace(ZZ, 2)
sage: F = GF(3)
sage: A2(F).points()
[(0, 0), (0, 1), (0, 2), (1, 0), (1, 1), (1, 2), (2, 0), (2, 1), (2, 2)]

sage: R = ZZ
sage: A.<x,y> = R[]
sage: I = A.ideal(x^2-y^2-1)
sage: V = AffineSpace(R, 2)
sage: X = V.subscheme(I)
sage: M = X(R)
sage: M.points(bound=1)
[(-1, 0), (1, 0)]
sage: u = QQ['u'].0
sage: K.<v> = NumberField(u^2 + 3)
sage: A.<x,y> = AffineSpace(K, 2)
sage: len(A(K).points(bound=2))
1849
sage: A.<x,y> = AffineSpace(QQ, 2)
sage: E = A.subscheme([x^2 + y^2 - 1, y^2 - x^3 + x^2 + x - 1])
sage: E(A.base_ring()).points()
[(-1, 0), (0, -1), (0, 1), (1, 0)]
class sage.schemes.affine.affine_homset.SchemeHomset_points_spec(X, Y, category=None, check=True, base=None)

Bases: sage.schemes.generic.homset.SchemeHomset_generic

Set of rational points of an affine variety.

INPUT:

See SchemeHomset_generic.

EXAMPLES:

sage: from sage.schemes.affine.affine_homset import SchemeHomset_points_spec
sage: SchemeHomset_points_spec(Spec(QQ), Spec(QQ))
Set of rational points of Spectrum of Rational Field