Skip to content

Commit

Permalink
unifies kwargs
Browse files Browse the repository at this point in the history
  • Loading branch information
ederc authored and fingolfin committed Sep 16, 2024
1 parent 97bc0a4 commit c5e91ec
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Quotient
"""
@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)
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]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function cohomology_ring(v::NormalToricVarietyType; check::Bool = true)
if check
@req is_simplicial(v) && is_complete(v) "The cohomology ring is only supported for simplicial and complete toric varieties"
end
R, _ = graded_polynomial_ring(coefficient_ring(v), coordinate_names(v), cached = false)
R, _ = graded_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)
set_attribute!(v, :cohomology_ring, quo(R, linear_relations + stanley_reisner)[1])
Expand Down Expand Up @@ -63,7 +63,7 @@ end
generators = [cohomology_class(d) for d in torusinvariant_prime_divisors(v)]

# find combinations of those classes that we have to integrate
S, _ = graded_polynomial_ring(QQ, ["g$i" for i in 1:length(generators)], cached=false)
S, _ = graded_polynomial_ring(QQ, ["g$i" for i in 1:length(generators)]; cached=false)
hc = homogeneous_component(S, [dim(v)])
monoms = [hc[2](x) for x in gens(hc[1])]
combinations = reduce(vcat, [[[ZZRingElem(l) for l in k] for k in AbstractAlgebra.exponent_vectors(m)] for m in monoms])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ true
```
"""
@attr MPolyRing function cox_ring(v::NormalToricVarietyType)
S, _ = polynomial_ring(coefficient_ring(v), coordinate_names(v), cached=false)
S, _ = polynomial_ring(coefficient_ring(v), coordinate_names(v); cached=false)
return cox_ring(S, v)
end

Expand Down Expand Up @@ -431,7 +431,7 @@ julia> ngens(ideal_of_linear_relations(p2))
```
"""
@attr MPolyIdeal function ideal_of_linear_relations(v::NormalToricVarietyType)
R, _ = graded_polynomial_ring(coefficient_ring(v), coordinate_names(v), cached = false)
R, _ = graded_polynomial_ring(coefficient_ring(v), coordinate_names(v); cached=false)
return ideal_of_linear_relations(R, v)
end

Expand Down Expand Up @@ -506,7 +506,7 @@ Ideal generated by
@attr MPolyIdeal function toric_ideal(antv::AffineNormalToricVariety)
C = cone(pm_object(antv).WEIGHT_CONE)
n = length(hilbert_basis(C))
R, _ = polynomial_ring(coefficient_ring(antv), n, cached=false)
R, _ = polynomial_ring(coefficient_ring(antv), n; cached=false)
return toric_ideal(R, antv)
end

Expand Down Expand Up @@ -566,7 +566,7 @@ Quotient
```
"""
@attr MPolyQuoRing function coordinate_ring_of_torus(v::NormalToricVarietyType)
S, _ = polynomial_ring(coefficient_ring(v), vcat(coordinate_names_of_torus(v), [x*"_" for x in coordinate_names_of_torus(v)]), cached=false)
S, _ = polynomial_ring(coefficient_ring(v), vcat(coordinate_names_of_torus(v), [x*"_" for x in coordinate_names_of_torus(v)]); cached=false)
return coordinate_ring_of_torus(S, v)
end

Expand All @@ -590,7 +590,7 @@ x2^2*x1_
```
"""
function character_to_rational_function(v::NormalToricVarietyType, character::Vector{ZZRingElem})
S, _ = polynomial_ring(coefficient_ring(v), vcat(coordinate_names_of_torus(v), [x*"_" for x in coordinate_names_of_torus(v)]), cached=false)
S, _ = polynomial_ring(coefficient_ring(v), vcat(coordinate_names_of_torus(v), [x*"_" for x in coordinate_names_of_torus(v)]); cached=false)
return character_to_rational_function(S, v::NormalToricVarietyType, character::Vector{ZZRingElem})
end
character_to_rational_function(v::NormalToricVarietyType, character::Vector{Int}) = character_to_rational_function(v, [ZZRingElem(k) for k in character])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Ideal generated by
```
"""
function binomial_exponents_to_ideal(binoms::Union{AbstractMatrix, ZZMatrix})
R, _ = polynomial_ring(QQ, ncols(binoms), cached=false)
R, _ = polynomial_ring(QQ, ncols(binoms); cached=false)
return binomial_exponents_to_ideal(R, binoms)
end

Expand Down Expand Up @@ -77,7 +77,7 @@ Ideal generated by
"""
function toric_ideal(pts::ZZMatrix)
n = nrows(pts)
R, _ = polynomial_ring(QQ, n, cached=false)
R, _ = polynomial_ring(QQ, n; cached=false)
return toric_ideal(R, pts)
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ with default covering
for (k, A) in enumerate(patch_list)
C = cone(pm_object(A).WEIGHT_CONE)
n = length(hilbert_basis(C))
R, _ = polynomial_ring(QQ, ["x_$(i)_$(k)" for i in 1:n], cached = false);
R, _ = polynomial_ring(QQ, ["x_$(i)_$(k)" for i in 1:n]; cached=false);
set_attribute!(A, :toric_ideal, toric_ideal(R, A))
end
cov = Covering(patch_list)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function command_string(v::NormalToricVarietyType, c::Vector{ZZRingElem})
# Add information about the Stanley-Reisner ideal to string_list
current_coordinate_names = [string(x) for x in Hecke.gens(cox_ring(v))]
new_coordinate_names = ["x$i" for i = 1:length(current_coordinate_names)]
new_ring, _ = polynomial_ring(coefficient_ring(v), new_coordinate_names, cached=false)
new_ring, _ = polynomial_ring(coefficient_ring(v), new_coordinate_names; cached=false)
generators = [string(g) for g in gens(stanley_reisner_ideal(new_ring, v))]
push!(string_list, "srideal [" * joincomma(generators) * "]")

Expand Down

0 comments on commit c5e91ec

Please sign in to comment.