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

support Oscar.iso_gap_oscar for Alnuth's FieldByMatrices #2254

Merged
merged 3 commits into from
May 3, 2023
Merged

support Oscar.iso_gap_oscar for Alnuth's FieldByMatrices #2254

merged 3 commits into from
May 3, 2023

Conversation

ThomasBreuer
Copy link
Member

The idea is to get a better interface between Oscar and those functions from Alnuth which used to delegate tasks to Pari/GP, see #2220 for the current situation.

Note that the proposed Oscar.iso_gap_oscar and the already available Oscar.iso_gap_oscar code that deals with algebraic extensions on the GAP side cannot be used to simply replace the _OscarField that has been introduced in #2220, because of the difference between DefiningPolynomial and IntegerDefiningPolynomial (see my comment in the discussion of #2220).


# Construct the isomorphic number field in Oscar.
cfs = GAPWrap.CoefficientsOfUnivariatePolynomial(pol)
R, x = polynomial_ring(QQ, "x")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
R, x = polynomial_ring(QQ, "x")
R, x = polynomial_ring(QQ, "x", cached = false)

Copy link
Member Author

Choose a reason for hiding this comment

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

Why shall we force the creation of a new polynomial ring whenever a new number field in Oscar gets created?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I am happy if you want to keep it, but why shall we force a useless dictionary lookup whenever a new number field is created?

Copy link
Member

Choose a reason for hiding this comment

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

Do we have a written down policy when to enable the caching and when not? @fieker?

cfs = GAPWrap.CoefficientsOfUnivariatePolynomial(pol)
R, x = polynomial_ring(QQ, "x")
polFO = R(Vector{QQFieldElem}(cfs))
FO, _ = number_field(polFO, "z")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
FO, _ = number_field(polFO, "z")
FO, _ = number_field(polFO, "z", cached = false)

@codecov
Copy link

codecov bot commented Apr 14, 2023

Codecov Report

Merging #2254 (3c2b44b) into master (95409fb) will increase coverage by 72.48%.
The diff coverage is 97.22%.

❗ Current head 3c2b44b differs from pull request most recent head bf4021e. Consider uploading reports for the commit bf4021e to get more accurate results

Additional details and impacted files
@@             Coverage Diff             @@
##           master    #2254       +/-   ##
===========================================
+ Coverage    0.00%   72.48%   +72.48%     
===========================================
  Files         372      373        +1     
  Lines       51949    51793      -156     
===========================================
+ Hits            0    37544    +37544     
+ Misses      51949    14249    -37700     
Impacted Files Coverage Δ
src/GAP/iso_gap_oscar.jl 86.48% <96.77%> (+86.48%) ⬆️
src/GAP/wrappers.jl 92.80% <100.00%> (+92.80%) ⬆️

... and 342 files with indirect coverage changes

@fieker fieker closed this Apr 28, 2023
@fieker fieker reopened this Apr 28, 2023
@ThomasBreuer ThomasBreuer requested a review from thofma April 28, 2023 20:53
Copy link
Member

@fingolfin fingolfin left a comment

Choose a reason for hiding this comment

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

Looks good to me. Unless @thofma has objections, maybe we can merge it later today?

- Call `number_field` with option `cached = false`.
  (The field will be cached in the map created by `iso_gap_oscar`.)
- Use `Hecke.Globals.Qx` for creating number fields.
- Call `polynomial_ring` over other base rings with option `cached = false`.
  (The polynomial ring will be cached in the map created by `iso_gap_oscar`.)
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.

4 participants