Anonymous

I am new to programming in general but in my project, I am required to work with a finite set ๐={๐ด_1,...,๐ด_๐} of ๐ร๐ matrices over a finite ring ๐ , and the submodule ๐ they generate. To be more specific, I would like to compute facts such as: Maximal lin. indep. set of columns for each matrix, maximal lin. indep. subset of ๐ , minimal generating set of ๐ , span of S, length of ๐ and a composition series if it exists, and free rank of largest free submodule of ๐ (or possibly the set of all submodules/free submodules of ๐ , which is finite since ๐ and ๐ are finite). However, while browsing through the documentation in the Sage website, I found very little in terms of commands that compute the above facts for suitable ๐ , could someone point out a package or set of commands that compute (some of) the above stuff? I apologize in advance if the question violates forum rules.

edit retag close merge delete

Homework ?

( 2023-10-21 10:13:14 +0100 )edit

It is not homework, I recently started a project where I will have to compute invariants like this all the time

( 2023-10-21 21:28:09 +0100 )edit

Can you please specify what sorts of finite rings you will be working over?

( 2023-10-22 00:37:57 +0100 )edit

I sincerely apologize for the late reply, but I'll be working with the ring Z/nZ, for possibly composite n, a Galois ring GR(p,n,r), or a suitable extension of the latter two.

( 2023-10-23 10:32:45 +0100 )edit

Sort by ยป oldest newest most voted

Check out this Sage Quick Reference: Linear Algebra

For example, for "Maximal lin. indep. set of columns for each matrix" you can use

A.pivot_rows() indices of rows spanning row space

just transpose the matrix below applying it: A.T.pivot_rows()

The same method can be used for "maximal lin. indep. subset of ๐" - just flatten each given matrix and consider them as row-vectors.

more

This doesn't work for me over a ring like Z/8, which I think is what the poster has in mind.

( 2023-10-22 00:37:42 +0100 )edit

It's hard to understand what they really want without an example.

( 2023-10-22 01:23:45 +0100 )edit

See https://math.stackexchange.com/questi... โ same question before it appeared here.

( 2023-10-22 02:11:02 +0100 )edit

Dear Max Alekseyev, I apologize for the late reply. For example, given a matrix with rows {a,b,c},{d,e,f},{g,h,i},{j,k,l} (he ring Z/nZ, for possibly composite n, a Galois ring GR(p,n,r), or a suitable extension of the latter two), I would like to compute the minimal generating set of vectors for its row or column space, the maximal independent set of rows etc. Or, given a set of matrices, possibly compute linear dependence between them etc. I had the same idea as you, to flatten the matrix before doing computations, but I do not know how to implement it in the case of the rings in question.

( 2023-10-23 10:58:26 +0100 )edit

Flattening matrix M into a vector can be done via vector(M.list()). There still may an issue that linear algebra is poorly implemented over rings in Sage. For rings like $Z/nZ$, we may consider a workaround working with the integer lattice spanned by the original basis together with the columns of $n$ times the identity matrix.

( 2023-10-23 22:39:39 +0100 )edit