New implementation of map_from_func with changed argument order#4988
New implementation of map_from_func with changed argument order#4988lgoettgens merged 10 commits intooscar-system:masterfrom
map_from_func with changed argument order#4988Conversation
|
For some reason these changes are breaking julia> P2 = abstract_projective_space(2)
AbstractVariety of dim 2
julia> P5 = abstract_projective_space(5, symbol = "H")
AbstractVariety of dim 5
julia> h = gens(P2)[1]
h
julia> i = map(P2, P5, [2*h])
AbstractVarietyMap from AbstractVariety of dim 2 to AbstractVariety of dim 5
julia> i.pushforward
ERROR: UndefRefError: access to undefined reference
Stacktrace:
[1] getproperty(x::AbstractVarietyMap{AbstractVariety, AbstractVariety}, f::Symbol)
@ Base ./Base.jl:37
[2] top-level scope
@ REPL[13]:1this causes problems later... this seemed to be set correctly when julia> P2 = abstract_projective_space(2)
AbstractVariety of dim 2
julia> P5 = abstract_projective_space(5, symbol = "H")
AbstractVariety of dim 5
julia> h = gens(P2)[1]
h
julia> i = map(P2, P5, [2*h])
AbstractVarietyMap from AbstractVariety of dim 2 to AbstractVariety of dim 5
julia> i.pushforward
Map defined by a Julia function
from quotient of multivariate polynomial ring by ideal (h^3)
to quotient of multivariate polynomial ring by ideal (H^6) |
|
Ahhh, okay this is because the |
|
As near as I can tell, this new error: julia> P2 = abstract_projective_space(2)
AbstractVariety of dim 2
julia> P5 = abstract_projective_space(5)
AbstractVariety of dim 5
julia> i = map(P2, P5, [2P2.O1])
AbstractVarietyMap from AbstractVariety of dim 2 to AbstractVariety of dim 5
julia> Bl, E, j = blow_up(i)
ERROR: ArgumentError: Image not in the codomain
Stacktrace:
[1] macro expansion
@ ~/.julia/packages/AbstractAlgebra/5aJmh/src/Assertions.jl:602 [inlined]
[2] image(f::MapFromFunc{MPolyQuoRing{…}, MPolyQuoRing{…}}, x::MPolyQuoRingElem{MPolyDecRingElem{…}})
@ Hecke ~/.julia/packages/Hecke/RwzTY/src/Map/MapType.jl:196
[3] (::MapFromFunc{MPolyQuoRing{…}, MPolyQuoRing{…}})(x::MPolyQuoRingElem{MPolyDecRingElem{…}})
@ Hecke ~/.julia/packages/Hecke/RwzTY/src/Hecke.jl:612
[4] pushforward(f::AbstractVarietyMap{AbstractVariety, AbstractVariety}, F::AbstractBundle{AbstractVariety})
@ Oscar.IntersectionTheory ~/.julia/dev/Oscar/experimental/IntersectionTheory/src/Main.jl:583
[5] blow_up(i::AbstractVarietyMap{AbstractVariety, AbstractVariety}; symbol::String)
@ Oscar.IntersectionTheory ~/.julia/dev/Oscar/experimental/IntersectionTheory/src/blowup.jl:209
[6] blow_up(i::AbstractVarietyMap{AbstractVariety, AbstractVariety})
@ Oscar.IntersectionTheory ~/.julia/dev/Oscar/experimental/IntersectionTheory/src/blowup.jl:82
[7] top-level scope
@ REPL[61]:1
Some type information was truncated. Use `show(err)` to see complete types.arises because I think this line 198 from |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #4988 +/- ##
==========================================
- Coverage 84.88% 84.88% -0.01%
==========================================
Files 697 698 +1
Lines 94190 94191 +1
==========================================
Hits 79956 79956
- Misses 14234 14235 +1
🚀 New features to boost your workflow:
|
|
I guess to finish this up, I need to deprecate |
To do that you could put Line 184 in 546c0fc @deprecate map_from_func(func, dom, codom) MapFromFunc(dom, codom, func) to deprecations.jl to create a new function map_from_func in Oscar that delegates to MapFromFunc but prints a deprecation warning
|
|
Or if we want to keep the current behaviour, still add it to the exclude_hecke and add the following to function map_from_func(func, dom, codom)
Base.depwarn("something")
return AbstractAlgebra.map_from_func(func, dom, codom)
end |
|
Nobody in triage had objections to this PR |
|
One more option: we could do |
I like this idea best, of |
|
There was some discussion before and the consensus was that we want the convention |
|
Is there an existing file where it makes sense to put this code? Or should I make a new file in |
@mjrodgers Thx for catching this! I will add a test as soon as this PR is merged. |
wdecker
left a comment
There was a problem hiding this comment.
@mjrodgers The intersection theory changes look good to me. To double check the bug correction you made, try
P2 = abstract_projective_space(2);
P5 = abstract_projective_space(5);
i = map(P2, P5, [2P2.O1]);
Bl, E, j = blow_up(i);
AE = chow_ring(E);
CE = j.pushforward(one(AE))
The result you should get is e (it works on my machine):
|
Hi Wolfram,
Yes, we get `e` on both the old and new versions. However in the current `main` branch we have
```julia-repl
julia> parent(j.pushforward(one(AE)))
Quotient
of multivariate polynomial ring in 2 variables over QQ graded by
e -> [1]
h -> [1]
by ideal (2*e^3 - 9*e^2*h + 15*e*h^2 - 8*h^3, e*h^3)
julia> codomain(j.pushforward)
Quotient
of multivariate polynomial ring in 1 variable over QQ graded by
h -> [1]
by ideal (h^6)
```
because `map_from_func` returns a `FunctionalMap` which does not check that the image actually lies in the codomain.
In the new version with the correction I made to the comain, these now match.
|
|
I've added in this (in a new file in Actually scratch that, I should probably redo all of the |
|
Or maybe I should leave the |
|
Originally, this PR just tried to replace all internal uses of |
map_from_func with MapFromFuncmap_from_func with changed argument order
|
@lgoettgens OK like this? I wonder if we should add the |
Closes #4741
There is a lot of confusion from the methods
map_from_funcandMapFromFuncand their similar names; one first step to resolving this is to try to convert all existing uses ofmap_from_funcin Oscar to useMapFromFuncinstead.This PR also
AbstractAlgebraversion ofmap_from_funcfrom being imported fromHeckeOSCARversion ofmap_from_funcas an alias toMapFromFuncAs a result, we now have that the version of
map_from_funcavailable in Oscar(D, C, fun [, inv]), as opposed to the prior(fun, D, C)MapFromFunc, as opposed to the priorFunctionalMap.