-
Notifications
You must be signed in to change notification settings - Fork 125
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
No type piracy: remove matrix*vector methods for Nemo types #760
Conversation
6190727
to
6f22e06
Compare
6f22e06
to
4d5cfc3
Compare
Status? AbstractAlgebra has matrix vector products where the vector is a julia vector. Internally, this delegates to a mul! function which will be overridden in Nemo soon for efficiency with common types. |
6cfbc8e
to
90f5521
Compare
90f5521
to
e311295
Compare
Let's try to resolve this one way or another: either by deleting the methods which multiple a Deleting it as this PR does leads to additional test failures that I could fix. But the core issue remains: people have a matrix group, say The naive approach is to use If not, then we need some other way to get a suitable "vector space" on which the group acts. Perhaps via a function like How to proceed? Hoping for some input from @fieker |
OK I remember now why we can't just move this to AA (at least not easily): because general matrices are not square, and so So this would suggest to "resolve" (?) the issue here by removing the code which pretends to multiply free module elements by a |
Hrm, though of course code like this also breaks if we remove those
|
Regarding support for Regarding |
@fieker unfortunately |
14c6b70
to
da7c1bf
Compare
@@ -170,14 +170,6 @@ end | |||
# | |||
######################################################################## | |||
|
|||
|
|||
Base.:*(v::AbstractAlgebra.Generic.FreeModuleElem{T},x::MatElem{T}) where T <: RingElem = v.parent(v.v*x) |
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.
Unfortunately we use this in one book example in the group theory chapter:
julia> R2 = free_module(K, 2) # the "euclidean" plane over K
Vector space of dimension 2 over QQBar
julia> A = R2([0,1])
(Root 0 of x, Root 1.00000 of x - 1)
julia> pts = [A*mat_rot^i for i in 0:4];
However if we replace A*mat_rot
by A*G_mat[1]
it is fine because we retained that method -- we can retain it as (a) it is not type piracy, and (b) matrix group elements are guaranteed to be square).
So we either need to modify the book example or keep this method... Guess we can decide it when we decide how to proceed with the book.
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.
Since the book is now being revised I can adjust the book example to match, I guess. But I suggest that is done first in the book, and then in all repositories which have stuff derived from it. And only once that all is through do we merge this here.
Repositories that contain code extract from book examples
- Oscar.jl of course
- https://github.com/oscar-system/book-notebooks (do we still care about it?)
- https://github.com/oscar-system/book.oscar-system.org
- anything else?
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 really needs to be settled one way or another this Wednesday.
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 discussed this with @fieker this morning and it turns out we don't even need the linke pts = [A*mat_rot^i for i in 0:4];
in the book example anymore! So I have now taken it out of the book, and that means this obstacle is gone.
Just need to wait for the book examples to be synced into this repository
95e45c3
to
1096ce2
Compare
f316055
to
6e0caac
Compare
(Root 0 of x, Root 1.00000 of x - 1) | ||
|
||
julia> pts = [A*mat_rot^i for i in 0:4]; | ||
julia> R2 = vector_space(K, 2); # the "euclidean" plane over K |
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 reflects a change in the book, i.e. we removed the definition of A
and pts
and tweaked that of R2
for the book.
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 am happy with the changes here. However, I don't like changing the book tests in this PR. Instead, I would suggest to wait until #4205 has been forwardported (or whatever the word for backporting in the other direction is) onto master and then rebase this here on top of that.
@fingolfin now that #4221 is merged, can you rebase this onto master so that this PR no longer touches the book tests? |
Multiplying FreeModuleElem by a matrix group element returning a Vector{} is weird and shouldn't be done. While this could be fixed by adding a second transpose call, I don't think this kind of inefficient operation should be encouraged, that vector space simply is a right-module, end of story. In a similar vein, remove the three argument * method.
6e0caac
to
a011fee
Compare
Looks good to merge from my POV. Any objection @ThomasBreuer ? |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #760 +/- ##
=======================================
Coverage 84.58% 84.58%
=======================================
Files 631 631
Lines 84999 84994 -5
=======================================
- Hits 71899 71895 -4
+ Misses 13100 13099 -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.
No objection
No description provided.