-
Notifications
You must be signed in to change notification settings - Fork 132
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
Print group generators in detailed printing #2878
base: master
Are you sure you want to change the base?
Print group generators in detailed printing #2878
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #2878 +/- ##
==========================================
+ Coverage 81.35% 81.63% +0.27%
==========================================
Files 556 545 -11
Lines 74495 72788 -1707
==========================================
- Hits 60604 59417 -1187
+ Misses 13891 13371 -520
|
|
||
julia> W = wreath_product(G,H) | ||
<group of size 18 with 2 generators> | ||
with 2 generators | ||
WreathProductElement(f1,<identity> of ...,()) |
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.
This needs some change to be useful.
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 think it is already useful (and compared to not showing anything, conveys infinitely more information). But of course it could be made even more useful :-)
I think this should have been the default in the first place. Edit: When do you find it annoying? |
@thofma I find it annoying when I have thirty 200x200 matrices as generators (this is not hypothetical, by the way...). So I'd really like a way to limit it based on the screen size... Also, the generators of subgroups often are determined by randomized algorithms, which can make this kind of printing a PITA when used in doctests (in GAP frequently minor changes to algorithms require annoying changes to doctests -- even with machinery as we have it to update them semi-automatically, it's often a bother). Of course doctest filters may be able to help with that if we encounter it. I also don't find it very helpful for pc groups where the are, say, 10 generators named But none of these are insurmountable! (and I would not have made this PR if I was fundamentally opposed to this change, after all ;-) |
|
||
[1 0 0] | ||
[0 a 0] | ||
[0 0 -a - 1] | ||
|
||
julia> IR = invariant_ring(G) |
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.
The printing of the invariant ring should also be adjusted, I just did not yet get to that (CC @joschmitt)
julia> G = matrix_group(M1, M2) | ||
Matrix group of degree 3 | ||
over cyclotomic field of order 3 | ||
with 2 generators | ||
[0 0 1] | ||
[1 0 0] | ||
[0 1 0] | ||
|
||
[1 0 0] | ||
[0 a 0] | ||
[0 0 -a - 1] |
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.
Here it would be nice if there was a hint somewhere that a
is the name of the generator of the cyclotomic field.
But I notice that the cyclotomic field has no option for printing that. Indeed, even its detailed printing omits the name of its generator:
julia> K, a = cyclotomic_field(3, "a")
(Cyclotomic field of order 3, a)
julia> K
Number field with defining polynomial _$^2 + _$ + 1
over rational field
julia> gen(K)
a
In fact I am surprised to see that the detailed printing drops the hint that this is a cyclotomic field (I mean, of course one can see this from the defining polynomial, but in larger degrees I would not be able to recognize these reliably).
@ThomasBreuer do you have any thoughts on this, pro or contra? |
I agree that for some complicated coefficient fields, the printing might not convey all the information, but I think this is outweighed by the advantages. |
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 think that printing full information about group order and generators is meaningful at most for small examples.
For example, try atlas_group(MatrixGroup, "J3")
: This is a group with 2 generators in dimension 80 over GF(2), probably nobody wants to see such matrices, except if one asks explicitly to look at them.
Or try sylow_subgroup(symmetric_group(100), 2)[1]
: This group has 97 generators, almost nobody wants to see them.
(And then replace degree 100 by 1000 and see what happens.)
I think these examples are not artificially large, already the 10 by 10 matrices generating the group M11 (that occur in one of the examples) are not interesting enough to be shown if one just wants to work with the group.
Even beginners working with small groups will deal with such large permutations and matrices -- think of regular actions.
Let us compare the situation with that in GAP, where we had similar problems.
An answer was to distinguish between View
(short output, not nec. GAP-readable) and Print
(longer output, preferably GAP-readable); the main idea was that in the case of long output, full information shall be given only if the user asks for it, by calling Print
.
And View
tries to abbreviate permutations of large degree by showing only the first cycles and then ( [...] )
; of course this does not help if the permutation consists only of one cycle.
The current situation in GAP may still be regarded as not convincing.
I remember of a discussion in which a user argued that in the case of View
(that is, one has not explicitly asked for more output, presumably one just forgot to type the double semicolon that suppresses the output) the output should always be restricted to the first n lines and the last n lines, with ...
in the middle, where n should be about 5.
If one does not care for the output in the first place, one can just use a |
This was one of the points in the abovementioned discussion in the GAP Forum: The user in question did not agree with the argument that typing one more semicolon would save him from many pages of annoying output. He wrote that this argument is the same as a statement somewhere in the fineprint that all one has to do in order to prevent the computer from blowing up is to push the "Dont't blow up" button before switching the machine on. I understand this comparison as the verdict that a system should not only allow one to avoid obviously useless output but that avoiding such output should be the default. |
A system has a default way of printing and there is an easy way to suppress it. Doesn't sound so complicated to me. A system should not try to decide what "useless" is. Why not just print "group"? Obviously in my application, this is all I need to know. |
@thofma |
In my opinion, any reasonable "default" of printing should print at most one screen full of stuff. So in this sense, I really like the julia way of printing vectors. |
The problem with This |
Good point. |
I am in favor of the changes. For matrix groups of large degree (say >= 10) I would not print the matrices. |
b26191b
to
602eb9b
Compare
Note to self: also add suitable code to prevent lower casing for
Note the |
602eb9b
to
07d6e69
Compare
This is an experiment to see what happens if we print the generators of groups, at least in "detailed" mode. I find it quite useful in some cases, but in others it is annoying. Would be interesting to know what others think about this.