# Revision history [back]

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.