Here is another way:
sage: coeffs = [[i^2-j for j in range(6)] for i in range(6)]
sage: matrix(coeffs)
[ 0 -1 -2 -3 -4 -5]
[ 1 0 -1 -2 -3 -4]
[ 4 3 2 1 0 -1]
[ 9 8 7 6 5 4]
[16 15 14 13 12 11]
[25 24 23 22 21 20]
On Sat, Mar 13, 2010 at 7:58 AM, Alasdair wrote:
> This can be done in m
This can be done in maxima:
genmatrix(lambda([i,j],i-j),6,6);
for example. But is there an easy Sage way of doing this? If I enter
sage: M=maxima('genmatrix(lambda([i,j],i-j),6,6)')
then I obtain a Maxima matrix, which then has to turned into a Sage
matrix (I don't know how to do this either)