[sage-devel] Re: Random matrices over Finite Fields

2010-05-12 Thread Roberto Nóbrega
Thank you. Setting density=None does the job. Regards, Roberto. On May 12, 7:45 am, Martin Albrecht wrote: > On Tuesday 11 May 2010, Roberto Nóbrega wrote: > > > As a note, > > > MatrixSpace(GF(2), nrows, ncols).random_element() > > > works as expected. &

[sage-devel] Re: Random matrices over Finite Fields

2010-05-11 Thread Roberto Nóbrega
As a note, MatrixSpace(GF(2), nrows, ncols).random_element() works as expected. Regards, Roberto. On May 11, 5:39 pm, Roberto Nóbrega wrote: > Hello, all! > > After running > > random_matrix(GF(2), 2, 1) > > I always get the same matrix, [[1][1]]. > > Also,

[sage-devel] Random matrices over Finite Fields

2010-05-11 Thread Roberto Nóbrega
Hello, all! After running random_matrix(GF(2), 2, 1) I always get the same matrix, [[1][1]]. Also, the following code freq = {} for _ in range(1000): M = random_matrix(GF(2), 2, 2) M.set_immutable() if M not in freq: freq[M] = 1 else: freq[M] += 1 show(freq) gi