trace(A) must check that 'A' is a matrix.