1 | initial version |
Like that
sage: M = Matrix([[0,0,0,-1],[1,0,0,-1],[0,1,0,-1],[0,0,1,-1]])
sage: [(z.multiplicative_order(), m) for z, m in M.charpoly().roots(QQbar)]
[(5, 1), (5, 1), (5, 1), (5, 1)]
2 | No.2 Revision |
Like that
sage: M = Matrix([[0,0,0,-1],[1,0,0,-1],[0,1,0,-1],[0,0,1,-1]])
sage: [(z.multiplicative_order(), m) for z, m in M.charpoly().roots(QQbar)]
[(5, 1), (5, 1), (5, 1), (5, 1)]
or even better:
sage: [(p.is_cyclotomic(certificate=True), m) for (p, m) in M.charpoly().factor()]
[(5, 1)]