Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
sagemath
GitHub Repository: sagemath/sagesmc
Path: blob/master/src/sage/schemes/affine/affine_space.py
8820 views
1
"""
2
Affine `n` space over a ring
3
"""
4
5
#*****************************************************************************
6
# Copyright (C) 2006 William Stein <[email protected]>
7
#
8
# Distributed under the terms of the GNU General Public License (GPL)
9
#
10
# http://www.gnu.org/licenses/
11
#*****************************************************************************
12
13
from sage.rings.all import (
14
PolynomialRing,
15
ZZ,
16
Integer)
17
18
from sage.rings.ring import is_Ring
19
from sage.rings.rational_field import is_RationalField
20
from sage.rings.polynomial.multi_polynomial_ring import is_MPolynomialRing
21
from sage.rings.finite_rings.constructor import is_FiniteField
22
23
from sage.categories.fields import Fields
24
_Fields = Fields()
25
26
from sage.misc.all import latex
27
from sage.structure.parent_gens import normalize_names
28
29
from sage.schemes.generic.scheme import AffineScheme
30
from sage.schemes.generic.ambient_space import AmbientSpace
31
from sage.schemes.affine.affine_homset import SchemeHomset_points_affine
32
from sage.schemes.affine.affine_morphism import (SchemeMorphism_polynomial_affine_space,
33
SchemeMorphism_polynomial_affine_space_field,
34
SchemeMorphism_polynomial_affine_space_finite_field)
35
from sage.schemes.affine.affine_point import (SchemeMorphism_point_affine,
36
SchemeMorphism_point_affine_field,
37
SchemeMorphism_point_affine_finite_field)
38
39
40
41
def is_AffineSpace(x):
42
r"""
43
Returns True if x is an affine space, i.e., an ambient space
44
`\mathbb{A}^n_R`, where `R` is a ring and
45
`n\geq 0` is an integer.
46
47
EXAMPLES::
48
49
sage: from sage.schemes.affine.affine_space import is_AffineSpace
50
sage: is_AffineSpace(AffineSpace(5, names='x'))
51
True
52
sage: is_AffineSpace(AffineSpace(5, GF(9,'alpha'), names='x'))
53
True
54
sage: is_AffineSpace(Spec(ZZ))
55
False
56
"""
57
return isinstance(x, AffineSpace_generic)
58
59
def AffineSpace(n, R=None, names='x'):
60
r"""
61
Return affine space of dimension `n` over the ring `R`.
62
63
EXAMPLES:
64
65
The dimension and ring can be given in either order::
66
67
sage: AffineSpace(3, QQ, 'x')
68
Affine Space of dimension 3 over Rational Field
69
sage: AffineSpace(5, QQ, 'x')
70
Affine Space of dimension 5 over Rational Field
71
sage: A = AffineSpace(2, QQ, names='XY'); A
72
Affine Space of dimension 2 over Rational Field
73
sage: A.coordinate_ring()
74
Multivariate Polynomial Ring in X, Y over Rational Field
75
76
Use the divide operator for base extension::
77
78
sage: AffineSpace(5, names='x')/GF(17)
79
Affine Space of dimension 5 over Finite Field of size 17
80
81
The default base ring is `\ZZ`::
82
83
sage: AffineSpace(5, names='x')
84
Affine Space of dimension 5 over Integer Ring
85
86
There is also an affine space associated to each polynomial ring::
87
88
sage: R = GF(7)['x,y,z']
89
sage: A = AffineSpace(R); A
90
Affine Space of dimension 3 over Finite Field of size 7
91
sage: A.coordinate_ring() is R
92
True
93
"""
94
if is_MPolynomialRing(n) and R is None:
95
R = n
96
A = AffineSpace(R.ngens(), R.base_ring(), R.variable_names())
97
A._coordinate_ring = R
98
return A
99
if isinstance(R, (int, long, Integer)):
100
n, R = R, n
101
if R is None:
102
R = ZZ # default is the integers
103
if names is None:
104
if n == 0:
105
names = ''
106
else:
107
raise TypeError("You must specify the variables names of the coordinate ring.")
108
if R in _Fields:
109
if is_FiniteField(R):
110
return AffineSpace_finite_field(n, R, names)
111
else:
112
return AffineSpace_field(n, R, names)
113
return AffineSpace_generic(n, R, names)
114
115
116
class AffineSpace_generic(AmbientSpace, AffineScheme):
117
"""
118
Affine space of dimension `n` over the ring `R`.
119
120
EXAMPLES::
121
122
sage: X.<x,y,z> = AffineSpace(3, QQ)
123
sage: X.base_scheme()
124
Spectrum of Rational Field
125
sage: X.base_ring()
126
Rational Field
127
sage: X.category()
128
Category of schemes over Rational Field
129
sage: X.structure_morphism()
130
Scheme morphism:
131
From: Affine Space of dimension 3 over Rational Field
132
To: Spectrum of Rational Field
133
Defn: Structure map
134
135
Loading and saving::
136
137
sage: loads(X.dumps()) == X
138
True
139
140
We create several other examples of affine spaces::
141
142
sage: AffineSpace(5, PolynomialRing(QQ, 'z'), 'Z')
143
Affine Space of dimension 5 over Univariate Polynomial Ring in z over Rational Field
144
145
sage: AffineSpace(RealField(), 3, 'Z')
146
Affine Space of dimension 3 over Real Field with 53 bits of precision
147
148
sage: AffineSpace(Qp(7), 2, 'x')
149
Affine Space of dimension 2 over 7-adic Field with capped relative precision 20
150
151
Even 0-dimensional affine spaces are supported::
152
153
sage: AffineSpace(0)
154
Affine Space of dimension 0 over Integer Ring
155
"""
156
def __init__(self, n, R, names):
157
"""
158
EXAMPLES::
159
160
sage: AffineSpace(3, Zp(5), 'y')
161
Affine Space of dimension 3 over 5-adic Ring with capped relative precision 20
162
"""
163
names = normalize_names(n, names)
164
AmbientSpace.__init__(self, n, R)
165
self._assign_names(names)
166
167
def __iter__(self):
168
"""
169
Return iterator over the elements of this affine space when defined
170
over a finite field.
171
172
EXAMPLES::
173
174
sage: FF = FiniteField(3)
175
sage: AA = AffineSpace(FF, 0)
176
sage: [ x for x in AA ]
177
[()]
178
sage: AA = AffineSpace(FF, 1, 'Z')
179
sage: [ x for x in AA ]
180
[(0), (1), (2)]
181
sage: AA.<z,w> = AffineSpace(FF, 2)
182
sage: [ x for x in AA ]
183
[(0, 0), (1, 0), (2, 0), (0, 1), (1, 1), (2, 1), (0, 2), (1, 2), (2, 2)]
184
185
AUTHOR:
186
187
- David Kohel
188
"""
189
n = self.dimension_relative()
190
R = self.base_ring()
191
zero = R(0)
192
P = [ zero for _ in range(n) ]
193
yield self(P)
194
iters = [ iter(R) for _ in range(n) ]
195
for x in iters: x.next() # put at zero
196
i = 0
197
while i < n:
198
try:
199
P[i] = iters[i].next()
200
yield self(P)
201
i = 0
202
except StopIteration:
203
iters[i] = iter(R) # reset
204
iters[i].next() # put at zero
205
P[i] = zero
206
i += 1
207
208
def ngens(self):
209
"""
210
Return the number of generators of self, i.e. the number of
211
variables in the coordinate ring of self.
212
213
EXAMPLES::
214
215
sage: AffineSpace(3, QQ).ngens()
216
3
217
sage: AffineSpace(7, ZZ).ngens()
218
7
219
"""
220
return self.dimension_relative()
221
222
def rational_points(self, F=None):
223
"""
224
Return the list of `F`-rational points on the affine space self,
225
where `F` is a given finite field, or the base ring of self.
226
227
EXAMPLES::
228
229
sage: A = AffineSpace(1, GF(3))
230
sage: A.rational_points()
231
[(0), (1), (2)]
232
sage: A.rational_points(GF(3^2, 'b'))
233
[(0), (b), (b + 1), (2*b + 1), (2), (2*b), (2*b + 2), (b + 2), (1)]
234
235
sage: AffineSpace(2, ZZ).rational_points(GF(2))
236
[(0, 0), (1, 0), (0, 1), (1, 1)]
237
238
TESTS::
239
240
sage: AffineSpace(2, QQ).rational_points()
241
Traceback (most recent call last):
242
...
243
TypeError: Base ring (= Rational Field) must be a finite field.
244
sage: AffineSpace(1, GF(3)).rational_points(ZZ)
245
Traceback (most recent call last):
246
...
247
TypeError: Second argument (= Integer Ring) must be a finite field.
248
"""
249
if F == None:
250
if not is_FiniteField(self.base_ring()):
251
raise TypeError("Base ring (= %s) must be a finite field."%self.base_ring())
252
return [ P for P in self ]
253
elif not is_FiniteField(F):
254
raise TypeError("Second argument (= %s) must be a finite field."%F)
255
return [ P for P in self.base_extend(F) ]
256
257
def __cmp__(self, right):
258
"""
259
Compare ``self`` with ``right``.
260
261
EXAMPLES::
262
263
sage: AffineSpace(QQ, 3, 'a') == AffineSpace(ZZ, 3, 'a')
264
False
265
sage: AffineSpace(ZZ,1, 'a') == AffineSpace(ZZ, 0, 'a')
266
False
267
sage: loads(AffineSpace(ZZ, 1, 'x').dumps()) == AffineSpace(ZZ, 1, 'x')
268
True
269
"""
270
if not isinstance(right, AffineSpace_generic):
271
return -1
272
return cmp([self.dimension_relative(), self.coordinate_ring()],
273
[right.dimension_relative(), right.coordinate_ring()])
274
275
def _latex_(self):
276
r"""
277
Return a LaTeX representation of this affine space.
278
279
EXAMPLES::
280
281
sage: print latex(AffineSpace(1, ZZ, 'x'))
282
\mathbf{A}_{\Bold{Z}}^1
283
284
TESTS::
285
286
sage: AffineSpace(3, Zp(5), 'y')._latex_()
287
'\\mathbf{A}_{\\ZZ_{5}}^3'
288
"""
289
return "\\mathbf{A}_{%s}^%s"%(latex(self.base_ring()), self.dimension_relative())
290
291
def _morphism(self, *args, **kwds):
292
"""
293
Construct a morphism determined by action on points of ``self``.
294
295
INPUT:
296
297
Same as for
298
:class:`~sage.schemes.affine.affine_morphism.SchemeMorphism_polynomial_affine_space`.
299
300
OUPUT:
301
302
A new instance of
303
:class:`~sage.schemes.affine.affine_morphism.SchemeMorphism_polynomial_affine_space`.
304
305
EXAMPLES::
306
307
sage: AA = AffineSpace(QQ, 3, 'a')
308
sage: AA.inject_variables()
309
Defining a0, a1, a2
310
sage: EndAA = AA.Hom(AA)
311
sage: AA._morphism(EndAA, [a0*a1, a1*a2, a0*a2])
312
Scheme endomorphism of Affine Space of dimension 3 over Rational Field
313
Defn: Defined on coordinates by sending (a0, a1, a2) to
314
(a0*a1, a1*a2, a0*a2)
315
"""
316
return SchemeMorphism_polynomial_affine_space(*args, **kwds)
317
318
def _point_homset(self, *args, **kwds):
319
"""
320
Construct a Hom-set for ``self``.
321
322
INPUT:
323
324
Same as for
325
:class:`~sage.schemes.affine.affine_homset.SchemeHomset_points_affine`.
326
327
OUPUT:
328
329
A new instance of
330
:class:`~sage.schemes.affine.affine_homset.SchemeHomset_points_affine`.
331
332
EXAMPLES::
333
334
sage: AA = AffineSpace(QQ, 3, 'a')
335
sage: AA._point_homset(Spec(QQ), AA)
336
Set of rational points of Affine Space of dimension 3 over Rational Field
337
"""
338
return SchemeHomset_points_affine(*args, **kwds)
339
340
def _point(self, *args, **kwds):
341
r"""
342
Construct a point of ``self``.
343
344
INPUT:
345
346
Same as for
347
:class:`~sage.schemes.affine.affine_point.SchemeMorphism_point_affine`.
348
349
OUPUT:
350
351
A new instance of
352
:class:`~sage.schemes.affine.affine_point.SchemeMorphism_point_affine`.
353
354
TESTS::
355
356
sage: AA = AffineSpace(QQ, 3, 'a')
357
sage: AA._point(AA.point_homset(), [0,1,2])
358
(0, 1, 2)
359
"""
360
return SchemeMorphism_point_affine(*args, **kwds)
361
362
def _repr_(self):
363
"""
364
Return a string representation of this affine space.
365
366
EXAMPLES::
367
368
sage: AffineSpace(1, ZZ, 'x')
369
Affine Space of dimension 1 over Integer Ring
370
371
TESTS::
372
373
sage: AffineSpace(3, Zp(5), 'y')._repr_()
374
'Affine Space of dimension 3 over 5-adic Ring with capped relative precision 20'
375
"""
376
return "Affine Space of dimension %s over %s"%(self.dimension_relative(), self.base_ring())
377
378
def _repr_generic_point(self, polys=None):
379
"""
380
Return a string representation of the generic point
381
corresponding to the list of polys on this affine space.
382
383
If polys is None, the representation of the generic point of
384
the affine space is returned.
385
386
EXAMPLES::
387
388
sage: A.<x, y> = AffineSpace(2, ZZ)
389
sage: A._repr_generic_point([y-x^2])
390
'(-x^2 + y)'
391
sage: A._repr_generic_point()
392
'(x, y)'
393
"""
394
if polys is None:
395
polys = self.gens()
396
return '(%s)'%(", ".join([str(f) for f in polys]))
397
398
def _latex_generic_point(self, v=None):
399
"""
400
Return a LaTeX representation of the generic point
401
corresponding to the list of polys on this affine space.
402
403
If polys is None, the representation of the generic point of
404
the affine space is returned.
405
406
EXAMPLES::
407
408
sage: A.<x, y> = AffineSpace(2, ZZ)
409
sage: A._latex_generic_point([y-x^2])
410
'\\left(- x^{2} + y\\right)'
411
sage: A._latex_generic_point()
412
'\\left(x, y\\right)'
413
"""
414
if v is None:
415
v = self.gens()
416
return '\\left(%s\\right)'%(", ".join([str(latex(f)) for f in v]))
417
418
def _check_satisfies_equations(self, v):
419
"""
420
Return True if `v` defines a point on the scheme self; raise a
421
TypeError otherwise.
422
423
EXAMPLES::
424
425
sage: A = AffineSpace(3, ZZ)
426
sage: A._check_satisfies_equations([1, 1, 0])
427
True
428
sage: A._check_satisfies_equations((0, 1, 0))
429
True
430
sage: A._check_satisfies_equations([0, 0, 0])
431
True
432
sage: A._check_satisfies_equations([1, 2, 3, 4, 5])
433
Traceback (most recent call last):
434
...
435
TypeError: The list v=[1, 2, 3, 4, 5] must have 3 components
436
sage: A._check_satisfies_equations([1/2, 1, 1])
437
Traceback (most recent call last):
438
...
439
TypeError: The components of v=[1/2, 1, 1] must be elements of Integer Ring
440
sage: A._check_satisfies_equations(5)
441
Traceback (most recent call last):
442
...
443
TypeError: The argument v=5 must be a list or tuple
444
"""
445
if not isinstance(v, (list, tuple)):
446
raise TypeError('The argument v=%s must be a list or tuple'%v)
447
n = self.ngens()
448
if not len(v) == n:
449
raise TypeError('The list v=%s must have %s components'%(v, n))
450
R = self.base_ring()
451
from sage.structure.sequence import Sequence
452
if not Sequence(v).universe() == R:
453
raise TypeError('The components of v=%s must be elements of %s'%(v, R))
454
return True
455
456
def __pow__(self, m):
457
"""
458
Return the cartesian power of self.
459
460
INPUT:
461
462
- ``m`` -- integer
463
464
OUTPUT:
465
466
- affine ambient space
467
468
EXAMPLES::
469
470
sage: A = AffineSpace(1, QQ, 'x')
471
sage: A5 = A^5; A5
472
Affine Space of dimension 5 over Rational Field
473
sage: A5.variable_names()
474
('x0', 'x1', 'x2', 'x3', 'x4')
475
sage: A2 = AffineSpace(2, QQ, "x, y")
476
sage: A4 = A2^2; A4
477
Affine Space of dimension 4 over Rational Field
478
sage: A4.variable_names()
479
('x0', 'x1', 'x2', 'x3')
480
481
As you see, custom variable names are not preserved by power operator,
482
since there is no natural way to make new ones in general.
483
"""
484
mm = int(m)
485
if mm != m:
486
raise ValueError("m must be an integer")
487
return AffineSpace(self.dimension_relative() * mm, self.base_ring())
488
489
def change_ring(self, R):
490
r"""
491
Return an affine space over ring `R` and otherwise the same as self.
492
493
INPUT:
494
495
- ``R`` -- commutative ring
496
497
OUTPUT:
498
499
- affine space over ``R``
500
501
.. NOTE::
502
503
There is no need to have any relation between `R` and the base ring
504
of self, if you want to have such a relation, use
505
``self.base_extend(R)`` instead.
506
507
EXAMPLES::
508
509
sage: A.<x, y, z> = AffineSpace(3, ZZ)
510
sage: AQ = A.change_ring(QQ); AQ
511
Affine Space of dimension 3 over Rational Field
512
sage: AQ.change_ring(GF(5))
513
Affine Space of dimension 3 over Finite Field of size 5
514
"""
515
return AffineSpace(self.dimension_relative(), R, self.variable_names())
516
517
def coordinate_ring(self):
518
"""
519
Return the coordinate ring of this scheme, if defined.
520
521
EXAMPLES::
522
523
sage: R = AffineSpace(2, GF(9,'alpha'), 'z').coordinate_ring(); R
524
Multivariate Polynomial Ring in z0, z1 over Finite Field in alpha of size 3^2
525
sage: AffineSpace(3, R, 'x').coordinate_ring()
526
Multivariate Polynomial Ring in x0, x1, x2 over Multivariate Polynomial Ring in z0, z1 over Finite Field in alpha of size 3^2
527
"""
528
try:
529
return self._coordinate_ring
530
except AttributeError:
531
self._coordinate_ring = PolynomialRing(self.base_ring(), self.dimension_relative(), names=self.variable_names())
532
return self._coordinate_ring
533
534
def _validate(self, polynomials):
535
"""
536
If ``polynomials`` is a tuple of valid polynomial functions on self,
537
return ``polynomials``, otherwise raise TypeError.
538
539
Since this is an affine space, all polynomials are valid.
540
541
INPUT:
542
543
- ``polynomials`` -- tuple of polynomials in the coordinate ring of
544
self
545
546
OUTPUT:
547
548
- tuple of polynomials in the coordinate ring of self
549
550
EXAMPLES::
551
552
sage: A.<x, y, z> = AffineSpace(3, ZZ)
553
sage: A._validate((x*y - z, 1))
554
(x*y - z, 1)
555
"""
556
return polynomials
557
558
def projective_embedding(self, i=None, PP=None):
559
"""
560
Returns a morphism from this space into an ambient projective space
561
of the same dimension.
562
563
INPUT:
564
565
566
- ``i`` - integer (default: dimension of self = last
567
coordinate) determines which projective embedding to compute. The
568
embedding is that which has a 1 in the i-th coordinate, numbered
569
from 0.
570
571
- ``PP`` - (default: None) ambient projective space, i.e.,
572
codomain of morphism; this is constructed if it is not
573
given.
574
575
EXAMPLES::
576
577
sage: AA = AffineSpace(2, QQ, 'x')
578
sage: pi = AA.projective_embedding(0); pi
579
Scheme morphism:
580
From: Affine Space of dimension 2 over Rational Field
581
To: Projective Space of dimension 2 over Rational Field
582
Defn: Defined on coordinates by sending (x0, x1) to
583
(1 : x0 : x1)
584
sage: z = AA(3,4)
585
sage: pi(z)
586
(1/4 : 3/4 : 1)
587
sage: pi(AA(0,2))
588
(1/2 : 0 : 1)
589
sage: pi = AA.projective_embedding(1); pi
590
Scheme morphism:
591
From: Affine Space of dimension 2 over Rational Field
592
To: Projective Space of dimension 2 over Rational Field
593
Defn: Defined on coordinates by sending (x0, x1) to
594
(x0 : 1 : x1)
595
sage: pi(z)
596
(3/4 : 1/4 : 1)
597
sage: pi = AA.projective_embedding(2)
598
sage: pi(z)
599
(3 : 4 : 1)
600
"""
601
n = self.dimension_relative()
602
if i is None:
603
try:
604
i = self._default_embedding_index
605
except AttributeError:
606
i = int(n)
607
else:
608
i = int(i)
609
try:
610
return self.__projective_embedding[i]
611
except AttributeError:
612
self.__projective_embedding = {}
613
except KeyError:
614
pass
615
if PP is None:
616
from sage.schemes.projective.projective_space import ProjectiveSpace
617
PP = ProjectiveSpace(n, self.base_ring())
618
R = self.coordinate_ring()
619
v = list(R.gens())
620
if n < 0 or n >self.dimension_relative():
621
raise ValueError("Argument i (=%s) must be between 0 and %s, inclusive"%(i,n))
622
v.insert(i, R(1))
623
phi = self.hom(v, PP)
624
self.__projective_embedding[i] = phi
625
return phi
626
627
def subscheme(self, X):
628
"""
629
Return the closed subscheme defined by X.
630
631
INPUT:
632
633
634
- ``X`` - a list or tuple of equations
635
636
637
EXAMPLES::
638
639
sage: A.<x,y> = AffineSpace(QQ, 2)
640
sage: X = A.subscheme([x, y^2, x*y^2]); X
641
Closed subscheme of Affine Space of dimension 2 over Rational Field defined by:
642
x,
643
y^2,
644
x*y^2
645
646
::
647
648
sage: X.defining_polynomials ()
649
(x, y^2, x*y^2)
650
sage: I = X.defining_ideal(); I
651
Ideal (x, y^2, x*y^2) of Multivariate Polynomial Ring in x, y over Rational Field
652
sage: I.groebner_basis()
653
[y^2, x]
654
sage: X.dimension()
655
0
656
sage: X.base_ring()
657
Rational Field
658
sage: X.base_scheme()
659
Spectrum of Rational Field
660
sage: X.structure_morphism()
661
Scheme morphism:
662
From: Closed subscheme of Affine Space of dimension 2 over Rational Field defined by:
663
x,
664
y^2,
665
x*y^2
666
To: Spectrum of Rational Field
667
Defn: Structure map
668
sage: X.dimension()
669
0
670
"""
671
from sage.schemes.generic.algebraic_scheme import AlgebraicScheme_subscheme_affine
672
return AlgebraicScheme_subscheme_affine(self, X)
673
674
def _an_element_(self):
675
r"""
676
Returns a (preferably typical) element of ``self``.
677
678
This is used both for illustration and testing purposes.
679
680
OUTPUT: a point in the affine space ``self``.
681
682
EXAMPLES::
683
684
sage: AffineSpace(ZZ,2,'x').an_element()
685
(5, 4)
686
687
sage: AffineSpace(Qp(5),2,'x').an_element()
688
(5^2 + O(5^22), 4*5 + O(5^21))
689
"""
690
n = self.dimension_relative()
691
R = self.base_ring()
692
return self([(5 - i) * R.an_element() for i in range(n)])
693
694
695
class AffineSpace_field(AffineSpace_generic):
696
def _point(self, *args, **kwds):
697
"""
698
Construct a point.
699
700
For internal use only. See :mod:`morphism` for details.
701
702
TESTS::
703
704
sage: P2.<x,y,z> = AffineSpace(3, GF(3))
705
sage: point_homset = P2._point_homset(Spec(GF(3)), P2)
706
sage: P2._point(point_homset, [1,2,3])
707
(1, 2, 0)
708
"""
709
return SchemeMorphism_point_affine_field(*args, **kwds)
710
711
def _morphism(self, *args, **kwds):
712
"""
713
Construct a morphism.
714
715
For internal use only. See :mod:`morphism` for details.
716
717
TESTS::
718
719
sage: P2.<x,y,z> = AffineSpace(3, GF(3))
720
sage: P2._morphism(P2.Hom(P2), [x,y,z])
721
Scheme endomorphism of Affine Space of dimension 3 over Finite Field of size 3
722
Defn: Defined on coordinates by sending (x, y, z) to
723
(x, y, z)
724
"""
725
return SchemeMorphism_polynomial_affine_space_field(*args, **kwds)
726
727
class AffineSpace_finite_field(AffineSpace_field):
728
def _point(self, *args, **kwds):
729
"""
730
Construct a point.
731
732
For internal use only. See :mod:`morphism` for details.
733
734
TESTS::
735
736
sage: P2.<x,y,z> = AffineSpace(3, GF(3))
737
sage: point_homset = P2._point_homset(Spec(GF(3)), P2)
738
sage: P2._point(point_homset, [1,2,3])
739
(1, 2, 0)
740
"""
741
return SchemeMorphism_point_affine_finite_field(*args, **kwds)
742
743
def _morphism(self, *args, **kwds):
744
"""
745
Construct a morphism.
746
747
For internal use only. See :mod:`morphism` for details.
748
749
TESTS::
750
751
sage: P2.<x,y,z> = AffineSpace(3, GF(3))
752
sage: P2._morphism(P2.Hom(P2), [x,y,z])
753
Scheme endomorphism of Affine Space of dimension 3 over Finite Field of size 3
754
Defn: Defined on coordinates by sending (x, y, z) to
755
(x, y, z)
756
"""
757
return SchemeMorphism_polynomial_affine_space_finite_field(*args, **kwds)
758
759
#fix the pickles from moving affine_space.py
760
from sage.structure.sage_object import register_unpickle_override
761
register_unpickle_override('sage.schemes.generic.affine_space',
762
'AffineSpace_generic',
763
AffineSpace_generic)
764
765