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
>>> from sage.all import *
>>> ProjectiveSpace(Integer(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
>>> from sage.all import *
>>> X = ProjectiveSpace(Integer(1000), QQ); X
Projective Space of dimension 1000 over Rational Field
>>> 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 # needs sage.rings.real_mpfr
Projective Space of dimension 5 over Complex Field with 53 bits of precision
>>> from sage.all import *
>>> X = ProjectiveSpace(Integer(5))/QQ; X
Projective Space of dimension 5 over Rational Field
>>> X/CC # needs sage.rings.real_mpfr
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
homogeneous 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)
>>> from sage.all import *
>>> P2, vars = ProjectiveSpace(Integer(10), QQ, 't').objgens()
>>> 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
>>> from sage.all import *
>>> P2 = ProjectiveSpace(Integer(2), QQ, names=('x', 'y', 'z',)); (x, y, z,) = P2._first_ngens(3)
>>> P2
Projective Space of dimension 2 over Rational Field
>>> 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()
>>> from sage.all import *
>>> P2 = ProjectiveSpace(Integer(2), QQ, 'xyz')
>>> 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() # needs sage.libs.singular
0
>>> from sage.all import *
>>> 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
>>> V.dimension() # needs sage.libs.singular
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=None)[source]#
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
>>> from sage.all import * >>> ProjectiveSpace(Integer(3), QQ) Projective Space of dimension 3 over Rational Field >>> ProjectiveSpace(Integer(5), QQ) Projective Space of dimension 5 over Rational Field >>> P = ProjectiveSpace(Integer(2), QQ, names='XYZ'); P Projective Space of dimension 2 over Rational Field >>> 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
>>> from sage.all import * >>> ProjectiveSpace(Integer(5))/GF(Integer(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
>>> from sage.all import * >>> ProjectiveSpace(Integer(5)) Projective Space of dimension 5 over Integer Ring
There is also a 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
>>> from sage.all import * >>> R = GF(Integer(7))['x,y,z'] >>> P = ProjectiveSpace(R); P Projective Space of dimension 2 over Finite Field of size 7 >>> P.coordinate_ring() Multivariate Polynomial Ring in x, y, z over Finite Field of size 7 >>> P.coordinate_ring() is R True
sage: ProjectiveSpace(3, Zp(5), 'y') # needs sage.rings.padics Projective Space of dimension 3 over 5-adic Ring with capped relative precision 20
>>> from sage.all import * >>> ProjectiveSpace(Integer(3), Zp(Integer(5)), 'y') # needs sage.rings.padics 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
>>> from sage.all import * >>> ProjectiveSpace(Integer(2), QQ, 'x,y,z') Projective Space of dimension 2 over Rational Field
sage: PS.<x,y> = ProjectiveSpace(1, CC); PS # needs sage.rings.real_mpfr Projective Space of dimension 1 over Complex Field with 53 bits of precision
>>> from sage.all import * >>> PS = ProjectiveSpace(Integer(1), CC, names=('x', 'y',)); (x, y,) = PS._first_ngens(2); PS # needs sage.rings.real_mpfr 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')
>>> from sage.all import * >>> R = QQ['x, y, z']; (x, y, z,) = R._first_ngens(3) >>> 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
>>> from sage.all import * >>> R = QQ['x']; (x,) = R._first_ngens(1) >>> ProjectiveSpace(R) Projective Space of dimension 0 over Rational Field
- class sage.schemes.projective.projective_space.ProjectiveSpace_field(n, R=Integer Ring, names=None)[source]#
Bases:
ProjectiveSpace_ring
- curve(F)[source]#
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]) # needs sage.schemes Projective Plane Curve over Rational Field defined by y^2 - x*z
>>> from sage.all import * >>> P = ProjectiveSpace(QQ, Integer(2), names=('x', 'y', 'z',)); (x, y, z,) = P._first_ngens(3) >>> P.curve([y**Integer(2) - x*z]) # needs sage.schemes Projective Plane Curve over Rational Field defined by y^2 - x*z
- line_through(p, q)[source]#
Return the line through
p
andq
.INPUT:
p
,q
– distinct rational points of the projective space
EXAMPLES:
sage: P3.<x0,x1,x2,x3> = ProjectiveSpace(3, QQ) sage: p1 = P3(1, 2, 3, 4) sage: p2 = P3(4, 3, 2, 1) sage: P3.line_through(p1, p2) # needs sage.libs.singular sage.schemes Projective Curve over Rational Field defined by -5/4*x0 + 5/2*x1 - 5/4*x2, -5/2*x0 + 15/4*x1 - 5/4*x3, -5/4*x0 + 15/4*x2 - 5/2*x3, -5/4*x1 + 5/2*x2 - 5/4*x3 sage: p3 = P3(2,4,6,8) sage: P3.line_through(p1, p3) Traceback (most recent call last): ... ValueError: not distinct points
>>> from sage.all import * >>> P3 = ProjectiveSpace(Integer(3), QQ, names=('x0', 'x1', 'x2', 'x3',)); (x0, x1, x2, x3,) = P3._first_ngens(4) >>> p1 = P3(Integer(1), Integer(2), Integer(3), Integer(4)) >>> p2 = P3(Integer(4), Integer(3), Integer(2), Integer(1)) >>> P3.line_through(p1, p2) # needs sage.libs.singular sage.schemes Projective Curve over Rational Field defined by -5/4*x0 + 5/2*x1 - 5/4*x2, -5/2*x0 + 15/4*x1 - 5/4*x3, -5/4*x0 + 15/4*x2 - 5/2*x3, -5/4*x1 + 5/2*x2 - 5/4*x3 >>> p3 = P3(Integer(2),Integer(4),Integer(6),Integer(8)) >>> P3.line_through(p1, p3) Traceback (most recent call last): ... ValueError: not distinct points
- subscheme_from_Chow_form(Ch, dim)[source]#
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) # needs sage.modules Closed subscheme of Projective Space of dimension 4 over Rational Field defined by: -5*z0*z1 + z2^2 + z3^2
>>> from sage.all import * >>> P = ProjectiveSpace(QQ, Integer(4), 'z') >>> R = PolynomialRing(QQ, names=('x0', 'x1', 'x2', 'x3', 'x4',)); (x0, x1, x2, x3, x4,) = R._first_ngens(5) >>> H = x1**Integer(2) + x2**Integer(2) + Integer(5)*x3*x4 >>> P.subscheme_from_Chow_form(H, Integer(3)) # needs sage.modules 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) # needs sage.modules 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
>>> from sage.all import * >>> P = ProjectiveSpace(QQ, Integer(3), 'z') >>> R = PolynomialRing(QQ, names=('x0', 'x1', 'x2', 'x3', 'x4', 'x5',)); (x0, x1, x2, x3, x4, x5,) = R._first_ngens(6) >>> H = x1 - x2 - x3 + x5 + Integer(2)*x0 >>> P.subscheme_from_Chow_form(H, Integer(1)) # needs sage.modules 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: # needs sage.libs.singular 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
>>> from sage.all import * >>> # needs sage.libs.singular >>> P = ProjectiveSpace(GF(Integer(7)), Integer(3), names=('x0', 'x1', 'x2', 'x3',)); (x0, x1, x2, x3,) = P._first_ngens(4) >>> X = P.subscheme([x3**Integer(2) + x1*x2, x2 - x0]) >>> Ch = X.Chow_form(); Ch t0^2 - 2*t0*t3 + t3^2 - t2*t4 - t4*t5 >>> Y = P.subscheme_from_Chow_form(Ch, Integer(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 >>> I = Y.defining_ideal() >>> I.saturation(I.ring().ideal(list(I.ring().gens())))[Integer(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)[source]#
Bases:
ProjectiveSpace_field
- rational_points(F=None)[source]#
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: sorted(P.rational_points(GF(3^2, 'b')), key=str) # needs sage.rings.finite_rings [(0 : 1), (1 : 0), (1 : 1), (2 : 1), (2*b + 1 : 1), (2*b + 2 : 1), (2*b : 1), (b + 1 : 1), (b + 2 : 1), (b : 1)]
>>> from sage.all import * >>> P = ProjectiveSpace(Integer(1), GF(Integer(3))) >>> P.rational_points() [(0 : 1), (1 : 1), (2 : 1), (1 : 0)] >>> sorted(P.rational_points(GF(Integer(3)**Integer(2), 'b')), key=str) # needs sage.rings.finite_rings [(0 : 1), (1 : 0), (1 : 1), (2 : 1), (2*b + 1 : 1), (2*b + 2 : 1), (2*b : 1), (b + 1 : 1), (b + 2 : 1), (b : 1)]
- rational_points_dictionary()[source]#
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}
>>> from sage.all import * >>> P1 = ProjectiveSpace(GF(Integer(7)), Integer(1), 'x') >>> 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)[source]#
Bases:
ProjectiveSpace_field
- rational_points(bound=0)[source]#
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)]
>>> from sage.all import * >>> PP = ProjectiveSpace(Integer(0), QQ) >>> PP.rational_points(Integer(1)) [(1)] >>> PP = ProjectiveSpace(Integer(1), QQ) >>> PP.rational_points(Integer(2)) [(-2 : 1), (-1 : 1), (0 : 1), (1 : 1), (2 : 1), (-1/2 : 1), (1/2 : 1), (1 : 0)] >>> PP = ProjectiveSpace(Integer(2), QQ) >>> PP.rational_points(Integer(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)
- class sage.schemes.projective.projective_space.ProjectiveSpace_ring(n, R=Integer Ring, names=None)[source]#
Bases:
UniqueRepresentation
,AmbientSpace
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
>>> from sage.all import * >>> X = ProjectiveSpace(Integer(3), QQ, names=('x', 'y', 'z', 'w',)); (x, y, z, w,) = X._first_ngens(4) >>> X.base_scheme() Spectrum of Rational Field >>> X.base_ring() Rational Field >>> X.structure_morphism() Scheme morphism: From: Projective Space of dimension 3 over Rational Field To: Spectrum of Rational Field Defn: Structure map >>> 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
>>> from sage.all import * >>> loads(X.dumps()) == X True >>> P = ProjectiveSpace(ZZ, Integer(1), 'x') >>> 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
>>> from sage.all import * >>> ProjectiveSpace(QQ, Integer(3), 'a') == ProjectiveSpace(ZZ, Integer(3), 'a') False >>> ProjectiveSpace(ZZ, Integer(1), 'a') == ProjectiveSpace(ZZ, Integer(0), 'a') False >>> ProjectiveSpace(ZZ, Integer(2), 'a') == AffineSpace(ZZ, Integer(2), 'a') False >>> ProjectiveSpace(QQ, Integer(3), 'a') != ProjectiveSpace(ZZ, Integer(3), 'a') True >>> ProjectiveSpace(ZZ, Integer(1), 'a') != ProjectiveSpace(ZZ, Integer(0), 'a') True >>> ProjectiveSpace(ZZ, Integer(2), 'a') != AffineSpace(ZZ, Integer(2), 'a') True >>> hash(ProjectiveSpace(QQ, Integer(3), 'a')) == hash(ProjectiveSpace(ZZ, Integer(3), 'a')) False >>> hash(ProjectiveSpace(ZZ, Integer(1), 'a')) == hash(ProjectiveSpace(ZZ, Integer(0), 'a')) False >>> hash(ProjectiveSpace(ZZ, Integer(2), 'a')) == hash(AffineSpace(ZZ, Integer(2), 'a')) False
- Lattes_map(E, m)[source]#
Given an elliptic curve
E
and an integerm
return the Lattes map associated to multiplication by \(m\).In other words, the rational map on the quotient \(E/\{\pm 1\} \cong \mathbb{P}^1\) associated to \([m]:E \to E\).
INPUT:
E
– an elliptic curve.m
– an integer.
OUTPUT: a dynamical system on this projective space.
EXAMPLES:
sage: P.<x,y> = ProjectiveSpace(QQ, 1) sage: E = EllipticCurve(QQ,[-1, 0]) # needs sage.schemes sage: P.Lattes_map(E, 2) # needs sage.schemes Dynamical System of Projective Space of dimension 1 over Rational Field Defn: Defined on coordinates by sending (x : y) to (1/4*x^4 + 1/2*x^2*y^2 + 1/4*y^4 : x^3*y - x*y^3)
>>> from sage.all import * >>> P = ProjectiveSpace(QQ, Integer(1), names=('x', 'y',)); (x, y,) = P._first_ngens(2) >>> E = EllipticCurve(QQ,[-Integer(1), Integer(0)]) # needs sage.schemes >>> P.Lattes_map(E, Integer(2)) # needs sage.schemes Dynamical System of Projective Space of dimension 1 over Rational Field Defn: Defined on coordinates by sending (x : y) to (1/4*x^4 + 1/2*x^2*y^2 + 1/4*y^4 : x^3*y - x*y^3)
- affine_patch(i, AA=None)[source]#
Return the \(i^{th}\) affine patch of this projective space.
This is an ambient affine space \(\mathbb{A}^n_R,\) where \(R\) is the base ring of
self
, whose “projective embedding” map is \(1\) in the \(i^{th}\) factor.INPUT:
i
– integer between 0 and dimension ofself
, inclusive.AA
– (default: None) ambient affine space, this is constructed if it is not given.
OUTPUT:
An ambient affine space with fixed projective_embedding map.
EXAMPLES:
sage: PP = ProjectiveSpace(5) / QQ sage: AA = PP.affine_patch(2) sage: AA Affine Space of dimension 5 over Rational Field sage: AA.projective_embedding() Scheme morphism: From: Affine Space of dimension 5 over Rational Field To: Projective Space of dimension 5 over Rational Field Defn: Defined on coordinates by sending (x0, x1, x3, x4, x5) to (x0 : x1 : 1 : x3 : x4 : x5) sage: AA.projective_embedding(0) Scheme morphism: From: Affine Space of dimension 5 over Rational Field To: Projective Space of dimension 5 over Rational Field Defn: Defined on coordinates by sending (x0, x1, x3, x4, x5) to (1 : x0 : x1 : x3 : x4 : x5)
>>> from sage.all import * >>> PP = ProjectiveSpace(Integer(5)) / QQ >>> AA = PP.affine_patch(Integer(2)) >>> AA Affine Space of dimension 5 over Rational Field >>> AA.projective_embedding() Scheme morphism: From: Affine Space of dimension 5 over Rational Field To: Projective Space of dimension 5 over Rational Field Defn: Defined on coordinates by sending (x0, x1, x3, x4, x5) to (x0 : x1 : 1 : x3 : x4 : x5) >>> AA.projective_embedding(Integer(0)) Scheme morphism: From: Affine Space of dimension 5 over Rational Field To: Projective Space of dimension 5 over Rational Field Defn: Defined on coordinates by sending (x0, x1, x3, x4, x5) to (1 : x0 : x1 : x3 : x4 : x5)
sage: P.<x,y> = ProjectiveSpace(QQ, 1) sage: P.affine_patch(0).projective_embedding(0).codomain() == P True
>>> from sage.all import * >>> P = ProjectiveSpace(QQ, Integer(1), names=('x', 'y',)); (x, y,) = P._first_ngens(2) >>> P.affine_patch(Integer(0)).projective_embedding(Integer(0)).codomain() == P True
- cartesian_product(other)[source]#
Return the Cartesian product of this projective space and
other
.INPUT:
other
– A projective space with the same base ring as this space.
OUTPUT:
A Cartesian product of projective spaces.
EXAMPLES:
sage: P1 = ProjectiveSpace(QQ, 1, 'x') sage: P2 = ProjectiveSpace(QQ, 2, 'y') sage: PP = P1.cartesian_product(P2); PP Product of projective spaces P^1 x P^2 over Rational Field sage: PP.gens() (x0, x1, y0, y1, y2)
>>> from sage.all import * >>> P1 = ProjectiveSpace(QQ, Integer(1), 'x') >>> P2 = ProjectiveSpace(QQ, Integer(2), 'y') >>> PP = P1.cartesian_product(P2); PP Product of projective spaces P^1 x P^2 over Rational Field >>> PP.gens() (x0, x1, y0, y1, y2)
- change_ring(R)[source]#
Return a projective space over ring
R
.INPUT:
R
– commutative ring or morphism.
OUTPUT:
projective space over
R
.
Note
There is no need to have any relation between
R
and the base ring of this space, if you want to have such a relation, useself.base_extend(R)
instead.EXAMPLES:
sage: P.<x, y, z> = ProjectiveSpace(2, ZZ) sage: PQ = P.change_ring(QQ); PQ Projective Space of dimension 2 over Rational Field sage: PQ.change_ring(GF(5)) Projective Space of dimension 2 over Finite Field of size 5
>>> from sage.all import * >>> P = ProjectiveSpace(Integer(2), ZZ, names=('x', 'y', 'z',)); (x, y, z,) = P._first_ngens(3) >>> PQ = P.change_ring(QQ); PQ Projective Space of dimension 2 over Rational Field >>> PQ.change_ring(GF(Integer(5))) Projective Space of dimension 2 over Finite Field of size 5
sage: K.<w> = QuadraticField(2) # needs sage.rings.number_field sage: P = ProjectiveSpace(K, 2, 't') # needs sage.rings.number_field sage: P.change_ring(K.embeddings(QQbar)[0]) # needs sage.rings.number_field Projective Space of dimension 2 over Algebraic Field
>>> from sage.all import * >>> K = QuadraticField(Integer(2), names=('w',)); (w,) = K._first_ngens(1)# needs sage.rings.number_field >>> P = ProjectiveSpace(K, Integer(2), 't') # needs sage.rings.number_field >>> P.change_ring(K.embeddings(QQbar)[Integer(0)]) # needs sage.rings.number_field Projective Space of dimension 2 over Algebraic Field
- chebyshev_polynomial(n, kind='first', monic=False)[source]#
Generates an endomorphism of this projective line by a Chebyshev polynomial.
Chebyshev polynomials are a sequence of recursively defined orthogonal polynomials. Chebyshev of the first kind are defined as \(T_0(x) = 1\), \(T_1(x) = x\), and \(T_{n+1}(x) = 2xT_n(x) - T_{n-1}(x)\). Chebyshev of the second kind are defined as \(U_0(x) = 1\), \(U_1(x) = 2x\), and \(U_{n+1}(x) = 2xU_n(x) - U_{n-1}(x)\).
INPUT:
n
– a non-negative integer.kind
–first
orsecond
specifying which kind of chebyshev the user would like to generate. Defaults tofirst
.monic
–True
orFalse
specifying if the polynomial defining the system should be monic or not. Defaults toFalse
.
OUTPUT:
DynamicalSystem_projective
EXAMPLES:
sage: P.<x,y> = ProjectiveSpace(QQ, 1) sage: P.chebyshev_polynomial(5, 'first') # needs sage.symbolic Dynamical System of Projective Space of dimension 1 over Rational Field Defn: Defined on coordinates by sending (x : y) to (16*x^5 - 20*x^3*y^2 + 5*x*y^4 : y^5)
>>> from sage.all import * >>> P = ProjectiveSpace(QQ, Integer(1), names=('x', 'y',)); (x, y,) = P._first_ngens(2) >>> P.chebyshev_polynomial(Integer(5), 'first') # needs sage.symbolic Dynamical System of Projective Space of dimension 1 over Rational Field Defn: Defined on coordinates by sending (x : y) to (16*x^5 - 20*x^3*y^2 + 5*x*y^4 : y^5)
sage: P.<x,y> = ProjectiveSpace(QQ, 1) sage: P.chebyshev_polynomial(3, 'second') # needs sage.symbolic Dynamical System of Projective Space of dimension 1 over Rational Field Defn: Defined on coordinates by sending (x : y) to (8*x^3 - 4*x*y^2 : y^3)
>>> from sage.all import * >>> P = ProjectiveSpace(QQ, Integer(1), names=('x', 'y',)); (x, y,) = P._first_ngens(2) >>> P.chebyshev_polynomial(Integer(3), 'second') # needs sage.symbolic Dynamical System of Projective Space of dimension 1 over Rational Field Defn: Defined on coordinates by sending (x : y) to (8*x^3 - 4*x*y^2 : y^3)
sage: P.<x,y> = ProjectiveSpace(QQ, 1) sage: P.chebyshev_polynomial(3, 2) # needs sage.symbolic Traceback (most recent call last): ... ValueError: keyword 'kind' must have a value of either 'first' or 'second'
>>> from sage.all import * >>> P = ProjectiveSpace(QQ, Integer(1), names=('x', 'y',)); (x, y,) = P._first_ngens(2) >>> P.chebyshev_polynomial(Integer(3), Integer(2)) # needs sage.symbolic Traceback (most recent call last): ... ValueError: keyword 'kind' must have a value of either 'first' or 'second'
sage: P.<x,y> = ProjectiveSpace(QQ, 1) sage: P.chebyshev_polynomial(-4, 'second') Traceback (most recent call last): ... ValueError: first parameter 'n' must be a non-negative integer
>>> from sage.all import * >>> P = ProjectiveSpace(QQ, Integer(1), names=('x', 'y',)); (x, y,) = P._first_ngens(2) >>> P.chebyshev_polynomial(-Integer(4), 'second') Traceback (most recent call last): ... ValueError: first parameter 'n' must be a non-negative integer
sage: P = ProjectiveSpace(QQ, 2, 'x') sage: P.chebyshev_polynomial(2) Traceback (most recent call last): ... TypeError: projective space must be of dimension 1
>>> from sage.all import * >>> P = ProjectiveSpace(QQ, Integer(2), 'x') >>> P.chebyshev_polynomial(Integer(2)) Traceback (most recent call last): ... TypeError: projective space must be of dimension 1
sage: P.<x,y> = ProjectiveSpace(QQ, 1) sage: P.chebyshev_polynomial(3, monic=True) # needs sage.symbolic Dynamical System of Projective Space of dimension 1 over Rational Field Defn: Defined on coordinates by sending (x : y) to (x^3 - 3*x*y^2 : y^3)
>>> from sage.all import * >>> P = ProjectiveSpace(QQ, Integer(1), names=('x', 'y',)); (x, y,) = P._first_ngens(2) >>> P.chebyshev_polynomial(Integer(3), monic=True) # needs sage.symbolic Dynamical System of Projective Space of dimension 1 over Rational Field Defn: Defined on coordinates by sending (x : y) to (x^3 - 3*x*y^2 : y^3)
sage: F.<t> = FunctionField(QQ) sage: P.<y,z> = ProjectiveSpace(F, 1) sage: P.chebyshev_polynomial(4, monic=True) # needs sage.symbolic Dynamical System of Projective Space of dimension 1 over Rational function field in t over Rational Field Defn: Defined on coordinates by sending (y : z) to (y^4 + (-4)*y^2*z^2 + 2*z^4 : z^4)
>>> from sage.all import * >>> F = FunctionField(QQ, names=('t',)); (t,) = F._first_ngens(1) >>> P = ProjectiveSpace(F, Integer(1), names=('y', 'z',)); (y, z,) = P._first_ngens(2) >>> P.chebyshev_polynomial(Integer(4), monic=True) # needs sage.symbolic Dynamical System of Projective Space of dimension 1 over Rational function field in t over Rational Field Defn: Defined on coordinates by sending (y : z) to (y^4 + (-4)*y^2*z^2 + 2*z^4 : z^4)
- coordinate_ring()[source]#
Return the coordinate ring of this scheme.
EXAMPLES:
sage: ProjectiveSpace(3, GF(19^2,'alpha'), 'abcd').coordinate_ring() # needs sage.rings.finite_rings Multivariate Polynomial Ring in a, b, c, d over Finite Field in alpha of size 19^2
>>> from sage.all import * >>> ProjectiveSpace(Integer(3), GF(Integer(19)**Integer(2),'alpha'), 'abcd').coordinate_ring() # needs sage.rings.finite_rings Multivariate Polynomial Ring in a, b, c, d over Finite Field in alpha of size 19^2
sage: ProjectiveSpace(3).coordinate_ring() Multivariate Polynomial Ring in x0, x1, x2, x3 over Integer Ring
>>> from sage.all import * >>> ProjectiveSpace(Integer(3)).coordinate_ring() Multivariate Polynomial Ring in x0, x1, x2, x3 over Integer Ring
sage: ProjectiveSpace(2, QQ, ['alpha', 'beta', 'gamma']).coordinate_ring() Multivariate Polynomial Ring in alpha, beta, gamma over Rational Field
>>> from sage.all import * >>> ProjectiveSpace(Integer(2), QQ, ['alpha', 'beta', 'gamma']).coordinate_ring() Multivariate Polynomial Ring in alpha, beta, gamma over Rational Field
- hyperplane_transformation_matrix(plane_1, plane_2)[source]#
Return a PGL element sending
plane_1
toplane_2
.plane_1
andplane_2
must be hyperplanes (subschemes of codimension 1, each defined by a single linear homogeneous equation).INPUT:
plane_1
,plane_2
– hyperplanes of this projective space
OUTPUT: An element of PGL
EXAMPLES:
sage: P.<x,y> = ProjectiveSpace(QQ, 1) sage: plane1 = P.subscheme(x) sage: plane2 = P.subscheme(y) sage: m = P.hyperplane_transformation_matrix(plane1, plane2); m # needs sage.modules [0 1] [1 0] sage: plane2(m*P((0,1))) # needs sage.modules (1 : 0)
>>> from sage.all import * >>> P = ProjectiveSpace(QQ, Integer(1), names=('x', 'y',)); (x, y,) = P._first_ngens(2) >>> plane1 = P.subscheme(x) >>> plane2 = P.subscheme(y) >>> m = P.hyperplane_transformation_matrix(plane1, plane2); m # needs sage.modules [0 1] [1 0] >>> plane2(m*P((Integer(0),Integer(1)))) # needs sage.modules (1 : 0)
sage: P.<x,y,z,w> = ProjectiveSpace(QQ, 3) sage: plane1 = P.subscheme(x + 2*y + z) sage: plane2 = P.subscheme(2*x + y + z) sage: P.hyperplane_transformation_matrix(plane1, plane2) # needs sage.modules [1 0 0 0] [0 4 0 0] [0 0 2 0] [0 0 0 1]
>>> from sage.all import * >>> P = ProjectiveSpace(QQ, Integer(3), names=('x', 'y', 'z', 'w',)); (x, y, z, w,) = P._first_ngens(4) >>> plane1 = P.subscheme(x + Integer(2)*y + z) >>> plane2 = P.subscheme(Integer(2)*x + y + z) >>> P.hyperplane_transformation_matrix(plane1, plane2) # needs sage.modules [1 0 0 0] [0 4 0 0] [0 0 2 0] [0 0 0 1]
sage: P.<x,y> = ProjectiveSpace(ZZ, 1) sage: plane1 = P.subscheme(x + y) sage: plane2 = P.subscheme(y) sage: P.hyperplane_transformation_matrix(plane1, plane2) # needs sage.modules [-1 0] [ 1 1]
>>> from sage.all import * >>> P = ProjectiveSpace(ZZ, Integer(1), names=('x', 'y',)); (x, y,) = P._first_ngens(2) >>> plane1 = P.subscheme(x + y) >>> plane2 = P.subscheme(y) >>> P.hyperplane_transformation_matrix(plane1, plane2) # needs sage.modules [-1 0] [ 1 1]
sage: # needs sage.rings.number_field sage: K.<v> = CyclotomicField(3) sage: P.<x,y,z> = ProjectiveSpace(K, 2) sage: plane1 = P.subscheme(x - 2*v*y + z) sage: plane2 = P.subscheme(x + v*y + v*z) sage: m = P.hyperplane_transformation_matrix(plane1, plane2); m # needs sage.modules [ v 0 0] [ 0 -2*v 0] [ 0 0 1]
>>> from sage.all import * >>> # needs sage.rings.number_field >>> K = CyclotomicField(Integer(3), names=('v',)); (v,) = K._first_ngens(1) >>> P = ProjectiveSpace(K, Integer(2), names=('x', 'y', 'z',)); (x, y, z,) = P._first_ngens(3) >>> plane1 = P.subscheme(x - Integer(2)*v*y + z) >>> plane2 = P.subscheme(x + v*y + v*z) >>> m = P.hyperplane_transformation_matrix(plane1, plane2); m # needs sage.modules [ v 0 0] [ 0 -2*v 0] [ 0 0 1]
sage: # needs sage.rings.number_field sage: R.<x> = QQ[] sage: K.<k> = NumberField(x^2 + 1) sage: P.<x,y,z,w> = ProjectiveSpace(K, 3) sage: plane1 = P.subscheme(k*x + 2*k*y + z) sage: plane2 = P.subscheme(7*k*x + y + 9*z) sage: m = P.hyperplane_transformation_matrix(plane1, plane2); m # needs sage.modules [ 1 0 0 0] [ 0 14*k 0 0] [ 0 0 7/9 0] [ 0 0 0 1]
>>> from sage.all import * >>> # needs sage.rings.number_field >>> R = QQ['x']; (x,) = R._first_ngens(1) >>> K = NumberField(x**Integer(2) + Integer(1), names=('k',)); (k,) = K._first_ngens(1) >>> P = ProjectiveSpace(K, Integer(3), names=('x', 'y', 'z', 'w',)); (x, y, z, w,) = P._first_ngens(4) >>> plane1 = P.subscheme(k*x + Integer(2)*k*y + z) >>> plane2 = P.subscheme(Integer(7)*k*x + y + Integer(9)*z) >>> m = P.hyperplane_transformation_matrix(plane1, plane2); m # needs sage.modules [ 1 0 0 0] [ 0 14*k 0 0] [ 0 0 7/9 0] [ 0 0 0 1]
sage: # needs sage.rings.number_field sage: K.<v> = CyclotomicField(3) sage: R.<t> = K[] sage: F.<w> = K.extension(t^5 + 2) sage: G.<u> = F.absolute_field() sage: P.<x,y,z> = ProjectiveSpace(G, 2) sage: plane1 = P.subscheme(x - 2*u*y + z) sage: plane2 = P.subscheme(x + u*y + z) sage: m = P.hyperplane_transformation_matrix(plane1, plane2) # needs sage.modules sage: plane2(m*P((2*u, 1, 0))) # needs sage.modules (-u : 1 : 0)
>>> from sage.all import * >>> # needs sage.rings.number_field >>> K = CyclotomicField(Integer(3), names=('v',)); (v,) = K._first_ngens(1) >>> R = K['t']; (t,) = R._first_ngens(1) >>> F = K.extension(t**Integer(5) + Integer(2), names=('w',)); (w,) = F._first_ngens(1) >>> G = F.absolute_field(names=('u',)); (u,) = G._first_ngens(1) >>> P = ProjectiveSpace(G, Integer(2), names=('x', 'y', 'z',)); (x, y, z,) = P._first_ngens(3) >>> plane1 = P.subscheme(x - Integer(2)*u*y + z) >>> plane2 = P.subscheme(x + u*y + z) >>> m = P.hyperplane_transformation_matrix(plane1, plane2) # needs sage.modules >>> plane2(m*P((Integer(2)*u, Integer(1), Integer(0)))) # needs sage.modules (-u : 1 : 0)
sage: P.<x,y,z> = ProjectiveSpace(FiniteField(2), 2) sage: plane1 = P.subscheme(x + y + z) sage: plane2 = P.subscheme(z) sage: P.hyperplane_transformation_matrix(plane1, plane2) # needs sage.modules [1 0 0] [1 1 0] [1 1 1]
>>> from sage.all import * >>> P = ProjectiveSpace(FiniteField(Integer(2)), Integer(2), names=('x', 'y', 'z',)); (x, y, z,) = P._first_ngens(3) >>> plane1 = P.subscheme(x + y + z) >>> plane2 = P.subscheme(z) >>> P.hyperplane_transformation_matrix(plane1, plane2) # needs sage.modules [1 0 0] [1 1 0] [1 1 1]
sage: R.<t> = QQ[] sage: P.<x,y,z> = ProjectiveSpace(R, 2) sage: plane1 = P.subscheme(x + 9*t*y + z) sage: plane2 = P.subscheme(x + z) sage: P.hyperplane_transformation_matrix(plane1, plane2) # needs sage.modules [ 1 9*t 0] [ 1 0 0] [ 0 0 1]
>>> from sage.all import * >>> R = QQ['t']; (t,) = R._first_ngens(1) >>> P = ProjectiveSpace(R, Integer(2), names=('x', 'y', 'z',)); (x, y, z,) = P._first_ngens(3) >>> plane1 = P.subscheme(x + Integer(9)*t*y + z) >>> plane2 = P.subscheme(x + z) >>> P.hyperplane_transformation_matrix(plane1, plane2) # needs sage.modules [ 1 9*t 0] [ 1 0 0] [ 0 0 1]
- is_linearly_independent(points, n=None)[source]#
Return whether the set of points is linearly independent.
Alternatively, specify
n
to check if every subset of sizen
is linearly independent.INPUT:
points
– a list of points in this projective space.n
– (Optional) A positive integer less than or equal to the length ofpoints
. Specifies the size of the subsets to check for linear independence.
OUTPUT:
True
ifpoints
is linearly independent,False
otherwise.
EXAMPLES:
sage: P.<x,y,z> = ProjectiveSpace(QQ, 2) sage: points = [P((1, 0, 1)), P((1, 2, 1)), P((1, 3, 4))] sage: P.is_linearly_independent(points) # needs sage.modules True
>>> from sage.all import * >>> P = ProjectiveSpace(QQ, Integer(2), names=('x', 'y', 'z',)); (x, y, z,) = P._first_ngens(3) >>> points = [P((Integer(1), Integer(0), Integer(1))), P((Integer(1), Integer(2), Integer(1))), P((Integer(1), Integer(3), Integer(4)))] >>> P.is_linearly_independent(points) # needs sage.modules True
sage: P.<x,y,z> = ProjectiveSpace(GF(5), 2) sage: points = [P((1, 0, 1)), P((1, 2, 1)), P((1, 3, 4)), P((0, 0, 1))] sage: P.is_linearly_independent(points, 2) # needs sage.modules True
>>> from sage.all import * >>> P = ProjectiveSpace(GF(Integer(5)), Integer(2), names=('x', 'y', 'z',)); (x, y, z,) = P._first_ngens(3) >>> points = [P((Integer(1), Integer(0), Integer(1))), P((Integer(1), Integer(2), Integer(1))), P((Integer(1), Integer(3), Integer(4))), P((Integer(0), Integer(0), Integer(1)))] >>> P.is_linearly_independent(points, Integer(2)) # needs sage.modules True
sage: R.<c> = QQ[] sage: P.<x,y,z> = ProjectiveSpace(R, 2) sage: points = [P((c, 0, 1)), P((0, c, 1)), P((1, 0, 4)), P((0, 0, 1))] sage: P.is_linearly_independent(points, 3) # needs sage.modules False
>>> from sage.all import * >>> R = QQ['c']; (c,) = R._first_ngens(1) >>> P = ProjectiveSpace(R, Integer(2), names=('x', 'y', 'z',)); (x, y, z,) = P._first_ngens(3) >>> points = [P((c, Integer(0), Integer(1))), P((Integer(0), c, Integer(1))), P((Integer(1), Integer(0), Integer(4))), P((Integer(0), Integer(0), Integer(1)))] >>> P.is_linearly_independent(points, Integer(3)) # needs sage.modules False
sage: R.<c> = QQ[] sage: P.<x,y,z> = ProjectiveSpace(FractionField(R), 2) sage: points = [P((c, 0, 1)), P((0, c, 1)), P((1, 3, 4)), P((0, 0, 1))] sage: P.is_linearly_independent(points, 3) # needs sage.modules True
>>> from sage.all import * >>> R = QQ['c']; (c,) = R._first_ngens(1) >>> P = ProjectiveSpace(FractionField(R), Integer(2), names=('x', 'y', 'z',)); (x, y, z,) = P._first_ngens(3) >>> points = [P((c, Integer(0), Integer(1))), P((Integer(0), c, Integer(1))), P((Integer(1), Integer(3), Integer(4))), P((Integer(0), Integer(0), Integer(1)))] >>> P.is_linearly_independent(points, Integer(3)) # needs sage.modules True
sage: # needs sage.rings.number_field sage: K.<k> = CyclotomicField(3) sage: P.<x,y,z> = ProjectiveSpace(K, 2) sage: points = [P((k, k^2, 1)), P((0, k, 1)), P((1, 0, 4)), P((0, 0, 1))] sage: P.is_linearly_independent(points, 3) # needs sage.modules True
>>> from sage.all import * >>> # needs sage.rings.number_field >>> K = CyclotomicField(Integer(3), names=('k',)); (k,) = K._first_ngens(1) >>> P = ProjectiveSpace(K, Integer(2), names=('x', 'y', 'z',)); (x, y, z,) = P._first_ngens(3) >>> points = [P((k, k**Integer(2), Integer(1))), P((Integer(0), k, Integer(1))), P((Integer(1), Integer(0), Integer(4))), P((Integer(0), Integer(0), Integer(1)))] >>> P.is_linearly_independent(points, Integer(3)) # needs sage.modules True
sage: P.<x,y> = ProjectiveSpace(QQ, 1) sage: points = [P((1, 0)), P((1, 1))] sage: P.is_linearly_independent(points) # needs sage.modules True
>>> from sage.all import * >>> P = ProjectiveSpace(QQ, Integer(1), names=('x', 'y',)); (x, y,) = P._first_ngens(2) >>> points = [P((Integer(1), Integer(0))), P((Integer(1), Integer(1)))] >>> P.is_linearly_independent(points) # needs sage.modules True
- is_projective()[source]#
Return that this ambient space is projective \(n\)-space.
EXAMPLES:
sage: ProjectiveSpace(3,QQ).is_projective() True
>>> from sage.all import * >>> ProjectiveSpace(Integer(3),QQ).is_projective() True
- ngens()[source]#
Return the number of generators of this projective space.
This is the number of variables in the coordinate ring of
self
.EXAMPLES:
sage: ProjectiveSpace(3, QQ).ngens() 4 sage: ProjectiveSpace(7, ZZ).ngens() 8
>>> from sage.all import * >>> ProjectiveSpace(Integer(3), QQ).ngens() 4 >>> ProjectiveSpace(Integer(7), ZZ).ngens() 8
- point(v, check=True)[source]#
Create a point on this projective space.
INPUT:
v
– anything that defines a pointcheck
– boolean (default:True
); whether to check the defining data for consistency
OUTPUT: A point of this projective space.
EXAMPLES:
sage: P2 = ProjectiveSpace(QQ, 2) sage: P2.point([4,5]) (4 : 5 : 1)
>>> from sage.all import * >>> P2 = ProjectiveSpace(QQ, Integer(2)) >>> P2.point([Integer(4),Integer(5)]) (4 : 5 : 1)
sage: P = ProjectiveSpace(QQ, 1) sage: P.point(infinity) (1 : 0)
>>> from sage.all import * >>> P = ProjectiveSpace(QQ, Integer(1)) >>> P.point(infinity) (1 : 0)
sage: P = ProjectiveSpace(QQ, 2) sage: P.point(infinity) Traceback (most recent call last): ... ValueError: +Infinity not well defined in dimension > 1
>>> from sage.all import * >>> P = ProjectiveSpace(QQ, Integer(2)) >>> P.point(infinity) Traceback (most recent call last): ... ValueError: +Infinity not well defined in dimension > 1
sage: P = ProjectiveSpace(ZZ, 2) sage: P.point([infinity]) Traceback (most recent call last): ... ValueError: [+Infinity] not well defined in dimension > 1
>>> from sage.all import * >>> P = ProjectiveSpace(ZZ, Integer(2)) >>> P.point([infinity]) Traceback (most recent call last): ... ValueError: [+Infinity] not well defined in dimension > 1
- point_transformation_matrix(points_source, points_target, normalize=True)[source]#
Returns a unique element of PGL that transforms one set of points to another.
Given a projective space of dimension 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 find the unique element of PGL that translates the source points to the target points.
Warning
over non-exact rings such as the ComplexField, the returned matrix could be very far from correct.
INPUT:
points_source
– points in source projective space.points_target
– points in target projective space.normalize
– (default:True
) If the returned matrix should be normalized. Only works over exact rings. If the base ring is a field, the matrix is normalized so that the last nonzero entry in the last row is 1. If the base ring is a ring, then the matrix is normalized so that the entries are elements of the base ring.
OUTPUT: Transformation matrix - element of PGL.
ALGORITHM:
See [Hutz2007], Proposition 2.16 for details.
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 # needs sage.modules [ -13/59 -128/59 -25/59] [538/177 8/59 26/177] [ -45/59 -196/59 1] sage: [m*points_source[i] == points_target[i] for i in range(4)] # needs sage.modules [True, True, True, True]
>>> from sage.all import * >>> P1 = ProjectiveSpace(QQ, Integer(2), names=('a', 'b', 'c',)); (a, b, c,) = P1._first_ngens(3) >>> points_source = [P1([Integer(1), Integer(4), Integer(1)]), P1([Integer(1), Integer(2), Integer(2)]), P1([Integer(3), Integer(5), Integer(1)]), P1([Integer(1), -Integer(1), Integer(1)])] >>> points_target = [P1([Integer(5), -Integer(2), Integer(7)]), P1([Integer(3), -Integer(2), Integer(3)]), P1([Integer(6), -Integer(5), Integer(9)]), P1([Integer(3), Integer(6), Integer(7)])] >>> m = P1.point_transformation_matrix(points_source, points_target); m # needs sage.modules [ -13/59 -128/59 -25/59] [538/177 8/59 26/177] [ -45/59 -196/59 1] >>> [m*points_source[i] == points_target[i] for i in range(Integer(4))] # needs sage.modules [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) # needs sage.modules [10 4] [10 1]
>>> from sage.all import * >>> P = ProjectiveSpace(GF(Integer(13)), Integer(1), names=('a', 'b',)); (a, b,) = P._first_ngens(2) >>> points_source = [P([-Integer(6), Integer(7)]), P([Integer(1), Integer(4)]), P([Integer(3), Integer(2)])] >>> points_target = [P([-Integer(1), Integer(2)]), P([Integer(0), Integer(2)]), P([-Integer(1), Integer(6)])] >>> P.point_transformation_matrix(points_source, points_target) # needs sage.modules [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) # needs sage.modules Traceback (most recent call last): ... ValueError: source points not independent
>>> from sage.all import * >>> P = ProjectiveSpace(QQ, Integer(1), names=('a', 'b',)); (a, b,) = P._first_ngens(2) >>> points_source = [P([-Integer(6), -Integer(4)]), P([Integer(1), Integer(4)]), P([Integer(3), Integer(2)])] >>> points_target = [P([-Integer(1), Integer(2)]), P([Integer(0), Integer(2)]), P([-Integer(7), -Integer(3)])] >>> P.point_transformation_matrix(points_source, points_target) # needs sage.modules Traceback (most recent call last): ... ValueError: source points not independent
sage: R.<t> = FunctionField(QQ) sage: P.<a,b> = ProjectiveSpace(R, 1) sage: points_source = [P([-6*t, 7]), P([1, 4]), P([3, 2])] sage: points_target = [P([-1, 2*t]), P([0, 2]), P([-1, 6])] sage: P.point_transformation_matrix(points_source, points_target) # needs sage.modules [ (1/3*t + 7/12)/(t^2 - 53/24*t) (-1/12*t - 7/48)/(t^2 - 53/24*t)] [(-2/3*t^2 - 7/36*t - 35/12)/(t^2 - 53/24*t) 1]
>>> from sage.all import * >>> R = FunctionField(QQ, names=('t',)); (t,) = R._first_ngens(1) >>> P = ProjectiveSpace(R, Integer(1), names=('a', 'b',)); (a, b,) = P._first_ngens(2) >>> points_source = [P([-Integer(6)*t, Integer(7)]), P([Integer(1), Integer(4)]), P([Integer(3), Integer(2)])] >>> points_target = [P([-Integer(1), Integer(2)*t]), P([Integer(0), Integer(2)]), P([-Integer(1), Integer(6)])] >>> P.point_transformation_matrix(points_source, points_target) # needs sage.modules [ (1/3*t + 7/12)/(t^2 - 53/24*t) (-1/12*t - 7/48)/(t^2 - 53/24*t)] [(-2/3*t^2 - 7/36*t - 35/12)/(t^2 - 53/24*t) 1]
sage: P1.<a,b,c> = ProjectiveSpace(RR, 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: P1.point_transformation_matrix(points_source, # abs tol 1e-13 # needs sage.modules ....: points_target) [-0.0619047619047597 -0.609523809523810 -0.119047619047621] [ 0.853968253968253 0.0380952380952380 0.0412698412698421] [ -0.214285714285712 -0.933333333333333 0.280952380952379]
>>> from sage.all import * >>> P1 = ProjectiveSpace(RR, Integer(2), names=('a', 'b', 'c',)); (a, b, c,) = P1._first_ngens(3) >>> points_source = [P1([Integer(1), Integer(4), Integer(1)]), P1([Integer(1), Integer(2), Integer(2)]), P1([Integer(3), Integer(5), Integer(1)]), P1([Integer(1), -Integer(1), Integer(1)])] >>> points_target = [P1([Integer(5), -Integer(2), Integer(7)]), P1([Integer(3), -Integer(2), Integer(3)]), P1([Integer(6), -Integer(5), Integer(9)]), P1([Integer(3), Integer(6), Integer(7)])] >>> P1.point_transformation_matrix(points_source, # abs tol 1e-13 # needs sage.modules ... points_target) [-0.0619047619047597 -0.609523809523810 -0.119047619047621] [ 0.853968253968253 0.0380952380952380 0.0412698412698421] [ -0.214285714285712 -0.933333333333333 0.280952380952379]
sage: P1.<a,b,c> = ProjectiveSpace(ZZ, 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: P1.point_transformation_matrix(points_source, points_target) # needs sage.modules [ -39 -384 -75] [ 538 24 26] [-135 -588 177]
>>> from sage.all import * >>> P1 = ProjectiveSpace(ZZ, Integer(2), names=('a', 'b', 'c',)); (a, b, c,) = P1._first_ngens(3) >>> points_source = [P1([Integer(1), Integer(4), Integer(1)]), P1([Integer(1), Integer(2), Integer(2)]), P1([Integer(3), Integer(5), Integer(1)]), P1([Integer(1), -Integer(1), Integer(1)])] >>> points_target = [P1([Integer(5), -Integer(2), Integer(7)]), P1([Integer(3), -Integer(2), Integer(3)]), P1([Integer(6), -Integer(5), Integer(9)]), P1([Integer(3), Integer(6), Integer(7)])] >>> P1.point_transformation_matrix(points_source, points_target) # needs sage.modules [ -39 -384 -75] [ 538 24 26] [-135 -588 177]
sage: P1.<a,b,c> = ProjectiveSpace(ZZ, 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: P1.point_transformation_matrix(points_source, points_target, # needs sage.modules ....: normalize=False) [-13/30 -64/15 -5/6] [269/45 4/15 13/45] [ -3/2 -98/15 59/30]
>>> from sage.all import * >>> P1 = ProjectiveSpace(ZZ, Integer(2), names=('a', 'b', 'c',)); (a, b, c,) = P1._first_ngens(3) >>> points_source = [P1([Integer(1), Integer(4), Integer(1)]), P1([Integer(1), Integer(2), Integer(2)]), P1([Integer(3), Integer(5), Integer(1)]), P1([Integer(1), -Integer(1), Integer(1)])] >>> points_target = [P1([Integer(5), -Integer(2), Integer(7)]), P1([Integer(3), -Integer(2), Integer(3)]), P1([Integer(6), -Integer(5), Integer(9)]), P1([Integer(3), Integer(6), Integer(7)])] >>> P1.point_transformation_matrix(points_source, points_target, # needs sage.modules ... normalize=False) [-13/30 -64/15 -5/6] [269/45 4/15 13/45] [ -3/2 -98/15 59/30]
sage: R.<t> = ZZ[] sage: P.<a,b> = ProjectiveSpace(R, 1) sage: points_source = [P([-6*t, 7]), P([1, 4]), P([3, 2])] sage: points_target = [P([-1, 2*t]), P([0, 2]), P([-1, 6])] sage: P.point_transformation_matrix(points_source, points_target) # needs sage.modules [ -48*t - 84 12*t + 21] [96*t^2 + 28*t + 420 -144*t^2 + 318*t]
>>> from sage.all import * >>> R = ZZ['t']; (t,) = R._first_ngens(1) >>> P = ProjectiveSpace(R, Integer(1), names=('a', 'b',)); (a, b,) = P._first_ngens(2) >>> points_source = [P([-Integer(6)*t, Integer(7)]), P([Integer(1), Integer(4)]), P([Integer(3), Integer(2)])] >>> points_target = [P([-Integer(1), Integer(2)*t]), P([Integer(0), Integer(2)]), P([-Integer(1), Integer(6)])] >>> P.point_transformation_matrix(points_source, points_target) # needs sage.modules [ -48*t - 84 12*t + 21] [96*t^2 + 28*t + 420 -144*t^2 + 318*t]
- points_of_bounded_height(**kwds)[source]#
Return an iterator of the points in
self
of absolute multiplicative height of at most the given bound.ALGORITHM:
This is an implementation of Algorithm 6 in [Krumm2016].
INPUT:
kwds:
bound
– a real numberprecision
– (default: 53) a positive integer
OUTPUT:
an iterator of points of bounded height
EXAMPLES:
sage: P.<x,y> = ProjectiveSpace(QQ, 1) sage: sorted(list(P.points_of_bounded_height(bound=2))) [(-2 : 1), (-1 : 1), (-1/2 : 1), (0 : 1), (1/2 : 1), (1 : 0), (1 : 1), (2 : 1)]
>>> from sage.all import * >>> P = ProjectiveSpace(QQ, Integer(1), names=('x', 'y',)); (x, y,) = P._first_ngens(2) >>> sorted(list(P.points_of_bounded_height(bound=Integer(2)))) [(-2 : 1), (-1 : 1), (-1/2 : 1), (0 : 1), (1/2 : 1), (1 : 0), (1 : 1), (2 : 1)]
sage: u = QQ['u'].0 sage: P.<x,y,z> = ProjectiveSpace(NumberField(u^2 - 2, 'v'), 2) # needs sage.rings.number_field sage: len(list(P.points_of_bounded_height(bound=2))) # needs sage.rings.number_field 265
>>> from sage.all import * >>> u = QQ['u'].gen(0) >>> P = ProjectiveSpace(NumberField(u**Integer(2) - Integer(2), 'v'), Integer(2), names=('x', 'y', 'z',)); (x, y, z,) = P._first_ngens(3)# needs sage.rings.number_field >>> len(list(P.points_of_bounded_height(bound=Integer(2)))) # needs sage.rings.number_field 265
sage: # needs sage.rings.number_field sage: CF.<a> = CyclotomicField(3) sage: R.<x> = CF[] sage: L.<l> = CF.extension(x^3 + 2) sage: Q.<x,y> = ProjectiveSpace(L, 1) sage: sorted(list(Q.points_of_bounded_height(bound=1))) [(0 : 1), (1 : 0), (a + 1 : 1), (a : 1), (-1 : 1), (-a - 1 : 1), (-a : 1), (1 : 1)]
>>> from sage.all import * >>> # needs sage.rings.number_field >>> CF = CyclotomicField(Integer(3), names=('a',)); (a,) = CF._first_ngens(1) >>> R = CF['x']; (x,) = R._first_ngens(1) >>> L = CF.extension(x**Integer(3) + Integer(2), names=('l',)); (l,) = L._first_ngens(1) >>> Q = ProjectiveSpace(L, Integer(1), names=('x', 'y',)); (x, y,) = Q._first_ngens(2) >>> sorted(list(Q.points_of_bounded_height(bound=Integer(1)))) [(0 : 1), (1 : 0), (a + 1 : 1), (a : 1), (-1 : 1), (-a - 1 : 1), (-a : 1), (1 : 1)]
sage: # needs sage.rings.number_field sage: R.<x> = QQ[] sage: F.<a> = NumberField(x^4 - 8*x^2 + 3) sage: P.<x,y,z> = ProjectiveSpace(F, 2) sage: all(exp(p.global_height()) <= 1 # needs sage.symbolic ....: for p in P.points_of_bounded_height(bound=1)) True
>>> from sage.all import * >>> # needs sage.rings.number_field >>> R = QQ['x']; (x,) = R._first_ngens(1) >>> F = NumberField(x**Integer(4) - Integer(8)*x**Integer(2) + Integer(3), names=('a',)); (a,) = F._first_ngens(1) >>> P = ProjectiveSpace(F, Integer(2), names=('x', 'y', 'z',)); (x, y, z,) = P._first_ngens(3) >>> all(exp(p.global_height()) <= Integer(1) # needs sage.symbolic ... for p in P.points_of_bounded_height(bound=Integer(1))) True
sage: K.<a> = CyclotomicField(3) # needs sage.rings.number_field sage: P.<x,y,z> = ProjectiveSpace(K, 2) # needs sage.rings.number_field sage: len(list(P.points_of_bounded_height(bound=1))) # needs sage.rings.number_field 57
>>> from sage.all import * >>> K = CyclotomicField(Integer(3), names=('a',)); (a,) = K._first_ngens(1)# needs sage.rings.number_field >>> P = ProjectiveSpace(K, Integer(2), names=('x', 'y', 'z',)); (x, y, z,) = P._first_ngens(3)# needs sage.rings.number_field >>> len(list(P.points_of_bounded_height(bound=Integer(1)))) # needs sage.rings.number_field 57
sage: u = QQ['u'].0 sage: K.<k> = NumberField(u^2 - 2) # needs sage.rings.number_field sage: P.<x,y> = ProjectiveSpace(K, 1) # needs sage.rings.number_field sage: len(list(P.points_of_bounded_height(bound=2))) # needs sage.rings.number_field 24
>>> from sage.all import * >>> u = QQ['u'].gen(0) >>> K = NumberField(u**Integer(2) - Integer(2), names=('k',)); (k,) = K._first_ngens(1)# needs sage.rings.number_field >>> P = ProjectiveSpace(K, Integer(1), names=('x', 'y',)); (x, y,) = P._first_ngens(2)# needs sage.rings.number_field >>> len(list(P.points_of_bounded_height(bound=Integer(2)))) # needs sage.rings.number_field 24
sage: R.<x> = QQ[] sage: K.<k> = NumberField(x^4 - 8*x^2 + 3) # needs sage.rings.number_field sage: P.<x,y> = ProjectiveSpace(K, 1) # needs sage.rings.number_field sage: len(list(P.points_of_bounded_height(bound=2))) # needs sage.rings.number_field 108
>>> from sage.all import * >>> R = QQ['x']; (x,) = R._first_ngens(1) >>> K = NumberField(x**Integer(4) - Integer(8)*x**Integer(2) + Integer(3), names=('k',)); (k,) = K._first_ngens(1)# needs sage.rings.number_field >>> P = ProjectiveSpace(K, Integer(1), names=('x', 'y',)); (x, y,) = P._first_ngens(2)# needs sage.rings.number_field >>> len(list(P.points_of_bounded_height(bound=Integer(2)))) # needs sage.rings.number_field 108
sage: # needs sage.rings.number_field sage: R.<x> = QQ[] sage: K.<v> = NumberField(x^5 + x^3 + 1) sage: P.<x,y,z> = ProjectiveSpace(K, 2) sage: L = P.points_of_bounded_height(bound=1.2) sage: len(list(L)) 109
>>> from sage.all import * >>> # needs sage.rings.number_field >>> R = QQ['x']; (x,) = R._first_ngens(1) >>> K = NumberField(x**Integer(5) + x**Integer(3) + Integer(1), names=('v',)); (v,) = K._first_ngens(1) >>> P = ProjectiveSpace(K, Integer(2), names=('x', 'y', 'z',)); (x, y, z,) = P._first_ngens(3) >>> L = P.points_of_bounded_height(bound=RealNumber('1.2')) >>> len(list(L)) 109
sage: # needs sage.rings.number_field sage: K.<v> = QuadraticField(2) sage: P.<x,y> = ProjectiveSpace(K, 1) sage: sorted(list(P.points_of_bounded_height(bound=2))) [(-v - 2 : 1), (-v - 1 : 1), (-2 : 1), (-1/2*v - 1 : 1), (-v : 1), (-1 : 1), (-1/2*v : 1), (v - 2 : 1), (-1/2 : 1), (-v + 1 : 1), (1/2*v - 1 : 1), (0 : 1), (-1/2*v + 1 : 1), (v - 1 : 1), (1/2 : 1), (-v + 2 : 1), (1/2*v : 1), (1 : 0), (1 : 1), (v : 1), (1/2*v + 1 : 1), (2 : 1), (v + 1 : 1), (v + 2 : 1)]
>>> from sage.all import * >>> # needs sage.rings.number_field >>> K = QuadraticField(Integer(2), names=('v',)); (v,) = K._first_ngens(1) >>> P = ProjectiveSpace(K, Integer(1), names=('x', 'y',)); (x, y,) = P._first_ngens(2) >>> sorted(list(P.points_of_bounded_height(bound=Integer(2)))) [(-v - 2 : 1), (-v - 1 : 1), (-2 : 1), (-1/2*v - 1 : 1), (-v : 1), (-1 : 1), (-1/2*v : 1), (v - 2 : 1), (-1/2 : 1), (-v + 1 : 1), (1/2*v - 1 : 1), (0 : 1), (-1/2*v + 1 : 1), (v - 1 : 1), (1/2 : 1), (-v + 2 : 1), (1/2*v : 1), (1 : 0), (1 : 1), (v : 1), (1/2*v + 1 : 1), (2 : 1), (v + 1 : 1), (v + 2 : 1)]
sage: # needs sage.rings.number_field sage: R.<x> = QQ[] sage: K.<a> = NumberField(3*x^2 + 1) sage: P.<z,w> = ProjectiveSpace(K, 1) sage: sorted(list(P.points_of_bounded_height(bound=1))) [(-1 : 1), (-3/2*a - 1/2 : 1), (3/2*a - 1/2 : 1), (0 : 1), (-3/2*a + 1/2 : 1), (3/2*a + 1/2 : 1), (1 : 0), (1 : 1)]
>>> from sage.all import * >>> # needs sage.rings.number_field >>> R = QQ['x']; (x,) = R._first_ngens(1) >>> K = NumberField(Integer(3)*x**Integer(2) + Integer(1), names=('a',)); (a,) = K._first_ngens(1) >>> P = ProjectiveSpace(K, Integer(1), names=('z', 'w',)); (z, w,) = P._first_ngens(2) >>> sorted(list(P.points_of_bounded_height(bound=Integer(1)))) [(-1 : 1), (-3/2*a - 1/2 : 1), (3/2*a - 1/2 : 1), (0 : 1), (-3/2*a + 1/2 : 1), (3/2*a + 1/2 : 1), (1 : 0), (1 : 1)]
sage: # needs sage.rings.number_field sage: R.<x> = QQ[] sage: K.<a> = NumberField(3*x^2 + 1) sage: O = K.maximal_order() sage: P.<z,w> = ProjectiveSpace(O, 1) sage: len(sorted(list(P.points_of_bounded_height(bound=2)))) 44
>>> from sage.all import * >>> # needs sage.rings.number_field >>> R = QQ['x']; (x,) = R._first_ngens(1) >>> K = NumberField(Integer(3)*x**Integer(2) + Integer(1), names=('a',)); (a,) = K._first_ngens(1) >>> O = K.maximal_order() >>> P = ProjectiveSpace(O, Integer(1), names=('z', 'w',)); (z, w,) = P._first_ngens(2) >>> len(sorted(list(P.points_of_bounded_height(bound=Integer(2))))) 44
sage: # needs sage.rings.number_field sage: R.<x> = QQ[] sage: K.<a> = NumberField(x^3 - 7) sage: O = K.maximal_order() sage: P.<z,w> = ProjectiveSpace(O, 1) sage: len(sorted(list(P.points_of_bounded_height(bound=2)))) 28
>>> from sage.all import * >>> # needs sage.rings.number_field >>> R = QQ['x']; (x,) = R._first_ngens(1) >>> K = NumberField(x**Integer(3) - Integer(7), names=('a',)); (a,) = K._first_ngens(1) >>> O = K.maximal_order() >>> P = ProjectiveSpace(O, Integer(1), names=('z', 'w',)); (z, w,) = P._first_ngens(2) >>> len(sorted(list(P.points_of_bounded_height(bound=Integer(2))))) 28
sage: P.<w,z> = ProjectiveSpace(ZZ, 1) sage: sorted(list(P.points_of_bounded_height(bound=2))) [(-2 : -1), (-2 : 1), (-1 : -2), (-1 : -1), (-1 : 0), (-1 : 1), (-1 : 2), (0 : -1)]
>>> from sage.all import * >>> P = ProjectiveSpace(ZZ, Integer(1), names=('w', 'z',)); (w, z,) = P._first_ngens(2) >>> sorted(list(P.points_of_bounded_height(bound=Integer(2)))) [(-2 : -1), (-2 : 1), (-1 : -2), (-1 : -1), (-1 : 0), (-1 : 1), (-1 : 2), (0 : -1)]
sage: R.<x> = QQ[] sage: P.<z,w> = ProjectiveSpace(R, 1) sage: P.points_of_bounded_height(bound=2) Traceback (most recent call last): ... NotImplementedError: self must be a projective space over a number field or a ring of integers
>>> from sage.all import * >>> R = QQ['x']; (x,) = R._first_ngens(1) >>> P = ProjectiveSpace(R, Integer(1), names=('z', 'w',)); (z, w,) = P._first_ngens(2) >>> P.points_of_bounded_height(bound=Integer(2)) Traceback (most recent call last): ... NotImplementedError: self must be a projective space over a number field or a ring of integers
sage: # needs sage.rings.number_field sage: K.<i> = NumberField(x^2 + 1) sage: PK.<t> = K[] sage: L.<a> = K.extension(t^4 - i) sage: P.<z,w> = ProjectiveSpace(L, 1) sage: sorted(list(P.points_of_bounded_height(bound=1))) [(0 : 1), (1 : 0), (a : 1), (a^2 : 1), (a^3 : 1), (i : 1), (i*a : 1), (i*a^2 : 1), (i*a^3 : 1), (-1 : 1), (-a : 1), (-a^2 : 1), (-a^3 : 1), (-i : 1), (-i*a : 1), (-i*a^2 : 1), (-i*a^3 : 1), (1 : 1)]
>>> from sage.all import * >>> # needs sage.rings.number_field >>> K = NumberField(x**Integer(2) + Integer(1), names=('i',)); (i,) = K._first_ngens(1) >>> PK = K['t']; (t,) = PK._first_ngens(1) >>> L = K.extension(t**Integer(4) - i, names=('a',)); (a,) = L._first_ngens(1) >>> P = ProjectiveSpace(L, Integer(1), names=('z', 'w',)); (z, w,) = P._first_ngens(2) >>> sorted(list(P.points_of_bounded_height(bound=Integer(1)))) [(0 : 1), (1 : 0), (a : 1), (a^2 : 1), (a^3 : 1), (i : 1), (i*a : 1), (i*a^2 : 1), (i*a^3 : 1), (-1 : 1), (-a : 1), (-a^2 : 1), (-a^3 : 1), (-i : 1), (-i*a : 1), (-i*a^2 : 1), (-i*a^3 : 1), (1 : 1)]
- subscheme(X)[source]#
Return the closed subscheme defined by
X
.INPUT:
X
– a list or tuple of equations.
EXAMPLES:
sage: A.<x,y,z> = ProjectiveSpace(2, QQ) sage: X = A.subscheme([x*z^2, y^2*z, x*y^2]); X Closed subscheme of Projective Space of dimension 2 over Rational Field defined by: x*z^2, y^2*z, x*y^2 sage: X.defining_polynomials () (x*z^2, y^2*z, x*y^2) sage: I = X.defining_ideal(); I Ideal (x*z^2, y^2*z, x*y^2) of Multivariate Polynomial Ring in x, y, z over Rational Field sage: I.groebner_basis() # needs sage.libs.singular [x*y^2, y^2*z, x*z^2] sage: X.dimension() # needs sage.libs.singular 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 Projective Space of dimension 2 over Rational Field defined by: x*z^2, y^2*z, x*y^2 To: Spectrum of Rational Field Defn: Structure map
>>> from sage.all import * >>> A = ProjectiveSpace(Integer(2), QQ, names=('x', 'y', 'z',)); (x, y, z,) = A._first_ngens(3) >>> X = A.subscheme([x*z**Integer(2), y**Integer(2)*z, x*y**Integer(2)]); X Closed subscheme of Projective Space of dimension 2 over Rational Field defined by: x*z^2, y^2*z, x*y^2 >>> X.defining_polynomials () (x*z^2, y^2*z, x*y^2) >>> I = X.defining_ideal(); I Ideal (x*z^2, y^2*z, x*y^2) of Multivariate Polynomial Ring in x, y, z over Rational Field >>> I.groebner_basis() # needs sage.libs.singular [x*y^2, y^2*z, x*z^2] >>> X.dimension() # needs sage.libs.singular 0 >>> X.base_ring() Rational Field >>> X.base_scheme() Spectrum of Rational Field >>> X.structure_morphism() Scheme morphism: From: Closed subscheme of Projective Space of dimension 2 over Rational Field defined by: x*z^2, y^2*z, x*y^2 To: Spectrum of Rational Field Defn: Structure map
- veronese_embedding(d, CS=None, order='lex')[source]#
Return the degree
d
Veronese embedding from this projective space.INPUT:
d
– a positive integer.CS
– a projective ambient space to embed into. If this projective space has dimension \(N\), the dimension ofCS
must be \(\binom{N + d}{d} - 1\). This is constructed if not specified. Default:None
.order
– a monomial order to use to arrange the monomials defining the embedding. The monomials will be arranged from greatest to least with respect to this order. Default:'lex'
.
OUTPUT:
a scheme morphism from this projective space to
CS
.
EXAMPLES:
sage: P.<x,y> = ProjectiveSpace(QQ, 1) sage: vd = P.veronese_embedding(4, order='invlex') # needs sage.combinat sage: vd # needs sage.combinat Scheme morphism: From: Projective Space of dimension 1 over Rational Field To: Projective Space of dimension 4 over Rational Field Defn: Defined on coordinates by sending (x : y) to (y^4 : x*y^3 : x^2*y^2 : x^3*y : x^4)
>>> from sage.all import * >>> P = ProjectiveSpace(QQ, Integer(1), names=('x', 'y',)); (x, y,) = P._first_ngens(2) >>> vd = P.veronese_embedding(Integer(4), order='invlex') # needs sage.combinat >>> vd # needs sage.combinat Scheme morphism: From: Projective Space of dimension 1 over Rational Field To: Projective Space of dimension 4 over Rational Field Defn: Defined on coordinates by sending (x : y) to (y^4 : x*y^3 : x^2*y^2 : x^3*y : x^4)
Veronese surface:
sage: P.<x,y,z> = ProjectiveSpace(QQ, 2) sage: Q.<q,r,s,t,u,v> = ProjectiveSpace(QQ, 5) sage: vd = P.veronese_embedding(2, Q) # needs sage.combinat sage: vd # needs sage.combinat Scheme morphism: From: Projective Space of dimension 2 over Rational Field To: Projective Space of dimension 5 over Rational Field Defn: Defined on coordinates by sending (x : y : z) to (x^2 : x*y : x*z : y^2 : y*z : z^2) sage: vd(P.subscheme([])) # needs sage.combinat sage.libs.singular Closed subscheme of Projective Space of dimension 5 over Rational Field defined by: -u^2 + t*v, -s*u + r*v, -s*t + r*u, -s^2 + q*v, -r*s + q*u, -r^2 + q*t
>>> from sage.all import * >>> P = ProjectiveSpace(QQ, Integer(2), names=('x', 'y', 'z',)); (x, y, z,) = P._first_ngens(3) >>> Q = ProjectiveSpace(QQ, Integer(5), names=('q', 'r', 's', 't', 'u', 'v',)); (q, r, s, t, u, v,) = Q._first_ngens(6) >>> vd = P.veronese_embedding(Integer(2), Q) # needs sage.combinat >>> vd # needs sage.combinat Scheme morphism: From: Projective Space of dimension 2 over Rational Field To: Projective Space of dimension 5 over Rational Field Defn: Defined on coordinates by sending (x : y : z) to (x^2 : x*y : x*z : y^2 : y*z : z^2) >>> vd(P.subscheme([])) # needs sage.combinat sage.libs.singular Closed subscheme of Projective Space of dimension 5 over Rational Field defined by: -u^2 + t*v, -s*u + r*v, -s*t + r*u, -s^2 + q*v, -r*s + q*u, -r^2 + q*t
- sage.schemes.projective.projective_space.is_ProjectiveSpace(x)[source]#
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')) doctest:warning... DeprecationWarning: The function is_ProjectiveSpace is deprecated; use 'isinstance(..., ProjectiveSpace_ring)' instead. See https://github.com/sagemath/sage/issues/38022 for details. True sage: is_ProjectiveSpace(ProjectiveSpace(5, GF(9, 'alpha'), names='x')) # needs sage.rings.finite_rings True sage: is_ProjectiveSpace(Spec(ZZ)) False
>>> from sage.all import * >>> from sage.schemes.projective.projective_space import is_ProjectiveSpace >>> is_ProjectiveSpace(ProjectiveSpace(Integer(5), names='x')) doctest:warning... DeprecationWarning: The function is_ProjectiveSpace is deprecated; use 'isinstance(..., ProjectiveSpace_ring)' instead. See https://github.com/sagemath/sage/issues/38022 for details. True >>> is_ProjectiveSpace(ProjectiveSpace(Integer(5), GF(Integer(9), 'alpha'), names='x')) # needs sage.rings.finite_rings True >>> is_ProjectiveSpace(Spec(ZZ)) False