I need to determine if a large set of matrices are linearly independent, i.e. linearly independent from each other (not linearly independent in their individual rows and columns). Anyone have any ideas on how to efficiently do this in Mathematica?

### Like this:

Like Loading...

My guess: set up the equation a1 * m1 + … = 0 and tell it to solve for the ai. If that doesn’t work, linearize the matrices into vectors first, then try again.

Thanks. I know this sounds ridiculous, but I haven’t figured out how to tell it to do either, i.e. how does one tell it to solve for the ai? Regarding linearization, do you have to do it manually? I’m terrible at “guessing” what collection of words will work best in search and so I have struck out on these questions in the Documentation Center.

M = { M_1, M_2, …); (* List of N x N matrices *)

V = Map[ Flatten, M]; (* List of vectors whose entries are those of the matrices *)

linearIndependenceQ = Not[ RowReduce[V][[-1]] == Table[0, {N}]]; (* Row reduces list of vectors; if they are linearly dependent, the bottom row will be all zeroes *)

Anon: Thanks! That’s quite helpful!