| 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.
Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.