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
More competitive and comprehensive finite dimensional algebras #23707
Comments
This comment has been minimized.
This comment has been minimized.
comment:2
FYI: PARI/GP has recently gained functionality to deal with general finite dimensional algebras. But it seems that this ticket is mostly about basic arithmetic, so I'm not sure that it's relevant. |
comment:3
Replying to @jdemeyer:
This ticket is not necessarily about basic arithmetic. Eventually, I finally want to implement my F5 algorithm for modules over path algebra quotients (after being distracted by other things for several years), starting with finite dimensional quotients. So, having an implementation of finite dimensional algebras over any field (but for me most importantly over finite not necessarily prime fields!) that is really competitive would be nice. Can you give me a pointer for the PARI/GP implementation? Would it be difficult to wrap in cython? |
comment:4
Replying to @simon-king-jena:
An algebra over Fq is just a special case of an algebra over Fp. PARI/GP supports algebras over Q and over Fp.
See https://pari.math.u-bordeaux.fr/dochtml/html-stable/ section "Associative and central simple algebras".
I don't think so. Depending on your needs, you could also use |
comment:5
Replying to @jdemeyer:
I don't buy that. A matrix over Fp should be the same as an algebra over Fq, but the current default in sage differs totally in performance. Anyway, if you wanted to say that PARI/GP is good in both cases then it's fine.
Thank you!
What's that? |
comment:6
|
comment:7
Replying to @jdemeyer:
Thanks. Are algebras wrapped? If found cypari2 by googling, but a quick look seems to indicate that the conversions are about numbers, not algebras. |
comment:8
How can I do the following pari code in Sage?
Defining the matrices works:
However, my attempts to define the algebra failed:
|
comment:9
Replying to @simon-king-jena:
Everything is wrapped. That's the nice thing about It's probably not so relevant, but it's best to use #23518.
Well yes, it's a Python package so it only supports a limited set of conversions for standard Python types. Sage does support more conversions though. In any case, don't be blinded by the conversions, that's really just a detail. If PARI supports your algorithms, surely the conversion between Sage and PARI should be possible to implement. |
comment:10
Use a different variable name :-)
Note that you don't need With #23518, you should be able to write this as
or
|
comment:11
Replying to @jdemeyer:
Why is that? |
comment:12
What's wrong with this?
So, does the first argument of alginit really needs to be a number field, not a finite field? |
comment:13
Reading that over finite fields one uses
which didn't work either. Why? |
comment:14
The following doesn't look promising:
|
comment:15
Replying to @simon-king-jena:
Don't you need a list of 1024 matrices in dimension 1024? |
comment:16
Replying to @jdemeyer:
Ouch, yes! Apparently I thought of constructing the algebra that is generated by these matrices (which I guess has dimension much larger than 1024). |
comment:17
Replying to @jdemeyer:
But in any case, Pari complains about type (t_VEC), not about value. So, the number of matrices isn't the only problem. |
comment:18
Replying to @simon-king-jena:
Don't take the PARI error messages too literally... |
Commit: |
comment:20
I think I shouldn't be overambitious in this ticket: The finite-dimensional path algebra quotient stuff should be for a later ticket, where I will probably sub-class the now cythonised finite dimensional algebra elements. Changes:
Caveat: It seems to me that OVER QQ multiplying a square matrix with a single-column matrix is faster than multiplying a single-row matrix with a square matrix. But that's the only case where I found that behaviour. Since I am not interested in the rational case anyway, I don't plan to provide a special implementation over QQ where elements are encoded as single-column matrices rather than single-row matrices. PS: For me, tests pass... New commits:
|
comment:21
Back to pari:
What's wrong? |
comment:22
Replying to @simon-king-jena:
I don't know why, but apparently Pari doesn't accept some associative algebras that are perfectly fine in Sage, while it accept others:
Is there a clear reason or are associative algebras in Pari just broken? |
comment:23
Strangely, the patchbot doesn't test it (although it needs review). I'm trying to |
comment:24
you need to fill the Author field, otherwise it is deemed unsafe |
comment:70
Replying to @tscrim:
I do believe not raising an IndexError is wrong in that case.
Here I am unsure what you are referring to by "different behaviour". As a matter of fact, iterator works now:
I don't think it is possible to be consistent, as even multi- and univariate polynomials aren't:
A finite dimensional algebra is a finite dimensional vector space, and thus I believe one should be consistent with vectors, not with multivariate polynomials. And that is the case with the current implementation. |
comment:71
Replying to @simon-king-jena:
Also note that it is |
comment:72
I wasn't thinking of polynomial rings (which are not [currently] in the category of
|
comment:73
Replying to @simon-king-jena:
It probably is a side-effect of a generic implementation of
The old behavior for
Good point. Always fun the differences between uni- and multivariate polynomials.
See comment:72 for other algebras. Polynomials error out when trying to do, e.g., I am okay with the current behavior, even if I would prefer it to agree with |
comment:74
Thank you! |
comment:75
Thank you for your work on this. I look forward to having the quotients as well. |
comment:76
You are using |
comment:77
Replying to @jdemeyer:
The restriction has already been there before:
|
comment:78
Replying to @jdemeyer:
And doesn't |
comment:79
One could even argue that using
|
comment:80
Replying to @simon-king-jena:
The fact that a certain bug exists already is not a good reason to add more bugs of a similar nature. |
comment:81
Replying to @simon-king-jena:
Yes, it does. However, Python generally uses
|
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:83
Replying to @jdemeyer:
OK, that's a good reason. I changed to |
comment:84
Jeroen, any more comments (or things not addressed)? |
comment:85
Not really. Anyway, I have not looked deeply into this ticket, I was just pointing a few random things. |
comment:86
I let this drop off. Whoops. Back to positive review. |
Changed branch from u/SimonKing/more_competitive_and_comprehensive_finite_dimensional_algebras to |
Issues
Currently, sage.algebras.finite_dimensional_algebras.finite_dimensional_algebra_element is Python.
Multiplication is implemented by
which for some matrix implementations is not the fastest way:
(Remark: The timings for
GF(9,'x')
are with MeatAxe)The last example is 163 ms vs. 14.6 µs!!!
In my applications, I need finite dimensional path algebra quotients. The current implementation corresponds to a finite dimensional path algebra quotient where the underlying quiver has a single vertex.
Creation of an element also involves construction of its multiplication matrix. From my experience, it can be faster (in some applications) to not construct the matrix of it right away, but be lazy. E.g., when one computes Gröbner bases, only multiplication by power products of the algebra generators are needed, and then it is faster to map the defining vector of the element repeatedly by multiplying with the matrices of the generators, instead of doing matrix by matrix multiplications.
Suggestion
CC: @tscrim @fchapoton @videlec
Component: algebra
Keywords: finite dimensional, algebra, quiver
Author: Simon King
Branch/Commit:
3cc3a27
Reviewer: Travis Scrimshaw
Issue created by migration from https://trac.sagemath.org/ticket/23707
The text was updated successfully, but these errors were encountered: