Finite dimensional algebra generated by matrices

212 views
Skip to first unread message

Yingdong Li

unread,
May 12, 2022, 5:45:53 AM5/12/22
to sage-devel
Dear all,

I have written some codes in Sage to compute the finite-dimensional algebra by a list of commuting matrices and I want to contribute it to Sage. Here is the idea of my codes.

1. We can construct the algebra as a quotient of a polynomial ring(by using the homomorphism which sends each x_i to t_i, where t_1,...,t_n is the n matrices generate the algebra), we can also get the basis by doing this.

2. With the basis of the algebra, we can also compute the multiplication table then use the finite-dimensional algebra command in Sage to get a description to this algebra.

Once we have done with these things above, we can get the ring structure of the algebra. This is very useful in dealing with some problems about modular forms since we can further study the prime ideals or maximal ideals of Hecke algebra by using its ring structure.

I'm an undergraduate student and this is part of my research project. I was wondering how I can contribute the codes to Sage. Could anyone give me some help me with this(since I'm not so familiar about the Sage trac and I'm not sure where I can share my codes)? Thanks in advance!

Moreover, if you have some questions or comments on this, we can discuss about it here.

Best wishes,
Li Yingdong




davida...@gmail.com

unread,
May 12, 2022, 8:55:55 AM5/12/22
to sage-devel
Hello,

Most of the SageMath developpment is explained in this guide:


Also, I don't know exactly what is the scale of your code, but I would advise you to first upload your code to Github (if it isn't already done) as an external package. Github is very convenient for sharing code, so it would be easier to share it with the community. Next, I think to contribute to SageMath it is better to start with small contribution. For example, review some tickets or fix some bugs. Then, it becomes easier to contribute to bigger projects. 

Anyway, welcome to the community and good job on your research project!

David Ayotte

Travis Scrimshaw

unread,
May 14, 2022, 11:16:24 PM5/14/22
to sage-devel
I would advise against having it as an external package if you plan to integrate it into Sage. It further fragments the code and makes it more likely to bitrot from what I have seen. I would instead create a ticket and upload the code to that.

Is this a finite dimensional commutative algebra? We already have finite dimensional algebras (with no assumptions, e.g., associativity) in Sage. How does your code compare with this code? Could they be combined?

Best,
Travis

Yingdong Li

unread,
May 17, 2022, 9:37:06 AM5/17/22
to sage-devel
Dear Travis,

Thanks for your advice! The finite dimensional algebra code in Sage need a multiplication table, so the second part of our code is used to find the multiplication table with the basis of the algebra. And the first part of our code is used to find the basis with the generators of the algebra(along with a ideal of the polynomial ring). Our aim is to find the ring structure of the algebra generated by a list of commuting matrices.

Best wishes,
Li Yingdong

Yingdong Li

unread,
May 26, 2022, 3:12:41 AM5/26/22
to sage-devel
Dear all,

I have put my code in GitHub(with some explanation of it) so that you can clearly see it. 

Here's a link of my code in GitHub(see the code called "Finite generated algebra as a ring")

Best wishes,
Li Yingdong

Travis Scrimshaw

unread,
Jun 9, 2022, 8:38:41 PM6/9/22
to sage-devel
One thing you could consider doing is adding an option for the input of the finite dimensional algebra code to take the generators as input and then use that to generate a basis and feed that back into the finite dimensional algebra. I am sure I have written code to compute a basis from a generating set in at least one form somewhere in Sage. It seems like this code needs to be factored out to be used for purposes like this.

Best,
Travis

Yingdong Li

unread,
Jun 11, 2022, 11:30:27 PM6/11/22
to sage-devel
Dear Travis,

I think my code already has the function you mentioned(the function named "basis_of_algebra" is used to build a basis, and we can plug it in the "ideal" function to get the ideal we want, see line 53-139). I'm not sure whether I misunderstood your advice. Anyway, thanks for your advice and welcome to point out more  problem about my code(we can still discuss it here)!

Best wishes,
Li Yingdong

Travis Scrimshaw

unread,
Jun 12, 2022, 8:35:50 PM6/12/22
to sage-devel
Yes, you have. To better integrate it into Sage, I would expand the existing functionality of FiniteDimensionalAlgebra (and ideally it would do the basis and multiplication table lazily) . This class would likely need some additional work to get it to do what you eventually want, but it would make for a good project. Note that FiniteDimensionalAlgebra already has a class for ideals.

Sage, in principle, should also be able to construct any subalgebra of a finite-dimensional algebra given by generators using some of its generic code (i.e., not just from a subalgebra of all matrices) through a simple modification of your code. (In practice, I think the matrices are essentially compatible up to dealing with issues of mutability. I don't know how much this has been tested though...)

Some general coding advice: Python is an object-oriented programming language. This means you can organize your code into logical groupings called "classes" that give additional information about what the data represents. So rather than having a bunch of unrelated functions, they can become more tied together (of course, when this appropriate). It is wise to take advantage of this.

Best,
Travis

Yingdong Li

unread,
Jun 14, 2022, 10:27:06 PM6/14/22
to sage-devel
Dear Travis,

Thanks so much for your advice! I'll try it later.

Best wishes,
Li Yingdong

Reply all
Reply to author
Forward
0 new messages