How can I generate a number of matrices with specified attributes?

23 Views Asked by At

For my researches, I need to have a list of different matrices (about 400 matrices) with some specified attributes such as determinant, trace, the number of zero eigenvalues, etc. as a dataset.
How can I generated these matrices and save them as an Excel file?

Thank in advance.

1

There are 1 best solutions below

1
On BEST ANSWER

Obviously this will depend on exactly what you want the matrices to look like, but you might recall the characteristic polynomial $\chi_A(t)$ has

  • the eigenvalues as roots
  • the determinant as a constant term (up to sign)
  • the trace as the second highest term (up to sign)

Moreover, given a characteristic polynomial of interest, we can build a matrix which has that as its characteristic polynomial by looking at the companion matrix of a polynomial $p$.

So, what does this mean for your project? Well, you know what attributes you want. You should find a way to generate polynomials with these attributes. Then by looking at the companion matrices for the polynomials you get in this way, you can generate matrices with exactly the attributes you want.

You can do much of this efficiently in sage, and then export it as a csv file to open in excel. If you want to do it directly in excel, I'm afraid this isn't the right place to ask.


I hope this helps ^_^