Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
sagemath
GitHub Repository: sagemath/sagelib
Path: blob/master/sage/schemes/toric/library.py
4095 views
1
r"""
2
Library of toric varieties
3
4
This module provides a simple way to construct often-used toric
5
varieties. Please see the help for the individual methods of
6
``toric_varieties`` for a more detailed description of which varieties
7
can be constructed.
8
9
AUTHORS:
10
11
- Volker Braun (2010-07-02): initial version
12
13
EXAMPLES::
14
15
sage: toric_varieties.dP6()
16
2-d CPR-Fano toric variety covered by 6 affine patches
17
18
You can assign the homogeneous coordinates to Sage variables either
19
with
20
:meth:`~sage.schemes.toric.variety.ToricVariety_field.inject_variables`
21
or immediately during assignment like this::
22
23
sage: P2.<x,y,z> = toric_varieties.P2()
24
sage: x^2 + y^2 + z^2
25
x^2 + y^2 + z^2
26
sage: P2.coordinate_ring()
27
Multivariate Polynomial Ring in x, y, z over Rational Field
28
"""
29
30
#*****************************************************************************
31
# Copyright (C) 2010 Volker Braun <[email protected]>
32
# Copyright (C) 2010 Andrey Novoseltsev <[email protected]>
33
#
34
# Distributed under the terms of the GNU General Public License (GPL)
35
#
36
# http://www.gnu.org/licenses/
37
#*****************************************************************************
38
39
from sage.structure.sage_object import SageObject
40
41
from sage.matrix.all import matrix, identity_matrix
42
from sage.geometry.fan import Fan
43
from sage.geometry.lattice_polytope import LatticePolytope
44
from sage.rings.all import ZZ
45
from sage.schemes.toric.variety import (DEFAULT_PREFIX,
46
ToricVariety,
47
normalize_names)
48
from sage.schemes.toric.fano_variety import CPRFanoToricVariety
49
50
51
52
53
# The combinatorial data of the toric varieties is stored separately here
54
# since we might want to use it later on to do the reverse lookup.
55
toric_varieties_rays_cones = {
56
'dP6':[
57
[(0, 1), (-1, 0), (-1, -1), (0, -1), (1, 0), (1, 1)],
58
[[0,1],[1,2],[2,3],[3,4],[4,5],[5,0]] ],
59
'dP7':[
60
[(0, 1), (-1, 0), (-1, -1), (0, -1), (1, 0)],
61
[[0,1],[1,2],[2,3],[3,4],[4,0]] ],
62
'dP8':[
63
[(1,1), (0, 1), (-1, -1), (1, 0)],
64
[[0,1],[1,2],[2,3],[3,0]]
65
],
66
'P1xP1':[
67
[(1, 0), (-1, 0), (0, 1), (0, -1)],
68
[[0,2],[2,1],[1,3],[3,0]] ],
69
'P1xP1_Z2':[
70
[(1, 1), (-1, -1), (-1, 1), (1, -1)],
71
[[0,2],[2,1],[1,3],[3,0]] ],
72
'P1':[
73
[(1,), (-1,)],
74
[[0],[1]] ],
75
'P2':[
76
[(1,0), (0, 1), (-1, -1)],
77
[[0,1],[1,2],[2,0]] ],
78
'A1':[
79
[(1,)],
80
[[0]] ],
81
'A2':[
82
[(1, 0), (0, 1)],
83
[[0,1]] ],
84
'A2_Z2':[
85
[(1, 0), (1, 2)],
86
[[0,1]] ],
87
'P1xA1':[
88
[(1, 0), (-1, 0), (0, 1)],
89
[[0,2],[2,1]] ],
90
'Conifold':[
91
[(0, 0, 1), (0, 1, 1), (1, 0, 1), (1, 1, 1)],
92
[[0,1,2,3]] ],
93
'dP6xdP6':[
94
[(0, 1, 0, 0), (-1, 0, 0, 0), (-1, -1, 0, 0),
95
(0, -1, 0, 0), (1, 0, 0, 0), (1, 1, 0, 0),
96
(0, 0, 0, 1), (0, 0, -1, 0), (0, 0, -1, -1),
97
(0, 0, 0, -1), (0, 0, 1, 0), (0, 0, 1, 1)],
98
[[0, 1, 6, 7], [0, 1, 7, 8], [0, 1, 8, 9], [0, 1, 9, 10],
99
[0, 1, 10, 11], [0, 1, 6, 11], [1, 2, 6, 7], [1, 2, 7, 8],
100
[1, 2, 8, 9], [1, 2, 9, 10], [1, 2, 10, 11], [1, 2, 6, 11],
101
[2, 3, 6, 7], [2, 3, 7, 8], [2, 3, 8, 9], [2, 3, 9, 10],
102
[2, 3, 10, 11], [2, 3, 6, 11], [3, 4, 6, 7], [3, 4, 7, 8],
103
[3, 4, 8, 9], [3, 4, 9, 10], [3, 4, 10, 11], [3, 4, 6, 11],
104
[4, 5, 6, 7], [4, 5, 7, 8], [4, 5, 8, 9], [4, 5, 9, 10],
105
[4, 5, 10, 11], [4, 5, 6, 11], [0, 5, 6, 7], [0, 5, 7, 8],
106
[0, 5, 8, 9], [0, 5, 9, 10], [0, 5, 10, 11], [0, 5, 6, 11]] ],
107
'Cube_face_fan':[
108
[(1, 1, 1), (1, -1, 1), (-1, 1, 1), (-1, -1, 1),
109
(-1, -1, -1), (-1, 1, -1), (1, -1, -1), (1, 1, -1)],
110
[[0,1,2,3], [4,5,6,7], [0,1,7,6], [4,5,3,2], [0,2,5,7], [4,6,1,3]] ],
111
'Cube_sublattice':[
112
[(1, 0, 0), (0, 1, 0), (0, 0, 1), (-1, 1, 1),
113
(-1, 0, 0), (0, -1, 0), (0, 0, -1), (1, -1, -1)],
114
[[0,1,2,3],[4,5,6,7],[0,1,7,6],[4,5,3,2],[0,2,5,7],[4,6,1,3]] ],
115
'Cube_nonpolyhedral':[
116
[(1, 2, 3), (1, -1, 1), (-1, 1, 1), (-1, -1, 1),
117
(-1, -1, -1), (-1, 1, -1), (1, -1, -1), (1, 1, -1)],
118
[[0,1,2,3],[4,5,6,7],[0,1,7,6],[4,5,3,2],[0,2,5,7],[4,6,1,3]] ],
119
'BCdlOG':[
120
[(-1, 0, 0, 2, 3), # 0
121
( 0,-1, 0, 2, 3), # 1
122
( 0, 0,-1, 2, 3), # 2
123
( 0, 0,-1, 1, 2), # 3
124
( 0, 0, 0,-1, 0), # 4
125
( 0, 0, 0, 0,-1), # 5
126
( 0, 0, 0, 2, 3), # 6
127
( 0, 0, 1, 2, 3), # 7
128
( 0, 0, 2, 2, 3), # 8
129
( 0, 0, 1, 1, 1), # 9
130
( 0, 1, 2, 2, 3), # 10
131
( 0, 1, 3, 2, 3), # 11
132
( 1, 0, 4, 2, 3)], # 12
133
[ [0,6,7,1,4], [0,6,10,2,4], [0,6,1,2,4], [0,9,7,1,5], [0,6,7,1,5],
134
[0,6,10,2,5], [0,6,1,2,5], [0,9,1,4,5], [0,6,10,4,11],[0,6,7,4,11],
135
[0,6,10,5,11], [0,9,7,5,11], [0,6,7,5,11], [0,9,4,5,11], [0,10,4,5,11],
136
[0,9,7,1,8], [0,9,1,4,8], [0,7,1,4,8], [0,9,7,11,8], [0,9,4,11,8],
137
[0,7,4,11,8], [0,10,2,4,3], [0,1,2,4,3], [0,10,2,5,3], [0,1,2,5,3],
138
[0,10,4,5,3], [0,1,4,5,3], [12,6,7,1,4], [12,6,10,2,4],[12,6,1,2,4],
139
[12,9,7,1,5], [12,6,7,1,5], [12,6,10,2,5], [12,6,1,2,5], [12,9,1,4,5],
140
[12,6,10,4,11],[12,6,7,4,11], [12,6,10,5,11],[12,9,7,5,11],[12,6,7,5,11],
141
[12,9,4,5,11], [12,10,4,5,11],[12,9,7,1,8], [12,9,1,4,8], [12,7,1,4,8],
142
[12,9,7,11,8], [12,9,4,11,8], [12,7,4,11,8], [12,10,2,4,3],[12,1,2,4,3],
143
[12,10,2,5,3], [12,1,2,5,3], [12,10,4,5,3], [12,1,4,5,3] ] ],
144
'BCdlOG_base':[
145
[(-1, 0, 0),
146
( 0,-1, 0),
147
( 0, 0,-1),
148
( 0, 0, 1),
149
( 0, 1, 2),
150
( 0, 1, 3),
151
( 1, 0, 4)],
152
[[0,4,2],[0,4,5],[0,5,3],[0,1,3],[0,1,2],
153
[6,4,2],[6,4,5],[6,5,3],[6,1,3],[6,1,2]] ],
154
'P2_112':[
155
[(1,0), (0, 1), (-1, -2)],
156
[[0,1],[1,2],[2,0]] ],
157
'P2_123':[
158
[(1,0), (0, 1), (-2, -3)],
159
[[0,1],[1,2],[2,0]] ],
160
'P4_11169':[
161
[(1, 0, 0, 0), (0, 1, 0, 0), (0, 0, 1, 0), (0, 0, 0, 1), (-9, -6, -1, -1)],
162
[[0,1,2,3],[0,1,2,4],[0,1,3,4],[0,2,3,4],[1,2,3,4]] ],
163
'P4_11169_resolved':[
164
[(1, 0, 0, 0), (0, 1, 0, 0), (0, 0, 1, 0), (0, 0, 0, 1), (-9, -6, -1, -1), (-3, -2, 0, 0)],
165
[[0, 1, 2, 3], [0, 1, 3, 4], [0, 1, 2, 4], [1, 3, 4, 5], [0, 3, 4, 5],
166
[1, 2, 4, 5], [0, 2, 4, 5], [1, 2, 3, 5], [0, 2, 3, 5]] ],
167
'P4_11133':[
168
[(1, 0, 0, 0), (0, 1, 0, 0), (0, 0, 1, 0), (0, 0, 0, 1), (-3, -3, -1, -1)],
169
[[0,1,2,3],[0,1,2,4],[0,1,3,4],[0,2,3,4],[1,2,3,4]] ],
170
'P4_11133_resolved':[
171
[(1, 0, 0, 0), (0, 1, 0, 0), (0, 0, 1, 0), (0, 0, 0, 1), (-3, -3, -1, -1), (-1, -1, 0, 0)],
172
[[0, 1, 2, 3], [0, 1, 3, 4], [0, 1, 2, 4], [1, 3, 4, 5], [0, 3, 4, 5],
173
[1, 2, 4, 5], [0, 2, 4, 5], [1, 2, 3, 5], [0, 2, 3, 5]] ]
174
}
175
176
177
178
class ToricVarietyFactory(SageObject):
179
r"""
180
The methods of this class construct toric varieties.
181
182
.. WARNING::
183
184
You need not create instances of this class. Use the
185
already-provided object ``toric_varieties`` instead.
186
"""
187
188
_check = True
189
190
def _make_ToricVariety(self, name, coordinate_names):
191
"""
192
Construct a toric variety and cache the result.
193
194
INPUT:
195
196
- ``name`` -- string. One of the pre-defined names in the
197
``toric_varieties_rays_cones`` data structure.
198
199
- ``coordinate_names`` -- A string describing the names of the
200
homogeneous coordinates of the toric variety.
201
202
OUTPUT:
203
204
A :class:`toric variety
205
<sage.schemes.toric.variety.ToricVariety_field>`.
206
207
EXAMPLES::
208
209
sage: toric_varieties.A1() # indirect doctest
210
1-d affine toric variety
211
"""
212
rays, cones = toric_varieties_rays_cones[name]
213
if coordinate_names is None:
214
dict_key = '_cached_'+name
215
else:
216
coordinate_names = normalize_names(coordinate_names, len(rays),
217
DEFAULT_PREFIX)
218
dict_key = '_cached_'+name+'_'+'_'.join(coordinate_names)
219
if dict_key not in self.__dict__:
220
fan = Fan(cones, rays, check=self._check)
221
self.__dict__[dict_key] = \
222
ToricVariety(fan,
223
coordinate_names=coordinate_names)
224
return self.__dict__[dict_key]
225
226
def _make_CPRFanoToricVariety(self, name, coordinate_names):
227
"""
228
Construct a (crepant partially resolved) Fano toric variety
229
and cache the result.
230
231
INPUT:
232
233
- ``name`` -- string. One of the pre-defined names in the
234
``toric_varieties_rays_cones`` data structure.
235
236
- ``coordinate_names`` -- A string describing the names of the
237
homogeneous coordinates of the toric variety.
238
239
OUTPUT:
240
241
A :class:`CPR-Fano toric variety
242
<sage.schemes.toric.fano_variety.CPRFanoToricVariety_field>`.
243
244
EXAMPLES::
245
246
sage: toric_varieties.P2() # indirect doctest
247
2-d CPR-Fano toric variety covered by 3 affine patches
248
"""
249
rays, cones = toric_varieties_rays_cones[name]
250
if coordinate_names is None:
251
dict_key = '_cached_'+name
252
else:
253
coordinate_names = normalize_names(coordinate_names, len(rays),
254
DEFAULT_PREFIX)
255
dict_key = '_cached_'+name+'_'+'_'.join(coordinate_names)
256
if dict_key not in self.__dict__:
257
polytope = LatticePolytope( matrix(rays).transpose() )
258
points = map(tuple, polytope.points().columns())
259
ray2point = [points.index(r) for r in rays]
260
charts = [ [ray2point[i] for i in c] for c in cones ]
261
self.__dict__[dict_key] = \
262
CPRFanoToricVariety(Delta_polar=polytope,
263
coordinate_points=ray2point,
264
charts=charts,
265
coordinate_names=coordinate_names,
266
check=self._check)
267
return self.__dict__[dict_key]
268
269
def dP6(self, names='x u y v z w'):
270
r"""
271
Construct the del Pezzo surface of degree 6 (`\mathbb{P}^2`
272
blown up at 3 points) as a toric variety.
273
274
INPUT:
275
276
- ``names`` -- string. Names for the homogeneous
277
coordinates. See
278
:func:`~sage.schemes.toric.variety.normalize_names`
279
for acceptable formats.
280
281
OUTPUT:
282
283
A :class:`CPR-Fano toric variety
284
<sage.schemes.toric.fano_variety.CPRFanoToricVariety_field>`.
285
286
EXAMPLES::
287
288
sage: dP6 = toric_varieties.dP6()
289
sage: dP6
290
2-d CPR-Fano toric variety covered by 6 affine patches
291
sage: dP6.fan().ray_matrix()
292
[ 0 -1 -1 0 1 1]
293
[ 1 0 -1 -1 0 1]
294
sage: dP6.gens()
295
(x, u, y, v, z, w)
296
"""
297
return self._make_CPRFanoToricVariety('dP6', names)
298
299
def dP7(self, names='x u y v z'):
300
r"""
301
Construct the del Pezzo surface of degree 7 (`\mathbb{P}^2`
302
blown up at 2 points) as a toric variety.
303
304
INPUT:
305
306
- ``names`` -- string. Names for the homogeneous
307
coordinates. See
308
:func:`~sage.schemes.toric.variety.normalize_names`
309
for acceptable formats.
310
311
OUTPUT:
312
313
A :class:`CPR-Fano toric variety
314
<sage.schemes.toric.fano_variety.CPRFanoToricVariety_field>`.
315
316
EXAMPLES::
317
318
sage: dP7 = toric_varieties.dP7()
319
sage: dP7
320
2-d CPR-Fano toric variety covered by 5 affine patches
321
sage: dP7.fan().ray_matrix()
322
[ 0 -1 -1 0 1]
323
[ 1 0 -1 -1 0]
324
sage: dP7.gens()
325
(x, u, y, v, z)
326
"""
327
return self._make_CPRFanoToricVariety('dP7', names)
328
329
def dP8(self, names='t x y z'):
330
r"""
331
Construct the del Pezzo surface of degree 8 (`\mathbb{P}^2`
332
blown up at 1 point) as a toric variety.
333
334
INPUT:
335
336
- ``names`` -- string. Names for the homogeneous
337
coordinates. See
338
:func:`~sage.schemes.toric.variety.normalize_names`
339
for acceptable formats.
340
341
OUTPUT:
342
343
A :class:`CPR-Fano toric variety
344
<sage.schemes.toric.fano_variety.CPRFanoToricVariety_field>`.
345
346
EXAMPLES::
347
348
sage: dP8 = toric_varieties.dP8()
349
sage: dP8
350
2-d CPR-Fano toric variety covered by 4 affine patches
351
sage: dP8.fan().ray_matrix()
352
[ 1 0 -1 1]
353
[ 1 1 -1 0]
354
sage: dP8.gens()
355
(t, x, y, z)
356
"""
357
return self._make_CPRFanoToricVariety('dP8', names)
358
359
def P1xP1(self, names='s t x y'):
360
r"""
361
Construct the del Pezzo surface `\mathbb{P}^1 \times
362
\mathbb{P}^1` as a toric variety.
363
364
INPUT:
365
366
- ``names`` -- string. Names for the homogeneous
367
coordinates. See
368
:func:`~sage.schemes.toric.variety.normalize_names`
369
for acceptable formats.
370
371
OUTPUT:
372
373
A :class:`CPR-Fano toric variety
374
<sage.schemes.toric.fano_variety.CPRFanoToricVariety_field>`.
375
376
EXAMPLES::
377
378
sage: P1xP1 = toric_varieties.P1xP1()
379
sage: P1xP1
380
2-d CPR-Fano toric variety covered by 4 affine patches
381
sage: P1xP1.fan().ray_matrix()
382
[ 1 -1 0 0]
383
[ 0 0 1 -1]
384
sage: P1xP1.gens()
385
(s, t, x, y)
386
"""
387
return self._make_CPRFanoToricVariety('P1xP1', names)
388
389
def P1xP1_Z2(self, names='s t x y'):
390
r"""
391
Construct the toric `\mathbb{Z}_2`-orbifold of the del Pezzo
392
surface `\mathbb{P}^1 \times \mathbb{P}^1` as a toric variety.
393
394
INPUT:
395
396
- ``names`` -- string. Names for the homogeneous
397
coordinates. See
398
:func:`~sage.schemes.toric.variety.normalize_names`
399
for acceptable formats.
400
401
OUTPUT:
402
403
A :class:`CPR-Fano toric variety
404
<sage.schemes.toric.fano_variety.CPRFanoToricVariety_field>`.
405
406
EXAMPLES::
407
408
sage: P1xP1_Z2 = toric_varieties.P1xP1_Z2()
409
sage: P1xP1_Z2
410
2-d CPR-Fano toric variety covered by 4 affine patches
411
sage: P1xP1_Z2.fan().ray_matrix()
412
[ 1 -1 -1 1]
413
[ 1 -1 1 -1]
414
sage: P1xP1_Z2.gens()
415
(s, t, x, y)
416
sage: P1xP1_Z2.Chow_group().degree(1)
417
C2 x Z^2
418
"""
419
return self._make_CPRFanoToricVariety('P1xP1_Z2', names)
420
421
def P1(self, names='s t'):
422
r"""
423
Construct the projective line `\mathbb{P}^1` as a toric
424
variety.
425
426
INPUT:
427
428
- ``names`` -- string. Names for the homogeneous
429
coordinates. See
430
:func:`~sage.schemes.toric.variety.normalize_names`
431
for acceptable formats.
432
433
OUTPUT:
434
435
A :class:`CPR-Fano toric variety
436
<sage.schemes.toric.fano_variety.CPRFanoToricVariety_field>`.
437
438
EXAMPLES::
439
440
sage: P1 = toric_varieties.P1()
441
sage: P1
442
1-d CPR-Fano toric variety covered by 2 affine patches
443
sage: P1.fan().ray_matrix()
444
[ 1 -1]
445
sage: P1.gens()
446
(s, t)
447
"""
448
return self._make_CPRFanoToricVariety('P1', names)
449
450
def P2(self, names='x y z'):
451
r"""
452
Construct the projective plane `\mathbb{P}^2` as a toric
453
variety.
454
455
INPUT:
456
457
- ``names`` -- string. Names for the homogeneous
458
coordinates. See
459
:func:`~sage.schemes.toric.variety.normalize_names`
460
for acceptable formats.
461
462
OUTPUT:
463
464
A :class:`CPR-Fano toric variety
465
<sage.schemes.toric.fano_variety.CPRFanoToricVariety_field>`.
466
467
EXAMPLES::
468
469
sage: P2 = toric_varieties.P2()
470
sage: P2
471
2-d CPR-Fano toric variety covered by 3 affine patches
472
sage: P2.fan().ray_matrix()
473
[ 1 0 -1]
474
[ 0 1 -1]
475
sage: P2.gens()
476
(x, y, z)
477
"""
478
return self._make_CPRFanoToricVariety('P2', names)
479
480
def P(self, n, names='z+'):
481
r"""
482
Construct the ``n``-dimensional projective space `\mathbb{P}^n`.
483
484
INPUT:
485
486
- ``n`` -- positive integer. The dimension of the projective space.
487
488
- ``names`` -- string. Names for the homogeneous
489
coordinates. See
490
:func:`~sage.schemes.toric.variety.normalize_names`
491
for acceptable formats.
492
493
OUTPUT:
494
495
A :class:`CPR-Fano toric variety
496
<sage.schemes.toric.fano_variety.CPRFanoToricVariety_field>`.
497
498
EXAMPLES::
499
500
sage: P3 = toric_varieties.P(3)
501
sage: P3
502
3-d CPR-Fano toric variety covered by 4 affine patches
503
sage: P3.fan().ray_matrix()
504
[ 1 0 0 -1]
505
[ 0 1 0 -1]
506
[ 0 0 1 -1]
507
sage: P3.gens()
508
(z0, z1, z2, z3)
509
"""
510
# We are going to eventually switch off consistency checks, so we need
511
# to be sure that the input is acceptable.
512
try:
513
n = ZZ(n) # make sure that we got a "mathematical" integer
514
except TypeError:
515
raise TypeError("dimension of the projective space must be a "
516
"positive integer!\nGot: %s" % n)
517
if n <= 0:
518
raise ValueError("only projective spaces of positive dimension "
519
"can be constructed!\nGot: %s" % n)
520
m = identity_matrix(n).augment(matrix(n, 1, [-1]*n))
521
charts = [ range(0,i)+range(i+1,n+1) for i in range(0,n+1) ]
522
return CPRFanoToricVariety(Delta_polar=LatticePolytope(m),
523
charts=charts, check=self._check,
524
coordinate_names=names)
525
526
def A1(self, names='z'):
527
r"""
528
Construct the affine line `\mathbb{A}^1` as a toric variety.
529
530
INPUT:
531
532
- ``names`` -- string. Names for the homogeneous
533
coordinates. See
534
:func:`~sage.schemes.toric.variety.normalize_names`
535
for acceptable formats.
536
537
OUTPUT:
538
539
A :class:`toric variety
540
<sage.schemes.toric.variety.ToricVariety_field>`.
541
542
EXAMPLES::
543
544
sage: A1 = toric_varieties.A1()
545
sage: A1
546
1-d affine toric variety
547
sage: A1.fan().ray_matrix()
548
[1]
549
sage: A1.gens()
550
(z,)
551
"""
552
return self._make_ToricVariety('A1', names)
553
554
def A2(self, names='x y'):
555
r"""
556
Construct the affine plane `\mathbb{A}^2` as a toric variety.
557
558
INPUT:
559
560
- ``names`` -- string. Names for the homogeneous
561
coordinates. See
562
:func:`~sage.schemes.toric.variety.normalize_names`
563
for acceptable formats.
564
565
OUTPUT:
566
567
A :class:`toric variety
568
<sage.schemes.toric.variety.ToricVariety_field>`.
569
570
EXAMPLES::
571
572
sage: A2 = toric_varieties.A2()
573
sage: A2
574
2-d affine toric variety
575
sage: A2.fan().ray_matrix()
576
[1 0]
577
[0 1]
578
sage: A2.gens()
579
(x, y)
580
"""
581
return self._make_ToricVariety('A2', names)
582
583
def A(self, n, names='z+'):
584
r"""
585
Construct the ``n``-dimensional affine space.
586
587
INPUT:
588
589
- ``n`` -- positive integer. The dimension of the affine space.
590
591
- ``names`` -- string. Names for the homogeneous
592
coordinates. See
593
:func:`~sage.schemes.toric.variety.normalize_names`
594
for acceptable formats.
595
596
OUTPUT:
597
598
A :class:`toric variety
599
<sage.schemes.toric.variety.ToricVariety_field>`.
600
601
EXAMPLES::
602
603
sage: A3 = toric_varieties.A(3)
604
sage: A3
605
3-d affine toric variety
606
sage: A3.fan().ray_matrix()
607
[1 0 0]
608
[0 1 0]
609
[0 0 1]
610
sage: A3.gens()
611
(z0, z1, z2)
612
"""
613
# We are going to eventually switch off consistency checks, so we need
614
# to be sure that the input is acceptable.
615
try:
616
n = ZZ(n) # make sure that we got a "mathematical" integer
617
except TypeError:
618
raise TypeError("dimension of the affine space must be a "
619
"positive integer!\nGot: %s" % n)
620
if n <= 0:
621
raise ValueError("only affine spaces of positive dimension can "
622
"be constructed!\nGot: %s" % n)
623
rays = identity_matrix(n).columns()
624
cones = [ range(0,n) ]
625
fan = Fan(cones, rays, check=self._check)
626
return ToricVariety(fan, coordinate_names=names)
627
628
def A2_Z2(self, names='x y'):
629
r"""
630
Construct the orbifold `\mathbb{A}^2 / \ZZ_2` as a toric
631
variety.
632
633
INPUT:
634
635
- ``names`` -- string. Names for the homogeneous
636
coordinates. See
637
:func:`~sage.schemes.toric.variety.normalize_names`
638
for acceptable formats.
639
640
OUTPUT:
641
642
A :class:`toric variety
643
<sage.schemes.toric.variety.ToricVariety_field>`.
644
645
EXAMPLES::
646
647
sage: A2_Z2 = toric_varieties.A2_Z2()
648
sage: A2_Z2
649
2-d affine toric variety
650
sage: A2_Z2.fan().ray_matrix()
651
[1 1]
652
[0 2]
653
sage: A2_Z2.gens()
654
(x, y)
655
"""
656
return self._make_ToricVariety('A2_Z2', names)
657
658
def P1xA1(self, names='s t z'):
659
r"""
660
Construct the cartesian product `\mathbb{P}^1 \times \mathbb{A}^1` as
661
a toric variety.
662
663
INPUT:
664
665
- ``names`` -- string. Names for the homogeneous
666
coordinates. See
667
:func:`~sage.schemes.toric.variety.normalize_names`
668
for acceptable formats.
669
670
OUTPUT:
671
672
A :class:`toric variety
673
<sage.schemes.toric.variety.ToricVariety_field>`.
674
675
EXAMPLES::
676
677
sage: P1xA1 = toric_varieties.P1xA1()
678
sage: P1xA1
679
2-d toric variety covered by 2 affine patches
680
sage: P1xA1.fan().ray_matrix()
681
[ 1 -1 0]
682
[ 0 0 1]
683
sage: P1xA1.gens()
684
(s, t, z)
685
"""
686
return self._make_ToricVariety('P1xA1', names)
687
688
def Conifold(self, names='u x y v'):
689
r"""
690
Construct the conifold as a toric variety.
691
692
INPUT:
693
694
- ``names`` -- string. Names for the homogeneous
695
coordinates. See
696
:func:`~sage.schemes.toric.variety.normalize_names`
697
for acceptable formats.
698
699
OUTPUT:
700
701
A :class:`toric variety
702
<sage.schemes.toric.variety.ToricVariety_field>`.
703
704
EXAMPLES::
705
706
sage: Conifold = toric_varieties.Conifold()
707
sage: Conifold
708
3-d affine toric variety
709
sage: Conifold.fan().ray_matrix()
710
[0 0 1 1]
711
[0 1 0 1]
712
[1 1 1 1]
713
sage: Conifold.gens()
714
(u, x, y, v)
715
"""
716
return self._make_ToricVariety('Conifold', names)
717
718
def dP6xdP6(self, names='x0 x1 x2 x3 x4 x5 y0 y1 y2 y3 y4 y5'):
719
r"""
720
Construct the product of two del Pezzo surfaces of degree 6
721
(`\mathbb{P}^2` blown up at 3 points) as a toric variety.
722
723
INPUT:
724
725
- ``names`` -- string. Names for the homogeneous
726
coordinates. See
727
:func:`~sage.schemes.toric.variety.normalize_names`
728
for acceptable formats.
729
730
OUTPUT:
731
732
A :class:`CPR-Fano toric variety
733
<sage.schemes.toric.fano_variety.CPRFanoToricVariety_field>`.
734
735
EXAMPLES::
736
737
sage: dP6xdP6 = toric_varieties.dP6xdP6() # long time (20s on sage.math, 2011)
738
sage: dP6xdP6 # long time
739
4-d CPR-Fano toric variety covered by 36 affine patches
740
sage: dP6xdP6.fan().ray_matrix() # long time
741
[ 0 -1 -1 0 1 1 0 0 0 0 0 0]
742
[ 1 0 -1 -1 0 1 0 0 0 0 0 0]
743
[ 0 0 0 0 0 0 0 -1 -1 0 1 1]
744
[ 0 0 0 0 0 0 1 0 -1 -1 0 1]
745
sage: dP6xdP6.gens() # long time
746
(x0, x1, x2, x3, x4, x5, y0, y1, y2, y3, y4, y5)
747
"""
748
return self._make_CPRFanoToricVariety('dP6xdP6', names)
749
750
def Cube_face_fan(self, names='z+'):
751
r"""
752
Construct the toric variety given by the face fan of the
753
3-dimensional unit lattice cube.
754
755
This variety has 6 conifold singularities but the fan is still
756
polyhedral.
757
758
INPUT:
759
760
- ``names`` -- string. Names for the homogeneous
761
coordinates. See
762
:func:`~sage.schemes.toric.variety.normalize_names`
763
for acceptable formats.
764
765
OUTPUT:
766
767
A :class:`CPR-Fano toric variety
768
<sage.schemes.toric.fano_variety.CPRFanoToricVariety_field>`.
769
770
EXAMPLES::
771
772
sage: Cube_face_fan = toric_varieties.Cube_face_fan()
773
sage: Cube_face_fan
774
3-d CPR-Fano toric variety covered by 6 affine patches
775
sage: Cube_face_fan.fan().ray_matrix()
776
[ 1 1 -1 -1 -1 -1 1 1]
777
[ 1 -1 1 -1 -1 1 -1 1]
778
[ 1 1 1 1 -1 -1 -1 -1]
779
sage: Cube_face_fan.gens()
780
(z0, z1, z2, z3, z4, z5, z6, z7)
781
"""
782
return self._make_CPRFanoToricVariety('Cube_face_fan', names)
783
784
def Cube_sublattice(self, names='z+'):
785
r"""
786
Construct the toric variety defined by a face fan over a
787
3-dimensional cube, but not the unit cube in the
788
N-lattice. See [FultonP65]_.
789
790
Its Chow group is `A_2(X)=\mathbb{Z}^5`, which distinguishes
791
it from the face fan of the unit cube.
792
793
INPUT:
794
795
- ``names`` -- string. Names for the homogeneous
796
coordinates. See
797
:func:`~sage.schemes.toric.variety.normalize_names`
798
for acceptable formats.
799
800
OUTPUT:
801
802
A :class:`CPR-Fano toric variety
803
<sage.schemes.toric.fano_variety.CPRFanoToricVariety_field>`.
804
805
EXAMPLES::
806
807
sage: Cube_sublattice = toric_varieties.Cube_sublattice()
808
sage: Cube_sublattice
809
3-d CPR-Fano toric variety covered by 6 affine patches
810
sage: Cube_sublattice.fan().ray_matrix()
811
[ 1 0 0 -1 -1 0 0 1]
812
[ 0 1 0 1 0 -1 0 -1]
813
[ 0 0 1 1 0 0 -1 -1]
814
sage: Cube_sublattice.gens()
815
(z0, z1, z2, z3, z4, z5, z6, z7)
816
817
REFERENCES:
818
819
.. [FultonP65]
820
Page 65, 3rd exercise (Section 3.4) of Wiliam Fulton,
821
"Introduction to Toric Varieties", Princeton University
822
Press
823
"""
824
return self._make_CPRFanoToricVariety('Cube_sublattice', names)
825
826
def Cube_nonpolyhedral(self, names='z+'):
827
r"""
828
Construct the toric variety defined by a fan that is not the
829
face fan of a polyhedron.
830
831
This toric variety is defined by a fan that is topologically
832
like the face fan of a 3-dimensional cube, but with a
833
different N-lattice structure.
834
835
INPUT:
836
837
- ``names`` -- string. Names for the homogeneous
838
coordinates. See
839
:func:`~sage.schemes.toric.variety.normalize_names`
840
for acceptable formats.
841
842
OUTPUT:
843
844
A :class:`toric variety
845
<sage.schemes.toric.variety.ToricVariety_field>`.
846
847
NOTES:
848
849
* This is an example of an non-polyhedral fan.
850
851
* Its Chow group has torsion: `A_2(X)=\ZZ^5 \oplus \ZZ_2`
852
853
EXAMPLES::
854
855
sage: Cube_nonpolyhedral = toric_varieties.Cube_nonpolyhedral()
856
sage: Cube_nonpolyhedral
857
3-d toric variety covered by 6 affine patches
858
sage: Cube_nonpolyhedral.fan().ray_matrix()
859
[ 1 1 -1 -1 -1 -1 1 1]
860
[ 2 -1 1 -1 -1 1 -1 1]
861
[ 3 1 1 1 -1 -1 -1 -1]
862
sage: Cube_nonpolyhedral.gens()
863
(z0, z1, z2, z3, z4, z5, z6, z7)
864
"""
865
return self._make_ToricVariety('Cube_nonpolyhedral', names)
866
867
def Cube_deformation(self,k, names=None):
868
r"""
869
Construct, for each `k\in\ZZ_{\geq 0}`, a toric variety with
870
`\ZZ_k`-torsion in the Chow group.
871
872
The fans of this sequence of toric varieties all equal the
873
face fan of a unit cube topologically, but the
874
``(1,1,1)``-vertex is moved to ``(1,1,2k+1)``. This example
875
was studied in [FS]_.
876
877
INPUT:
878
879
- ``k`` -- integer. The case ``k=0`` is the same as
880
:meth:`Cube_face_fan`.
881
882
- ``names`` -- string. Names for the homogeneous
883
coordinates. See
884
:func:`~sage.schemes.toric.variety.normalize_names`
885
for acceptable formats.
886
887
OUTPUT:
888
889
A :class:`toric variety
890
<sage.schemes.toric.variety.ToricVariety_field>`
891
`X_k`. Its Chow group is `A_1(X_k)=\ZZ_k`.
892
893
EXAMPLES::
894
895
sage: X_2 = toric_varieties.Cube_deformation(2)
896
sage: X_2
897
3-d toric variety covered by 6 affine patches
898
sage: X_2.fan().ray_matrix()
899
[ 1 1 -1 -1 -1 -1 1 1]
900
[ 1 -1 1 -1 -1 1 -1 1]
901
[ 5 1 1 1 -1 -1 -1 -1]
902
sage: X_2.gens()
903
(z0, z1, z2, z3, z4, z5, z6, z7)
904
905
REFERENCES:
906
907
.. [FS]
908
William Fulton, Bernd Sturmfels, "Intersection Theory on
909
Toric Varieties", http://arxiv.org/abs/alg-geom/9403002
910
"""
911
# We are going to eventually switch off consistency checks, so we need
912
# to be sure that the input is acceptable.
913
try:
914
k = ZZ(k) # make sure that we got a "mathematical" integer
915
except TypeError:
916
raise TypeError("cube deformations X_k are defined only for "
917
"non-negative integer k!\nGot: %s" % k)
918
if k < 0:
919
raise ValueError("cube deformations X_k are defined only for "
920
"non-negative k!\nGot: %s" % k)
921
rays = lambda kappa: matrix([[ 1, 1, 2*kappa+1],[ 1,-1, 1],[-1, 1, 1],[-1,-1, 1],
922
[-1,-1,-1],[-1, 1,-1],[ 1,-1,-1],[ 1, 1,-1]])
923
cones = [[0,1,2,3],[4,5,6,7],[0,1,7,6],[4,5,3,2],[0,2,5,7],[4,6,1,3]]
924
fan = Fan(cones, rays(k))
925
return ToricVariety(fan, coordinate_names=names)
926
927
def BCdlOG(self, names='v1 v2 c1 c2 v4 v5 b e1 e2 e3 f g v6'):
928
r"""
929
Construct the 5-dimensional toric variety studied in
930
[BCdlOG]_, [HLY]_
931
932
INPUT:
933
934
- ``names`` -- string. Names for the homogeneous
935
coordinates. See
936
:func:`~sage.schemes.toric.variety.normalize_names`
937
for acceptable formats.
938
939
OUTPUT:
940
941
A :class:`CPR-Fano toric variety
942
<sage.schemes.toric.fano_variety.CPRFanoToricVariety_field>`.
943
944
EXAMPLES::
945
946
sage: X = toric_varieties.BCdlOG() # long time (56s on sage.math, 2011)
947
sage: X # long time
948
5-d CPR-Fano toric variety covered by 54 affine patches
949
sage: X.fan().ray_matrix() # long time
950
[-1 0 0 0 0 0 0 0 0 0 0 0 1]
951
[ 0 -1 0 0 0 0 0 0 0 0 1 1 0]
952
[ 0 0 -1 -1 0 0 0 1 2 1 2 3 4]
953
[ 2 2 2 1 -1 0 2 2 2 1 2 2 2]
954
[ 3 3 3 2 0 -1 3 3 3 1 3 3 3]
955
sage: X.gens() # long time
956
(v1, v2, c1, c2, v4, v5, b, e1, e2, e3, f, g, v6)
957
958
REFERENCES:
959
960
.. [BCdlOG]
961
Volker Braun, Philip Candelas, Xendia de la Ossa,
962
Antonella Grassi, "Toric Calabi-Yau Fourfolds, Duality
963
Between N=1 Theories and Divisors that Contribute to the
964
Superpotential", http://arxiv.org/abs/hep-th/0001208
965
966
.. [HLY]
967
Yi Hu, Chien-Hao Liu, Shing-Tung Yau, "Toric morphisms and
968
fibrations of toric Calabi-Yau hypersurfaces",
969
http://arxiv.org/abs/math/0010082
970
"""
971
return self._make_CPRFanoToricVariety('BCdlOG', names)
972
973
def BCdlOG_base(self, names='d4 d3 r2 r1 d2 u d1'):
974
r"""
975
Construct the base of the `\mathbb{P}^2(1,2,3)` fibration
976
:meth:`BCdlOG`.
977
978
INPUT:
979
980
- ``names`` -- string. Names for the homogeneous
981
coordinates. See
982
:func:`~sage.schemes.toric.variety.normalize_names`
983
for acceptable formats.
984
985
OUTPUT:
986
987
A :class:`toric variety
988
<sage.schemes.toric.variety.ToricVariety_field>`.
989
990
EXAMPLES::
991
992
sage: base = toric_varieties.BCdlOG_base()
993
sage: base
994
3-d toric variety covered by 10 affine patches
995
sage: base.fan().ray_matrix()
996
[-1 0 0 0 0 0 1]
997
[ 0 -1 0 0 1 1 0]
998
[ 0 0 -1 1 2 3 4]
999
sage: base.gens()
1000
(d4, d3, r2, r1, d2, u, d1)
1001
"""
1002
return self._make_ToricVariety('BCdlOG_base', names)
1003
1004
def P2_112(self, names='z+'):
1005
r"""
1006
Construct the weighted projective space
1007
`\mathbb{P}^2(1,1,2)`.
1008
1009
INPUT:
1010
1011
- ``names`` -- string. Names for the homogeneous
1012
coordinates. See
1013
:func:`~sage.schemes.toric.variety.normalize_names`
1014
for acceptable formats.
1015
1016
OUTPUT:
1017
1018
A :class:`CPR-Fano toric variety
1019
<sage.schemes.toric.fano_variety.CPRFanoToricVariety_field>`.
1020
1021
EXAMPLES::
1022
1023
sage: P2_112 = toric_varieties.P2_112()
1024
sage: P2_112
1025
2-d CPR-Fano toric variety covered by 3 affine patches
1026
sage: P2_112.fan().ray_matrix()
1027
[ 1 0 -1]
1028
[ 0 1 -2]
1029
sage: P2_112.gens()
1030
(z0, z1, z2)
1031
"""
1032
return self._make_CPRFanoToricVariety('P2_112', names)
1033
1034
def P2_123(self, names='z+'):
1035
r"""
1036
Construct the weighted projective space
1037
`\mathbb{P}^2(1,2,3)`.
1038
1039
INPUT:
1040
1041
- ``names`` -- string. Names for the homogeneous
1042
coordinates. See
1043
:func:`~sage.schemes.toric.variety.normalize_names`
1044
for acceptable formats.
1045
1046
OUTPUT:
1047
1048
A :class:`CPR-Fano toric variety
1049
<sage.schemes.toric.fano_variety.CPRFanoToricVariety_field>`.
1050
1051
EXAMPLES::
1052
1053
sage: P2_123 = toric_varieties.P2_123()
1054
sage: P2_123
1055
2-d CPR-Fano toric variety covered by 3 affine patches
1056
sage: P2_123.fan().ray_matrix()
1057
[ 1 0 -2]
1058
[ 0 1 -3]
1059
sage: P2_123.gens()
1060
(z0, z1, z2)
1061
"""
1062
return self._make_CPRFanoToricVariety('P2_123', names)
1063
1064
def P4_11169(self, names='z+'):
1065
r"""
1066
Construct the weighted projective space
1067
`\mathbb{P}^4(1,1,1,6,9)`.
1068
1069
INPUT:
1070
1071
- ``names`` -- string. Names for the homogeneous
1072
coordinates. See
1073
:func:`~sage.schemes.toric.variety.normalize_names`
1074
for acceptable formats.
1075
1076
OUTPUT:
1077
1078
A :class:`CPR-Fano toric variety
1079
<sage.schemes.toric.fano_variety.CPRFanoToricVariety_field>`.
1080
1081
EXAMPLES::
1082
1083
sage: P4_11169 = toric_varieties.P4_11169()
1084
sage: P4_11169
1085
4-d CPR-Fano toric variety covered by 5 affine patches
1086
sage: P4_11169.fan().ray_matrix()
1087
[ 1 0 0 0 -9]
1088
[ 0 1 0 0 -6]
1089
[ 0 0 1 0 -1]
1090
[ 0 0 0 1 -1]
1091
sage: P4_11169.gens()
1092
(z0, z1, z2, z3, z4)
1093
"""
1094
return self._make_CPRFanoToricVariety('P4_11169', names)
1095
1096
def P4_11169_resolved(self, names='z+'):
1097
r"""
1098
Construct the blow-up of the weighted projective space
1099
`\mathbb{P}^4(1,1,1,6,9)` at its curve of `\ZZ_3` orbifold
1100
fixed points.
1101
1102
INPUT:
1103
1104
- ``names`` -- string. Names for the homogeneous
1105
coordinates. See
1106
:func:`~sage.schemes.toric.variety.normalize_names`
1107
for acceptable formats.
1108
1109
OUTPUT:
1110
1111
A :class:`CPR-Fano toric variety
1112
<sage.schemes.toric.fano_variety.CPRFanoToricVariety_field>`.
1113
1114
EXAMPLES::
1115
1116
sage: P4_11169_resolved = toric_varieties.P4_11169_resolved() # long time (2s on sage.math, 2011)
1117
sage: P4_11169_resolved # long time
1118
4-d CPR-Fano toric variety covered by 9 affine patches
1119
sage: P4_11169_resolved.fan().ray_matrix() # long time
1120
[ 1 0 0 0 -9 -3]
1121
[ 0 1 0 0 -6 -2]
1122
[ 0 0 1 0 -1 0]
1123
[ 0 0 0 1 -1 0]
1124
sage: P4_11169_resolved.gens() # long time
1125
(z0, z1, z2, z3, z4, z5)
1126
"""
1127
return self._make_CPRFanoToricVariety('P4_11169_resolved', names)
1128
1129
def P4_11133(self, names='z+'):
1130
"""
1131
Construct the weighted projective space
1132
`\mathbb{P}^4(1,1,1,3,3)`.
1133
1134
INPUT:
1135
1136
- ``names`` -- string. Names for the homogeneous
1137
coordinates. See
1138
:func:`~sage.schemes.toric.variety.normalize_names`
1139
for acceptable formats.
1140
1141
OUTPUT:
1142
1143
A :class:`CPR-Fano toric variety
1144
<sage.schemes.toric.fano_variety.CPRFanoToricVariety_field>`.
1145
1146
EXAMPLES::
1147
1148
sage: P4_11133 = toric_varieties.P4_11133()
1149
sage: P4_11133
1150
4-d CPR-Fano toric variety covered by 5 affine patches
1151
sage: P4_11133.fan().ray_matrix()
1152
[ 1 0 0 0 -3]
1153
[ 0 1 0 0 -3]
1154
[ 0 0 1 0 -1]
1155
[ 0 0 0 1 -1]
1156
sage: P4_11133.gens()
1157
(z0, z1, z2, z3, z4)
1158
"""
1159
return self._make_CPRFanoToricVariety('P4_11133', names)
1160
1161
def P4_11133_resolved(self, names='z+'):
1162
"""
1163
Construct the weighted projective space
1164
`\mathbb{P}^4(1,1,1,3,3)`.
1165
1166
INPUT:
1167
1168
- ``names`` -- string. Names for the homogeneous
1169
coordinates. See
1170
:func:`~sage.schemes.toric.variety.normalize_names`
1171
for acceptable formats.
1172
1173
OUTPUT:
1174
1175
A :class:`CPR-Fano toric variety
1176
<sage.schemes.toric.fano_variety.CPRFanoToricVariety_field>`.
1177
1178
EXAMPLES::
1179
1180
sage: P4_11133_resolved = toric_varieties.P4_11133_resolved()
1181
sage: P4_11133_resolved
1182
4-d CPR-Fano toric variety covered by 9 affine patches
1183
sage: P4_11133_resolved.fan().ray_matrix()
1184
[ 1 0 0 0 -3 -1]
1185
[ 0 1 0 0 -3 -1]
1186
[ 0 0 1 0 -1 0]
1187
[ 0 0 0 1 -1 0]
1188
sage: P4_11133_resolved.gens()
1189
(z0, z1, z2, z3, z4, z5)
1190
"""
1191
return self._make_CPRFanoToricVariety('P4_11133_resolved', names)
1192
1193
1194
toric_varieties = ToricVarietyFactory()
1195
1196