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

Fix _automorphisms for degree 1 number field #1585

Merged
merged 1 commit into from
Aug 23, 2024

Conversation

StevellM
Copy link
Collaborator

Before

julia> Qt, t = QQ["t"]
(Univariate polynomial ring in t over QQ, t)

julia> K, a = number_field(t+1)
(Number field of degree 1 over QQ, -1)

julia> automorphism_list(K)
ERROR: Data does not define a morphism
Stacktrace:
 [1] error(s::String)
   @ Base ./error.jl:35
 [2] #map_data#323
   @ ~/.julia/packages/Hecke/CoyAD/src/Map/NumField.jl:281 [inlined]
 [3] map_data
   @ ~/.julia/packages/Hecke/CoyAD/src/Map/NumField.jl:272 [inlined]
 [4] #hom#322
   @ ~/.julia/packages/Hecke/CoyAD/src/Map/NumField.jl:150 [inlined]
 [5] hom
   @ ~/.julia/packages/Hecke/CoyAD/src/Map/NumField.jl:137 [inlined]
 [6] _automorphisms(K::AbsSimpleNumField; is_abelian::Bool)
   @ Hecke ~/.julia/packages/Hecke/CoyAD/src/Map/automorphisms.jl:29
 [7] automorphism_list(K::AbsSimpleNumField; copy::Bool, is_abelian::Bool)
   @ Hecke ~/.julia/packages/Hecke/CoyAD/src/Map/automorphisms.jl:141
 [8] automorphism_list(K::AbsSimpleNumField)
   @ Hecke ~/.julia/packages/Hecke/CoyAD/src/Map/automorphisms.jl:127
 [9] top-level scope
   @ REPL[3]:1

caused by the code of _automorphisms to create the identity morphism for degree 1 number fields by calling hom(K, K, one(K)). But in the case gen(K) != one(K) this does not work (I guess the code was initially intended to work for QQ defined as a number field by the polynomial t-1). Now with the change, even "exotic" degree 1 polynomials work

julia> Qt, t = QQ["t"]
(Univariate polynomial ring in t over QQ, t)

julia> K, a = number_field(t-984762)
(Number field of degree 1 over QQ, 984762)

julia> automorphism_list(K)
1-element Vector{NumFieldHom{AbsSimpleNumField, AbsSimpleNumField, Hecke.MapDataFromAnticNumberField{AbsSimpleNumFieldElem}, Hecke.MapDataFromAnticNumberField{AbsSimpleNumFieldElem}, AbsSimpleNumFieldElem}}:
 Map: K -> K

julia> s = ans[1]
Map
  from number field of degree 1 over QQ
  to number field of degree 1 over QQ

julia> s(one(K))
1

Copy link

codecov bot commented Aug 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 75.75%. Comparing base (f88e78f) to head (94a8d86).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1585      +/-   ##
==========================================
+ Coverage   75.73%   75.75%   +0.02%     
==========================================
  Files         358      358              
  Lines      113694   113693       -1     
==========================================
+ Hits        86105    86127      +22     
+ Misses      27589    27566      -23     
Files Coverage Δ
src/Map/automorphisms.jl 86.40% <100.00%> (ø)

... and 26 files with indirect coverage changes

@thofma thofma enabled auto-merge (squash) August 23, 2024 17:18
@thofma
Copy link
Owner

thofma commented Aug 23, 2024

Merci. Do you want a quick release? If so, just bump the version number in the Project.toml and I'll take care of the rest.

@StevellM
Copy link
Collaborator Author

No, no need for a quick release. It was just something I remarked while doing some computations; I have already bypassed the problem :-)

@thofma thofma merged commit c8604b9 into thofma:master Aug 23, 2024
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants