-
Notifications
You must be signed in to change notification settings - Fork 133
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
Implement printing guidelines for multivariate ideals #3250
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall I agree with the direction, but I wonder if we can't do something to help those cases were IMHO the new printed output is strictly worse than the old. Of course that's just about my subjective opinion -- I am not strictly opposed, and if others feel this is the way to go, I am happy enough (also, we can always improve again later).
That said it'd be great if others could chime in, to see if we can get a (partial) consensus
of prime ideal with 1 generator in multivariate polynomial ring | ||
in multivariate polynomial ring in 3 variables over QQ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In places like this, we loose information while now printing redundant information. Don't get me wrong, at the same time there are good reasons for the change in this PR (overall I like it!).
But I wonder if that means we perhaps need another printing mode, or just some special cases where we don't just recurse but do something specific when recording?
Like here, perhaps the complement function should print a list of generators of the ideal? If the printing here was any of these, I think it would be better (but perhaps not in general?)
Complement of
prime ideal
of multivariate polynomial ring in 3 variables over QQ
generated by
x
or
Complement of
prime ideal generated by
x
in multivariate polynomial ring in 3 variables over QQ
Of course in this specific case some people might also like
Complement of
prime ideal P
in R
or
Complement of
prime ideal generated by [ x ]
in QQ[x, y, z]
but both also have downsides, IMHO...
Perhaps @simonbrandhorst or @fieker or @thofma or others have something to say...
@@ -86,17 +86,17 @@ julia> (x, y) = coordinates(A) | |||
julia> X = algebraic_set(ideal([y - x^2])) | |||
Affine algebraic set | |||
in affine 2-space over QQ with coordinates [x, y] | |||
defined by ideal(-x^2 + y) | |||
defined by Ideal with 1 generator in multivariate polynomial ring |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another situation where the old printing seems strictly more useful than the new printing :-/.
Of course that might change if there are 50 ideal generators, each spanning three lines...
BTW, there seems to be a Lowercase()
missing in the show method for Affine algebraic set
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that for a few, small generators the old printing is better. In the end this gets us back at the discussion, whether objects should print all their generators or not or just some.
Here, I followed the example in #2166 by @simonbrandhorst , but we could of course also print something like
Ideal generated by x1, x2, ..., xn in multivariate polynomial ring
in one-line mode. If one generator is just huge this will of course explode again.
Oh, and I'd like to be very clear: I am very grateful for @joschmitt to have made this PR! I don't have a better idea than what is in here :-) |
I changed the one-line mode now, so that the generators are printed if they need not more than 20 characters. See this example from the doc tests:
We can change the 20 to something else and we can also change the |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #3250 +/- ##
==========================================
- Coverage 81.63% 81.62% -0.02%
==========================================
Files 546 546
Lines 73162 73204 +42
==========================================
+ Hits 59729 59754 +25
- Misses 13433 13450 +17
|
My impression is also that it looks worse than before. The one line print mode is useless if we just print the number of generators. |
I'm not sure I understand. Do you just propose
(Or both.) Here is a new proposal: Detailed mode:
One-line mode:
... assuming this fits a fixed number of characters (80 or 100 or 120 or whatever a "line"is) and
... if the list of generators would be too long. Supercompact:
And just to say: I feel like the examples we see in the documentation might be misleading since they almost always show ideals with very few and small generators. |
Thanks at lot for the new proposal. I think it is close to optimal! |
My thought was that |
I agree with @joschmitt . How about just using plain ASCII |
Plain asci |
Oh and i would agree that |
Also show generators in one-line mode, if there are few
I implemented now what I believe is the consensus. I also adjusted the printing of |
Is long output in one line mode now truncated .. at how many characters? I could not find an example in the diff. |
|
||
julia> affine_algebra(IR) | ||
(Quotient of multivariate polynomial ring by ideal(y1^6 - 3*y1^4*y3 - 16*y1^3*y2^3 - 4*y1^3*y4 + 3*y1^2*y3^2 + 24*y1*y2^3*y3 + 4*y1*y3*y4 + 72*y2^6 + 24*y2^3*y4 - y3^3 + 8*y4^2), Hom: quotient of multivariate polynomial ring -> graded multivariate polynomial ring) | ||
(Quotient of multivariate polynomial ring by ideal with 1 generator, Hom: quotient of multivariate polynomial ring -> graded multivariate polynomial ring) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@simonbrandhorst here is an example where the generator(s) are not printed in one-line mode. I put the limit at 100 characters.
This is certainly an improvement. Thank you @joschmitt |
Implement the printing guidelines for
MPolyIdeal
andInvRing
.For the ideals, I followed the example in #2166, with the exception that so far all generators are printed in detailed mode. I can adjust this, but I wasn't sure what the outcome of this general discussion was (the analogous question was discussed e.g. in #2878).
Note: the printing of
MPolyLocalizedIdeal
should be adjusted consistently (once there is an agreement forMPolyIdeal
).