| 1 | initial version |
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).
Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.