if n != m:
        raise ValueError('The matrix is not square!')