二次型对角化

diagonalization of quadratic form