matrix and quadratic matrix