QP is to find a point that minimizes a quadradic function while satisfying other constraints.

It’s a generic form. however, in real cases such as f(x, y) = x2+y2+x+y, we should rewrite in matrix form:


In applying SLSQP to solve portfolio weighting optimization, we have f(x0, x1, … xn) = sigma(x – xi)^2.