### Navigation

- index
- modules |
- previous |
- Schemes »

# Enumerate Points of a Toric Variety

The classes here are not meant to be instatiated manually. Instead, you should always use the methods of the `point set` of the variety.

In this module, points are always represented by tuples instead of Sage’s class for points of the toric variety. All Sage library code must then convert it to proper point objects before returning it to the user.

EXAMPLES:

    sage: P2 = toric_varieties.P2(base_ring=GF(3))
    sage: point_set = P2.point_set()
    sage: point_set.cardinality()
    13
    sage: iter(point_set).next()
    [0 : 0 : 1]
    sage: list(point_set)[0:5]
    [[0 : 0 : 1], [1 : 0 : 0], [0 : 1 : 0], [0 : 1 : 1], [0 : 1 : 2]]

class `sage.schemes.toric.points.``InfinitePointEnumerator`(fan, ring)

  Bases: `object`

  Point enumerator for infinite fields.

  INPUT:

  - `fan` – fan of the toric variety.
  - `ring` – infinite base ring over which to enumerate points.

  TESTS:

      sage: from sage.schemes.toric.points import InfinitePointEnumerator
      sage: fan = toric_varieties.P2().fan()
      sage: n = InfinitePointEnumerator(fan, QQ)
      sage: ni = iter(n)
      sage: [ni.next() for k in range(10)]
      [(0, 1, 1), (1, 1, 1), (-1, 1, 1), (1/2, 1, 1), (-1/2, 1, 1),
       (2, 1, 1), (-2, 1, 1), (1/3, 1, 1), (-1/3, 1, 1), (3, 1, 1)]

      sage: X = ToricVariety(Fan([], lattice=ZZ^0))
      sage: X.point_set().cardinality()
      1
      sage: X.base_ring().is_finite()
      False
      sage: X.point_set().list()
      ([],)

class `sage.schemes.toric.points.``NaiveFinitePointEnumerator`(fan, ring)

  Bases: `object`

  The naive point enumerator.

  This is very slow.

  INPUT:

  - `fan` – fan of the toric variety.
  - `ring` – finite base ring over which to enumerate points.

  EXAMPLES:

      sage: from sage.schemes.toric.points import NaiveFinitePointEnumerator
      sage: fan = toric_varieties.P2().fan()
      sage: n = NaiveFinitePointEnumerator(fan, GF(3))
      sage: iter(n).next()
      (0, 0, 1)

  `cone_iter`()

    Iterate over all cones of the fan

    OUTPUT:

    Iterator over the cones, starting with the high-dimensional ones.

    EXAMPLES:

        sage: ne = toric_varieties.dP6(base_ring=GF(11)).point_set()._naive_enumerator()
        sage: for cone in ne.cone_iter():
        ....:     print cone.ambient_ray_indices()
        (0, 1)
        (1, 2)
        (2, 3)
        (3, 4)
        (4, 5)
        (0, 5)
        (0,)
        (1,)
        (2,)
        (3,)
        (4,)
        (5,)
        ()

  `coordinate_iter`()

    Iterate over all distinct homogeneous coordinates.

    This method does NOT identify homogeneous coordinates that are equivalent by a homogeneous rescaling.

    OUTPUT:

    An iterator over the points.

    EXAMPLES:

        sage: F2 = GF(2)
        sage: ni = toric_varieties.P2(base_ring=F2).point_set()._naive_enumerator()
        sage: list(ni.coordinate_iter())
        [(0, 0, 1), (1, 0, 0), (0, 1, 0), (0, 1, 1), (1, 0, 1), (1, 1, 0), (1, 1, 1)]

        sage: ni = toric_varieties.P1xP1(base_ring=F2).point_set()._naive_enumerator()
        sage: list(ni.coordinate_iter())
        [(0, 1, 0, 1), (1, 0, 0, 1), (1, 0, 1, 0),
         (0, 1, 1, 0), (0, 1, 1, 1), (1, 0, 1, 1),
         (1, 1, 0, 1), (1, 1, 1, 0), (1, 1, 1, 1)]

    TESTS:

        sage: V = ToricVariety(Fan([Cone([(1,1)])]), base_ring=GF(3))
        sage: ni = V.point_set()._naive_enumerator()
        sage: list(ni.coordinate_iter())
        [(0, 1), (0, 2), (1, 1), (1, 2), (2, 1), (2, 2)]

  `orbit`(point)

    Return the orbit of homogeneous coordinates under rescalings.

    OUTPUT:

    The set of all homogeneous coordinates that are equivalent to `point`.

    EXAMPLES:

        sage: ne = toric_varieties.P2_123(base_ring=GF(7)).point_set()._naive_enumerator()
        sage: sorted(ne.orbit([1, 0, 0]))
        [(1, 0, 0), (2, 0, 0), (4, 0, 0)]
        sage: sorted(ne.orbit([0, 1, 0]))
        [(0, 1, 0), (0, 6, 0)]
        sage: sorted(ne.orbit([0, 0, 1]))
        [(0, 0, 1), (0, 0, 2), (0, 0, 3), (0, 0, 4), (0, 0, 5), (0, 0, 6)]
        sage: sorted(ne.orbit([1, 1, 0]))
        [(1, 1, 0), (1, 6, 0), (2, 1, 0), (2, 6, 0), (4, 1, 0), (4, 6, 0)]

  `rescalings`()

    Return the rescalings of homogeneous coordinates.

    OUTPUT:

    A tuple containing all points that are equivalent to \([1:1:\dots:1]\), the distinguished point of the big torus orbit.

    EXAMPLES:

        sage: ni = toric_varieties.P2_123(base_ring=GF(5)).point_set()._naive_enumerator()
        sage: ni.rescalings()
        ((1, 1, 1), (1, 4, 4), (4, 2, 3), (4, 3, 2))

        sage: ni = toric_varieties.dP8(base_ring=GF(3)).point_set()._naive_enumerator()
        sage: ni.rescalings()
        ((1, 1, 1, 1), (1, 2, 2, 2), (2, 1, 2, 1), (2, 2, 1, 2))

        sage: ni = toric_varieties.P1xP1(base_ring=GF(3)).point_set()._naive_enumerator()
        sage: ni.rescalings()
        ((1, 1, 1, 1), (1, 1, 2, 2), (2, 2, 1, 1), (2, 2, 2, 2))

  `roots`(n)

    Return the n-th roots in the base field

    EXAMPLES:

        sage: ne = toric_varieties.P2(base_ring=GF(5)).point_set()._naive_enumerator()
        sage: ne.roots(2)
        (1, 4)
        sage: ne.roots(3)
        (1,)
        sage: ne.roots(4)
        (1, 2, 3, 4)

  `units`()

    Return the units in the base field.

    EXAMPLES:

        sage: ne = toric_varieties.P2(base_ring=GF(5)).point_set()._naive_enumerator()
        sage: ne.units()
        (1, 2, 3, 4)

### Navigation

- index
- modules |
- previous |
- Schemes »