Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

The issue is that when you do a = (1,0) you are creating a tuple which is one of Python's built-in data types.

sage: type((1,0))
<type 'tuple'>

Sage doesn't "know" how to multiply a matrix and a tuple.

If you make a a vector instead, then thing will work like you want:

sage: Iz=1/2*matrix(2,2,[[1,0],[0,-1]])
sage: a = vector([1,0])
sage: type(a)
<type 'sage.modules.vector_rational_dense.Vector_rational_dense'>
sage: Iz * a
(1/2, 0)