Hi all,
For the cvxopt QP solver, I tried a positive-semidefinite(PSD) quadratic term with just one constraint. The solver gives Rank(A) < p or Rank([P; A; G]) < n error. Here is my QP(also attached as .py file):
u = np.array([[1.],[1.],[1.],[1.],[1.]]) # 1x5 matrix
Q_np = np.dot(u, u.transpose())
Q = cvxopt.matrix(np.tril(Q_np)) # Q is a 5x5 PSD matrix of rank 1
G = cvxopt.matrix(np.array([0.,0.,0.,0.,1.]).astype('d')).trans()
h = cvxopt.matrix(np.ones(1).astype('d'))
# one constraint, x5<=1
c = cvxopt.matrix(np.ones(5))
sol = cvxopt.solvers.qp(Q,c, G, h)
When I go to to the source code (cvxopt 1.1.8) in misc.py, line 1445,
if type(F['S']) is matrix:
lapack.potrf(F['S'])
>>> np.array(F['S'])
gives a non-symmetric matrix. (I think lapack potrf takes only the lower triangular part, so being non-symmetric should be OK )
array([[ 1., 0., 0., 0., 0.],
[ 1., 1., 0., 0., 0.],
[ 1., 1., 1., 0., 0.],
[ 1., 1., 1., 1., 0.],
[ 1., 1., 1., 1., 2.]])
So I believe the solver recognizes that the problem(with that constraint) is not PD, and tries to correct this by adding G'G to it. However, F['S'] is still not PD , so lapack function potrf cannot be applied.
So it seems cvxopt does not handle the PSD QP, is that the case? Is there another way to model the problem? Also I could make change in the source code for myself if you could give me a quick fox for that.
Thank you for your help in advance.
Murat