This repository has been archived by the owner on Jan 30, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add some methods to projective morphisms
- Loading branch information
Showing
5 changed files
with
229 additions
and
70 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
r""" | ||
Products of projective spaces | ||
This class builds on the projective space class and its point and morphism classes. | ||
This class builds on the projective space class and its point and morphism | ||
classes. | ||
Products of projective spaces of varying dimension are convenient | ||
ambient spaces for complete intersections. | ||
Products of projective spaces of varying dimension are convenient ambient | ||
spaces for complete intersections. | ||
Group actions on them, and | ||
the interplay with representation theory, provide many interesting | ||
examples of algebraic varieties. | ||
Group actions on them, and the interplay with representation theory, provide | ||
many interesting examples of algebraic varieties. | ||
EXAMPLES: | ||
|
@@ -28,6 +28,7 @@ | |
sage: P2xP2.coordinate_ring().inject_variables() | ||
Defining x0, x1, x2, y0, y1, y2 | ||
""" | ||
|
||
#***************************************************************************** | ||
# Copyright (C) 2014 Volker Braun <[email protected]> | ||
# Copyright (C) 2014 Ben Hutz <[email protected]> | ||
|
@@ -39,7 +40,6 @@ | |
# http://www.gnu.org/licenses/ | ||
#***************************************************************************** | ||
|
||
|
||
from sage.misc.cachefunc import cached_method | ||
from sage.misc.misc_c import prod | ||
from sage.rings.all import (PolynomialRing, QQ, Integer, CommutativeRing) | ||
|
@@ -81,16 +81,17 @@ def ProductProjectiveSpaces(n, R=None, names='x'): | |
r""" | ||
Return the Cartesian product of projective spaces. | ||
Can input either a list of projective space over the same base \ | ||
ring or the list of dimensions, the base ring, and the variable names. | ||
The input ``n`` is either a list of projective space over the same base | ||
ring or the list of dimensions, ``R`` the base ring, and ``names`` the | ||
variable names. | ||
INPUT: | ||
- ``n`` -- a list of integers or a list of projective spaces. | ||
- ``n`` -- a list of integers or a list of projective spaces | ||
- ``R`` -- a ring. | ||
- ``R`` -- a ring | ||
- ``names`` -- a string or list of strings. | ||
- ``names`` -- a string or list of strings | ||
EXAMPLES:: | ||
|
@@ -120,7 +121,7 @@ def ProductProjectiveSpaces(n, R=None, names='x'): | |
if R is None: | ||
R = QQ # default is the rationals | ||
if isinstance(n[0], ProjectiveSpace_ring): | ||
#this should be a list of projective spaces | ||
# this should be a list of projective spaces | ||
names = [] | ||
N = [] | ||
R = None | ||
|
@@ -146,15 +147,15 @@ def ProductProjectiveSpaces(n, R=None, names='x'): | |
if not isinstance(R, CommutativeRing): | ||
raise ValueError("must be a commutative ring") | ||
from sage.structure.category_object import normalize_names | ||
n_vars = sum(d+1 for d in n) | ||
n_vars = sum(d + 1 for d in n) | ||
if isinstance(names, str): | ||
names = normalize_names(n_vars, names) | ||
else: | ||
name_list = list(names) | ||
if len(name_list) == len(n): | ||
names = [] | ||
for name, dim in zip(name_list, n): | ||
names += normalize_names(dim+1, name) | ||
names += normalize_names(dim + 1, name) | ||
else: | ||
n_vars = sum(1+d for d in n) | ||
names = normalize_names(n_vars, name_list) | ||
|
@@ -196,12 +197,12 @@ def __init__(self, N, R = QQ, names = None): | |
INPUT: | ||
- ``N`` - a list or tuple of positive integers. | ||
- ``N`` -- a list or tuple of positive integers | ||
- ``R`` - a ring. | ||
- ``R`` -- a ring | ||
- ``names`` - a tuple or list of strings. This must either be a single variable name | ||
or the complete list of variables. | ||
- ``names`` -- a tuple or list of strings; this must either be a single | ||
variable name or the complete list of variables | ||
EXAMPLES:: | ||
|
@@ -236,38 +237,33 @@ def __init__(self, N, R = QQ, names = None): | |
for i in range(len(N)): | ||
self._components.append(ProjectiveSpace(N[i],R,names[start:start+N[i]+1])) | ||
start += N[i]+1 | ||
#Note that the coordinate ring should really be the tensor product of the component | ||
#coordinate rings. But we just deal with them as multihomogeneous polynomial rings | ||
# Note that the coordinate ring should really be the tensor product of | ||
# the component coordinate rings. But we just deal with them as | ||
# multihomogeneous polynomial rings. | ||
self._coordinate_ring = PolynomialRing(R,sum(N)+ len(N),names) | ||
self._assign_names(names) | ||
|
||
def _repr_(self): | ||
r""" | ||
Return a string representation of this space. | ||
OUTPUT: String. | ||
EXAMPLES:: | ||
sage: ProductProjectiveSpaces([1, 1, 1], ZZ, ['x', 'y', 'z', 'u', 'v', 'w']) | ||
Product of projective spaces P^1 x P^1 x P^1 over Integer Ring | ||
""" | ||
return ''.join([ | ||
'Product of projective spaces ', | ||
' x '.join('P^{0}'.format(d) for d in self._dims), | ||
' over ', | ||
str(self.base_ring())]) | ||
return ''.join(['Product of projective spaces ', | ||
' x '.join('P^{0}'.format(d) for d in self._dims), | ||
' over ', str(self.base_ring())]) | ||
|
||
def _repr_generic_point(self, v=None): | ||
""" | ||
Return a string representation of the generic point | ||
on this product space. | ||
If ``v`` is None, the representation of the generic point of | ||
If ``v`` is ``None``, the representation of the generic point of | ||
the product space is returned. | ||
OUTPUT: String. | ||
EXAMPLES:: | ||
sage: T = ProductProjectiveSpaces([1, 2, 1], QQ, 'x') | ||
|
@@ -318,9 +314,9 @@ def __getitem__(self, i): | |
INPUT: | ||
- ``i`` - a positive integer. | ||
- ``i`` -- a positive integer | ||
OUTPUT: A projective space. | ||
OUTPUT: a projective space | ||
EXAMPLES:: | ||
|
@@ -416,7 +412,7 @@ def __mul__(self, right): | |
INPUT: | ||
- ``right`` - a projective space, product of projective spaces, or subscheme. | ||
- ``right`` -- a projective space, product of projective spaces, or subscheme | ||
OUTPUT: a product of projective spaces or subscheme | ||
|
@@ -476,7 +472,7 @@ def components(self): | |
r""" | ||
Return the components of this product of projective spaces. | ||
OUTPUT: A list of projective spaces. | ||
OUTPUT: a list of projective spaces | ||
EXAMPLES:: | ||
|
@@ -491,7 +487,7 @@ def dimension_relative(self): | |
r""" | ||
Return the relative dimension of the product of projective spaces. | ||
OUTPUT: A positive integer. | ||
OUTPUT: a positive integer | ||
EXAMPLES:: | ||
|
@@ -505,7 +501,7 @@ def dimension_absolute(self): | |
r""" | ||
Return the absolute dimension of the product of projective spaces. | ||
OUTPUT: A positive integer. | ||
OUTPUT: a positive integer | ||
EXAMPLES:: | ||
|
@@ -526,7 +522,7 @@ def dimension_relative_components(self): | |
r""" | ||
Return the relative dimension of the product of projective spaces. | ||
OUTPUT: A list of positive integers. | ||
OUTPUT: a list of positive integers | ||
EXAMPLES:: | ||
|
@@ -540,7 +536,7 @@ def dimension_absolute_components(self): | |
r""" | ||
Return the absolute dimension of the product of projective spaces. | ||
OUTPUT: A list of positive integers. | ||
OUTPUT: a list of positive integers | ||
EXAMPLES:: | ||
|
@@ -561,7 +557,7 @@ def num_components(self): | |
r""" | ||
Returns the number of components of this space. | ||
OUTPUT: An integer. | ||
OUTPUT: an integer | ||
EXAMPLES:: | ||
|
@@ -578,7 +574,7 @@ def ngens(self): | |
This is the number of variables in the coordinate ring of the | ||
projective space. | ||
OUTPUT: An integer. | ||
OUTPUT: an integer | ||
EXAMPLES:: | ||
|
@@ -594,9 +590,9 @@ def _factors(self, v): | |
INPUT: | ||
- ``v`` -- a list or tuple. | ||
- ``v`` -- a list or tuple | ||
OUTPUT: A list of lists. | ||
OUTPUT: a list of lists | ||
EXAMPLES:: | ||
|
@@ -622,11 +618,9 @@ def _degree(self, polynomial): | |
INPUT: | ||
A polynomial in :meth:`coordinate_ring`. | ||
- ``polynomial`` -- a polynomial in the coordinate_ring | ||
OUTPUT: | ||
A tuple of integers, one for each projective space component. A | ||
OUTPUT: A tuple of integers, one for each projective space component. A | ||
``ValueError`` is raised if the polynomial is not multihomogeneous. | ||
EXAMPLES:: | ||
|
@@ -832,7 +826,7 @@ def subscheme(self, X): | |
INPUT: | ||
- ``X`` - a list or tuple of equations. | ||
- ``X`` -- a list or tuple of equations | ||
OUTPUT: | ||
|
@@ -872,7 +866,7 @@ def change_ring(self, R): | |
INPUT: | ||
- ``R`` -- commutative ring or morphism. | ||
- ``R`` -- commutative ring or morphism | ||
OUTPUT: | ||
|
@@ -1152,15 +1146,13 @@ def points_of_bounded_height(self, **kwds): | |
INPUT: | ||
- ``bound`` - a real number | ||
- ``bound`` -- a real number | ||
- ``tolerance`` - a rational number in (0,1] used in doyle-krumm algorithm-4 | ||
- ``tolerance`` -- a rational number in (0,1] used in doyle-krumm algorithm-4 | ||
- ``precision`` - the precision to use for computing the elements of bounded height of number fields. | ||
OUTPUT: | ||
- ``precision`` -- the precision to use for computing the elements of bounded height of number fields. | ||
- an iterator of points in this space | ||
OUTPUT: an iterator of points in this space | ||
EXAMPLES:: | ||
|
Oops, something went wrong.