Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prefer symbols over strings as indeterminants #4158

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
2 changes: 1 addition & 1 deletion docs/src/AlgebraicGeometry/Schemes/AffineSchemes.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ See [`inclusion_morphism(::AbsAffineScheme, ::AbsAffineScheme)`](@ref) for a way
### Affine n-space

```@docs
affine_space(kk::BRT, n::Int; variable_name="x") where {BRT<:Ring}
affine_space(kk::BRT, n::Int; variable_name=:x) where {BRT<:Ring}
affine_space(kk::BRT, var_names::AbstractVector{<:VarName}) where {BRT<:Ring}
```

Expand Down
5 changes: 5 additions & 0 deletions docs/src/DeveloperDocumentation/styleguide.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ deviate from them in some cases; in that case just do so.
matrices...
- Input sanity checks should be enabled by default, they can then be disabled
internally if they are known to be true, and manually by users.
- All user-facing functions that expect some kind of indeterminant name etc.
(like `polynomial_ring(QQ, <indeterminant_name>)`) should accept a
`VarName = Union{Symbol, Char, String}`, and convert it to a symbol for internal
handling. Library and test code should (if possible) call such functions with
`Symbol` arguments, as this is the most efficient way.


## Naming conventions
Expand Down
2 changes: 1 addition & 1 deletion experimental/BasisLieHighestWeight/src/WeylPolytope.jl
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ function compute_zero_coordinates(
zero_coordinates = Int[]
for c in n:-1:1
length(non_zeros) == m && break
if !isempty(intersect(non_zeros, findall(!iszero, bir_sequence.weights_alpha[c])))
if !isdisjoint(non_zeros, findall(!iszero, bir_sequence.weights_alpha[c]))
afkafkafk13 marked this conversation as resolved.
Show resolved Hide resolved
union!(non_zeros, findall(<(0), bir_sequence.weights_w[c]))
else
push!(zero_coordinates, c)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ function put_over_concrete_base(m::AbstractFTheoryModel, concrete_data::Dict{Str
all_appearing_exponents = hcat([collect(exponents(m))[1] for m in all_appearing_monomials]...)
for k in 1:nrows(all_appearing_exponents)
if any(!is_zero, all_appearing_exponents[k,:])
gen_name = string(gens(parent(polys[1]))[k])
gen_name = string(symbols(parent(polys[1]))[k])
@req haskey(concrete_data, gen_name) "Required base section $gen_name not specified"
@req parent(concrete_data[gen_name]) == cox_ring(concrete_data["base"]) "Specified sections must reside in Cox ring of given base"
new_model_secs[gen_name] = concrete_data[gen_name]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ end

function hypersurface_model(base::NormalToricVariety, fiber_ambient_space::NormalToricVariety, fiber_twist_divisor_classes::Vector{ToricDivisorClass}, p::String; completeness_check::Bool = true)
# Consistency checks
gens_base_names = [string(g) for g in gens(cox_ring(base))]
gens_fiber_names = [string(g) for g in gens(cox_ring(fiber_ambient_space))]
if intersect(Set(gens_base_names), Set(gens_fiber_names)) != Set()
gens_base_names = symbols(cox_ring(base))
gens_fiber_names = symbols(cox_ring(fiber_ambient_space))
if !isdisjoint(gens_base_names, gens_fiber_names)
@vprint :FTheoryModelPrinter 0 "Variable names duplicated between base and fiber coordinates.\n"
end
if completeness_check
Expand Down Expand Up @@ -183,7 +183,7 @@ function hypersurface_model(auxiliary_base_vars::Vector{String}, auxiliary_base_

# Conduct simple consistency checks
@req d > 0 "The dimension of the base space must be positive"
@req intersect(set_base_vars, set_fiber_vars) == Set() "Variable names duplicated between base and fiber coordinates."
@req isdisjoint(set_base_vars, set_fiber_vars) "Variable names duplicated between base and fiber coordinates."
@req union(set_base_vars, set_fiber_vars) == set_p_vars "Variables names for polynomial p do not match variable choice for base and fiber"
@req ncols(auxiliary_base_grading) == length(auxiliary_base_vars) "Number of base variables does not match the number of provided base gradings"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ function tune(h::HypersurfaceModel, input_sections::Dict{String, <:Any}; complet
# 2. Compute the new hypersurface equation
parametrized_hypersurface_equation = hypersurface_equation_parametrization(h)
R = parent(parametrized_hypersurface_equation)
vars = [string(k) for k in gens(R)]
vars = [string(k) for k in symbols(R)]
S = cox_ring(ambient_space(h))
images = [k in secs_names ? eval_poly(string(explicit_secs[k]), S) : k == "Kbar" ? eval_poly("0", S) : eval_poly(k, S) for k in vars]
map = hom(R, S, images; check=false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ function _construct_literature_model_over_arbitrary_base(model_dict::Dict{String
elseif model_dict["model_descriptors"]["type"] == "hypersurface"

# Extract base variable names
auxiliary_base_vars = [string(g) for g in gens(auxiliary_base_ring)]
auxiliary_base_vars = [string(g) for g in symbols(auxiliary_base_ring)]

# Extract fiber ambient space
rays = [[a for a in b] for b in model_dict["model_data"]["fiber_ambient_space_rays"]]
Expand Down
6 changes: 3 additions & 3 deletions experimental/FTheoryTools/src/TateModels/constructors.jl
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ function global_tate_model(base::NormalToricVariety,
vs2 = collect(keys(defining_section_parametrization))
@req all(in(["a1", "a2", "a3", "a4", "a6"]), vs2) "Only the Tate sections a1, a2, a3, a4, a6 must be parametrized"

gens_base_names = [string(g) for g in gens(cox_ring(base))]
gens_base_names = [string(g) for g in symbols(cox_ring(base))]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@HereAround pinging you to make you aware that symbols(::MPolyRing) exists. In many of these cases you probably don't even need to convert to strings afterwards, but I kept it like this if I didn't see an obvious way to change the below code

if ("x" in gens_base_names) || ("y" in gens_base_names) || ("z" in gens_base_names)
@vprint :FTheoryModelPrinter 0 "Variable names duplicated between base and fiber coordinates.\n"
end
Expand Down Expand Up @@ -144,7 +144,7 @@ Global Tate model over a not fully specified base
function global_tate_model(auxiliary_base_ring::MPolyRing, auxiliary_base_grading::Matrix{Int64}, d::Int, ais::Vector{T}) where {T<:MPolyRingElem}

# Execute consistency checks
gens_base_names = [string(g) for g in gens(auxiliary_base_ring)]
gens_base_names = [string(g) for g in symbols(auxiliary_base_ring)]
@req length(ais) == 5 "We expect exactly 5 Tate sections"
@req all(k -> parent(k) == auxiliary_base_ring, ais) "All Tate sections must reside in the provided auxiliary base ring"
@req d > 0 "The dimension of the base space must be positive"
Expand All @@ -170,7 +170,7 @@ function global_tate_model(auxiliary_base_ring::MPolyRing, auxiliary_base_gradin

# Compute defining_section_parametrization
defining_section_parametrization = Dict{String, MPolyRingElem}()
vars_S = [string(k) for k in gens(S)]
vars_S = [string(k) for k in symbols(S)]
if !("a1" in vars_S) || (a1 != eval_poly("a1", parent(a1)))
defining_section_parametrization["a1"] = a1
end
Expand Down
2 changes: 1 addition & 1 deletion experimental/FTheoryTools/src/TateModels/methods.jl
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ function tune(t::GlobalTateModel, input_sections::Dict{String, <:Any}; completen
if !isempty(parametrization_keys) && !isempty(secs_names)
R = parent(def_secs_param[parametrization_keys[1]])
S = parent(explicit_secs[secs_names[1]])
vars = [string(k) for k in gens(R)]
vars = [string(k) for k in symbols(R)]
images = [k in secs_names ? explicit_secs[k] : k == "Kbar" ? eval_poly("0", S) : eval_poly(k, S) for k in vars]
map = hom(R, S, images)
for section in tate_sections
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ function weierstrass_model(base::NormalToricVariety,
vs2 = collect(keys(defining_section_parametrization))
@req all(in(("f", "g")), vs2) "Only the Weierstrass sections f, g must be parametrized"

gens_base_names = [string(g) for g in gens(cox_ring(base))]
if ("x" in gens_base_names) || ("y" in gens_base_names) || ("z" in gens_base_names)
gens_base_names = symbols(cox_ring(base))
if (:x in gens_base_names) || (:y in gens_base_names) || (:z in gens_base_names)
@vprint :FTheoryModelPrinter 0 "Variable names duplicated between base and fiber coordinates.\n"
end

Expand Down Expand Up @@ -125,7 +125,7 @@ Weierstrass model over a not fully specified base
function weierstrass_model(auxiliary_base_ring::MPolyRing, auxiliary_base_grading::Matrix{Int64}, d::Int, weierstrass_f::MPolyRingElem, weierstrass_g::MPolyRingElem)

# Execute consistency checks
gens_base_names = [string(g) for g in gens(auxiliary_base_ring)]
gens_base_names = [string(g) for g in symbols(auxiliary_base_ring)]
@req ((parent(weierstrass_f) == auxiliary_base_ring) && (parent(weierstrass_g) == auxiliary_base_ring)) "All Weierstrass sections must reside in the provided auxiliary base ring"
@req d > 0 "The dimension of the base space must be positive"
if ("x" in gens_base_names) || ("y" in gens_base_names) || ("z" in gens_base_names)
Expand All @@ -150,7 +150,7 @@ function weierstrass_model(auxiliary_base_ring::MPolyRing, auxiliary_base_gradin

# Compute defining_section_parametrization
defining_section_parametrization = Dict{String, MPolyRingElem}()
vars_S = [string(k) for k in gens(S)]
vars_S = [string(k) for k in symbols(S)]
if !("f" in vars_S) || (f != eval_poly("f", parent(f)))
defining_section_parametrization["f"] = f
end
Expand Down
2 changes: 1 addition & 1 deletion experimental/FTheoryTools/src/WeierstrassModels/methods.jl
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ function tune(w::WeierstrassModel, input_sections::Dict{String, <:Any}; complete
if !isempty(parametrization_keys) && !isempty(secs_names)
R = parent(def_secs_param[parametrization_keys[1]])
S = parent(explicit_secs[secs_names[1]])
vars = [string(k) for k in gens(R)]
vars = [string(k) for k in symbols(R)]
images = [k in secs_names ? explicit_secs[k] : k == "Kbar" ? eval_poly("0", S) : eval_poly(k, S) for k in vars]
map = hom(R, S, images)
for section in weierstrass_sections
Expand Down
22 changes: 11 additions & 11 deletions experimental/FTheoryTools/src/auxiliary.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
b_rays = matrix(ZZ, rays(base))
b_cones = matrix(ZZ, ray_indices(maximal_cones(base)))
b_grades = reduce(vcat, [elem.coeff for elem in cox_ring(base).d])
b_var_names = [string(k) for k in gens(cox_ring(base))]
b_var_names = symbols(cox_ring(base))

# Extract information about the fiber ambient space
f_rays = matrix(ZZ, rays(fiber_amb_space))
f_cones = matrix(ZZ, ray_indices(maximal_cones(fiber_amb_space)))
f_grades = reduce(vcat, [elem.coeff for elem in cox_ring(fiber_amb_space).d])
f_var_names = [string(k) for k in gens(cox_ring(fiber_amb_space))]
f_var_names = symbols(cox_ring(fiber_amb_space))

# Extract coefficients of divisors D1, D2 and compute u_matrix
fiber_twist_divisor_classes_coeffs = [divisor_class(D).coeff for D in fiber_twist_divisor_classes]
Expand Down Expand Up @@ -179,8 +179,8 @@

# Create new ring with auxiliary variable to construct the monodromy polynomial
R = parent(f)
S, (_psi, ) = polynomial_ring(QQ, ["_psi"; [string(v) for v in gens(R)]], cached = false)
ring_map = hom(R, S, gens(S)[2:end])
S, (_psi,), _old_gens = polynomial_ring(QQ, [:_psi], symbols(R); cached = false)
ring_map = hom(R, S, _old_gens)
poly_f = ring_map(f)
poly_g = ring_map(g)
locus = ring_map(gens(id)[1])
Expand All @@ -206,17 +206,17 @@

# Get the grading matrix and the coordinates of the arbitrary base
grading = weights(base_space(w))
base_coords = gens(coordinate_ring(base_space(w)))
@req (length(base_coords) == length(grading[1, :])) "The number of columns in the weight matrix does not match the number of base cooordinates"
base_coords_symbols = symbols(coordinate_ring(base_space(w)))
@req (length(base_coords_symbols) == length(grading[1, :])) "The number of columns in the weight matrix does not match the number of base cooordinates"

# Choose explicit sections for all parameters of the model,
# and then put the model over the concrete base using these data
concrete_data = merge(Dict(string(base_coords[i]) => generic_section(KBar^grading[1, i] * prod(hyperplane_bundle^grading[j, i] for j in 2:length(grading[:, 1]))) for i in eachindex(base_coords)), Dict("base" => concrete_base))
concrete_data = merge(Dict(string(base_coords_symbols[i]) => generic_section(KBar^grading[1, i] * prod(hyperplane_bundle^grading[j, i] for j in 2:length(grading[:, 1]))) for i in eachindex(base_coords_symbols)), Dict("base" => concrete_base))
w = put_over_concrete_base(w, concrete_data)

# We also need to determine the gauge locus over the new base
# by using the explicit forms of all of the sections chosen above
list_of_sections = [concrete_data[string(base_coords[i])] for i in eachindex(base_coords)]
list_of_sections = [concrete_data[string(base_coords_symbols[i])] for i in eachindex(base_coords_symbols)]
id = ideal([evaluate(p, list_of_sections) for p in gens(id)])
end

Expand Down Expand Up @@ -315,7 +315,7 @@
lin = ideal(map(hom(base_ring(lin), R, collect(1:ngens(R))), gens(lin)))

# Create new base ring for the blown up ideal and a map between the rings
S, S_gens = polynomial_ring(QQ, [string("e_", index); [string("b_", index, "_", i) for i in 1:center_size]; [string(v) for v in gens(R)]], cached = false)
S, S_gens = polynomial_ring(QQ, [Symbol("e_", index); [Symbol("b_", index, "_", i) for i in 1:center_size]; symbols(R)], cached = false)

Check warning on line 318 in experimental/FTheoryTools/src/auxiliary.jl

View check run for this annotation

Codecov / codecov/patch

experimental/FTheoryTools/src/auxiliary.jl#L318

Added line #L318 was not covered by tests
(_e, new_coords...) = S_gens[1:center_size + 1]
ring_map = hom(R, S, S_gens[center_size + 2:end])

Expand Down Expand Up @@ -471,7 +471,7 @@
_e = gen(S, index_of_new_ray(bd))
images = MPolyRingElem[]
g_list = gens(S)
g_center = [string(k) for k in gens(ideal_in_cox_ring(center_unnormalized(bd)))]
g_center = [string(k) for k in symbols(ideal_in_cox_ring(center_unnormalized(bd)))]

Check warning on line 474 in experimental/FTheoryTools/src/auxiliary.jl

View check run for this annotation

Codecov / codecov/patch

experimental/FTheoryTools/src/auxiliary.jl#L474

Added line #L474 was not covered by tests
for v in g_list
v == _e && continue
if string(v) in g_center
Expand All @@ -490,7 +490,7 @@
function _strict_transform(bd::ToricBlowupMorphism, tate_poly::MPolyRingElem)
S = cox_ring(domain(bd))
_e = gen(S, index_of_new_ray(bd))
g_list = string.(gens(S))
g_list = string.(symbols(S))
g_center = [string(k) for k in gens(ideal_in_cox_ring(center_unnormalized(bd)))]
position_of_center_variables = [findfirst(==(g), g_list) for g in g_center]
pos_of_e = findfirst(==(string(_e)), g_list)
Expand Down
8 changes: 4 additions & 4 deletions experimental/FTheoryTools/test/hypersurface_models.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ h = hypersurface_model(B3, ambient_space_of_fiber, [D1, D2, D3], p; completeness
@test dim(base_space(h)) == dim(B3)
@test fiber_ambient_space(h) == ambient_space_of_fiber
@test is_smooth(fiber_ambient_space(h)) == false
@test [string(g) for g in gens(cox_ring(fiber_ambient_space(h)))] == ["x", "y", "z"]
@test symbols(cox_ring(fiber_ambient_space(h))) == [:x, :y, :z]
@test toric_variety(calabi_yau_hypersurface(h)) == ambient_space(h)
@test is_base_space_fully_specified(h) == true
end
Expand Down Expand Up @@ -102,7 +102,7 @@ end
@test dim(base_space(h3)) == 2
@test is_smooth(fiber_ambient_space(h3)) == false
@test is_simplicial(fiber_ambient_space(h3)) == true
@test [string(g) for g in gens(cox_ring(fiber_ambient_space(h3)))] == ["u", "w", "v"]
@test symbols(cox_ring(fiber_ambient_space(h3))) == [:u, :w, :v]
@test is_base_space_fully_specified(h3) == true
@test is_partially_resolved(h3) == false
end
Expand Down Expand Up @@ -131,7 +131,7 @@ h4 = hypersurface_model(auxiliary_base_vars, auxiliary_base_grading, d, ambient_
@test fiber_ambient_space(h4) == ambient_space_of_fiber_2
@test is_smooth(fiber_ambient_space(h4)) == false
@test is_simplicial(fiber_ambient_space(h4)) == true
@test [string(g) for g in gens(cox_ring(fiber_ambient_space(h4)))] == ["x", "y", "z"]
@test symbols(cox_ring(fiber_ambient_space(h4))) == [:x, :y, :z]
@test is_base_space_fully_specified(h4) == false
@test is_partially_resolved(h4) == false
end
Expand All @@ -148,7 +148,7 @@ h5 = literature_model(arxiv_id = "1208.2695", equation = "B.5")
@test dim(base_space(h5)) == 2
@test is_smooth(fiber_ambient_space(h5)) == false
@test is_simplicial(fiber_ambient_space(h5)) == true
@test [string(g) for g in gens(cox_ring(fiber_ambient_space(h5)))] == ["u", "w", "v"]
@test symbols(cox_ring(fiber_ambient_space(h5))) == [:u, :w, :v]
@test is_base_space_fully_specified(h5) == false
@test is_partially_resolved(h5) == false
end
2 changes: 1 addition & 1 deletion experimental/FTheoryTools/test/literature_models.jl
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ h = literature_model(arxiv_id = "1507.05954", equation = "3.4")
@test parent(hypersurface_equation(h)) == coordinate_ring(ambient_space(h))
@test dim(base_space(h)) == 2
@test is_smooth(fiber_ambient_space(h)) == true
@test [string(g) for g in gens(cox_ring(fiber_ambient_space(h)))] == ["u", "v", "w"]
@test symbols(cox_ring(fiber_ambient_space(h))) == [:u, :v, :w]
@test is_base_space_fully_specified(h) == false
@test is_partially_resolved(h) == false
@test string.(zero_section(h)) == ["0", "-b1", "a1"]
Expand Down
2 changes: 1 addition & 1 deletion experimental/GroebnerWalk/examples/ku10.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ku
using Oscar

R, (x1, x2, x3, x4, x5, x6, x7, x8, x9, x10) = polynomial_ring(QQ, ["x$index" for index in 1:10])
R, (x1, x2, x3, x4, x5, x6, x7, x8, x9, x10) = polynomial_ring(QQ, "x#" => 1:10)

I = ideal([
5*x1*x2+ 5*x1+ 3*x2+ 55,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#cyclic7

using Oscar
R, (z0, z1, z2, z3, z4, z5, z6) = polynomial_ring(QQ, ["z$index" for index in 0:6 ])
R, (z0, z1, z2, z3, z4, z5, z6) = polynomial_ring(QQ, "z#" => 0:6)

I = ideal([
z0 + z1 + z2 + z3 + z4 + z5 + z6,
Expand Down
4 changes: 2 additions & 2 deletions experimental/IntersectionTheory/src/Bott.jl
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
function _get_ring(F::TnBundle)
if get_attribute(F, :R) === nothing
r = min(F.parent.dim, F.rank)
R, _ = graded_polynomial_ring(QQ, _parse_symbol("c", 1:r), collect(1:r))
R, _ = graded_polynomial_ring(QQ, :c => 1:r, collect(1:r))
set_attribute!(R, :abstract_variety_dim => F.parent.dim)
set_attribute!(F, :R => R)
end
Expand Down Expand Up @@ -168,7 +168,7 @@
# utility function that parses the weight specification
function _parse_weight(n::Int, w)
w == :int && return ZZ.(collect(1:n))
w == :poly && return polynomial_ring(QQ, ["u$i" for i in 1:n])[2]
w == :poly && return polynomial_ring(QQ, "u#" => 1:n)[2]

Check warning on line 171 in experimental/IntersectionTheory/src/Bott.jl

View check run for this annotation

Codecov / codecov/patch

experimental/IntersectionTheory/src/Bott.jl#L171

Added line #L171 was not covered by tests
if (w isa AbstractUnitRange) w = collect(w) end
w isa Vector && length(w) == n && return w
error("incorrect specification for weights")
Expand Down
2 changes: 1 addition & 1 deletion experimental/IntersectionTheory/src/Main.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1295,7 +1295,7 @@ function schur_functor(F::AbstractBundle, λ::Partition)
λ = conjugate(λ)
X = F.parent
w = _wedge(sum(λ), chern_character(F))
S, ei = polynomial_ring(QQ, ["e$i" for i in 1:length(w)])
S, ei = polynomial_ring(QQ, "e#" => 1:length(w))
e = i -> i < 0 ? S() : ei[i+1]
M = [e(λ[i]-i+j) for i in 1:length(λ), j in 1:length(λ)]
sch = det(matrix(S, M)) # Jacobi-Trudi
Expand Down
4 changes: 2 additions & 2 deletions experimental/LinearQuotients/src/cox_rings.jl
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ function minimal_parts(I::MPolyIdeal, w::Vector{ZZRingElem})
@assert nvars(R) == length(w)

w1 = push!(copy(w), ZZRingElem(-1))
S, t = graded_polynomial_ring(K, ["t$i" for i in 1:(nvars(R) + 1)], w1)
S, t = graded_polynomial_ring(K, "t#" => 1:(nvars(R) + 1), w1)

Ihom = homogenize_at_last_variable(I, S)

Expand Down Expand Up @@ -487,7 +487,7 @@ function g_homogeneous_ideal(I::MPolyIdeal, weights::Vector{ZZRingElem}, order::
R = base_ring(I)

w = push!(copy(weights), ZZRingElem(1))
S, t = graded_polynomial_ring(coefficient_ring(R), ["t$i" for i in 1:(nvars(R) + 1)], w)
S, t = graded_polynomial_ring(coefficient_ring(R), "t#" => 1:(nvars(R) + 1), w)

Ihom = homogenize_at_last_variable(I, S)

Expand Down
2 changes: 1 addition & 1 deletion experimental/LinearQuotients/src/linear_quotients.jl
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ function weights_of_action(
end

to_eig = right_action(R, inv(V))
S, t = graded_polynomial_ring(K, ["t$i" for i in 1:ngens(R)], weights)
S, t = graded_polynomial_ring(K, "t#" => 1:ngens(R), weights)
# The images of the generators of R are in general not homogeneous in S, so
# we have to turn of the check, if we want to build this map...
RtoS = hom(R, S, [to_eig(x)(t...) for x in gens(R)]; check=false)
Expand Down
2 changes: 1 addition & 1 deletion experimental/LinearQuotients/src/misc.jl
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ function homogenize_at_last_variable(I::MPolyIdeal, S::MPolyDecRing)
Rp = polynomial_ring(coefficient_ring(R), :t => 1:ngens(R))[1]
RtoRp = hom(R, Rp, [gen(Rp, findfirst(isequal(i), p)) for i in 1:ngens(Rp)])

Sp, _ = graded_polynomial_ring(coefficient_ring(S), ["t$i" for i in 1:ngens(S)], w_perm)
Sp, _ = graded_polynomial_ring(coefficient_ring(S), "t#" => 1:ngens(S), w_perm)
SptoS = hom(Sp, S, [gens(S)[p[i]] for i in 1:ngens(S)])

# Homogenize the generators
Expand Down
2 changes: 1 addition & 1 deletion experimental/Schemes/src/CoveredProjectiveSchemes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ end
# PW = projective_space(W, var_names)
# PWC = affine_cone(PW)
# prW = projection_to_base(PW)
# WA1, pW, pA = product(W, affine_space(base_ring(base_ring(OO(W))), 1, variable_name="t"))
# WA1, pW, pA = product(W, affine_space(base_ring(base_ring(OO(W))), 1, variable_name="t#"))
# t = pullback(pA)(OO(codomain(pA))(base_ring(OO(codomain(pA)))[1]))
# imgs = vcat((x->t*x).(pullback(pW).(gens(I))), pullback(pW).(gens(base_ring(OO(W)))))
# inner_phi = hom(base_ring(OO(PWC)), OO(WA1), imgs)
Expand Down
Loading
Loading