Author: Martin Bies
using Oscar
----- ----- ----- - -----
| | | | | | | | | |
| | | | | | | |
| | ----- | | | |-----
| | | | |-----| | |
| | | | | | | | | |
----- ----- ----- - - - -
...combining (and extending) ANTIC, GAP, Polymake and Singular
Version 0.12.0-DEV ...
... which comes with absolutely no warranty whatsoever
Type: '?Oscar' for more information
(c) 2019-2023 by The OSCAR Development Team
Any geometry course (analytic geometry, algebraic geometry and of course toric geometry too) begins with the study of affine varieties/schemes. So we first recall that affine toric varieties are encoded by rational polyhedral cones.
Specifically, let us state theorem 1.2.18 of the book Toric Varieties by David Cox, John Little and Hal Schenck:
Let $\sigma \subseteq N_{\mathbb{R}} \cong \mathbb{R}^n$ be a rational polyhedral cone with semigroup $S_\sigma = \sigma^\vee \cap M$. Then the associated affine toric variety $U_\sigma$ is given by
$$ U_\sigma = \mathrm{Spec} \left(\mathbb{C} \left[ S_\sigma \right]\right) = \mathrm{Spec} \left(\mathbb{C} \left[ \sigma^\vee \cap M \right]\right) \, .$$In particular, it holds
$$\mathrm{dim}( U_\sigma ) = n \, \Leftrightarrow \, \text{the torus of $U_\sigma$ is } T_N = N \otimes_{\mathbb{Z}} \mathbb{C}^\ast \, \Leftrightarrow \, \sigma \text{ is strongly convex.}$$As per usual, we focus on strongy convex polyhedral cones $\sigma$, so that $T_N$ is the algebraic torus of $U_\sigma$.
C = positive_hull([1 0; 0 1])
Polyhedral cone in ambient dimension 2
antv = affine_normal_toric_variety(C)
Normal, affine toric variety
The cone $\sigma$ encodes a lot of information about the affine toric variety $U_\sigma$. In the background, OSCAR conducts such investigations in polyhedral geometry with Polymake (cf. https://polymake.org/doku.php/start). This allows us to access a lot of properties of affine toric varieties. Here are a few examples
is_smooth(antv)
true
is_complete(antv)
false
is_simplicial(antv)
true
We can also look for polynomials that cut out this affine variety in $\mathbb{C}^k$ for a suitable integer $k$. The ideal, which cuts out the affine variety in question is nothing but the toric ideal. We compute it as follows:
toric_ideal(antv)
ideal(0)
This means, that the variety antv is nothing but $\mathbb{C}^2$. Here is a more interesting example:
C2 = positive_hull([1 1; -1 1])
Polyhedral cone in ambient dimension 2
antv2 = affine_normal_toric_variety(C2)
Normal, affine toric variety
is_smooth(antv2)
false
is_simplicial(antv2)
true
toric_ideal(antv2)
ideal(-x1*x2 + x3^2)
So in $\mathbb{C}^3$ with coordinate ring $\mathbb{C}[ x_1, x_2, x_3 ]$ we are looking at the variety $X = V( - x_1 x_2 + x_3^2 )$. This is a rather classical example of a simplicial, affine toric variety.
More general toric varieties are constructed by providing not only one strongly convex polyhedral cone, but a collection of "compatible" cones. Such a collection is termed a (strongly convex polyhedral) fan.
We give details on how to create fans and the corresponding toric varieties in section 3 of this tutorial. In this section however, we demonstrate the existing functionality in OSCAR by studying the projective space. Specifically, let us focus on the projective space $\mathbb{P}^2$.
We construct the projective space as follows:
P2 = projective_space(NormalToricVariety, 2)
Normal, non-affine, smooth, projective, gorenstein, fano, 2-dimensional toric variety without torusfactor
As you can notice, upon creation a lot of information on this space is already known.
Notice that the constructor expects us to state as first argument NormalToricVariety. This is to tell OSCAR that we want the projective space as a toric variety.
This is a design decision that was taken after careful consideration. Namely, the projective space could in principle be constructed as a scheme (with an arbitrary coefficient ring) or merely as a space parametrized by homogeneous coordinates. Depending on which of these perspectives is desired, specializes algorithms may be available. As of February 2023, there are many specialized toric algorithms. So in this regard, providing NormalToricVariety as the first argument ensures that we can perform a large number of computations.
We can check for properties by invoking "is_" followed by the property that we want to compute. Here are a few examples:
is_affine(P2)
false
is_smooth(P2)
true
is_projective(P2)
true
An exception to this rule is the torus factor. Namely, since the terminology is to ask for "having a torus factor", we have to invoke:
has_torusfactor(P2)
false
A basic attribute that we would like to access is the dimension of the space:
dim(P2)
2
The next interesting class of attributes concerns the divisors on toric varieties. Let us turn to them next.
The group of the torus-invariant Weil divisors $\mathrm{Div}_T(\mathbb{P}^2)$ can be accessed as follows:
torusinvariant_weil_divisor_group(P2)
GrpAb: Z^3
torusinvariant_cartier_divisor_group(P2)
GrpAb: Z^3
Of course, we can map torus-invariant Weil divisors to the class group $\mathrm{Cl}( \mathbb{P}^2 )$:
f1 = map_from_torusinvariant_weil_divisor_group_to_class_group(P2)
Map with following data Domain: ======= Abelian group with structure: Z^3 Codomain: ========= Abelian group with structure: Z
To see the mapping prescription, we can access the matrix of this map:
matrix(f1)
[1] [1] [1]
This means, that there are 3 torus-invariant Weil divisors $D_1$, $D_2$, $D_3$ for $\mathbb{P}^2$ (each corresponding to a ray in the fan of $\mathbb{P}^2$). The map to the class group assigns to each of the 3 torus-invariant Weil divisors the same divisor class, i.e. $[D_1] = [D_2] = [D_3]$. Or put differently, the Weil divisors $D_1$, $D_2$, $D_3$ are linearly equivalent: $D_1 \sim D_2 \sim D_3$.
Of course, we can also use this information to find the Class group $\mathrm{Cl} ( \mathbb{P}^2 )$:
class_group(P2)
GrpAb: Z
Similarly, we want to understand how the group of torus-invariant Cartier divisors $\mathrm{Div}_T(\mathbb{P}^2)$ map to the Picard group:
f2 = map_from_cartier_divisor_group_to_picard_group(P2)
Map with following data Domain: ======= Abelian group with structure: Z^3 Codomain: ========= Abelian group with structure: Z
matrix(f2)
[1] [1] [1]
With this, we can also find the Picard group $\mathrm{Pic} ( \mathbb{P}^2 )$ of the projective space:
picard_group(P2)
GrpAb: Z
Recall that $\mathbb{P}^2$ is smooth. Therefore, the notion of the torus-invariant Cartier divisors and of the torus-invariant Weil divisors coincide. Indeed, we can see this by considering the map from the torus-invariant Cartier divisors to the torus-invariant Weil divisors:
f3 = map_from_torusinvariant_cartier_divisor_group_to_torusinvariant_weil_divisor_group(P2)
Map with following data Domain: ======= Abelian group with structure: Z^3 Codomain: ========= Abelian group with structure: Z^3
matrix(f3)
[1 0 0] [0 1 0] [0 0 1]
At times, it will be interesting to find a torus-invariant Weil divisor $D$ that represents a certain divisor class. This is possible because $f_1$ is surjective:
is_surjective(f1)
true
Hence, for every $x \in \mathrm{Cl}(\mathbb{P}^2)$, there is a $y \in \mathrm{Div}_T(\mathbb{P}^2)$ with $f_1(y) = x$. We can compute such preimages:
[preimage(f1,x) for x in gens(class_group(P2))]
1-element Vector{GrpAbFinGenElem}: Element of GrpAb: Z^3 with components [1 0 0]
Alternatively, we can even find the preinverse of $f_1$ directly:
matrix(preinverse(f1))
[1 0 0]
This functionality is particularly useful in the context of line bundles on toric varieties, i.e. the elements of the Picard group $\mathrm{Pic}(\mathbb{P}^2)$. We will study line bundles momentarily.
We complete this section by briefly mentioning the character lattice $N(\mathbb{P}^2)$. Since $\mathbb{P}^2$ has no torus factor, there is a short exact sequence:
$$0 \to N(\mathbb{P}^2) \hookrightarrow \mathrm{Div}_T( \mathbb{P}^2 ) \twoheadrightarrow \mathrm{Cl} ( \mathbb{P}^2 ) \to 0.$$The map $N(\mathbb{P}^2) \hookrightarrow \mathrm{Div}_T( \mathbb{P}^2 )$ can be computed as follows:
f4 = map_from_character_lattice_to_torusinvariant_weil_divisor_group(P2)
Map with following data Domain: ======= Abelian group with structure: Z^2 Codomain: ========= Abelian group with structure: Z^3
is_injective(f4)
true
is_surjective(f4)
false
matrix(f4)
[1 0 -1] [0 1 -1]
The columns of this matrix are the ray generators of the fan of the projective space $\mathbb{P}^2$.
Let us now create a torus-invariant Weil divisor on the projective space $\mathbb{P}^2$. From the study of toric divisors above, we recall that the group of torus-invariant Weil divisors has 3 generators $D_1$, $D_2$ and $D_3$. Hence, the most general torus-invariant Weil divisor is of the form $a_1 D_1 + a_2 D_2 + a_3 D_3$ with $a_1, a_2, a_3 \in \mathbb{Z}$. The constructor for toric divisors on $\mathbb{P}^2$ expects the list $[a_1, a_2, a_3]$ as its second argument.
Let us now create the torusinvariant Weil divisor $D = 1 D_1 + 2 D_2 + 3 D_3$:
D = toric_divisor(P2,[1,2,3])
Torus-invariant, non-prime divisor on a normal toric variety
We support various properties and attributes for such a divisor:
is_ample(D)
true
is_very_ample(D)
true
is_cartier(D)
true
is_principal(D)
false
coefficients(D)
3-element Vector{ZZRingElem}: 1 2 3
In particular we can compute the divsior class associated to this divisor:
DC = toric_divisor_class(D)
Divisor class on a normal toric variety
The task of finding a divisor in this divisor class is exactly the question of inverting the map $f_1$ introduced above. This is handled behind the scenes with the following command:
D2 = toric_divisor(DC)
Torus-invariant, non-prime divisor on a normal toric variety
Note that $D_2$ and $D$ are not identical:
D == D2
false
We can see this explicitly, by asking for the coefficients of $D_2$:
coefficients(D2)
3-element Vector{ZZRingElem}: 6 0 0
However, $D \sim D_2$. This is the case since $D - D_2$ is a principal divisor:
is_principal(D - D2)
true
So, as expected $[D] = [D_2]$.
Line bundles are the elements of the Picard group $\mathrm{Pic}( \mathbb{P}^2 )$. They are created similarly to Weil divisor. Let us first demonstrate how we can compute the Picard group $\mathrm{Pic}(\mathbb{P}^2)$ in OSCAR:
picard_group(P2)
GrpAb: Z
Hence, this group has a single generator $G = \mathcal{O}_{\mathbb{P}^2}(1)$ and every element in this group is of the form $G^a = G \otimes \dots \otimes G = \mathcal{O}_{\mathbb{P}^2}(a)$ with $a \in \mathbb{Z}$. Therefore, the constructor for line bundles on the projective space expects $[a]$ as input. For instance, the following creates the line bundle $\mathcal{L} = \mathcal{O}_{\mathbb{P}^2}(1)$:
L = toric_line_bundle(P2,[1])
Toric line bundle on a normal toric variety
Again, various properties and attributes are supported for line bundles. For example, we can check if a line bundle is the trivial line bundle (i.e. the zero element in the Picard group):
is_trivial(L)
false
Other properties are accessed by computing a divisor (class) corresponding to the line bundle in question (i.e. inverting the map $\mathrm{CDiv}( \mathbb{P}^2 ) \to \mathrm{Pic}( \mathbb{P}^2 )$):
toric_divisor(L)
Torus-invariant, cartier, non-principal, prime divisor on a normal toric variety
divisor_class(L)
Element of GrpAb: Z with components [1]
Among others, ampleness of a line bundle is checked by checking it for the underlying divisor:
is_ample(L)
true
is_very_ample(L)
true
Another example is the degree of the line bundle:
degree(L)
1
To compute line bundle cohomology, we use the cohomCalg algorithm (cf. https://github.com/BenjaminJurke/cohomCalg). It is executed as follows:
all_cohomologies(L)
3-element Vector{ZZRingElem}: 3 0 0
This means that $h^0( \mathbb{P}^2, \mathcal{L} ) = 3$ and $h^1( \mathbb{P}^2, \mathcal{L} ) = h^2( \mathbb{P}^2, \mathcal{L} ) = 0$. This result is of course well-known to the experts. This functionality works as long as the variety in question is either (smooth and complete) or (simplicial and projective).
Of course, we can also compute just some of the line bundle cohomologies. For instance, the following finds $h^0( \mathbb{P}^2, \mathcal{L} )$:
cohomology(L,0)
3
The Cox ring of the toric variety is very important. It is the algebraic counterpart to the structure sheaf $\mathcal{O}_{\mathbb{P}^2}$:
cox_ring(P2)
Multivariate Polynomial Ring in x1, x2, x3 over Rational Field graded by x1 -> [1] x2 -> [1] x3 -> [1]
As such, it comes at no surprise that a basis of the global sections of line bundles can be found from the homogeneous components of the Cox ring. An alternative methods exists via Laurent monomials. Both options are available within OSCAR:
basis_of_global_sections_via_homogeneous_component(L)
3-element Vector{MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}}: x3 x2 x1
basis_of_global_sections_via_rational_functions(L)
3-element Vector{MPolyQuoRingElem{QQMPolyRingElem}}: x1_ x2*x1_ 1
For convenience, the default is to use the homogeneous components. That is:
basis_of_global_sections(L)
3-element Vector{MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}}: x3 x2 x1
We now come back to constructing more general toric varieties. As mentioned above, this in general relies on the construction of a fan consisting of strongly convex polyhedral cones. This polyhedral geometry is the backbone for many computations in toric geometry. In particular, OSCAR knows the fan of the projective space $\mathbb{P}^2$:
fan_of_P2 = fan(P2)
Polyhedral fan in ambient dimension 2
You can plot this fan by invoking the command visualize(f). This will (most likely) open a separate window with an illustration of the fan. Alternatively, we can investigate the fan in more details by computing its rays and maximal cones:
rays(fan_of_P2)
3-element SubObjectIterator{RayVector{QQFieldElem}}: [1, 0] [0, 1] [-1, -1]
maximal_cones(fan_of_P2)
3-element SubObjectIterator{Cone{QQFieldElem}}: Polyhedral cone in ambient dimension 2 Polyhedral cone in ambient dimension 2 Polyhedral cone in ambient dimension 2
[rays(c) for c in maximal_cones(fan_of_P2)]
3-element Vector{SubObjectIterator{RayVector{QQFieldElem}}}: [[1, 0], [0, 1]] [[0, 1], [-1, -1]] [[1, 0], [-1, -1]]
Indeed, this is the famous fan of the projective space $\mathbb{P}^2$.
We now want to demonstrate how a toric variety can be created from a fan. As we have gained familarity with the projective space in the previous sections, it is natural to exemplify the operations on the projective space $\mathbb{P}^2$. For this, we proceed as follows:
ray_generators = [[1, 0], [0, 1], [-1, -1]]
max_cones = [[1, 2], [2, 3], [3, 1]]
X = normal_toric_variety(ray_generators, max_cones)
Normal toric variety
When created in this way, the variety "knows" less information than by using the standard constructor projective_space()", as demonstrated in the previous section. The reason is that by providing the fan, we can construct all sorts of toric varieties. But we can of course compute the necessary information to convince ourselves that this indeed is the projective space $\mathbb{P}^2$:
is_projective(X)
true
is_smooth(X)
true
dim(X)
2
class_group(X)
GrpAb: Z
torusinvariant_weil_divisor_group(X)
GrpAb: Z^3
cox_ring(X)
Multivariate Polynomial Ring in x1, x2, x3 over Rational Field graded by x1 -> [1] x2 -> [1] x3 -> [1]
We provide a constructor for del Pezzo surfaces. For instance, we can issue:
dP3 = del_pezzo_surface(3)
Normal, non-affine, smooth, projective, gorenstein, fano, 2-dimensional toric variety without torusfactor
To demonstrate that the line bundle cohomology computations also work in such more general settings, let us construct a toric line bundle and compute its sheaf cohomology dimensions:
picard_group(dP3)
GrpAb: Z^4
L2 = toric_line_bundle(dP3,[3,2,1,0])
Toric line bundle on a normal toric variety
all_cohomologies(L2)
3-element Vector{ZZRingElem}: 6 0 0
It is worth recalling that we can find a basis of the global sections. However, a basis for the higher sheaf cohomologies cannot (yet) be computed with OSCAR.
basis_of_global_sections(L2)
6-element Vector{MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}}: x2^2*x3*e3^3 x1*x2*x3*e2*e3^2 x1*x2^2*e1*e3^2 x1^2*x3*e2^2*e3 x1^2*x2*e1*e2*e3 x1^3*e1*e2^2
Similarly, we can also construct Hirzebruch surfaces:
F2 = hirzebruch_surface(2)
Normal, non-affine, smooth, projective, gorenstein, non-fano, 2-dimensional toric variety without torusfactor
By means of a star subdivision, one can conduct a toric blowup. The relevant functionality is available in OSCAR. To this end let us look at the projective space anew:
P2
Normal, non-affine, smooth, projective, gorenstein, fano, 2-dimensional toric variety without torusfactor
cox_ring(P2)
Multivariate Polynomial Ring in x1, x2, x3 over Rational Field graded by x1 -> [1] x2 -> [1] x3 -> [1]
Let us now perform a blowup of the locus $V( x_1, x_2 )$. This is done as follows:
BP2 = blowup_on_ith_minimal_torus_orbit(P2, 1, "e")
Normal toric variety
The number "1" selects the maximal cone of the fan of $\mathbb{P}^2$ which we divide by the star subdivision. The string "e" defines the name for the new homogeneous coordinate of the toric variety. Here we have the following correspondence between ray generators and homogeneous variables: \begin{align} x_1 &\leftrightarrow [1,0] \,\\ x_2 &\leftrightarrow [0,1] \,\\ x_3 &\leftrightarrow [-1,-1] \,. \end{align} The blowup thus requires a star subdivision of the cone $C = \mathrm{Span}_{\mathbb{Z}_{\geq 0}} \left\{ [1,0], [0,1]\right\}$. To this end, we first compute the sum of the generators of $C$. This is a new ray generator: $$e \leftrightarrow [1,1] \,,$$ which we use to define the cones which maximally subdivide $C$, namely: $$C_1 = \mathrm{Span}_{\mathbb{Z}_{\geq 0}} \left\{ [1,0], [1,1]\right\} \, , \qquad C_2 = \mathrm{Span}_{\mathbb{Z}_{\geq 0}} \left\{ [1,1], [0,1]\right\} \, .$$ Let us see that this is indeed the case for the above computed toric space $B\mathbb{P}^2$:
fan_of_BP2 = fan(BP2)
Polyhedral fan in ambient dimension 2
rays(fan_of_BP2)
4-element SubObjectIterator{RayVector{QQFieldElem}}: [0, 1] [-1, -1] [1, 0] [1, 1]
So we notice the new ray $[1,1]$. To find the new cones $C_1$ and $C_2$, we issue the following:
[rays(c) for c in maximal_cones(fan_of_BP2)]
4-element Vector{SubObjectIterator{RayVector{QQFieldElem}}}: [[0, 1], [-1, -1]] [[-1, -1], [1, 0]] [[1, 0], [1, 1]] [[0, 1], [1, 1]]
So indeed, the last two cones are the expected new cones. The first two are the cones that exist for the fan of $\mathbb{P}^2$ and were not changed.
The variable $e$ we can see most prominently in the Cox ring:
cox_ring(BP2)
Multivariate Polynomial Ring in x2, x3, x1, e over Rational Field graded by x2 -> [1 0] x3 -> [0 1] x1 -> [1 0] e -> [-1 1]
It is instructive to look at the following alternative grading of the Cox ring (and we order the variables in ascending order): $$\begin{array}{ccc|c} x_1 & x_2 & x_3 & e \\ \hline 1 & 1 & 1 & 0 \\ 1 & 1 & 0 & -1 \end{array}$$ In the first line you notice the ordinary grading of the Cox ring of $\mathbb{P}^2$. The second line corresonds to the toric blowup that has been conducted. The $-1$ for $e$ tells us that this is the homogeneous coordinate introduced to resemble the blowup $\mathbb{P}^1$. The 1 for $x_1$ and $x_2$ tells us that this blowup added a $\mathbb{P}^1$ at the locus $\{ x_1 = x_2 = 0\}$ in $\mathbb{P}^2$. In other words, in $B\mathbb{P}^2$, $x_1$ and $x_2$ cannot vanish simultaneously: $$\{ [x_1 : x_2 : x_3 : e] \in B\mathbb{P}^2 | x_1 = x_2 = 0\} = \emptyset \, .$$ It is instructive to recall that the generators of the Stanley-Reisner ideal encode exactly which homogeneous variables cannot vanish simultaneously:
stanley_reisner_ideal(BP2)
ideal(x2*x1, x3*e)
This means that $\emptyset = V( x_2, x_1 ) \subseteq B \mathbb{P}^2$ and $\emptyset = V( x_3, e ) \subset B \mathbb{P}^2$.
Along these lines, we can also see that the locus $V(e) \subset B\mathbb{P}^2$ is a $\mathbb{P}^1$. Namely, from the Stanley-Reisner ideal we learn that $x_3$ and $e$ cannot vanish simultaneously. So $x_3 \neq 0$ and we can rescale it to $1$. This rescaling effectively eliminates the 2nd line in the grading of the Cox ring and leaves us with $$\begin{array}{ccc|c} x_1 & x_2 \\ \hline 1 & 1 \end{array}$$ So we notice, that the variables $x_1$ and $x_2$ each enjoy the standard grading $(1,1)$. Also, since $x_1 x_2 \in I_{\text{SR}}( B\mathbb{P}^2 )$, it holds $\emptyset = V( x_2, x_1 ) \subset B \mathbb{P}^2$. This implies $V( e ) \cong \mathbb{P}^1_{[x_1 \colon x_2]}$.
It is also possible to compute Cartesian products of toric varieties. Here is an example:
product = P2 * F2
Normal toric variety
cox_ring(product)
Multivariate Polynomial Ring in 7 variables xx1, xx2, xx3, yt1, ..., yx2 over Rational Field graded by xx1 -> [1 0 0] xx2 -> [1 0 0] xx3 -> [1 0 0] yt1 -> [0 1 0] yx1 -> [0 0 1] yt2 -> [0 1 0] yx2 -> [0 2 1]
Notice that the set of variables "xx*" correspond to the $\mathbb{P}^2$ factor, and the remaining variables are the homogeneous coordinates of the Hirzebruch surface $\mathbb{F}_2$.
Triangulations of polytopes open an entire arena for creating families of toric varieties whose properties are often related to one-another in interesting ways. A prominent example along these lines is the Kreuzer-Skarke database (cf. http://hep.itp.tuwien.ac.at/~kreuzer/CY/). Another popular example is the conifold transition, which we now use to demonstrate triangulation functionality in OSCAR:
P = convex_hull([0 0 0; 0 0 1; 1 0 1; 1 1 1; 0 1 1])
Polyhedron in ambient dimension 3
(v1, v2) = normal_toric_varieties_from_star_triangulations(P)
2-element Vector{NormalToricVariety}: Normal toric variety Normal toric variety
If desired, you can look at $P$ by invoking visualize(P). The polyhedron $P$ admits exactly two fine, regular, star triangulations. These were used to create the toric varieties $v_1$ and $v_2$. We now study these two varieties:
is_smooth(v1)
true
is_projective(v1)
false
dim(v1)
3
is_complete(v1)
false
cox_ring(v1)
Multivariate Polynomial Ring in x1, x2, x3, x4 over Rational Field graded by x1 -> [1] x2 -> [-1] x3 -> [1] x4 -> [-1]
stanley_reisner_ideal(v1)
ideal(x2*x4)
If we repeat these line with $v_2$, then the only difference is:
stanley_reisner_ideal(v2)
ideal(x1*x3)
So in a sence, the transition from $v_1$ to $v_2$ means that the roles of ($x_2$, $x_4$) and ($x_1$, $x_3$) are exchanged. Indeed, the conifold transition means to first perform a deformation which shrinks an algebraic cycle to zero. This leads to a conifold singularity which is subsequently resolved by blowing up another algebraic cycle.
Triangulations are a topic that features prominently in applied mathematics, e.g. in string theory. The following code was used in a recent string theory publication (https://arxiv.org/abs/2205.00008):
function involved_triangulation()
# (0) Define the polytope
fac1 = convex_hull( [-1 -1 -1; 2 -1 -1; -1 2 -1]);
fac2 = convex_hull( [-1 -1 -1; 2 -1 -1; -1 -1 5]);
fac3 = convex_hull( [-1 -1 -1; -1 2 -1; -1 -1 5]);
fac4 = convex_hull( [2 -1 -1; -1 2 -1; -1 -1 5]);
fac = fac1;
# (1) Set variable names of our choice
vars_dict = Dict();
vars_dict[matrix(ZZ,[-1 -1 -1])] = "x0";
vars_dict[matrix(ZZ,[2 -1 -1])] = "x1";
vars_dict[matrix(ZZ,[-1 2 -1])] = "x2";
vars_dict[matrix(ZZ,[-1 -1 5])] = "x3";
vars_dict[matrix(ZZ,[-1 -1 0])] = "x4";
vars_dict[matrix(ZZ,[-1 -1 1])] = "x5";
vars_dict[matrix(ZZ,[-1 -1 2])] = "x6";
vars_dict[matrix(ZZ,[-1 -1 3])] = "x7";
vars_dict[matrix(ZZ,[-1 -1 4])] = "x8";
vars_dict[matrix(ZZ,[-1 0 -1])] = "x9";
vars_dict[matrix(ZZ,[-1 0 0])] = "x10";
vars_dict[matrix(ZZ,[-1 0 1])] = "x11";
vars_dict[matrix(ZZ,[-1 0 2])] = "x12";
vars_dict[matrix(ZZ,[-1 0 3])] = "x13";
vars_dict[matrix(ZZ,[-1 1 -1])] = "x14";
vars_dict[matrix(ZZ,[-1 1 0])] = "x15";
vars_dict[matrix(ZZ,[-1 1 1])] = "x16";
vars_dict[matrix(ZZ,[0 -1 -1])] = "x17";
vars_dict[matrix(ZZ,[0 -1 0])] = "x18";
vars_dict[matrix(ZZ,[0 -1 1])] = "x19";
vars_dict[matrix(ZZ,[0 -1 2])] = "x20";
vars_dict[matrix(ZZ,[0 -1 3])] = "x21";
vars_dict[matrix(ZZ,[0 0 -1])] = "x22";
vars_dict[matrix(ZZ,[0 0 1])] = "x23";
vars_dict[matrix(ZZ,[0 1 -1])] = "x24";
vars_dict[matrix(ZZ,[1 -1 -1])] = "x25";
vars_dict[matrix(ZZ,[1 -1 0])] = "x26";
vars_dict[matrix(ZZ,[1 -1 1])] = "x27";
vars_dict[matrix(ZZ,[1 0 -1])] = "x28";
#(2) Form point set to be triangulated
points = lattice_points(fac);
d = ambient_dim(fac)
pts = vcat(zero_matrix(ZZ, 1, d), matrix(ZZ, transpose(reduce(hcat,points))));
#(3) Triangulate
trias = star_triangulations(pts; full=true, regular=true);
trias = [[[c[k]-1 for k in 2:length(c)] for c in t] for t in trias];
#(4) Compute rays of all toric varieties
fan_rays = matrix(ZZ, points);
#(5) Construct ring which contains all Stanley-Reisner ideals
max_cones = IncidenceMatrix(vcat(trias[1]));
pmfan = Polymake.fan.PolyhedralFan(RAYS=fan_rays, MAXIMAL_CONES=max_cones);
variety = NormalToricVariety(PolyhedralFan{fmpq}(pmfan));
my_vars = [vars_dict[fan_rays[i,:]] for i in 1:nrows(fan_rays)];
set_coordinate_names(variety, my_vars);
R = cox_ring(variety);
#(6) Compute all ideals
sr_ideals = [];
for n in 1:length(trias)
id = stanley_reisner_ideal(R, SimplicialComplex(trias[n]));
push!(sr_ideals,id);
end;
#(7) Finall intersect all ideals
return common_sr_ideal = reduce(intersect,sr_ideals);
end
involved_triangulation (generic function with 1 method)
In a nutshell, this code computes all fine regular star triangulations of the polyhedron fac1, computes the Stanley-Reisner of the associated toric varieties and then intersects these ideals. As such, it finds the intersection theory that is common to this family of toric varieties.
The code for fac1 and fac4 will likely execute within a few seconds. For the polyhedrons fac2 or fac3, the task is much more involved and will likely take a few minutes. This is why in the above code, we fixed the choice of polyhedron to fac1. Brave users may which to challenge their computer a bit by altering that choice to fac2 or fac3. The computations should still complete on most private computers within a few minutes.
To benchmark the execution time of the function involved_triangulation, and thus provide comparision to other computer systems, we can execute the following:
using BenchmarkTools
@btime involved_triangulation()
267.974 ms (358874 allocations: 13.91 MiB)
ideal(x24*x1, x17*x1, x2*x1, x0*x1, x2*x28, x9*x28, x14*x25, x0*x25, x17*x24, x9*x2, x0*x2, x0*x14, x9*x14*x1, x0*x24*x28, x14*x17*x28, x9*x24*x25, x2*x17*x25, x22*x25*x28*x1, x14*x22*x28*x1, x9*x22*x25*x1, x22*x24*x25*x28, x17*x22*x25*x28, x14*x22*x24*x28, x0*x17*x22*x28, x2*x22*x24*x25, x9*x17*x22*x25, x14*x2*x22*x24, x9*x14*x22*x24, x0*x9*x22*x24, x14*x2*x17*x22, x9*x14*x17*x22, x0*x9*x17*x22)
You might find it interesting to compare your executation time to the following result:
This result was obtained on March 7, 2023 by runnning the OSCAR (see the beginning of this notebook for the version) with Julia 1.7.3 on a TUXEDO InfinityBook Pro 14 v4 with Intel Core i7-Quad-Core, 32GB RAM and operating system Ubuntu 20.04.5 LTS.
OSCAR aims for a broad user audience. As such, input is usually checked for consistency. This comes at the expense of loosing a bit of performance and possibly modifying the input data (if needed), e.g. shuffling it. In the toric settings, such shufflings of e.g. the order of rays can be undesirable.
It is possible to switch off such input checks when creating toric varieties. However, it must be emphasized that then it is the user's responsibility to provide sane input.
As an example, the following lines are executed internally to create the del Pezzo surface $dP_3$:
fan_rays = [1 0; 0 1; -1 -1; 1 1; 0 -1; -1 0]
cones = IncidenceMatrix([[1, 4], [2, 4], [1, 5], [5, 3], [2, 6], [6, 3]])
variety = normal_toric_variety(PolyhedralFan(fan_rays, cones; non_redundant = true))
Normal toric variety
Notice the non_redundant = true entry in the constructor for NormalToricVariety. This switches off the input check by informing OSCAR that we (= the users) made sure that there is no redundancy in the input. It is encouraged to use this functionality with care and only after checking the input carefully.
To continue with the above example, we would like to see that this is indeed a del Pezzo surface. This can be seen directly from the fan - the three last rays correspond to the star subdivision of the 3 maximal cones of $\mathbb{P}^2$ - or by studying the properties of the variety in more detail. We opt for the latter and first assign suitable variable names:
vars = ["x1", "x2", "x3", "e1", "e2", "e3"]
set_coordinate_names(variety, vars[1:6])
It is also convenient to make a (valid!) standard choice for the grading of the cox ring. Namely, this must be such that the grading matrix corresponds to the map from the character lattice to the torus-invariant Weil divisor group. It is not too hard to verify that the following is a valid choice:
weights = matrix(ZZ, [1 1 1 0; 1 1 0 1; 1 0 1 1; 0 -1 0 0; 0 0 -1 0; 0 0 0 -1])
set_attribute!(variety, :map_from_torusinvariant_weil_divisor_group_to_class_group, hom(torusinvariant_weil_divisor_group(variety), class_group(variety), weights))
When executing del_pezzo_surface(3) more properties are set by OSCAR. But that put aside, the above are the internal steps of the constructor.
With that said, the following should identify this space as the del Pezzo surface $dP_3$:
cox_ring(variety)
Multivariate Polynomial Ring in 6 variables x1, x2, x3, e1, ..., e3 over Rational Field graded by x1 -> [1 1 1 0] x2 -> [1 1 0 1] x3 -> [1 0 1 1] e1 -> [0 -1 0 0] e2 -> [0 0 -1 0] e3 -> [0 0 0 -1]
is_smooth(variety)
true
is_projective(variety)
true
[betti_number(variety,i) for i in range(0,4)]
5-element Vector{ZZRingElem}: 1 0 4 0 1
picard_group(variety)
GrpAb: Z^4
torusinvariant_weil_divisor_group(variety)
GrpAb: Z^6
character_lattice(variety)
GrpAb: Z^2
For (smooth, complete) and (simplicial, projective) toric varieties, it is possible to find a unified description for all line bundles for which a certain cohomology class vanishes. This set is then referred to as a vanishing set.
The first description of this approach can be found in appendix B of https://arxiv.org/pdf/1802.08860.pdf. The corresponding functionality is available in Oscar.
We begin by demonstrating this for the projective space $\mathbb{P}^2$, for which the vanishing sets are well-known. Namely: \begin{align} V^0( \mathbb{P}^2 ) &= \{ \mathcal{L} \in \mathrm{Pic}(\mathbb{P}^2) | h^0(\mathbb{P}^2, \mathcal{L}) = 0\} = \{ \mathcal{L} \in \mathrm{Pic}(\mathbb{P}^2) | \mathrm{deg}( \mathcal{L} ) < 0 \} \, , \\ V^1( \mathbb{P}^2 ) &= \{ \mathcal{L} \in \mathrm{Pic}(\mathbb{P}^2) | h^1(\mathbb{P}^2, \mathcal{L}) = 0\} = \mathrm{Pic}(\mathbb{P}^2) \, , \\ V^2( \mathbb{P}^2 ) &= \{ \mathcal{L} \in \mathrm{Pic}(\mathbb{P}^2) | h^2(\mathbb{P}^2, \mathcal{L}) = 0\} = \{ \mathcal{L} \in \mathrm{Pic}(\mathbb{P}^2) | \mathrm{deg}( \mathcal{L} ) > -2 \}\, . \end{align} Let us recompute this with OSCAR:
vs = vanishing_sets(P2)
3-element Vector{ToricVanishingSet}: Toric vanishing set for cohomology index 0 Toric vanishing set for cohomology index 1 Toric vanishing set for cohomology index 2
polyhedra(vs[1])
1-element Vector{Polyhedron{QQFieldElem}}: Polyhedron in ambient dimension 1
p0 = polyhedra(vs[1])[1]
Polyhedron in ambient dimension 1
vertices(p0)
1-element SubObjectIterator{PointVector{QQFieldElem}}: [0]
rays(p0)
1-element SubObjectIterator{RayVector{QQFieldElem}}: [1]
We are thus looking at $C = \mathrm{Span}_{\mathbb{Z}_{\geq 0}}(1) \}$. This cone is a subset of $\mathrm{Pic}( \mathbb{P}^2)$ and the vanishing set is its complement, that is: $$V^0( \mathbb{P}^2 ) = \{ \mathcal{L} \in \mathrm{Pic}(\mathbb{P}^2) | h^0(\mathbb{P}^2, \mathcal{L}) = 0\} = \{ \mathcal{L} \in \mathrm{Pic}(\mathbb{P}^2) | \mathcal{L} ) \notin C \} \, .$$ It is readily verified that this indeed matches the above expectation.
Recall that $V^1( \mathbb{P}^2 ) = \mathrm{Pic}(\mathbb{P}^2)$. This we can see quickly:
polyhedra(vs[2])
Polyhedron{QQFieldElem}[]
This list of polyhedra is empty. In other words, the vanishing set is the complement of the empty set in $\mathrm{Pic}( \mathbb{P}^2 )$, which is nothing but the entire Picard group.
Let us now look at the vanishing set for $h^2$:
polyhedra(vs[3])
1-element Vector{Polyhedron{QQFieldElem}}: Polyhedron in ambient dimension 1
p3 = polyhedra(vs[3])[1]
Polyhedron in ambient dimension 1
vertices(p3)
1-element SubObjectIterator{PointVector{QQFieldElem}}: [-3]
rays(p3)
1-element SubObjectIterator{RayVector{QQFieldElem}}: [-1]
We are thus looking at $P_3 = \{-3\} + \mathrm{Span}_{\mathbb{Z}_{\geq 0}} \{-1\}$. Its complement is $V^2( \mathbb{P}^2 )$, which matches our expectation.
Recall that we constructed a line bundle $\mathcal{L}$ on $\mathbb{P}^2$ above:
L = toric_line_bundle(P2, [1])
Toric line bundle on a normal toric variety
Its cohomologies are:
all_cohomologies(L)
3-element Vector{ZZRingElem}: 3 0 0
So $L$ is not $V^0( \mathbb{P}^2 )$ but in $V^1( \mathbb{P}^2 )$ and $V^2( \mathbb{P}^2 )$:
contains(vs[1],L)
false
contains(vs[2],L)
true
contains(vs[3],L)
true
Intersection theory for toric varieties is well-understood and the Chow ring under good control. For a good example, let us consider the del Pezzo surface $dP_2$:
dP2 = del_pezzo_surface(2)
Normal, non-affine, smooth, projective, gorenstein, fano, 2-dimensional toric variety without torusfactor
Recall that this constructors invokes standard names for the homogeneous coordinates. This we can see upon execution of the Cox ring:
S = cox_ring(dP2)
Multivariate Polynomial Ring in x1, x2, x3, e1, e2 over Rational Field graded by x1 -> [1 1 1] x2 -> [1 1 0] x3 -> [1 0 1] e1 -> [0 -1 0] e2 -> [0 0 -1]
We now recall the toric ideal-variety correspondence from proposition 5.2.7 in the book "Toric Varieties" by David Cox, Hal Schenk and John Little:
Let $X_\Sigma$ be a simplicial toric variety. Then there is a bijective correspondence $$ \{ \text{ closed subvarieties of $X_\Sigma$ } \} \leftrightarrow \{ \text{ radical homogeneous ideals $I \subseteq B(\Sigma) \subseteq S$} \} \, .$$ In this expression $B(\Sigma)$ is the irrelevant ideal. For instance, for $\mathrm{dP}_2$ we have:
irrelevant_ideal(dP2)
ideal(x2*x3*e2, x1*x3*e2, x2*x3*e1, x1*x2*e1, x1*e1*e2)
Consequently, for every radical homogeneous ideal $I \subseteq B(\Sigma) \subseteq S$, we find a closed subvariety $V( I ) \subseteq X_\Sigma$ and every closed subvariety of a simplicial toric variety $X_\Sigma$ arises in this way.
An algebraic cycle is a formal linear sum of such closed subvarieties. Modulo rational equivalence, the algebraic cycles furnish the Chow ring. We can compute this ring as follows in OSCAR:
chow_ring(dP2)
Quotient of Multivariate Polynomial Ring in x1, x2, x3, e1, e2 over Rational Field by ideal(x1 - x3 + e1, x2 - x3 + e1 - e2, x1*x2, x1*x3, e1*e2, x2*e2, x3*e1)
There are several ways to create a rational equivalence class of an algebraic cycle. Here is one way to create such an object:
d = toric_divisor(dP2, [1, 2, 3, 4, 5]);
ac = rational_equivalence_class(d)
Rational equivalence class on a normal toric variety represented by 6V(x3)+V(e1)+7V(e2)
So $ac$ is represented by an algebraic cycle which in turn is given by a formal linear sum of the closed subvarieties $V(x_3)$, $V(e_1)$ and $V(e_2)$, namely $6 V(x_3) + 1 V( e_1 ) + 7 V( e_2 )$.
Intersections of rational equivalence classes can be computed in OSCAR:
ac * ac
Rational equivalence class on a normal toric variety represented by 34V(x2,x3)
If we only care about topological intersection numbers, then the intersection form suffices:
intersection_form(dP2)
Dict{MPolyRingElem, QQFieldElem} with 15 entries: x1*x3 => 0 x3*e2 => 1 x1^2 => -1 x1*e1 => 1 e2^2 => -1 x3^2 => 0 x2*x3 => 1 e1*e2 => 0 x2*e1 => 1 x1*e2 => 1 x2^2 => 0 e1^2 => -1 x3*e1 => 0 x1*x2 => 0 x2*e2 => 0
Note that this is obtained upon normalization with the volume form:
volume_form(dP2)
Cohomology class on a normal toric variety given by -e2^2