raise a ValueError if the precomputed matrix is not square