Used ValueError instead of custom exception when input matrix is not symmetric