Ask Your Question

Revision history [back]

When you defined the matrix u you didn't specify a base ring, so SageMath reasonably guessed it to be the integers ZZ. Hence the error.

The solution is to always specify the base ring, like u = Matrix(SR, [[....

You can also change the base ring later, e.g. u = u.change_ring(SR).