Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version
a=QQ(-1)
matrix(QQ,1000,1000,lambda i,j:a)

oddly enough the following is faster:

from itertools import repeat
matrix(QQ,1000,1000,repeat(a,1000000))

Of course, select the appropriate ring in your own applications.