I found that it is easy to construct such object as a matrix inside a
matrix. For example here is the code:
#
m00=matrix(SR,2,2)
m01=matrix(SR,2,2)
m10=matrix(SR,2,2)
m11=matrix(SR,2,2)
t=matrix([[m00,m01],[m10,m11]])
#
# now one can assign elements of tensor t in cycle, for example
#
var('v10,v11,v20,v21,v30,v31,v40,v41')
v1=vector([v10,v11])
v2=vector([v20,v21])
v3=vector([v30,v31])
v4=vector([v40,v41])
for i in range (2):
    for j in range (2):
        for k in range (2):
            for l in range (2):
                t[i,j][k,l]=v1[i]*v2[j]*v3[k]*v4[l]
#
Here t[i,j][k,l] is the object, that can be called be indication of
his indeces, and it have four indices. Of course, it has two couples
of square brackets instead of one couple ( t[i,j][,k,l] instead of
t[i,j,k,l] ), but it is not critical.

-- 
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

Reply via email to