Enumerate points of a toric variety#

The classes here are not meant to be instantiated 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: next(iter(point_set))
[0 : 0 : 1]
sage: list(point_set)[0:5]
[[0 : 0 : 1], [1 : 0 : 0], [0 : 1 : 0], [0 : 1 : 1], [0 : 1 : 2]]
>>> from sage.all import *
>>> P2 = toric_varieties.P2(base_ring=GF(Integer(3)))
>>> point_set = P2.point_set()
>>> point_set.cardinality()
13
>>> next(iter(point_set))
[0 : 0 : 1]
>>> list(point_set)[Integer(0):Integer(5)]
[[0 : 0 : 1], [1 : 0 : 0], [0 : 1 : 0], [0 : 1 : 1], [0 : 1 : 2]]
class sage.schemes.toric.points.FiniteFieldPointEnumerator(fan, ring)[source]#

Bases: NaiveFinitePointEnumerator

cardinality()[source]#

Return the cardinality of the point set.

OUTPUT: An integer. The number of points.

EXAMPLES:

sage: fan = NormalFan(ReflexivePolytope(2, 0))
sage: X = ToricVariety(fan, base_ring=GF(7))
sage: point_set = X.point_set()
sage: ffe = point_set._finite_field_enumerator()
sage: ffe.cardinality()
21
>>> from sage.all import *
>>> fan = NormalFan(ReflexivePolytope(Integer(2), Integer(0)))
>>> X = ToricVariety(fan, base_ring=GF(Integer(7)))
>>> point_set = X.point_set()
>>> ffe = point_set._finite_field_enumerator()
>>> ffe.cardinality()
21
cone_points_iter()[source]#

Iterate over the open torus orbits and yield distinct points.

OUTPUT:

For each open torus orbit (cone): A triple consisting of the cone, the nonzero homogeneous coordinates in that orbit (list of integers), and the nonzero log coordinates of distinct points as a cokernel.

EXAMPLES:

sage: fan = NormalFan(ReflexivePolytope(2, 0))
sage: X = ToricVariety(fan, base_ring=GF(7))
sage: point_set = X.point_set()
sage: ffe = point_set._finite_field_enumerator()
sage: cpi = ffe.cone_points_iter()
sage: cone, nonzero_points, cokernel = list(cpi)[5]
sage: cone
1-d cone of Rational polyhedral fan in 2-d lattice N
sage: cone.ambient_ray_indices()
(2,)
sage: nonzero_points
[0, 1]
sage: cokernel
Finitely generated module V/W over Integer Ring with invariants (2)
sage: list(cokernel)
[(0), (1)]
sage: [p.lift() for p in cokernel]
[(0, 0), (0, 1)]
>>> from sage.all import *
>>> fan = NormalFan(ReflexivePolytope(Integer(2), Integer(0)))
>>> X = ToricVariety(fan, base_ring=GF(Integer(7)))
>>> point_set = X.point_set()
>>> ffe = point_set._finite_field_enumerator()
>>> cpi = ffe.cone_points_iter()
>>> cone, nonzero_points, cokernel = list(cpi)[Integer(5)]
>>> cone
1-d cone of Rational polyhedral fan in 2-d lattice N
>>> cone.ambient_ray_indices()
(2,)
>>> nonzero_points
[0, 1]
>>> cokernel
Finitely generated module V/W over Integer Ring with invariants (2)
>>> list(cokernel)
[(0), (1)]
>>> [p.lift() for p in cokernel]
[(0, 0), (0, 1)]
exp(powers)[source]#

Return the component-wise exp of z

INPUT:

  • powers – a list/tuple/iterable of integers.

OUTPUT:

Tuple of finite field elements. The powers of the multiplicative_generator().

EXAMPLES:

sage: # needs sage.rings.finite_rings
sage: F.<a> = GF(5^2)
sage: point_set = toric_varieties.P2_123(base_ring=F).point_set()
sage: ffe = point_set._finite_field_enumerator()
sage: powers = list(range(24))
sage: ffe.exp(powers)
(1, a, a + 3, 4*a + 3, 2*a + 2, 4*a + 1, 2, 2*a, 2*a + 1, 3*a + 1,
 4*a + 4, 3*a + 2, 4, 4*a, 4*a + 2, a + 2, 3*a + 3, a + 4, 3, 3*a,
 3*a + 4, 2*a + 4, a + 1, 2*a + 3)
sage: ffe.log(ffe.exp(powers)) == tuple(powers)
True
>>> from sage.all import *
>>> # needs sage.rings.finite_rings
>>> F = GF(Integer(5)**Integer(2), names=('a',)); (a,) = F._first_ngens(1)
>>> point_set = toric_varieties.P2_123(base_ring=F).point_set()
>>> ffe = point_set._finite_field_enumerator()
>>> powers = list(range(Integer(24)))
>>> ffe.exp(powers)
(1, a, a + 3, 4*a + 3, 2*a + 2, 4*a + 1, 2, 2*a, 2*a + 1, 3*a + 1,
 4*a + 4, 3*a + 2, 4, 4*a, 4*a + 2, a + 2, 3*a + 3, a + 4, 3, 3*a,
 3*a + 4, 2*a + 4, a + 1, 2*a + 3)
>>> ffe.log(ffe.exp(powers)) == tuple(powers)
True
log(z)[source]#

Return the component-wise log of z

INPUT:

  • z – a list/tuple/iterable of non-zero finite field elements.

OUTPUT:

Tuple of integers. The logarithm with base the multiplicative_generator().

EXAMPLES:

sage: # needs sage.rings.finite_rings
sage: F.<a> = GF(5^2)
sage: point_set = toric_varieties.P2_123(base_ring=F).point_set()
sage: ffe = point_set._finite_field_enumerator()
sage: z = tuple(a^i for i in range(25));  z
(1, a, a + 3, 4*a + 3, 2*a + 2, 4*a + 1, 2, 2*a, 2*a + 1, 3*a + 1,
 4*a + 4, 3*a + 2, 4, 4*a, 4*a + 2, a + 2, 3*a + 3, a + 4, 3, 3*a,
 3*a + 4, 2*a + 4, a + 1, 2*a + 3, 1)
sage: ffe.log(z)
(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
 17, 18, 19, 20, 21, 22, 23, 0)
sage: ffe.exp(ffe.log(z)) == z
True
sage: ffe.log(ffe.exp(range(24))) == tuple(range(24))
True
>>> from sage.all import *
>>> # needs sage.rings.finite_rings
>>> F = GF(Integer(5)**Integer(2), names=('a',)); (a,) = F._first_ngens(1)
>>> point_set = toric_varieties.P2_123(base_ring=F).point_set()
>>> ffe = point_set._finite_field_enumerator()
>>> z = tuple(a**i for i in range(Integer(25)));  z
(1, a, a + 3, 4*a + 3, 2*a + 2, 4*a + 1, 2, 2*a, 2*a + 1, 3*a + 1,
 4*a + 4, 3*a + 2, 4, 4*a, 4*a + 2, a + 2, 3*a + 3, a + 4, 3, 3*a,
 3*a + 4, 2*a + 4, a + 1, 2*a + 3, 1)
>>> ffe.log(z)
(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
 17, 18, 19, 20, 21, 22, 23, 0)
>>> ffe.exp(ffe.log(z)) == z
True
>>> ffe.log(ffe.exp(range(Integer(24)))) == tuple(range(Integer(24)))
True
multiplicative_generator()[source]#

Return the multiplicative generator of the finite field.

OUTPUT: A finite field element.

EXAMPLES:

sage: point_set = toric_varieties.P2(base_ring=GF(5^2, 'a')).point_set()    # needs sage.rings.finite_rings
sage: ffe = point_set._finite_field_enumerator()                            # needs sage.rings.finite_rings
sage: ffe.multiplicative_generator()                                        # needs sage.rings.finite_rings
a
>>> from sage.all import *
>>> point_set = toric_varieties.P2(base_ring=GF(Integer(5)**Integer(2), 'a')).point_set()    # needs sage.rings.finite_rings
>>> ffe = point_set._finite_field_enumerator()                            # needs sage.rings.finite_rings
>>> ffe.multiplicative_generator()                                        # needs sage.rings.finite_rings
a
multiplicative_group_order()[source]#

EXAMPLES:

sage: class Foo:
....:     def __init__(self, x):
....:         self._x = x
....:     @cached_method
....:     def f(self):
....:         return self._x^2
sage: a = Foo(2)
sage: print(a.f.cache)
None
sage: a.f()
4
sage: a.f.cache
4
>>> from sage.all import *
>>> class Foo:
...     def __init__(self, x):
...         self._x = x
...     @cached_method
...     def f(self):
...         return self._x**Integer(2)
>>> a = Foo(Integer(2))
>>> print(a.f.cache)
None
>>> a.f()
4
>>> a.f.cache
4
rescaling_log_generators()[source]#

Return the log generators of rescalings().

OUTPUT:

A tuple containing the logarithms (see log()) of the generators of the multiplicative group of rescalings().

EXAMPLES:

sage: point_set = toric_varieties.P2_123(base_ring=GF(5)).point_set()
sage: ffe = point_set._finite_field_enumerator()
sage: ffe.rescalings()
((1, 1, 1), (1, 4, 4), (4, 2, 3), (4, 3, 2))
sage: list(map(ffe.log, ffe.rescalings()))
[(0, 0, 0), (0, 2, 2), (2, 1, 3), (2, 3, 1)]
sage: ffe.rescaling_log_generators()
((2, 3, 1),)
>>> from sage.all import *
>>> point_set = toric_varieties.P2_123(base_ring=GF(Integer(5))).point_set()
>>> ffe = point_set._finite_field_enumerator()
>>> ffe.rescalings()
((1, 1, 1), (1, 4, 4), (4, 2, 3), (4, 3, 2))
>>> list(map(ffe.log, ffe.rescalings()))
[(0, 0, 0), (0, 2, 2), (2, 1, 3), (2, 3, 1)]
>>> ffe.rescaling_log_generators()
((2, 3, 1),)
root_generator(n)[source]#

Return a generator for roots().

INPUT:

  • n integer.

OUTPUT: A multiplicative generator for roots().

EXAMPLES:

sage: point_set = toric_varieties.P2(base_ring=GF(5)).point_set()
sage: ffe = point_set._finite_field_enumerator()
sage: ffe.root_generator(2)
4
sage: ffe.root_generator(3)
1
sage: ffe.root_generator(4)
2
>>> from sage.all import *
>>> point_set = toric_varieties.P2(base_ring=GF(Integer(5))).point_set()
>>> ffe = point_set._finite_field_enumerator()
>>> ffe.root_generator(Integer(2))
4
>>> ffe.root_generator(Integer(3))
1
>>> ffe.root_generator(Integer(4))
2
class sage.schemes.toric.points.FiniteFieldSubschemePointEnumerator(polynomials, ambient)[source]#

Bases: NaiveSubschemePointEnumerator

cardinality()[source]#

Return the cardinality of the point set.

OUTPUT: An integer. The number of points.

EXAMPLES:

sage: fan = NormalFan(ReflexivePolytope(2, 0))
sage: X.<u,v,w> = ToricVariety(fan, base_ring=GF(7))
sage: Y = X.subscheme(u^3 + v^3 + w^3 + u*v*w)
sage: point_set = Y.point_set()
sage: list(point_set)                                                       # needs fpylll
[[0 : 1 : 3],
 [1 : 0 : 3],
 [1 : 3 : 0],
 [1 : 1 : 6],
 [1 : 1 : 4],
 [1 : 3 : 2],
 [1 : 3 : 5]]
sage: ffe = point_set._enumerator()                                         # needs fpylll
sage: ffe.cardinality()                                                     # needs fpylll
7
>>> from sage.all import *
>>> fan = NormalFan(ReflexivePolytope(Integer(2), Integer(0)))
>>> X = ToricVariety(fan, base_ring=GF(Integer(7)), names=('u', 'v', 'w',)); (u, v, w,) = X._first_ngens(3)
>>> Y = X.subscheme(u**Integer(3) + v**Integer(3) + w**Integer(3) + u*v*w)
>>> point_set = Y.point_set()
>>> list(point_set)                                                       # needs fpylll
[[0 : 1 : 3],
 [1 : 0 : 3],
 [1 : 3 : 0],
 [1 : 1 : 6],
 [1 : 1 : 4],
 [1 : 3 : 2],
 [1 : 3 : 5]]
>>> ffe = point_set._enumerator()                                         # needs fpylll
>>> ffe.cardinality()                                                     # needs fpylll
7
homogeneous_coordinates(log_t, nonzero_coordinates, cokernel)[source]#

Convert the log of inhomogeneous coordinates back to homogeneous coordinates

INPUT:

  • log_t – log of inhomogeneous coordinates of a point.

  • nonzero_coordinates – the nonzero homogeneous coordinates in the patch.

  • cokernel – the logs of the nonzero coordinates of all distinct points as a cokernel. See FiniteFieldPointEnumerator.cone_points_iter().

OUTPUT:

The same point, but as a tuple of homogeneous coordinates.

EXAMPLES:

sage: P2.<x,y,z> = toric_varieties.P2(base_ring=GF(7))
sage: X = P2.subscheme([x^3 + 2*y^3 + 3*z^3, x*y*z + x*y^2])
sage: point_set = X.point_set()
sage: ffe = point_set._enumerator()
sage: cone, nonzero_coordinates, cokernel = list(ffe.ambient.cone_points_iter())[5]
sage: cone.ambient_ray_indices(), nonzero_coordinates
((2,), [0, 1])
sage: ffe.homogeneous_coordinates([0], nonzero_coordinates, cokernel)
(1, 1, 0)
sage: ffe.homogeneous_coordinates([1], nonzero_coordinates, cokernel)
(1, 3, 0)
sage: ffe.homogeneous_coordinates([2], nonzero_coordinates, cokernel)
(1, 2, 0)
>>> from sage.all import *
>>> P2 = toric_varieties.P2(base_ring=GF(Integer(7)), names=('x', 'y', 'z',)); (x, y, z,) = P2._first_ngens(3)
>>> X = P2.subscheme([x**Integer(3) + Integer(2)*y**Integer(3) + Integer(3)*z**Integer(3), x*y*z + x*y**Integer(2)])
>>> point_set = X.point_set()
>>> ffe = point_set._enumerator()
>>> cone, nonzero_coordinates, cokernel = list(ffe.ambient.cone_points_iter())[Integer(5)]
>>> cone.ambient_ray_indices(), nonzero_coordinates
((2,), [0, 1])
>>> ffe.homogeneous_coordinates([Integer(0)], nonzero_coordinates, cokernel)
(1, 1, 0)
>>> ffe.homogeneous_coordinates([Integer(1)], nonzero_coordinates, cokernel)
(1, 3, 0)
>>> ffe.homogeneous_coordinates([Integer(2)], nonzero_coordinates, cokernel)
(1, 2, 0)
inhomogeneous_equations(ring, nonzero_coordinates, cokernel)[source]#

Inhomogenize the defining polynomials

INPUT:

  • ring – the polynomial ring for inhomogeneous coordinates.

  • nonzero_coordinates – list of integers. The indices of the non-zero homogeneous coordinates in the patch.

  • cokernel – the logs of the nonzero coordinates of all distinct points as a cokernel. See FiniteFieldPointEnumerator.cone_points_iter().

EXAMPLES:

sage: R.<s> = QQ[]
sage: P2.<x,y,z> = toric_varieties.P2(base_ring=GF(7))
sage: X = P2.subscheme([x^3 + 2*y^3 + 3*z^3, x*y*z + x*y^2])
sage: point_set = X.point_set()
sage: ffe = point_set._enumerator()
sage: cone, nonzero_coordinates, cokernel = list(ffe.ambient.cone_points_iter())[5]
sage: cone.ambient_ray_indices(), nonzero_coordinates
((2,), [0, 1])
sage: ffe.inhomogeneous_equations(R, nonzero_coordinates, cokernel)
[2*s^3 + 1, s^2]
>>> from sage.all import *
>>> R = QQ['s']; (s,) = R._first_ngens(1)
>>> P2 = toric_varieties.P2(base_ring=GF(Integer(7)), names=('x', 'y', 'z',)); (x, y, z,) = P2._first_ngens(3)
>>> X = P2.subscheme([x**Integer(3) + Integer(2)*y**Integer(3) + Integer(3)*z**Integer(3), x*y*z + x*y**Integer(2)])
>>> point_set = X.point_set()
>>> ffe = point_set._enumerator()
>>> cone, nonzero_coordinates, cokernel = list(ffe.ambient.cone_points_iter())[Integer(5)]
>>> cone.ambient_ray_indices(), nonzero_coordinates
((2,), [0, 1])
>>> ffe.inhomogeneous_equations(R, nonzero_coordinates, cokernel)
[2*s^3 + 1, s^2]
solutions(inhomogeneous_equations, log_range)[source]#

Parallel version of solutions_serial()

INPUT/OUTPUT:

Same as solutions_serial(), except that the output points are in random order. Order depends on the number of processors and relative speed of separate processes.

EXAMPLES:

sage: R.<s> = GF(7)[]
sage: P2.<x,y,z> = toric_varieties.P2(base_ring=GF(7))
sage: X = P2.subscheme(1)
sage: point_set = X.point_set()
sage: ffe = point_set._enumerator()
sage: ffe.solutions([s^2 - 1, s^6 - s^2], [range(6)])
<generator object ...solutions at 0x...>
sage: sorted(_)
[(0,), (3,)]
>>> from sage.all import *
>>> R = GF(Integer(7))['s']; (s,) = R._first_ngens(1)
>>> P2 = toric_varieties.P2(base_ring=GF(Integer(7)), names=('x', 'y', 'z',)); (x, y, z,) = P2._first_ngens(3)
>>> X = P2.subscheme(Integer(1))
>>> point_set = X.point_set()
>>> ffe = point_set._enumerator()
>>> ffe.solutions([s**Integer(2) - Integer(1), s**Integer(6) - s**Integer(2)], [range(Integer(6))])
<generator object ...solutions at 0x...>
>>> sorted(_)
[(0,), (3,)]
solutions_serial(inhomogeneous_equations, log_range)[source]#

Iterate over solutions in a range.

INPUT:

  • inhomogeneous_equations – list/tuple/iterable of inhomogeneous equations (i.e. output from inhomogeneous_equations()).

  • log_range – list/tuple/iterable of integer ranges. One for each inhomogeneous coordinate. The logarithms of the homogeneous coordinates.

OUTPUT:

All solutions (as tuple of log inhomogeneous coordinates) in the Cartesian product of the ranges.

EXAMPLES:

sage: R.<s> = GF(7)[]
sage: P2.<x,y,z> = toric_varieties.P2(base_ring=GF(7))
sage: X = P2.subscheme(1)
sage: point_set = X.point_set()
sage: ffe = point_set._enumerator()
sage: ffe.solutions_serial([s^2 - 1, s^6 - s^2], [range(6)])
<generator object ...solutions_serial at 0x...>
sage: list(_)
[(0,), (3,)]
>>> from sage.all import *
>>> R = GF(Integer(7))['s']; (s,) = R._first_ngens(1)
>>> P2 = toric_varieties.P2(base_ring=GF(Integer(7)), names=('x', 'y', 'z',)); (x, y, z,) = P2._first_ngens(3)
>>> X = P2.subscheme(Integer(1))
>>> point_set = X.point_set()
>>> ffe = point_set._enumerator()
>>> ffe.solutions_serial([s**Integer(2) - Integer(1), s**Integer(6) - s**Integer(2)], [range(Integer(6))])
<generator object ...solutions_serial at 0x...>
>>> list(_)
[(0,), (3,)]
class sage.schemes.toric.points.InfinitePointEnumerator(fan, ring)[source]#

Bases: object

Point enumerator for infinite fields.

INPUT:

  • fan – fan of the toric variety.

  • ring – infinite base ring over which to enumerate points.

class sage.schemes.toric.points.NaiveFinitePointEnumerator(fan, ring)[source]#

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: next(iter(n))
(0, 0, 1)
>>> from sage.all import *
>>> from sage.schemes.toric.points import NaiveFinitePointEnumerator
>>> fan = toric_varieties.P2().fan()
>>> n = NaiveFinitePointEnumerator(fan, GF(Integer(3)))
>>> next(iter(n))
(0, 0, 1)
cone_iter()[source]#

Iterate over all cones of the fan

OUTPUT:

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

EXAMPLES:

sage: dP6 = toric_varieties.dP6(base_ring=GF(11))
sage: ne = dP6.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,)
()
>>> from sage.all import *
>>> dP6 = toric_varieties.dP6(base_ring=GF(Integer(11)))
>>> ne = dP6.point_set()._naive_enumerator()
>>> 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()[source]#

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: P2 = toric_varieties.P2(base_ring=GF(2))
sage: ni = P2.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: P1xP1 = toric_varieties.P1xP1(base_ring=GF(2))
sage: ni = P1xP1.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)]
>>> from sage.all import *
>>> P2 = toric_varieties.P2(base_ring=GF(Integer(2)))
>>> ni = P2.point_set()._naive_enumerator()
>>> 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)]

>>> P1xP1 = toric_varieties.P1xP1(base_ring=GF(Integer(2)))
>>> ni = P1xP1.point_set()._naive_enumerator()
>>> 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)]
orbit(point)[source]#

Return the orbit of homogeneous coordinates under rescalings.

OUTPUT:

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

EXAMPLES:

sage: P2_123 = toric_varieties.P2_123(base_ring=GF(7))
sage: ne = P2_123.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)]
>>> from sage.all import *
>>> P2_123 = toric_varieties.P2_123(base_ring=GF(Integer(7)))
>>> ne = P2_123.point_set()._naive_enumerator()
>>> sorted(ne.orbit([Integer(1), Integer(0), Integer(0)]))
[(1, 0, 0), (2, 0, 0), (4, 0, 0)]
>>> sorted(ne.orbit([Integer(0), Integer(1), Integer(0)]))
[(0, 1, 0), (0, 6, 0)]
>>> sorted(ne.orbit([Integer(0), Integer(0), Integer(1)]))
[(0, 0, 1), (0, 0, 2), (0, 0, 3), (0, 0, 4), (0, 0, 5), (0, 0, 6)]
>>> sorted(ne.orbit([Integer(1), Integer(1), Integer(0)]))
[(1, 1, 0), (1, 6, 0), (2, 1, 0), (2, 6, 0), (4, 1, 0), (4, 6, 0)]
rays()[source]#

Return all rays (real and virtual).

OUTPUT: Tuple of rays of the fan.

EXAMPLES:

sage: from sage.schemes.toric.points import NaiveFinitePointEnumerator
sage: fan = toric_varieties.torus(2).fan()
sage: fan.rays()
Empty collection
in 2-d lattice N
sage: n = NaiveFinitePointEnumerator(fan, GF(3))
sage: n.rays()
N(1, 0),
N(0, 1)
in 2-d lattice N
>>> from sage.all import *
>>> from sage.schemes.toric.points import NaiveFinitePointEnumerator
>>> fan = toric_varieties.torus(Integer(2)).fan()
>>> fan.rays()
Empty collection
in 2-d lattice N
>>> n = NaiveFinitePointEnumerator(fan, GF(Integer(3)))
>>> n.rays()
N(1, 0),
N(0, 1)
in 2-d lattice N
rescalings()[source]#

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: P2_123 = toric_varieties.P2_123(base_ring=GF(5))
sage: ni = P2_123.point_set()._naive_enumerator()
sage: ni.rescalings()
((1, 1, 1), (1, 4, 4), (4, 2, 3), (4, 3, 2))

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

sage: P1xP1 = toric_varieties.P1xP1(base_ring=GF(3))
sage: ni = P1xP1.point_set()._naive_enumerator()
sage: ni.rescalings()
((1, 1, 1, 1), (1, 1, 2, 2), (2, 2, 1, 1), (2, 2, 2, 2))
>>> from sage.all import *
>>> P2_123 = toric_varieties.P2_123(base_ring=GF(Integer(5)))
>>> ni = P2_123.point_set()._naive_enumerator()
>>> ni.rescalings()
((1, 1, 1), (1, 4, 4), (4, 2, 3), (4, 3, 2))

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

>>> P1xP1 = toric_varieties.P1xP1(base_ring=GF(Integer(3)))
>>> ni = P1xP1.point_set()._naive_enumerator()
>>> ni.rescalings()
((1, 1, 1, 1), (1, 1, 2, 2), (2, 2, 1, 1), (2, 2, 2, 2))
roots(n)[source]#

Return the n-th roots in the base field

INPUT:

  • n integer.

OUTPUT:

Tuple containing all n-th roots (not only the primitive ones). In particular, 1 is included.

EXAMPLES:

sage: P2 = toric_varieties.P2(base_ring=GF(5))
sage: ne = P2.point_set()._naive_enumerator()
sage: ne.roots(2)
(1, 4)
sage: ne.roots(3)
(1,)
sage: ne.roots(4)
(1, 2, 3, 4)
>>> from sage.all import *
>>> P2 = toric_varieties.P2(base_ring=GF(Integer(5)))
>>> ne = P2.point_set()._naive_enumerator()
>>> ne.roots(Integer(2))
(1, 4)
>>> ne.roots(Integer(3))
(1,)
>>> ne.roots(Integer(4))
(1, 2, 3, 4)
units()[source]#

Return the units in the base field.

EXAMPLES:

sage: P2 = toric_varieties.P2(base_ring=GF(5))
sage: ne = P2.point_set()._naive_enumerator()
sage: ne.units()
(1, 2, 3, 4)
>>> from sage.all import *
>>> P2 = toric_varieties.P2(base_ring=GF(Integer(5)))
>>> ne = P2.point_set()._naive_enumerator()
>>> ne.units()
(1, 2, 3, 4)
class sage.schemes.toric.points.NaiveSubschemePointEnumerator(polynomials, ambient)[source]#

Bases: object

Point enumerator for algebraic subschemes of toric varieties.

INPUT:

  • polynomials – list/tuple/iterable of polynomials. The defining polynomials.

  • ambient – enumerator for ambient space points.