Projective \(n\) space over a ring¶
EXAMPLES:
We construct projective space over various rings of various dimensions.
The simplest projective space:
sage: ProjectiveSpace(0)
Projective Space of dimension 0 over Integer Ring
A slightly bigger projective space over \(\QQ\):
sage: X = ProjectiveSpace(1000, QQ); X
Projective Space of dimension 1000 over Rational Field
sage: X.dimension()
1000
We can use “over” notation to create projective spaces over various base rings.
sage: X = ProjectiveSpace(5)/QQ; X
Projective Space of dimension 5 over Rational Field
sage: X/CC
Projective Space of dimension 5 over Complex Field with 53 bits of precision
The third argument specifies the printing names of the generators of the homogenous coordinate ring. Using the method \(.objgens()\) you can obtain both the space and the generators as ready to use variables.
sage: P2, vars = ProjectiveSpace(10, QQ, 't').objgens()
sage: vars
(t0, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10)
You can alternatively use the special syntax with <
and >
.
sage: P2.<x,y,z> = ProjectiveSpace(2, QQ)
sage: P2
Projective Space of dimension 2 over Rational Field
sage: P2.coordinate_ring()
Multivariate Polynomial Ring in x, y, z over Rational Field
The first of the three lines above is just equivalent to the two lines:
sage: P2 = ProjectiveSpace(2, QQ, 'xyz')
sage: x,y,z = P2.gens()
For example, we use \(x,y,z\) to define the intersection of two lines.
sage: V = P2.subscheme([x+y+z, x+y-z]); V
Closed subscheme of Projective Space of dimension 2 over Rational Field defined by:
x + y + z,
x + y - z
sage: V.dimension()
0
AUTHORS:
- Ben Hutz: (June 2012): support for rings
- Ben Hutz (9/2014): added support for Cartesian products
- Rebecca Lauren Miller (March 2016) : added point_transformation_matrix
-
sage.schemes.projective.projective_space.
ProjectiveSpace
(n, R=None, names='x')¶ Return projective space of dimension
n
over the ringR
.EXAMPLES: The dimension and ring can be given in either order.
sage: ProjectiveSpace(3, QQ) Projective Space of dimension 3 over Rational Field sage: ProjectiveSpace(5, QQ) Projective Space of dimension 5 over Rational Field sage: P = ProjectiveSpace(2, QQ, names='XYZ'); P Projective Space of dimension 2 over Rational Field sage: P.coordinate_ring() Multivariate Polynomial Ring in X, Y, Z over Rational Field
The divide operator does base extension.
sage: ProjectiveSpace(5)/GF(17) Projective Space of dimension 5 over Finite Field of size 17
The default base ring is \(\ZZ\).
sage: ProjectiveSpace(5) Projective Space of dimension 5 over Integer Ring
There is also an projective space associated each polynomial ring.
sage: R = GF(7)['x,y,z'] sage: P = ProjectiveSpace(R); P Projective Space of dimension 2 over Finite Field of size 7 sage: P.coordinate_ring() Multivariate Polynomial Ring in x, y, z over Finite Field of size 7 sage: P.coordinate_ring() is R True
sage: ProjectiveSpace(3, Zp(5), 'y') Projective Space of dimension 3 over 5-adic Ring with capped relative precision 20
sage: ProjectiveSpace(2,QQ,'x,y,z') Projective Space of dimension 2 over Rational Field
sage: PS.<x,y>=ProjectiveSpace(1,CC) sage: PS Projective Space of dimension 1 over Complex Field with 53 bits of precision
sage: R.<x,y,z> = QQ[] sage: ProjectiveSpace(R).variable_names() ('x', 'y', 'z')
Projective spaces are not cached, i.e., there can be several with the same base ring and dimension (to facilitate gluing constructions).
sage: R.<x> = QQ[] sage: ProjectiveSpace(R) Projective Space of dimension 0 over Rational Field
-
class
sage.schemes.projective.projective_space.
ProjectiveSpace_field
(n, R=Integer Ring, names=None)¶ Bases:
sage.schemes.projective.projective_space.ProjectiveSpace_ring
-
curve
(F)¶ Return a curve defined by
F
in this projective space.INPUT:
F
– a polynomial, or a list or tuple of polynomials in the coordinate ring of this projective space.
EXAMPLES:
sage: P.<x,y,z> = ProjectiveSpace(QQ, 2) sage: P.curve([y^2 - x*z]) Projective Plane Curve over Rational Field defined by y^2 - x*z
-
point_transformation_matrix
(points_source, points_target)¶ Returns a unique element of PGL that transforms one set of points to another.
Given a projective space of degree n and a set of n+2 source points and a set of n+2 target points in the same projective space, such that no n+1 points of each set are linearly dependent finds the unique element of PGL that translates the source points to the target points.
Warning :: will not work over precision fields
INPUT:
points_source
- points in source projective space.points_target
- points in target projective space.
OUTPUT: Transformation matrix - element of PGL.
EXAMPLES:
sage: P1.<a,b,c>=ProjectiveSpace(QQ, 2) sage: points_source=[P1([1,4,1]),P1([1,2,2]),P1([3,5,1]),P1([1,-1,1])] sage: points_target=[P1([5,-2,7]),P1([3,-2,3]),P1([6,-5,9]), P1([3,6,7])] sage: m = P1.point_transformation_matrix(points_source, points_target); m [ -13/59 -128/59 -25/59] [538/177 8/59 26/177] [ -45/59 -196/59 1] sage: [P1(list(m*vector(list(points_source[i])))) == points_target[i] for i in range(4)] [True, True, True, True]
sage: P.<a,b> = ProjectiveSpace(GF(13),1) sage: points_source = [P([-6,7]), P([1,4]), P([3,2])] sage: points_target = [P([-1,2]), P([0,2]), P([-1,6])] sage: P.point_transformation_matrix(points_source, points_target) [10 4] [10 1]
sage: P.<a,b> = ProjectiveSpace(QQ,1) sage: points_source = [P([-6,-4]), P([1,4]), P([3,2])] sage: points_target = [P([-1,2]), P([0,2]), P([-7,-3])] sage: P.point_transformation_matrix(points_source, points_target) Traceback (most recent call last): ... ValueError: source points not independent
sage: P.<a,b> = ProjectiveSpace(QQ,1) sage: points_source = [P([-6,-1]), P([1,4]), P([3,2])] sage: points_target = [P([-1,2]), P([0,2]), P([-2,4])] sage: P.point_transformation_matrix(points_source, points_target) Traceback (most recent call last): ... ValueError: target points not independent
sage: P.<a,b,c>=ProjectiveSpace(QQ, 2) sage: points_source=[P([1,4,1]),P([2,-7,9]),P([3,5,1])] sage: points_target=[P([5,-2,7]),P([3,-2,3]),P([6,-5,9]),P([6,-1,1])] sage: P.point_transformation_matrix(points_source, points_target) Traceback (most recent call last): ... ValueError: incorrect number of points in source, need 4 points
sage: P.<a,b,c>=ProjectiveSpace(QQ, 2) sage: points_source=[P([1,4,1]),P([2,-7,9]),P([3,5,1]),P([1,-1,1])] sage: points_target=[P([5,-2,7]),P([3,-2,3]),P([6,-5,9]),P([6,-1,1]),P([7,8,-9])] sage: P.point_transformation_matrix(points_source, points_target) Traceback (most recent call last): ... ValueError: incorrect number of points in target, need 4 points
sage: P.<a,b,c>=ProjectiveSpace(QQ, 2) sage: P1.<x,y,z>=ProjectiveSpace(QQ, 2) sage: points_source=[P([1,4,1]),P([2,-7,9]),P([3,5,1]),P1([1,-1,1])] sage: points_target=[P([5,-2,7]),P([3,-2,3]),P([6,-5,9]),P([6,-1,1])] sage: P.point_transformation_matrix(points_source, points_target) Traceback (most recent call last): ... ValueError: source points not in self
sage: P.<a,b,c>=ProjectiveSpace(QQ, 2) sage: P1.<x,y,z>=ProjectiveSpace(QQ, 2) sage: points_source=[P([1,4,1]),P([2,-7,9]),P([3,5,1]),P([1,-1,1])] sage: points_target=[P([5,-2,7]),P([3,-2,3]),P([6,-5,9]),P1([6,-1,1])] sage: P.point_transformation_matrix(points_source, points_target) Traceback (most recent call last): ... ValueError: target points not in self
-
points_of_bounded_height
(**kwds)¶ Returns an iterator of the points in self of absolute height of at most the given bound.
Bound check is strict for the rational field. Requires self to be projective space over a number field. 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:
kwds:
bound
- a real numbertolerance
- a rational number in (0,1] used in doyle-krumm algorithm-4precision
- the precision to use for computing the elements of bounded height of number fields.
OUTPUT:
- an iterator of points in this space
EXAMPLES:
sage: P.<x,y> = ProjectiveSpace(QQ, 1) sage: sorted(list(P.points_of_bounded_height(bound=5))) [(0 : 1), (1 : -5), (1 : -4), (1 : -3), (1 : -2), (1 : -1), (1 : 0), (1 : 1), (1 : 2), (1 : 3), (1 : 4), (1 : 5), (2 : -5), (2 : -3), (2 : -1), (2 : 1), (2 : 3), (2 : 5), (3 : -5), (3 : -4), (3 : -2), (3 : -1), (3 : 1), (3 : 2), (3 : 4), (3 : 5), (4 : -5), (4 : -3), (4 : -1), (4 : 1), (4 : 3), (4 : 5), (5 : -4), (5 : -3), (5 : -2), (5 : -1), (5 : 1), (5 : 2), (5 : 3), (5 : 4)]
sage: u = QQ['u'].0 sage: P.<x,y,z> = ProjectiveSpace(NumberField(u^2 - 2, 'v'), 2) sage: len(list(P.points_of_bounded_height(bound=1.5, tolerance=0.1))) 57
-
subscheme_from_Chow_form
(Ch, dim)¶ Returns the subscheme defined by the Chow equations associated to the Chow form
Ch
.These equations define the subscheme set-theoretically, but only for smooth subschemes and hypersurfaces do they define the subscheme as a scheme.
ALGORITHM:
The Chow form is a polynomial in the Plucker coordinates. The Plucker coordinates are the bracket polynomials. We first re-write the Chow form in terms of the dual Plucker coordinates. Then we expand \(Ch(span(p,L)\) for a generic point \(p\) and a generic linear subspace \(L\). The coefficients as polynomials in the coordinates of \(p\) are the equations defining the subscheme. [DalbecSturmfels].
INPUT:
Ch
- a homogeneous polynomial.dim
- the dimension of the associated scheme.
OUTPUT: a projective subscheme.
EXAMPLES:
sage: P = ProjectiveSpace(QQ, 4, 'z') sage: R.<x0,x1,x2,x3,x4> = PolynomialRing(QQ) sage: H = x1^2 + x2^2 + 5*x3*x4 sage: P.subscheme_from_Chow_form(H,3) Closed subscheme of Projective Space of dimension 4 over Rational Field defined by: -5*z0*z1 + z2^2 + z3^2
sage: P = ProjectiveSpace(QQ, 3, 'z') sage: R.<x0,x1,x2,x3,x4,x5> = PolynomialRing(QQ) sage: H = x1-x2-x3+x5+2*x0 sage: P.subscheme_from_Chow_form(H, 1) Closed subscheme of Projective Space of dimension 3 over Rational Field defined by: -z1 + z3, z0 + z2 + z3, -z1 - 2*z3, -z0 - z1 + 2*z2
sage: P.<x0,x1,x2,x3> = ProjectiveSpace(GF(7), 3) sage: X = P.subscheme([x3^2+x1*x2,x2-x0]) sage: Ch = X.Chow_form();Ch t0^2 - 2*t0*t3 + t3^2 - t2*t4 - t4*t5 sage: Y = P.subscheme_from_Chow_form(Ch, 1); Y Closed subscheme of Projective Space of dimension 3 over Finite Field of size 7 defined by: x1*x2 + x3^2, -x0*x2 + x2^2, -x0*x1 - x1*x2 - 2*x3^2, x0^2 - x0*x2, x0*x1 + x3^2, -2*x0*x3 + 2*x2*x3, 2*x0*x3 - 2*x2*x3, x0^2 - 2*x0*x2 + x2^2 sage: I = Y.defining_ideal() sage: I.saturation(I.ring().ideal(list(I.ring().gens())))[0] Ideal (x0 - x2, x1*x2 + x3^2) of Multivariate Polynomial Ring in x0, x1, x2, x3 over Finite Field of size 7
-
-
class
sage.schemes.projective.projective_space.
ProjectiveSpace_finite_field
(n, R=Integer Ring, names=None)¶ Bases:
sage.schemes.projective.projective_space.ProjectiveSpace_field
-
rational_points
(F=None)¶ Return the list of
F
-rational points on this projective space, whereF
is a given finite field, or the base ring of this space.EXAMPLES:
sage: P = ProjectiveSpace(1, GF(3)) sage: P.rational_points() [(0 : 1), (1 : 1), (2 : 1), (1 : 0)] sage: P.rational_points(GF(3^2, 'b')) [(0 : 1), (b : 1), (b + 1 : 1), (2*b + 1 : 1), (2 : 1), (2*b : 1), (2*b + 2 : 1), (b + 2 : 1), (1 : 1), (1 : 0)]
-
rational_points_dictionary
()¶ Return dictionary of points.
OUTPUT:
- dictionary
EXAMPLES:
sage: P1 = ProjectiveSpace(GF(7),1,'x') sage: P1.rational_points_dictionary() {(0 : 1): 0, (1 : 0): 7, (1 : 1): 1, (2 : 1): 2, (3 : 1): 3, (4 : 1): 4, (5 : 1): 5, (6 : 1): 6}
-
-
class
sage.schemes.projective.projective_space.
ProjectiveSpace_rational_field
(n, R=Integer Ring, names=None)¶ Bases:
sage.schemes.projective.projective_space.ProjectiveSpace_field
-
rational_points
(bound=0)¶ - Returns the projective points \((x_0:\cdots:x_n)\) over \(\QQ\) with \(|x_i| \leq\) bound.
ALGORITHM:
The very simple algorithm works as follows: every point \((x_0:\cdots:x_n)\) in projective space has a unique largest index \(i\) for which \(x_i\) is not zero. The algorithm then iterates downward on this index. We normalize by choosing \(x_i\) positive. Then, the points \(x_0,\ldots,x_{i-1}\) are the points of affine \(i\)-space that are relatively prime to \(x_i\). We access these by using the Tuples method.
INPUT:
bound
- integer.
EXAMPLES:
sage: PP = ProjectiveSpace(0, QQ) sage: PP.rational_points(1) [(1)] sage: PP = ProjectiveSpace(1, QQ) sage: PP.rational_points(2) [(-2 : 1), (-1 : 1), (0 : 1), (1 : 1), (2 : 1), (-1/2 : 1), (1/2 : 1), (1 : 0)] sage: PP = ProjectiveSpace(2, QQ) sage: PP.rational_points(2) [(-2 : -2 : 1), (-1 : -2 : 1), (0 : -2 : 1), (1 : -2 : 1), (2 : -2 : 1), (-2 : -1 : 1), (-1 : -1 : 1), (0 : -1 : 1), (1 : -1 : 1), (2 : -1 : 1), (-2 : 0 : 1), (-1 : 0 : 1), (0 : 0 : 1), (1 : 0 : 1), (2 : 0 : 1), (-2 : 1 : 1), (-1 : 1 : 1), (0 : 1 : 1), (1 : 1 : 1), (2 : 1 : 1), (-2 : 2 : 1), (-1 : 2 : 1), (0 : 2 : 1), (1 : 2 : 1), (2 : 2 : 1), (-1/2 : -1 : 1), (1/2 : -1 : 1), (-1 : -1/2 : 1), (-1/2 : -1/2 : 1), (0 : -1/2 : 1), (1/2 : -1/2 : 1), (1 : -1/2 : 1), (-1/2 : 0 : 1), (1/2 : 0 : 1), (-1 : 1/2 : 1), (-1/2 : 1/2 : 1), (0 : 1/2 : 1), (1/2 : 1/2 : 1), (1 : 1/2 : 1), (-1/2 : 1 : 1), (1/2 : 1 : 1), (-2 : 1 : 0), (-1 : 1 : 0), (0 : 1 : 0), (1 : 1 : 0), (2 : 1 : 0), (-1/2 : 1 : 0), (1/2 : 1 : 0), (1 : 0 : 0)]
AUTHORS:
- Benjamin Antieau (2008-01-12)
-
-
sage.schemes.projective.projective_space.
ProjectiveSpace_ring
¶ Projective space of dimension \(n\) over the ring \(R\).
EXAMPLES:
sage: X.<x,y,z,w> = ProjectiveSpace(3, QQ) sage: X.base_scheme() Spectrum of Rational Field sage: X.base_ring() Rational Field sage: X.structure_morphism() Scheme morphism: From: Projective Space of dimension 3 over Rational Field To: Spectrum of Rational Field Defn: Structure map sage: X.coordinate_ring() Multivariate Polynomial Ring in x, y, z, w over Rational Field
Loading and saving:
sage: loads(X.dumps()) == X True sage: P = ProjectiveSpace(ZZ, 1, 'x') sage: loads(P.dumps()) is P True
Equality and hashing:
sage: ProjectiveSpace(QQ, 3, 'a') == ProjectiveSpace(ZZ, 3, 'a') False sage: ProjectiveSpace(ZZ, 1, 'a') == ProjectiveSpace(ZZ, 0, 'a') False sage: ProjectiveSpace(ZZ, 2, 'a') == AffineSpace(ZZ, 2, 'a') False sage: ProjectiveSpace(QQ, 3, 'a') != ProjectiveSpace(ZZ, 3, 'a') True sage: ProjectiveSpace(ZZ, 1, 'a') != ProjectiveSpace(ZZ, 0, 'a') True sage: ProjectiveSpace(ZZ, 2, 'a') != AffineSpace(ZZ, 2, 'a') True sage: hash(ProjectiveSpace(QQ, 3, 'a')) == hash(ProjectiveSpace(ZZ, 3, 'a')) False sage: hash(ProjectiveSpace(ZZ, 1, 'a')) == hash(ProjectiveSpace(ZZ, 0, 'a')) False sage: hash(ProjectiveSpace(ZZ, 2, 'a')) == hash(AffineSpace(ZZ, 2, 'a')) False
-
sage.schemes.projective.projective_space.
is_ProjectiveSpace
(x)¶ Return True if
x
is a projective space.In other words, if
x
is an ambient space \(\mathbb{P}^n_R\), where \(R\) is a ring and \(n\geq 0\) is an integer.EXAMPLES:
sage: from sage.schemes.projective.projective_space import is_ProjectiveSpace sage: is_ProjectiveSpace(ProjectiveSpace(5, names='x')) True sage: is_ProjectiveSpace(ProjectiveSpace(5, GF(9,'alpha'), names='x')) True sage: is_ProjectiveSpace(Spec(ZZ)) False