-
Notifications
You must be signed in to change notification settings - Fork 112
/
special_attributes.jl
131 lines (107 loc) · 3.93 KB
/
special_attributes.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
################################################
# 1: Special attributes of toric varieties
################################################
@doc raw"""
chow_ring(v::NormalToricVarietyType)
Return the Chow ring of the simplicial toric variety `v`.
While [CLS11](@cite) focus on simplicial and complete varieties to
define the Chow ring, it was described in [Peg14](@cite) that this
notion can also be extended to non-complete varieties. We explicitly
support the Chow ring also for non-complete varieties.
This is demonstrated by the following example. Note that the computation
for the non-complete variety leads to a Chow ring which is identical to
the Chow ring of a certain matroid. This observation can be anticipated
by e.g. the results in [FY04](@cite).
# Examples
```jldoctest
julia> p2 = projective_space(NormalToricVariety, 2);
julia> is_complete(p2)
true
julia> ngens(chow_ring(p2))
3
julia> v = normal_toric_variety(IncidenceMatrix([[1], [2], [3]]), [[1, 0], [0, 1], [-1, -1]])
Normal toric variety
julia> is_complete(v)
false
julia> set_coordinate_names(v, ["x_{1}", "x_{2}", "x_{3}"])
julia> chow_ring(v)
Quotient
of multivariate polynomial ring in 3 variables x_{1}, x_{2}, x_{3}
over rational field
by ideal (x_{1} - x_{3}, x_{2} - x_{3}, x_{1}*x_{2}, x_{1}*x_{3}, x_{2}*x_{3})
julia> M = cycle_matroid(complete_graph(3))
Matroid of rank 2 on 3 elements
julia> chow_ring(M)
Quotient
of multivariate polynomial ring in 3 variables x_{Edge(2, 1)}, x_{Edge(3, 1)}, x_{Edge(3, 2)}
over rational field
by ideal with 5 generators
```
"""
@attr MPolyQuoRing function chow_ring(v::NormalToricVarietyType)
@req is_simplicial(v) "The combinatorial Chow ring is (currently) only supported for simplicial toric varieties"
R, _ = polynomial_ring(coefficient_ring(v), coordinate_names(v), cached = false)
linear_relations = ideal_of_linear_relations(R, v)
stanley_reisner = stanley_reisner_ideal(R, v)
return quo(R, linear_relations + stanley_reisner)[1]
end
@doc raw"""
gens_of_rational_equivalence_classes(v::NormalToricVarietyType)
Return a list of generators of the Chow ring of a
complete, simplicial toric variety.
Recall that the cones of a complete, simplicial toric variety
can be seen as generators of the Chow ring (lemma 12.5.1 in
[CLS11](@cite)). This function first maps each cone to an
element of the Chow ring and then removes elements by taking
rational equivalence into account.
# Examples
```jldoctest
julia> p2 = projective_space(NormalToricVariety, 2);
julia> gens_of_rational_equivalence_classes(p2)
6-element Vector{MPolyQuoRingElem{QQMPolyRingElem}}:
x3^2
x3^2
x3^2
x3
x3
x3
```
"""
@attr Vector{MPolyQuoRingElem{QQMPolyRingElem}} function gens_of_rational_equivalence_classes(v::NormalToricVarietyType)
cr = chow_ring(v)
R = base_ring(cr)
cs = cones(v)
return [simplify(cr(R([1], [Vector{Int}(cs[k,:])]))) for k in 1:n_cones(v)]
end
@doc raw"""
map_gens_of_chow_ring_to_cox_ring(v::NormalToricVarietyType)
Return a dictionary which maps the generators of the chow
ring to monomials in the Cox ring. This dictionary involves
a choice, i.e. is not unique.
# Examples
```jldoctest
julia> p2 = projective_space(NormalToricVariety, 2);
julia> map_gens_of_chow_ring_to_cox_ring(p2)
Dict{QQMPolyRingElem, MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}} with 2 entries:
x3^2 => x1*x3
x3 => x3
```
"""
@attr Dict{QQMPolyRingElem, MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}} function map_gens_of_chow_ring_to_cox_ring(v::NormalToricVarietyType)
cr = chow_ring(v)
R = base_ring(cr)
co = cox_ring(v)
cs = cones(v)
mapping = Dict{QQMPolyRingElem, MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}}()
for k in 1:nrows(cs)
p1 = simplify(cr(R([1], [Vector{Int}(cs[k,:])]))).f
p2 = co([1], [Vector{Int}(cs[k,:])])
coeff = [c for c in AbstractAlgebra.coefficients(p1)][1]
if coeff != 1
p1 = 1//coeff * p1
p2 = 1//coeff * p2
end
mapping[p1] = p2
end
return mapping
end