First time here? Check out the FAQ!
answered 2019-03-06 05:53:43 +0100
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.