-
Notifications
You must be signed in to change notification settings - Fork 63
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
Enable matrix algebras over noncommutative rings #1127
Conversation
Love it! |
Codecov Report
@@ Coverage Diff @@
## master #1127 +/- ##
==========================================
+ Coverage 84.95% 85.47% +0.51%
==========================================
Files 95 97 +2
Lines 26266 27702 +1436
==========================================
+ Hits 22315 23677 +1362
- Misses 3951 4025 +74
Continue to review full report at Codecov.
|
It looks like this is introducing ambiguities for map_entries involving GAP objects. I wonder if @fingolfin could comment on this when he has a chance. https://github.com/Nemocas/AbstractAlgebra.jl/runs/5205706833?check_suite_focus=true Presumably the relevant method in AbstractAlgebra is:
which was formerly not restricted to T <: RingElement. As this has introduced an ambiguity rather than a method error, I may need some guidance on whether this is something that can easily be worked around in Oscar.jl or whether we need to come up with something new here. |
I think Oscar would need to do |
Thanks @thofma If that seems feasible then I'll assume that for now. |
Do we also want MatrixSpace over noncommutative ring or just MatrixAlgebra over noncommutative ring? I don't foresee any complication with having both (other than writing a hell of a lot of test code), but maybe you guys see something? (Unrelated to discussion above, I think.) |
At the moment my only application is |
Could fix the problem in Nemocas/AbstractAlgebra.jl#1127, let's see.
It's just test code, as the tests are separated. It's easier to actually have matrix spaces as well from a code point of view. I will do both. |
Just to clarify: GAP.jl knows nothing about AA, MatrixElem etc., and it should stay that way. Any necessary changes will have to be done in Oscar. |
@fingolfin I don't see any issue with that. @thofma appears to have confirmed above that this is in fact something that can be changed in Oscar. I was guessing on the basis of the types alone. |
I've already encountered an issue which is going to be a major problem:
It seems Julia itself doesn't support matrices of matrices the way we would expect. |
Even worse, this carries over to our types:
Which means that it is currently impossible to construct matrices over matrix algebras. |
I don't expect too much from julia matrices, so this is fine. The other issue you mention is a consequence of us allowing the syntax
to construct block matrices. I don't know what the best way would be to fix it. I think we should keep the block matrix syntax for convenience. For the tests you could just do |
Yes, I can do that. It works at least. |
The Oscar problem is fixed. Somehow the documentation needs to be adjusted. |
Great! What changes do you want to the docs? |
If think it would be enough if they would build :) |
Oh I see. This PR has a long way to go. Docs will be fixed in the end. I haven't touched them yet. |
There will be some interesting holes in the implementation. For example isunit for a matrix algebra currently relies on det. None of the det methods we currently have work for noncommutative rings and I don't know if it is a theorem that a matrix is invertible if its determinant is a unit in the case of a noncommutative ring. |
Also, I don't see how to test this function:
It requires a Julia Vector or Julia matrices over a noncommutative ring to test, and as we know, Julia flattens these. |
Yes, there are multiple definitions of determinant, so there should be no |
No, I don't think julia flattens them:
|
I was hoping to test it when T is a noncommutative type, i.e. type of a matrix algebra element. |
|
Ah, my mistake. I misread the signature. Don't think there is an easier way than doing |
@thofma I've added all the basic methods and test for them. We are up to the more complicated algorithms now. However, I don't know how we are going to fix the promotion system. Consider multiplying a Now that I've added promotion rules for promoting MatAlgElems as noncommutative ring elements it doesn't know which way to do the promotion. It sees an NCRingElement on the left and a MatAlgElem on the right. Which is it promoting to which? I don't think this is an easy problem to solve. |
Actually, I managed to fix that and another promotion issue just by adding more promotion rules. But here is one I don't know how to deal with:
|
…ange_base_ring for NCPoly. Add tests.
…move unneeded functions involving MatAlgElems, fix a test.
I've removed the WIP and rebased this. If it is still desirable to have this branch, it would need the ambiguity issue to be resolved. Otherwise it's ready from my point of view. |
Some strange method errir in the oscar ci. Will investigate |
Edit: Should be fixed by thofma/Hecke.jl#628 |
My 2 cents: I think the transpose function should transpose the entries as well. no? This also complicates matters because base_ring(x) may not be the same as base_ring(transpose(x)). or is it?
|
Can you elaborate why the transpose should be 'recursive'? It would be a bit awkward if there were no way to just transpose the matrix generically. |
I don't think (AB)^T = B^TA^T works without recursion |
Yes, transposition on |
De we want this identity? this is also interesting: oscar-system/Singular.jl#233 |
If you want that identity, just supply the anti-morphism/involution and use a different method. But guessing an involution should not be part of the |
ok, then I am fine. |
Fixes #1035