add  quadratic form