-
Notifications
You must be signed in to change notification settings - Fork 139
Improve documentation for the "Matrix groups" section #4556
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
Improve documentation for the "Matrix groups" section #4556
Conversation
- add introductory text and examples for matrix groups (analogous to the recent changes in the documentation for f.p. groups) - improve the documentation for sesquilinear forms - change/fix docstrings, add examples to docstrings - export `invariant_bilinear_form`, `invariant_quadratic_form`, `invariant_sesquilinear_form` (alternatively, we could remove their documentation from the manual)
src/Groups/matrices/form_group.jl
Outdated
@@ -184,7 +184,7 @@ An exception is thrown if `base_ring(G)` is not a finite field with even degree | |||
over its prime subfield. | |||
|
|||
!!! warning "Note:" | |||
At the moment, elements of the generating set are returned of type `mat_elem_type(G)`. | |||
At the moment, elements of the generating set are returned of type `mat_elem_type(typeof(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.
For other similar *_type
function we actually make sure that one can also pass in instances, for convenience. Maybe a good idea to do that here, too? E.g. we do this in AA:
elem_type(x) = elem_type(typeof(x))
elem_type(T::DataType) = throw(MethodError(elem_type, (T,)))
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 found mat_elem_type
a bit irritating: It is not documented at all, but it appears essentially in these warnings in the documentation.
Now I think that the function is useful. Thus I will document mat_elem_type
and ring_elem_type
, and then it makes sense to admit also the group as an argument instead of its type.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #4556 +/- ##
==========================================
+ Coverage 84.43% 85.40% +0.96%
==========================================
Files 673 677 +4
Lines 89624 101380 +11756
==========================================
+ Hits 75676 86582 +10906
- Misses 13948 14798 +850
🚀 New features to boost your workflow:
|
- document `ring_elem_type`, `mat_elem_type`, admit a matrix group as argument - add examples for `corresponding_bilinear_form`, `corresponding_quadratic_form` - changed `show` for forms to avoid trailing whitespace
The matrices returned by `corresponding_bilinear_form` and `corresponding_quadratic_form` are determined at most up to scalars, thus `jldoctest` cannot be used.
Some tests fail: Aqua's "persistent tasks" complains. |
I don't think the Aqua issue are from this PR. This PR is still marked as draft, please let me know when you think it is ready for review. |
```jldoctest | ||
julia> g = GL(2, 3); | ||
|
||
julia> ring_elem_type(typeof(g)) == elem_type(typeof(base_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.
So this is also the same as this then?
julia> ring_elem_type(typeof(g)) == elem_type(typeof(base_ring(g))) | |
julia> ring_elem_type(typeof(g)) == elem_type(base_ring_type(g)) |
Makes me wonder if we really need ring_elem_type
. Ah well, I guess we have it for now...
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 change from typeof(base_ring(X))
to base_ring_type(X)
would make sense across Oscar (perhaps for another pull request).
```@repl | ||
Q = quadratic_form(invariant_quadratic_form(GO(3,3))) | ||
corresponding_bilinear_form(Q) | ||
``` |
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.
Any reason not to use a doctest here?
```@repl | |
Q = quadratic_form(invariant_quadratic_form(GO(3,3))) | |
corresponding_bilinear_form(Q) | |
``` | |
```jldoctest | |
julia> Q = quadratic_form(invariant_quadratic_form(GO(3,3))) | |
quadratic form with Gram matrix | |
[0 1 0] | |
[0 0 0] | |
[0 0 1] | |
julia> corresponding_bilinear_form(Q) | |
symmetric form with Gram matrix | |
[0 1 0] | |
[1 0 0] | |
[0 0 2] | |
``` |
It is defined only in odd characteristic. | ||
|
||
# Examples | ||
```@repl |
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.
ditto
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 this looks good to me (I would consider changing the examples using @repl
to use jldoctest
instead but that's a minor point).
If there is something blocking this, it would be good to know what it is, @ThomasBreuer. Otherwise I hope we can just merge this soonish?
invariant_bilinear_form
,invariant_quadratic_form
,invariant_sesquilinear_form
(alternatively, we could remove their documentation from the manual)