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

Disable polynomial ring caching in projective_space and affine_space methods #4094

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ with coordinates [y1, y2, y3, y4, y5]
```
"""
function affine_space(kk::BRT, n::Int; variable_name="x") where {BRT<:Ring}
R, _ = polynomial_ring(kk, [variable_name * "$i" for i in 1:n])
R, _ = polynomial_ring(kk, [variable_name * "$i" for i in 1:n]; cached=false)
return spec(R)
end

Expand Down Expand Up @@ -207,17 +207,17 @@ with coordinates [x, y, z]
```
"""
function affine_space(kk::BRT, var_names::AbstractVector{<:VarName}) where {BRT<:Ring}
R, _ = polynomial_ring(kk, var_names)
R, _ = polynomial_ring(kk, var_names; cached=false)
return spec(R)
end

function affine_space(kk::BRT, n::Int; variable_name="x") where {BRT<:Field}
R, _ = polynomial_ring(kk, [variable_name * "$i" for i in 1:n])
R, _ = polynomial_ring(kk, [variable_name * "$i" for i in 1:n]; cached=false)
return variety(spec(R), check=false)
end

function affine_space(kk::BRT, var_names::AbstractVector{<:VarName}) where {BRT<:Field}
R, _ = polynomial_ring(kk, var_names)
R, _ = polynomial_ring(kk, var_names; cached=false)
return variety(spec(R), check=false)
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ Multivariate polynomial ring in 3 variables over QQ graded by
"""
function projective_space(A::Ring, var_symb::Vector{<:VarName})
n = length(var_symb)
S, _ = graded_polynomial_ring(A, Symbol.(var_symb))
S, _ = graded_polynomial_ring(A, Symbol.(var_symb); cached=false)
return proj(S)
end

Expand All @@ -100,7 +100,7 @@ Create the (relative) projective space `Proj(A[s₀,…,sᵣ])` over `A`
where `s` is a string for the variable names.
"""
function projective_space(A::Ring, r::Int; var_name::VarName=:s)
S, _ = graded_polynomial_ring(A, [Symbol(var_name, i) for i in 0:r])
S, _ = graded_polynomial_ring(A, [Symbol(var_name, i) for i in 0:r]; cached=false)
return proj(S)
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ end

function projective_space(A::Field, var_symb::Vector{VarName})
n = length(var_symb)
S, _ = graded_polynomial_ring(A, var_symb)
S, _ = graded_polynomial_ring(A, var_symb; cached=false)
return variety(proj(S), check=false)
end

Expand All @@ -104,6 +104,6 @@ function projective_space(
r::Int;
var_name::VarName=:s
) where {CoeffRingType<:Field}
S, _ = graded_polynomial_ring(A, [Symbol(var_name,i) for i in 0:r])
S, _ = graded_polynomial_ring(A, [Symbol(var_name,i) for i in 0:r]; cached=false)
return variety(proj(S), check=false)
end
4 changes: 1 addition & 3 deletions test/AlgebraicGeometry/Schemes/AffineRationalPoint.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,14 @@
pX = X([1,0])
pA = A2(pX)
@test pX == pA
@test A2([1,0]) == pA
# ring around the rosie once
@test pX == X(rational_point_coordinates(defining_ideal(scheme(pX))))
Oscar.closed_embedding(pA)
Oscar.closed_embedding(pX)
@test dim(tangent_space(pX))==1
@test dim(tangent_space(pA))==2

A2a = affine_space(GF(2), [:x, :y]);
@test A2a([1,0]) == pA
Copy link
Member Author

Choose a reason for hiding this comment

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

This test failed because now A2 and A2a are not using the same polynomial ring anymore (note that A2 != A2a holds now and also before)


@test pX in X
@test pA in X
@test codomain(pX)===X
Expand Down
Loading