Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

What kind of operations would you do on a 3-dimensional matrix? As far as I know this is not possible in Sage because the matrix needs to be defined over some ring. If you are not doing any fancy operations, then you might as well just store the vectors in a list of lists.

sage: v = vector(ZZ, [1,2,3])
sage: w = vector(ZZ, [2,3,4])
sage: V = [v, w]
sage: L = [[a.cross_product(b) for b in V] for a in V]
sage: L
[[(0, 0, 0), (-1, 2, -1)], [(1, -2, 1), (0, 0, 0)]]