Ask Your Question

Revision history [back]

how to get the diagonal of a matrix?

Is there something like ?

sage: A = matrix(QQ,3,3,[3,-1,1,3,6,2,3,3,7])

sage: A.diagonal()

[3,6,7]