Reputation: 4296
How do I loop through all nxn matrices of a finite field like Z/pZ in sage?
Do I have to build up n² iterated loops or is there a better way? I'd like to let n flexible.
Upvotes: 0
Views: 55
Reputation: 4402
The MatrixSpace
type is what you want.
M = MatrixSpace(GF(5),2,2)
M.list()
Don't try this at home with large numbers!
Upvotes: 1