8000 Overhaul printing of orders, (fractional) ideals, and related objects by thofma · Pull Request #1840 · thofma/Hecke.jl · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Overhaul printing of orders, (fractional) ideals, and related objects #1840

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

Merged
merged 1 commit into from
May 17, 2025

Conversation

thofma
Copy link
Owner
@thofma thofma commented Apr 2, 2025

No description provided.

@thofma
Copy link
Owner Author
thofma commented Apr 2, 2025

still missing fractional ideals

@thofma
Copy link
Owner Author
thofma commented Apr 2, 2025

I wonder if we should just do <2, a> instead of Ideal (2, a). I used Ideal (2, a) to be "consistent" with the multivariate polynomial ring ideals for now.

@thofma thofma force-pushed the th/pppprint branch 2 times, most recently from c1c4db8 to 59f7e09 Compare April 2, 2025 17:53
Copy link
codecov bot commented Apr 2, 2025

Codecov Report

Attention: Patch coverage is 87.04453% with 32 lines in your changes missing coverage. Please review.

Project coverage is 76.45%. Comparing base (1d5878a) to head (bd1a154).
Report is 34 commits behind head on master.

Files with missing lines Patch % Lines
src/NumFieldOrd/NfOrd/FracIdeal.jl 62.96% 10 Missing ⚠️
src/Map/NumField.jl 52.94% 8 Missing ⚠️
src/RCF/class_fields.jl 80.95% 4 Missing ⚠️
src/NumFieldOrd/NfOrd/NfOrd.jl 85.71% 3 Missing ⚠️
src/NumFieldOrd/NfRelOrd/FracIdeal.jl 85.71% 2 Missing ⚠️
src/NumFieldOrd/NfRelOrd/Ideal.jl 93.10% 2 Missing ⚠️
src/NumFieldOrd/NfRelOrd/NfRelOrd.jl 93.33% 2 Missing ⚠️
src/NumField/ComplexEmbeddings/NfAbs.jl 94.44% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1840      +/-   ##
==========================================
- Coverage   76.61%   76.45%   -0.17%     
==========================================
  Files         362      364       +2     
  Lines      115012   115635     +623     
==========================================
+ Hits        88119    88407     +288     
- Misses      26893    27228     +335     
Files with missing lines Coverage Δ
src/NumField/ComplexEmbeddings/Generic.jl 97.93% <ø> (ø)
src/NumField/InfinitePlaces.jl 100.00% <100.00%> (ø)
src/NumField/NfRel/NfRel.jl 78.62% <100.00%> (+0.09%) ⬆️
src/NumField/NfRel/NfRelNS.jl 85.80% <100.00%> (+0.05%) ⬆️
src/NumFieldOrd/NfOrd/Ideal/Ideal.jl 84.09% <100.00%> (+0.60%) ⬆️
src/NumFieldOrd/NfOrd/LinearAlgebra.jl 58.71% <100.00%> (+0.14%) ⬆️
src/NumFieldOrd/NumFieldOrdElem.jl 94.51% <100.00%> (+0.06%) ⬆️
src/NumField/ComplexEmbeddings/NfAbs.jl 87.20% <94.44%> (-0.04%) ⬇️
src/NumFieldOrd/NfRelOrd/FracIdeal.jl 84.41% <85.71%> (-0.03%) ⬇️
src/NumFieldOrd/NfRelOrd/Ideal.jl 88.06% <93.10%> (+1.03%) ⬆️
... and 5 more

... and 66 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@thofma
Copy link
Owner Author
thofma commented Apr 4, 2025

Updated (went back to <...>, because it looks much better in expressions that use an ideal:

julia> 2*OK
Ideal of order of number field of degree 2 over QQ
  with generator 2
  of norm 4
  of minimum 2

julia> [2*OK, 3*OK]
2-element Vector{AbsSimpleNumFieldOrderIdeal}:
 <2, 2>
 <3, 3>

julia> K(2) * OK
Fractional ideal with numerator
  ideal of order of number field of degree 2 over QQ
    with generator 2
    of norm 4
  with denominator 1

julia> [K(1//2) * OK]
1-element Vector{AbsSimpleNumFieldOrderFractionalIdeal}:
 <1, 1>//2

Comment on lines 22 to 25
Order of
number field with defining polynomial x^2 - 5
over rational field
with Z-basis [1, a]
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 wondering if, according to OSCAR printing conventions, it would not be better to have something printed as:

Order
  of number field with defining polynomial x^2 - 5
    over rational field
with Z-basis [1, a]

All the of, over, from... should be on a new line just before what they refer to.

Copy link
Owner Author
@thofma thofma Apr 4, 2025

Choose a reason for hiding this comment

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

Hm? Do you mean the following?

Order
of number field with defining polynomial x^2 - 5
  over rational field
with Z-basis [1, a]

or else I don't understand the "rule".

Copy link
Collaborator

Choose a reason for hiding this comment

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

This is the same as when we define maps I guess

julia> F = hom(A, B, [x^2+z, y^2-1, z^3])
Ring homomorphism
  from multivariate polynomial ring in 3 variables over QQ
  to quotient of multivariate polynomial ring by ideal (x*y)
defined by
  a -> x^2 + z
  b -> y^2 - 1
  c -> z^3

or what has been implemented with schemes also

julia> Y = affine_space(QQ,3)
Affine space of dimension 3
  over rational field
with coordinates [x1, x2, x3]

But yeah, anyway, within OSCAR there are still inconsistencies... I was just giving my opinion. I guess the most important was to move the of in the indented part. Where you put the with Z-basis ... is up to taste, maybe. I would still argue to de-indent it. My reason is that the basis belong to the object, the number field does not.

Copy link
Owner Author
@thofma thofma Apr 4, 2025

Choose a reason for hiding this comment

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

But the scheme example also has an of in the nonindented part. I really don't understand the rule (if there is actually one).

Compare with

julia> lie_algebra(QQ, :A, 5)
Abstract Lie algebra
  of type A5
  of dimension 35
over rational field

where all of things are indented, but where the indentation of over is the opposite of the scheme example.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I guess in the case of scheme it is because the of dimension 3 is small enough to be put on the first line (which happens often in other printings), and it is not a standalone of, there is something after it.
I do not think there is a general rule, just a global guideline and suggestions. Some people might disagree with what I am telling you now, of course.
And for the Lie Algebra printing, well, I do not agree with it.

Comment on lines 34 to 36
Ideal of order of cyclotomic field of order 7
with 29-normal generators [29, z_7 + 22]
of norm 29
of minimum 29
Copy link
Collaborator
@StevellM StevellM Apr 4, 2025

Choose a reason for hiding this comment

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

And this printed as

Ideal
  of order of cyclotomic field of order 7
with 29-normal generators [29, z_7 + 22]
  of norm 29
  of minimum 29

Probably here also the order of... could be more detailed but it really depends on how much information one wants to pass.

Copy link
Owner Author

Choose a reason for hiding this comment

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

This make it look like the second of are properties of the with 29-normal ... line.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes that's my bad, I misunderstood it. Then why not keeping (non-indented) Norm: 29 and Minimum: 29 as it was before ?

Copy link
Owner Author

Choose a reason for hiding this comment

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

I find the rule of what is intended and what not quite arbitrary. So I intended to indent everything consistently.

Indentation should help parse things. But if indentation is not consistent, this does not help. For example printing many ideals would give something like

Ideal
  of order of cyclotomic field of order 7
with 29-normal generators [29, z_7 + 22]
  of norm 29
  of minimum 29
Ideal
  of order of cyclotomic field of order 7
with 29-normal generators [29, z_7 + 22]
  of norm 29
  of minimum 29
Ideal
  of order of cyclotomic field of order 7
with 29-normal generators [29, z_7 + 22]
  of norm 29
  of minimum 29

It is now difficult to see where one thing starts/ends.

@thofma
Copy link
Owner Author
thofma commented Apr 4, 2025

Hm, I don't like

Order
  of ...
with ...
with ...

it kind of defeats the purpose of using indentation to mark where things start or end.

@thofma thofma force-pushed the th/pppprint branch 5 times, most recently from 162da85 to 05126e5 Compare April 5, 2025 06:52
@thofma
Copy link
Owner Author
thofma commented Apr 5, 2025

Added the relative stuff and also the pseudo-matrix. It went from

Pseudo-matrix over Relative maximal order of Relative number field of degree 2 over K
with pseudo-basis
(1, 1//1 * <1, 1>)
(b + 1, 1//2 * <1, 1>)
Fractional ideal with row [1 0 0 0]
Fractional ideal with row [5 1 0 0]
Fractional ideal with row [3 0 1 0]
Fractional ideal with row [0 0 0 1]

to

[1   0   0   0] * <7, 1//2*b + 7//2>//1
[5   1   0   0] * <1>//1
[3   0   1   0] * <1>//1
[0   0   0   1] * <1>//1

@thofma
Copy link
Owner Author
thofma commented Apr 5, 2025

I am finished for now and I think it is a clear improvement. There might be some disagreement about minor details, but this would be the case for any change.

@thofma
Copy link
Owner Author
thofma commented Apr 5, 2025

@StevellM sorry for the confusion. You were right. I tried to adjust it accordingly. Can you check again?

@StevellM
Copy link
Collaborator
StevellM commented Apr 5, 2025

It looks nice, I particularly like the new printing for pseudo-matrices! You are right in the sense that it would be hard to please everybody. I think in general the new printing is good, and it is clearly an improvement, as you said.
The only comment I have left, which is actually a question, is about fractional ideals. So currently it is of the form

Fractional ideal
  with numerator ideal of maximal order of relative number field of degree 2 over K
  with pseudo-basis
    (1, <7>//1)
    (b + 1, <7>//2)
  with denominator 1

Would it make sense to indent more the numerator ideal, like

Fractional ideal
  with numerator
    ideal of maximal order of relative number field of degree 2 over K
    with pseudo-basis
      (1, <7>//1)
      (b + 1, <7>//2)
  with denominator 1

or to just compactify it

Fractional ideal
  with numerator [compact printing of numerator]
  with denominator 1

? I have no preferences; the current printing looks fine to me. The last option would require maybe to, as in the case of integral ideals, add the maximal order to the printing, so more like

Fractional ideal
  of maximal order
    of relative number field of degree 2
      over K
  with pseudo-basis
    (1, <7>//1)
     (b + 1, <7>//2)
with numerator [compact printing ideal]
with denominator 1

(if I did not mess up whom the pseudo-basis belong to...)

@thofma
Copy link
Owner Author
thofma commented Apr 5, 2025

OK, I see. I think I will go with

Fractional ideal of maximal order of relative number field of degree 2 over K
with numerator
  ideal of maximal order of relative number field of degree 2 over K
  with pseudo-basis
    (1, <1, 1>//1)
    (a + 3, <6, 17*a^2 + 22*a + 2>//6)
with denominator 1

if there is no objection.

@thofma
Copy link
Owner Author
thofma commented Apr 5, 2025

Tests look good. Breakage is expected. I might use the chance to update some other printing as well in this PR here.

@thofma thofma marked this pull request as ready for review May 16, 2025 19:40
@thofma thofma closed this May 16, 2025
@thofma thofma reopened this May 16, 2025
@thofma thofma force-pushed the th/pppprint branch 2 times, most recently from 93e873c to b3754ee Compare May 17, 2025 06:05
@thofma thofma merged commit 5f1efbf into master May 17, 2025
17 of 18 checks passed
@thofma thofma deleted the th/pppprint branch May 17, 2025 08:54
@thofma thofma changed the title feat: overhaul printing of orders and ideals Overhaul printing of orders, (fractional) ideals, and related objects May 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0