1 Introduction

Let \(\mathcal{S}_+^n\) and \(\mathcal{S}^n_{++}\) be the cones of positive semidefinite and positive definite matrices, respectively, in the space of \(n\times n\) symmetric matrices \(\mathcal{S}^n\) endowed with the standard trace inner product \(\langle \cdot ,\,\cdot \rangle \) and Frobenius norm \(\Vert \cdot \Vert \). We consider the following convex quadratic semidefinite programming (QSDP) problem:

$$\begin{aligned} (\mathbf{P}) \quad \min \left\{ \frac{1}{2}\langle X,\,\mathcal{Q}X \rangle + \langle C,\,X \rangle \mid \mathcal{A}X= b, \; X\in \mathcal{S}_+^n \cap \mathcal{K}\right\} , \end{aligned}$$

where \(\mathcal{Q}:\mathcal{S}^n\rightarrow \mathcal{S}^n\) is a self-adjoint positive semidefinite linear operator, \(\mathcal{A}:\mathcal{S}^n\rightarrow \mathfrak {R}^{m}\) is a linear map whose adjoint is denoted as \(\mathcal{A}^*\), \(C\in \mathcal{S}^n\), \(b \in \mathfrak {R}^{m}\) are given data, \(\mathcal{K}\) is a simple nonempty closed convex polyhedral set in \(\mathcal{S}^n\), such as \(\mathcal{K}=\{X \in \mathcal{S}^n\mid \, L\le X\le U\}\) with \(L,U\in \mathcal{S}^n\) being given matrices. The main objective of this paper is to design and analyse efficient algorithms for solving (P) and its dual. We are particularly interested in the case where the dimensions n and/or m are large, and it may be impossible to explicitly store or compute the matrix representation of \(\mathcal{Q}\). For example, if \(\mathcal{Q}= H\otimes H\) is the Kronecker product of a dense matrix \(H\in \mathcal{S}^n_+\) with itself, then it would be extremely expensive to store the matrix representation of \(\mathcal{Q}\) explicitly when n is larger than, say, 500. As far as we are aware of, the best solvers currently available for solving (P) are based on inexact primal-dual interior-point methods [31]. However, they are highly inefficient for solving large scale problems as interior-point methods have severe inherent ill-conditioning limitations which would make the convergence of a Krylov subspace iterative solver employed to compute the search directions to be extremely slow. While sophisticated preconditioners have been constructed in [31] to alleviate the ill-conditioning, the improvement is however not dramatic enough for the algorithm to handle large scale problems comfortably. On the other hand, an interior-point method which employs a direct solver to compute the search directions is prohibitively expensive for solving (P) since the cost is at least \(O( (m+n^2)^3)\) arithmetic operations per iteration. It is safe to say that there is currently no solver which can efficiently handle large scale QSDP problems of the form (P) and our paper precisely aims to provide an efficient and robust solver for (P).

The algorithms which we will design later are based on the augmented Lagrangian function for the dual of (P) (in its equivalent minimization form):

$$\begin{aligned} (\mathbf{D}) \quad \min \left\{ \delta _{\mathcal{K}}^*(-Z) +\frac{1}{2}\langle W,\,\mathcal{Q}W \rangle - \langle b,\,y \rangle \; \Big | \begin{array}{l} Z - \mathcal{Q}W + S + \mathcal{A}^* y = C, \\ S\in \mathcal{S}^n_+,\; W\in \mathcal{W},\; y\in \mathfrak {R}^m, Z \in \mathcal{S}^n\end{array} \right\} , \end{aligned}$$

where \(\mathcal{W}\) is any subspace of \(\mathcal{S}^n\) containing the range space of \(\mathcal{Q}\) (denoted as \(Ran (\mathcal{Q}))\), \(\delta _{\mathcal{K}}^*(\cdot )\) is the Fenchel conjugate of the indicator function \(\delta _{\mathcal{K}}(\cdot )\).

Due to its great potential in applications and mathematical elegance, QSDP has been studied quite actively both from the theoretical and numerical aspects [1, 11, 14, 15, 19, 23, 31, 32]. For the recent theoretical developments, one may refer to [7, 10, 22, 30] and the references therein. Here we focus on the numerical aspect and we will next briefly review some of the methods available for solving QSDP problems. Toh et al. [32] and Toh [31] proposed inexact primal-dual path-following interior-point methods to solve the special class of convex QSDP without the constraint in \(\mathcal{K}\). In theory, these methods can be used to solve QSDP problems with inequality constraints and constraint in \(\mathcal{K}\) by reformulating the problems into the required standard form. However, as already mentioned above, in practice interior-point methods are not efficient for solving QSDP problems beyond moderate scales either due to the extremely high computational cost per iteration or the inherent ill-conditioning of the linear systems governing the search directions. In [34], Zhao designed a semismooth Newton-CG augmented Lagrangian (NAL) method and analyzed its convergence for solving the primal QSDP problem (P). However, the NAL algorithm often encounters numerical difficulty (due to singular or nearly singular generalized Hessian) when the polyhedral set constraint \(X\in \mathcal{K}\) is present. Subsequently, Jiang et al. [13] proposed an inexact accelerated proximal gradient method for least squares semidefinite programming with only equality constraints where the objective function in (P) is expressed explicitly in the form of \(\Vert \mathcal{B}X - d \Vert ^2\) for some given linear map \(\mathcal{B}\).

More recently, inspired by the successes achieved in [28, 33] for solving linear SDP problems with nonnegative constraints, Li et al. [18] proposed a first-order algorithm, known as the Schur complement based semi-proximal alternating direction method of multipliers (SCB-sPADMM), for solving the dual form (D) of QSDP. As far as we aware of, [18] is the first paper to advocate using the dual approach for solving QSDP problems even though the dual problem (D) looks a lot more complicated than the primal problem (P), especially with the presence of the subspace constraint involving \(\mathcal{W}\). By leveraging on the Schur complement based decomposition technique developed in [17, 18], Chen et al. [6] also employed the dual approach by proposing an efficient inexact ADMM-type first-order method (which we name as SCB-isPADMM) for solving problem (D). Promising numerical results have been obtained by the dual based first-order algorithms in solving various classes of QSDP problems to moderate accuracy [6, 18]. Naturally one may hope to also rely on the ADMM scheme to compute highly accurate solutions. However, as one will observe from the numerical experiments presented later in Sect. 6, ADMM-type methods are incapable of finding accurate solutions for difficult QSDP problems due to their slow local convergence or stagnation. On the other hand, recent studies on the convergence rate of the augmented Lagrangian method (ALM) for solving convex semidefinite programming with multiple solutions [7] show that comparing to ADMM-type methods, the ALM can enjoy a faster convergence rate (in fact asymptotically superlinear) under milder conditions. These recent advances thus strongly indicate that one should be able to design a highly efficient algorithm based on the ALM for (D) for solving QSDP problems to high accuracy. More specifically, we will propose a two-phase augmented Lagrangian based algorithm with Phase I to generate a reasonably good initial point to warm start the Phase II algorithm so as to compute accurate solutions efficiently. We call this new method Qsdpnal since it extends the ideas of SDPNAL [35] and SDPNAL+ [33] for linear SDP problems to QSDP problems. Although the aforementioned two-phase framework has already been demonstrated to be highly efficient for solving linear SDP problems [33, 35], it remains to be seen whether we can achieve comparable or even more impressive performance on various QSDP problems.

In recent years, it has become fashionable to design first-order algorithms for solving convex optimization problems, with some even claiming their efficacy in solving various challenging classes of matrix conic optimization problems based on limited performance evaluations. However, based on our extensive numerical experience in solving large scale linear SDPs [28, 33, 35], we have observed that while first-order methods can be rather effective in solving easy problems which are well-posed and nondegenerate, they are typically powerless in solving difficult instances which are ill-posed or degenerate. Even for a well designed first-order algorithm with guaranteed convergence and highly optimized implementations, such as the ADMM+ algorithm in [28], a first-order method may still fail on slightly more challenging problems. For example, the ADMM+ algorithm designed in [33] can encounter varying degrees of difficulties in solving linear SDPs arising from rank-one tensor approximation problems. On the other hand, the SDPNAL algorithm in [35] (which exploits second-order information) is able to solve those problems very efficiently to high accuracy. We believe that in order to design an efficient and robust algorithm to solve the highly challenging class of matrix conic optimization problems including QSDPs, one must fully combine the advantages offered by both the first and second order algorithms, rather than just solely relying on first-order algorithms even though they may appear to be easier to implement.

Next we briefly describe our algorithm Qsdpnal. Let \(\mathcal{Z}= \mathcal{S}^n\times \mathcal{W}\times \mathcal{S}^n\times \mathfrak {R}^m\). Consider the following Lagrange function associated with (D):

$$\begin{aligned} l(Z,W,S,y;X):= & {} \delta _{\mathcal{K}}^*(-Z) + \frac{1}{2}\langle W,\,\mathcal{Q}W \rangle +\delta _{\mathcal{S}^n_+}(S)- \langle b,\,y \rangle \\&+ \langle Z-\mathcal{Q}W + S + \mathcal{A}^*y - C,\,X \rangle , \end{aligned}$$

where \( (Z,W,S,y)\in \mathcal{Z}\) and \(X\in \mathcal{S}^n\). For a given positive scalar \(\sigma \), the augmented Lagrangian function for (D) is defined by

$$\begin{aligned} \mathcal{L}_{\sigma }(Z,W,S,y;X):= & {} l(Z,W,S,y;X) + \frac{\sigma }{2}\Vert Z-\mathcal{Q}W+S \nonumber \\&+ \mathcal{A}^*y-C \Vert ^2,\quad (Z,W,S,y)\in \mathcal{Z}, \; X\in \mathcal{S}^n. \end{aligned}$$
(1)

The algorithm which we will adopt in Qsdpnal-Phase I is a variant of the SCB-isPADMM algorithm developed in [6]. In Qsdpnal-Phase II, we design an ALM for solving (D) where the inner subproblem in each iteration is solved via an inexact semismooth Newton based algorithm. Given \(\sigma _0 >0\), \((Z^0,W^0,S^0,y^0,X^0)\in \mathcal{Z}\times \mathcal{S}^n\), the \((k+1)\)th iteration of the ALM consists of the following steps:

where \(\sigma _k\in (0,+\infty )\). The first issue in the above ALM is the choice of the subspace \(\mathcal{W}\). The obvious choice \(\mathcal{W}= \mathcal{S}^n\) can lead to various difficulties in the implementation of the above algorithm. For example, since \(\mathcal{Q}:\mathcal{S}^n\rightarrow \mathcal{S}^n\) is only assumed to be positive semidefinite, the Newton systems corresponding to the inner subproblems may be singular and the sequence \(\{W^{k}\}\) generated by the ALM can be unbounded. As a result, it will be extremely difficult to analyze the convergence of the inner algorithm for solving the ALM subproblems. The second issue is that one needs to design easy-to-check stopping criteria for the inner subproblems, and to ensure the fast convergence of the ALM under reasonable conditions imposed on the QSDP problems. Concerning the first issue, we propose to choose \(\mathcal{W}= Ran (\mathcal{Q})\), although such a choice also leads to obstacles which we will overcome in Section 4. Indeed, by restricting \(W\in Ran (\mathcal{Q})\), the difficulties in analyzing the convergence and the superlinear (quadratic) convergence of the Newton-CG algorithm are circumvented as the possibilities of singularity and unboundedness are removed. For the second issue, under the restriction that \(\mathcal{W}= Ran (\mathcal{Q})\), thanks to the recent advances in [7], we are able to design checkable stopping criteria for solving the inner subproblems inexactly while establishing the global convergence of the above ALM. Moreover, we are able to establish the R-(super)linear convergence rate of the KKT residual. At the first glance, the restriction that \(W\in Ran (\mathcal{Q})\) appears to introduce severe numerical difficulties when we need to solve a linear system under this restriction. Fortunately, by carefully examining our algorithm and devising novel numerical techniques, we are able to overcome these difficulties as we shall see in Sect. 4. Our extensive evaluations of Qsdpnal have demonstrated that our algorithm is capable of solving large scale general QSDP problems of the form (P) to high accuracy very efficiently and robustly. For example, we are able to solve an elementwise weighted nearest correlation matrix estimation problem with matrix dimension \(n=10{,}000\) in less than 11 h to the relative accuracy of less than \(10^{-6}\) in the KKT residual. Such a numerical performance has not been attained in the past.

As the readers may have already observed, even though our goal in developing algorithms for solving convex optimization problems such as (P) and (D) is to design those with desirable theoretical properties such as asymptotic superlinear convergence, it is our belief that it is equally if not even more important for the algorithms designed to be practically implementable and able to achieve realistic numerical efficiency. It is obvious that our proposed two-phase augmented Lagrangian based algorithm for solving (P) and (D) is designed based on such a belief.

The remaining parts of this paper are organized as follows. The next section is devoted to our main algorithm Qsdpnal, which is a two-phase augmented Lagrangian based algorithm whose Phase I is used to generate a reasonably good initial point to warm-start the Phase II algorithm so as to obtain accurate solutions efficiently. In Sect. 3, we propose to solve the inner minimization subproblems of the ALM by semismooth Newton based algorithms and study their global and local superlinear (quadratic) convergence. In Sect. 4, we discuss critical numerical issues concerning the efficient implementation of Qsdpnal. In Sect. 5.1, we discuss the special case of applying Qsdpnal to solve least squares semidefinite programming problems. The extension of Qsdpnal for solving QSDP problems with unstructured inequality constraints is discussed in Sect. 5.2. In Sect. 6, we conduct numerical experiments to evaluate the performance of Qsdpnal in solving various QSDP problems and their extensions. We conclude our paper in the final section.

Below we list several notation and definitions to be used in the paper. For a given closed proper convex function \(\theta :\mathcal{X}\rightarrow (-\infty ,\infty ]\), where \(\mathcal{X}\) is a finite-dimensional real inner product space, its Fenchel conjugate function is denoted by \(\theta ^*:\mathcal{X}\rightarrow (-\infty , +\infty ]\) . For a given closed convex set \(D\subseteq \mathcal{X}\) and \(x\in \mathcal{X}\), we define by \(\Pi _{D}(x)\) the metric projector of x onto D and \(\mathrm{dist}(x,D): = \inf _{d\in D}\Vert x - d \Vert = \Vert x - \Pi _{D}(x) \Vert .\) For any \(X\in \mathcal{S}^n\), we use \(\lambda _{\max }(X)\) and \(\lambda _{\min }(X)\) to denote the largest and smallest eigenvalues of X, respectively. Similar notation is used when X is replaced by the linear operator \(\mathcal{Q}\).

2 A two-phase augmented Lagrangian method

In this section, we shall present our two-phase algorithm Qsdpnal for solving the QSDP problems (D) and (P). For the convergence analysis of Algorithm Qsdpnal, we need to make the following standard assumption for (P). Such an assumption is analogous to the Slater’s condition in the context of nonlinear programming in \(\mathfrak {R}^m\).

Assumption 1

There exists \({\widehat{X}}\in \mathcal{S}^n_{++} \cap \mathrm{ri}(\mathcal{K})\) such that

$$\begin{aligned} \mathcal{A}(\mathcal{T}_{\mathcal{K}}({\widehat{X}})) = \mathfrak {R}^m, \end{aligned}$$

where \(\mathrm{ri}(\mathcal{K})\) denotes the relative interior of \(\mathcal{K}\) and \(\mathcal{T}_{\mathcal{K}}({\widehat{X}})\) is the tangent cone of \(\mathcal{K}\) at point \({\widehat{X}}\).

2.1 Phase I: An SCB based inexact semi-proximal ADMM

In Phase I, we propose a new variant of the Schur complement based inexact semi-proximal ADMM (SCB-isPADMM) developed in [6] to solve (D). Recall the augmented Lagrangian function associated with problem (D) defined in (1).

The detailed steps of our Phase I algorithm for solving (D) are given as follows.

figure a

Remark 2.1

We shall explain here the role of the error vectors \(\delta _y^k, \, \hat{\delta }_y^k, \delta _{\mathcal{Q}}^k\) and \({\hat{\delta }}_{\mathcal{Q}}^k\). There is no need to choose these error vectors in advance. The presence of these error vectors simply indicates that the corresponding subproblems can be solved inexactly. For example, the updating rule of \(y^{k+1}\) in the above algorithm can be interpreted as follows: find \(y^{k+1}\) inexactly through

$$\begin{aligned} y^{k+1}\approx {{\mathrm{argmin}}}\mathcal{L}_{\sigma }(Z^{k+1},W^{k+1},S^{k+1},y;X^k) \end{aligned}$$

such that the residual

$$\begin{aligned} \Vert \delta _y^k \Vert = \Vert b - \mathcal{A}X^k - \sigma \mathcal{A}(Z^{k+1} - \mathcal{Q}W^{k+1} + S^{k+1} + \mathcal{A}^* y^{k+1} - C) \Vert \le \varepsilon _k. \end{aligned}$$

Remark 2.2

In contrast to Aglorithm SCB-isPADMM in [6], our Algorithm Qsdpnal-Phase I requires the subspace constraint \(W\in Ran (\mathcal{Q})\) explicitly in the subproblems (2) and (3). Note that due to the presence of the subspace constraint \(W\in Ran (\mathcal{Q})\), there is no need to add extra proximal terms in the subproblems corresponding to W to satisfy the positive definiteness requirement needed in applying the inexact Schur compliment based decomposition technique developed in [17, 18]. This is certainly more elegant than the indirect reformulation strategy considered in [6, 18].

The convergence of the above algorithm follows from [6, Theorem 1] without much difficulty, and its proof is omitted.

Theorem 2.1

Suppose that the solution set of (P) is nonempty and Assumption 1 holds. Let \(\{(Z^k,W^k,S^k,y^k,X^k)\}\) be the sequence generated by Algorithm Qsdpnal-Phase I. If \(\tau \in (0,(1+\sqrt{5}\,)/2)\), then the sequence \(\{(Z^k,W^k,S^k,y^k)\}\) converges to an optimal solution of (D) and \(\{X^k\}\) converges to an optimal solution of (P).

Remark 2.3

Under some error bound conditions on the limit point of \(\{(Z^k,W^k,S^k,y^k,X^k)\}\), one can derive the linear rate of convergence of the exact version of Algorithm Qsdpnal-Phase I. For a recent study on this topic, see [10] and the references therein. Here we will not address this issue as our Phase II algorithm enjoys a better rate of convergence under weaker conditions.

2.2 Phase II: An augmented Lagrangian algorithm

In this section, we discuss our Phase II algorithm for solving the dual problem (D). The purpose of this phase is to obtain high accuracy solutions efficiently after being warm-started by our Phase I algorithm. The Phase II of our algorithm has the following template.

figure b

As an important issue on the implementation of the above algorithm, the stopping criteria for approximately solving subproblem (4) shall be discussed here. Let the feasible set for (P) be denoted as \(\mathcal{F}:=\{X\in \mathcal{S}^n\mid \mathcal{A}X = b, \, X\in \mathcal{S}^n_+\cap \mathcal{K}\}\). Define the feasibility residual function \(\gamma :\mathcal{S}^n\rightarrow \mathfrak {R}\) for the primal problem (P) by

$$\begin{aligned} \gamma (X) : = \Vert b - \mathcal{A}X \Vert + \Vert X - \Pi _{\mathcal{S}^n_+}(X) \Vert + \Vert X - \Pi _{\mathcal{K}}(X) \Vert ,\quad \forall \, X\in \mathcal{S}^n. \end{aligned}$$

Note that \(\gamma (X) = 0\) if and only if \(X\in \mathcal{F}\). Indeed, for \(X\not \in \mathcal{F}\), \(\gamma (X)\) provides an easy-to-compute measure on the primal infeasibility of X. Similar to [7, Proposition 4.2], we can use this feasibility residual function to derive an upper bound on the distance of a given point to the feasible set \(\mathcal{F}\) in the next lemma. Its proof can be obtained without much difficulty by applying Hoffman’s error bound [9, Lemma 3.2.3] to the nonempty polyhedral convex set \(\{X\in \mathcal{S}^n\mid \mathcal{A}X = b,\, X\in \mathcal{K}\}\), e.g., see [2, Theorem 7].

Lemma 2.1

Assume that \(\mathcal{F}\cap \mathcal{S}^n_{++}\ne \emptyset \). Then, there exists a constant \(\mu >0 \) such that

$$\begin{aligned} \Vert X - \Pi _{\mathcal{F}}(X) \Vert \le \mu (1+\Vert X \Vert ) \gamma (X), \quad \forall \, X\in \mathcal{S}^n. \end{aligned}$$
(5)

When the ALM is applied to solve (D), numerically it is difficult to execute the criteria \((A'')\) and \((\mathrm{B}_1'')\) proposed in [26]. Fortunately, Lemma 2.1 and recent advances in the analysis of the ALM [7] allow us to design easy-to-verify stopping criteria for the subproblems in Qsdpnal-Phase II. For any \(k\ge 0\), denote

$$\begin{aligned} f_k(X): = - \frac{1}{2}\langle X,\,\mathcal{Q}X \rangle - \langle C,\,X \rangle - \frac{1}{2\sigma _k}\Vert X - X^k \Vert ^2, \quad \forall \, X\in \mathcal{S}^n. \end{aligned}$$

Note that \(f_k(\cdot )\) is in fact the objective function in the dual of problem (4). Let \(\{\varepsilon _k\}\) and \(\{\delta _k\}\) be two given positive summable sequences. Given \(k\ge 0\) and \(X^k\in \mathcal{S}^n\), we propose to terminate the minimization of the subproblem (4) in the \((k+1)\)th iteration of Algorithm Qsdpnal-Phase II with either one of the following two easy-to-check stopping criteria:

$$\begin{aligned} \begin{aligned}&(A ) \quad \left\{ \begin{aligned}&\Psi _k(Z^{k+1},W^{k+1},S^{k+1},y^{k+1}) - f_k(X^{k+1}) \le \varepsilon _k^2/2\sigma _k, \\&(1+\Vert X^{k+1} \Vert )\gamma (X^{k+1}) \le \alpha _k \varepsilon _k/\sqrt{2\sigma _k}, \end{aligned} \right. \\&(\mathrm{B})\quad \left\{ \begin{aligned}&\Psi _k(Z^{k+1},W^{k+1},S^{k+1},y^{k+1}) - f_k(X^{k+1}) \le \delta _k^2 \Vert X^{k+1} - X^k \Vert ^2/2\sigma _k, \\&(1+\Vert X^{k+1} \Vert )\gamma (X^{k+1}) \le \beta _k\delta _k\Vert X^{k+1} - X^k \Vert /\sqrt{2\sigma _k}, \end{aligned} \right. \end{aligned} \end{aligned}$$

where

$$\begin{aligned} \alpha _k= & {} \min \left\{ 1,\sqrt{\sigma _k},\frac{\varepsilon _k}{\sqrt{2\sigma _k}\Vert \nabla f_k(X^{k+1}) \Vert }\right\} \quad \mathrm{and} \\ \beta _k= & {} \min \left\{ 1,\sqrt{\sigma _k},\frac{\delta _k\Vert X^{k+1} - X^k \Vert }{\sqrt{2\sigma _k}\Vert \nabla f_k(X^{k+1}) \Vert }\right\} . \end{aligned}$$

Lemma 2.2

Assume that Assumption 1 holds. Let \(\mu \) be the constant given in (5). Suppose that for some \(k\ge 0\), \(X^k\) is not an optimal solution to problem (P). Then one can always find \((Z^{k+1},W^{k+1},S^{k+1},y^{k+1})\) and \(X^{k+1} = X^k + \sigma _k(Z^{k+1} - \mathcal{Q}W^{k+1} + S^{k+1} + \mathcal{A}^*y^{k+1} - C)\) satisfying both (A) and (B). Moreover, (A) implies that

$$\begin{aligned} \Psi _k(Z^{k+1},W^{k+1},S^{k+1},y^{k+1}) - \inf \Psi _k \le \nu \varepsilon _k^2/2\sigma _k \end{aligned}$$

and (B) implies that

$$\begin{aligned} \Psi _k(Z^{k+1},W^{k+1},S^{k+1},y^{k+1}) - \inf \Psi _k\le (\nu \delta _k^2/2\sigma _k)\Vert X^{k+1} - X^k \Vert ^2, \end{aligned}$$

respectively, where

$$\begin{aligned} \nu = 1 + \mu + \frac{1}{2}\lambda _{\max }(\mathcal{Q}) + \frac{1}{2}\mu ^2. \end{aligned}$$
(6)

Proof

With the help of Lemma 2.1, one can establish the assertion in the same fashion as in [7, Proposition 4.2, Proposition 4.3]. \(\square \)

For the subsequent analysis, we need to define the essential objective function of (P), which is given by

$$\begin{aligned} \begin{aligned} \phi (X) := {}&- \inf \, \{\,l(Z,W,S,y;X)\mid (Z,W,S,y)\in \mathcal{S}^n\times Ran (\mathcal{Q})\times \mathcal{S}^n\times \mathfrak {R}^m\} \\ = {}&\left\{ \begin{aligned}&\frac{1}{2}\langle X,\,\mathcal{Q}X \rangle + \langle X,\,C \rangle + \delta _{\mathcal{S}^n_+}(X) + \delta _{\mathcal{K}}(X) \quad \hbox {if}\ \mathcal{A}X = b, \\&+\infty \quad \hbox {otherwise}. \end{aligned} \right. \end{aligned} \end{aligned}$$

For convenience, we also let \(\Omega = \partial \phi ^{-1}(0)\) denote the solution set of (P).

We say that for (P), the second order growth condition holds at an optimal solution \({\overline{X}}\in \Omega \) with respect to the set \(\Omega \) if there exist \(\kappa >0 \) and a neighborhood U of \({\overline{X}}\) such that

$$\begin{aligned} \phi (X) \ge \phi ({\overline{X}}) + {\kappa ^{-1} \mathrm{dist}^2(X,\Omega )}, \quad \forall \, X\in U. \end{aligned}$$
(7)

Let the objective function \(g:\mathcal{S}^n\times Ran (\mathcal{Q})\times \mathcal{S}^n\times \mathfrak {R}^m\rightarrow (-\,\infty ,+\,\infty ]\) associated with (D) be given as follows:

Now, with Lemma 2.2, we can prove the global and local (super)linear convergence of Algorithm Qsdpnal-Phase II by adapting the proofs in [26, Theorem 4] and [7, Theorem 4.2]. It shows that, for most QSDP problems, one can always expect the KKT residual of the sequence generated by Qsdpnal-Phase II to converge at least R-(super)linearly.

Theorem 2.2

Suppose that \(\Omega \), the solution set of (P), is nonempty and Assumption 1 holds. Then the sequence \(\{(Z^k,W^k,S^k,y^k,X^k)\}\) generated by Algorithm Qsdpnal-Phase II under the stopping criterion \((A )\) for all \(k\ge 0\) is bounded, and \(\{X^k\}\) converges to an optimal solution \(X^{\infty }\) of (P), and \(\{(Z^k,W^k,S^k,y^k)\}\) converges to an optimal solution of (D). Moreover, for all \(k\ge 0\), it holds that

$$\begin{aligned} \begin{aligned}&g(Z^{k+1},W^{k+1},S^{k+1},y^{k+1}) - \inf \,(\mathbf{D})\\&\quad \le \Psi _k(Z^{k+1},W^{k+1},S^{k+1},y^{k+1}) - \inf \Psi _k + (1/2\sigma _k)(\Vert X^k \Vert ^2 - \Vert X^{k+1} \Vert ^2). \end{aligned} \end{aligned}$$

Assume that for (P), the second order growth condition (7) holds at \(X^{\infty }\) with respect to the set \(\Omega \), i.e., there exists a constant \(\kappa > 0\) and a neighborhood U of \(X^{\infty }\) such that

$$\begin{aligned} \phi (X) \ge \phi (X^{\infty }) + \kappa ^{-1} \mathrm{dist}^2(X, {\Omega }), \quad \forall \, X\in U. \end{aligned}$$

Suppose that the algorithm is executed under criteria (A) and (B) for all \(k\ge 0\) and \(\nu \) is the constant given in (6). Then, for all k sufficiently large, it holds that

$$\begin{aligned}&\mathrm{dist}(X^{k+1}, {\Omega }) \le \theta _k \mathrm{dist}(X^{k}, {\Omega }), \end{aligned}$$
(8)
$$\begin{aligned}&\Vert Z^{k+1} - \mathcal{Q}W^{k+1} + S^{k+1} + \mathcal{A}^*y - C \Vert \le \tau _k\mathrm{dist}(X^k, {\Omega }), \end{aligned}$$
(9)
$$\begin{aligned}&g(Z^{k+1},W^{k+1},S^{k+1},y^{k+1}) - \inf \,(\mathbf{D}) \le \tau _k'\mathrm{dist}(X^k, {\Omega }), \end{aligned}$$
(10)

where

$$\begin{aligned} \begin{aligned}&1>\theta _k = \big (\kappa /\sqrt{\kappa ^2 + \sigma _k^2 }+ 2\nu \delta _k\big )(1 - \nu \delta _k)^{-1} \rightarrow \theta _{\infty } = \kappa /\sqrt{\kappa ^2 + \sigma _{\infty }^2} \\&\qquad (\theta _{\infty } = 0 \; \mathrm{if}\; \sigma _{\infty } = \infty ),\\&\tau _k = \sigma _k^{-1}(1-\nu \delta _k)^{-1} \rightarrow \tau _{\infty } = 1/\sigma _{\infty }\quad (\tau _{\infty } = 0 \; \mathrm{if}\; \sigma _{\infty } = \infty ), \\&\tau _k' = \tau _k(\nu ^2\delta _k^2\Vert X^{k+1} - X^k \Vert + \Vert X^{k+1} \Vert + \Vert X^k \Vert )/2 \rightarrow \tau '_{\infty } = \Vert X^{\infty } \Vert /\sigma _{\infty }\\&\qquad (\tau '_{\infty } = 0 \; \mathrm{if}\; \sigma _{\infty } = \infty ). \end{aligned} \end{aligned}$$

Next we give a few comments on the convergence rates and assumptions made in Theorem 2.2.

Remark 2.4

Under the assumptions of Theorem 2.2, we have proven that the KKT residual, corresponding to (P) and (D), along the sequence \(\{(Z^{k},W^k,S^k,y^k,X^k)\}\) converges at least R-(super)linearly. Indeed, under stopping criteria (A), (B) and from (8),(9) and (10), we know that the primal feasibility, the dual feasibility and the duality gap all converge at least R-(super)linearly.

Remark 2.5

The assumption that the second order growth condition (7) holds for (P) is quite mild. Indeed, it holds when any optimal solution \({\overline{X}}\) of (P), together with any of its multiplier \({\overline{S}} \in \mathcal{S}^n_+\) corresponding only to the semidefinite constraint, satisfies the strict complementarity condition [7, Corollary 3.1]. It is also valid when the “no-gap” second order sufficient condition holds at the optimal solutionFootnote 1 to (P) [4, Theorem 3.137].

3 Inexact semismooth Newton based algorithms for solving the inner subproblems (4) in ALM

In this section, we will design efficient inexact semismooth Newton based algorithms to solve the inner subproblems (4) in the augmented Lagrangian method, where each subproblem takes the form of:

$$\begin{aligned}&\min \left\{ \Psi (Z,W,S,y)\right. \nonumber \\&\left. \quad := \mathcal{L}_{\sigma }(Z,W,S,y;{\widehat{X}}) \mid \, (Z,W,S,y)\in \mathcal{S}^n\times Ran (\mathcal{Q})\times \mathcal{S}^n\times \mathfrak {R}^{m} \right\} \end{aligned}$$
(11)

for a given \( {\widehat{X}} \in \mathcal{S}^n\). Note that the dual problem of (11) is given as follows:

$$\begin{aligned} \max \left\{ - \frac{1}{2}\langle X,\,\mathcal{Q}X \rangle - \langle C,\,X \rangle - \frac{1}{2\sigma }\Vert X - {\widehat{X}} \Vert ^2 \mid \mathcal{A}X= b, \; X\in \mathcal{S}_+^n,\; X \in \mathcal{K}\right\} . \end{aligned}$$

Under Assumption 1, from [24, Theorems 17 & 18], we know that the optimal solution set of problem (11) is nonempty and for any \(\alpha \in \mathfrak {R}\), the level set \(\mathcal{L}_{\alpha }:=\{(Z,W,S,y) \in \mathcal{S}^n\times Ran (\mathcal{Q})\times \mathcal{S}^n\times \mathfrak {R}^{m} \,\mid \, \Psi (Z,W,S,y)\le \alpha \}\) is a closed and bounded convex set.

3.1 A semismooth Newton-CG algorithm for (11) with \(\mathcal{K}= \mathcal{S}^n\)

Note that in quite a number of applications, the polyhedral convex set \(\mathcal{K}\) is actually the whole space \(\mathcal{S}^n\). Therefore, we shall first study how the inner problems (11) in Algorithm ALM can be solved efficiently when \(\mathcal{K}= \mathcal{S}^n\). Under this setting, Z is vacuous, i.e., \(Z=0\).

Let \(\sigma >0\) be given. Denote

$$\begin{aligned} {\Upsilon (W,y) := \mathcal{A}^*y - \mathcal{Q}W - {\widehat{C}}, \quad \forall \, (W,y)\in Ran (\mathcal{Q}) \times \mathfrak {R}^m.} \end{aligned}$$

where \({\widehat{C}} = C - \sigma ^{-1}{\widehat{X}}\). Observe that if

$$\begin{aligned} (W^*,S^*,y^*) = {{\mathrm{argmin}}}\{\Psi (0,W,S,y) \,\mid \, (W,S,y)\in Ran (\mathcal{Q})\times \mathcal{S}^n\times \mathfrak {R}^m\}, \end{aligned}$$

then \((W^*,S^*,y^*)\) can be computed in the following manner

$$\begin{aligned}&(W^*,y^*) = {{\mathrm{argmin}}}\left\{ \varphi (W,y) \,|\, (W,y)\in Ran (\mathcal{Q})\times \mathfrak {R}^m \right\} , \nonumber \\&S^* = \Pi _{\mathcal{S}^n_+}(-\Upsilon (W^*,y^*)), \end{aligned}$$
(12)

where

$$\begin{aligned} \varphi (W,y){:=} \frac{1}{2} \langle W,\,\mathcal{Q}W \rangle - \langle b,\,y \rangle {+} \frac{\sigma }{2}\Vert \Pi _{\mathcal{S}^n_+}(\Upsilon (W,y)) \Vert ^2,\forall \, (W,y)\in Ran (\mathcal{Q})\times \mathfrak {R}^m. \end{aligned}$$

Note that \(\varphi (\cdot ,\cdot )\) is a continuously differentiable function on \(Ran (\mathcal{Q})\times \mathfrak {R}^m\) with

$$\begin{aligned} \nabla \varphi (W,y) = \left( \begin{array}{l} \mathcal{Q}W - \sigma \mathcal{Q}\Pi _{\mathcal{S}^n_+}(\Upsilon (W,y)) \\ -b + \sigma \mathcal{A}\Pi _{\mathcal{S}^n_+}(\Upsilon (W,y)) \end{array} \right) . \end{aligned}$$

Then, solving (12) is equivalent to solving the following nonsmooth equation:

$$\begin{aligned} \nabla \varphi (W,y) = 0, \quad (W,y)\in Ran (\mathcal{Q})\times \mathfrak {R}^m. \end{aligned}$$

Since \(\Pi _{\mathcal{S}^n_+}\) is strongly semismooth [27], we can design a semismooth Newton-CG (SNCG) method to solve (12) and could expect to get a fast superlinear or even quadratic convergence. For any \((W,y)\in Ran (\mathcal{Q})\times \mathfrak {R}^m\), define

$$\begin{aligned} {\hat{\partial }}^{2} \varphi (W,y) := \left[ \begin{array}{cc} \mathcal{Q}&{}\qquad \\ &{}\qquad 0 \end{array} \right] + \sigma \left[ \begin{array}{c} \mathcal{Q}\\ -\mathcal{A}\end{array} \right] \partial \Pi _{\mathcal{S}^n_+}(\Upsilon (W,y)) [\mathcal{Q}\; -\mathcal{A}^*], \end{aligned}$$

where \(\partial \Pi _{\mathcal{S}^n_+}(\Upsilon (W,y))\) is the Clarke subdifferential [8] of \(\Pi _{\mathcal{S}^n_+}(\cdot )\) at \(\Upsilon (W,y)\). Note that from [12], we know that

$$\begin{aligned} \hat{\partial }^2 \varphi (W,y)\, (d_W,d_y) = {\partial }^2 \varphi (W,y)\, (d_W,d_y), \quad \forall \, (d_W,d_y) \in Ran (\mathcal{Q})\times \mathfrak {R}^m, \end{aligned}$$

where \({\partial }^2 \varphi (W,y)\) denotes the generalized Hessian of \(\varphi \) at (Wy), i.e., the Clarke subdifferential of \(\nabla \varphi \) at (Wy).

Given \(({\widetilde{W}}, {\tilde{y}})\in Ran (Q)\times \mathfrak {R}^m\), consider the following eigenvalue decomposition:

$$\begin{aligned} \Upsilon ({\widetilde{W}}, {\tilde{y}}) = \mathcal{A}^*{\tilde{y}} - \mathcal{Q}{\widetilde{W}} - {\widehat{C}} = P \, \Gamma \,P^{{\text {T}}}, \end{aligned}$$

where \(P\in \mathfrak {R}^{n\times n}\) is an orthogonal matrix whose columns are eigenvectors, and \(\Gamma \) is the corresponding diagonal matrix of eigenvalues, arranged in a nonincreasing order: \(\lambda _1 \ge \lambda _2 \ge \cdots \ge \lambda _n\). Define the following index sets

$$\begin{aligned} \alpha := \{i \mid \lambda _i>0\}, \quad \bar{\alpha } :=\{i \mid \lambda _i\le 0\}. \end{aligned}$$

We define the operator \(U^0 : {\mathcal {S}}^n \rightarrow {\mathcal {S}}^n\) by

$$\begin{aligned} U^0 (H) := P(\Sigma \circ (P^{{\text {T}}}H P))P^{{\text {T}}}, \quad H \in {\mathcal {S}}^n, \end{aligned}$$
(13)

where \(``\circ ''\) denotes the Hadamard product of two matrices,

$$\begin{aligned} \quad \Sigma = \left[ \begin{array}{cc} E_{\alpha \alpha } &{}\quad \nu _{\alpha \bar{\alpha }}\\ \nu ^{{\text {T}}}_{\alpha \bar{\alpha }} &{}\quad 0 \end{array} \right] , \quad \nu _{ij} := \frac{\lambda _i}{\lambda _i-\lambda _j}, \,\, i \in \alpha , j \in \bar{\alpha }, \end{aligned}$$

and \(E_{\alpha \alpha } \in {\mathcal {S}}^{|\alpha |}\) is the matrix of ones. In [20, Lemma 11], it is proved that

$$\begin{aligned} U^0 \in \partial \Pi _{\mathcal{S}^n_+}(\Upsilon ({\widetilde{W}}, {\tilde{y}})). \end{aligned}$$

Define

$$\begin{aligned} V^0 := \left[ \begin{array}{c@{\quad }c} \mathcal{Q}&{}\quad \\ &{}\quad 0 \end{array} \right] + \sigma \left[ \begin{array}{c} \mathcal{Q}\\ -\mathcal{A}\end{array} \right] U^0 [\mathcal{Q}\, -\mathcal{A}^*]. \end{aligned}$$
(14)

Then, we have \(V^0\in {\hat{\partial }}^{2}\varphi ({\widetilde{W}},{\tilde{y}})\).

After all the above preparations, we can design the following semismooth Newton-CG method as in [35] to solve (12).

figure c

The convergence results for the above SNCG algorithm are stated in the next theorem.

Theorem 3.1

Suppose that Assumption 1 holds. Then Algorithm SNCG generates a bounded sequence \(\{(W^j,y^j)\}\) and any accumulation point \(({\overline{W}}, {\bar{y}}) \in Ran (\mathcal{Q})\times \mathfrak {R}^m\) is an optimal solution to problem (12).

The following proposition is the key ingredient in our subsequent convergence analysis.

Proposition 3.1

Let \(\mathcal{U}:\mathcal{S}^n\rightarrow \mathcal{S}^n\) be a self-adjoint positive semidefinite linear operator and \(\sigma >0\). Then, it holds that \(\mathcal{A}\mathcal{U}\mathcal{A}^*\) is positive definite if and only if

$$\begin{aligned} \left\langle \left[ \begin{array}{c} W\\ y \end{array}\right] ,\,\left( \left[ \begin{array}{cc} \mathcal{Q}&{}\quad \\ &{}\quad 0 \end{array} \right] +\sigma \left[ \begin{array}{c} \mathcal{Q}\\ -\mathcal{A}\end{array} \right] \mathcal{U}[\mathcal{Q}\, -\mathcal{A}^*]\right) \left[ \begin{array}{c} W\\ y \end{array}\right] \right\rangle > 0 \end{aligned}$$
(16)

for all \((W,y)\in Ran (\mathcal{Q})\times \mathfrak {R}^m\backslash \{(0,0)\}.\)

Proof

Since the “if” statement obviously holds true, we only need to prove the “only if” statement. Note that

$$\begin{aligned} \langle W,\,\mathcal{Q}W \rangle > 0,\quad \forall \, W\in Ran (\mathcal{Q}){\backslash \{0\}}. \end{aligned}$$

Now suppose that \(\mathcal{A}\mathcal{U}\mathcal{A}^*\) is positive definite, and hence nonsingular. By the Schur complement condition for ensuring the positive definiteness of a linear operator, we know that (16) holds if and only if

$$\begin{aligned} \langle W,\,(\mathcal{Q}+ \sigma \mathcal{Q}\mathcal{U}\mathcal{Q}- \sigma \mathcal{Q}\mathcal{U}\mathcal{A}^*(\mathcal{A}\mathcal{U}\mathcal{A}^*)^{-1}\mathcal{A}\mathcal{U}\mathcal{Q})W \rangle > 0,\quad \forall \, W\in Ran (\mathcal{Q}){\backslash \{0\}}.\nonumber \\ \end{aligned}$$
(17)

But for any \(W\in Ran (\mathcal{Q}) \backslash \{ 0\}\), we have that \(\langle W,\,\mathcal{Q}W \rangle > 0\), and

$$\begin{aligned}&\langle W,\,(\mathcal{Q}\mathcal{U}\mathcal{Q}- \mathcal{Q}\mathcal{U}\mathcal{A}^*(\mathcal{A}\mathcal{U}\mathcal{A}^*)^{-1}\mathcal{A}\mathcal{U}\mathcal{Q})W \rangle \\&\quad = \langle W,\,\mathcal{Q}\mathcal{U}^{\frac{1}{2}}(\mathcal{I}-\mathcal{U}^{\frac{1}{2}}\mathcal{A}^*(\mathcal{A}\mathcal{U}\mathcal{A}^*)^{-1}\mathcal{A}\mathcal{U}^{\frac{1}{2}})\mathcal{U}^{\frac{1}{2}}\mathcal{Q}W \rangle \\&\quad = \langle \mathcal{U}^{\frac{1}{2}} \mathcal{Q}W,\,(\mathcal{I}-\mathcal{U}^{\frac{1}{2}}\mathcal{A}^*(\mathcal{A}\mathcal{U}\mathcal{A}^*)^{-1}\mathcal{A}\mathcal{U}^{\frac{1}{2}})\mathcal{U}^{\frac{1}{2}}\mathcal{Q}W \rangle \;\ge \; 0. \end{aligned}$$

Hence, (17) holds automatically. This completes the proof of the proposition. \(\square \)

Base on the above proposition, under the constraint nondegeneracy condition for (P), we shall show in the next theorem that one can still ensure the positive definiteness of the coefficient matrix in the semismooth Newton system at the solution point.

Theorem 3.2

Let \(({\overline{W}}, \bar{y})\) be the optimal solution for problem (12). Let \({\overline{Y}} := \Pi _{\mathcal{S}^n_+}(\mathcal{A}^*{\bar{y}} - \mathcal{Q}{\overline{W}} - {\widehat{C}})\). The following conditions are equivalent:

  1. (i)

    The constraint nondegeneracy condition,

    $$\begin{aligned} \mathcal{A}\,\mathrm{lin}(\mathcal{T}_{\mathcal{S}^n_+}(\overline{Y})) = \mathfrak {R}^m, \end{aligned}$$
    (18)

    holds at \({\overline{Y}}\), where \(\mathrm{lin}(\mathcal{T}_{\mathcal{S}^n_+}(\overline{Y}))\) denotes the lineality space of the tangent cone of \(\mathcal{S}^n_+\) at \(\overline{Y}\).

  2. (ii)

    Every element in

    $$\begin{aligned} \left[ \begin{array}{cc} \mathcal{Q}&{}\quad \\ &{}\quad 0 \end{array} \right] +\sigma \left[ \begin{array}{c} \mathcal{Q}\\ -\mathcal{A}\end{array} \right] \partial \Pi _{\mathcal{S}^n_+}(\mathcal{A}^*{\bar{y}} - \mathcal{Q}{\overline{W}} - {\widehat{C}}) [\mathcal{Q}\, -\mathcal{A}^*] \end{aligned}$$

    is self-adjoint and positive definite on \(Ran (\mathcal{Q})\times \mathfrak {R}^m.\)

Proof

In the same fashion as in [35, Proposition 3.2], we can prove that \( \mathcal{A}\mathcal{U}\mathcal{A}^* \) is positive definite for all \(\mathcal{U}\in \partial \Pi _{\mathcal{S}^n_+}(\mathcal{A}^*{\bar{y}} - \mathcal{Q}{\overline{W}} - {\widehat{C}})\) if only if (i) holds. Then, by Proposition 3.1, we readily obtain the desired results. \(\square \)

Theorem 3.3

Assume that Assumption 1 holds. Let \(({\overline{W}}, {\bar{y}})\) be an accumulation point of the infinite sequence \(\{(W^j,y^j)\}\) generated by Algorithm SNCG for solving problem (12). Assume that the constraint nondegeneracy condition (18) holds at \({\overline{Y}}: = \Pi _{\mathcal{S}^n_+}(\mathcal{A}^*{\bar{y}} - \mathcal{Q}{\overline{W}} - {\widehat{C}})\). Then, the whole sequence \(\{(W^j,y^j)\}\) converges to \(({\overline{W}}, {\bar{y}})\) and

$$\begin{aligned} {\Vert (W^{j+1},y^{j+1}) - ({\overline{W}},{\bar{y}}) \Vert = O(\Vert (W^j,y^j) - ({\overline{W}},{\bar{y}}) \Vert ^{1+\tau }).} \end{aligned}$$

Proof

From Theorem 3.2, we know that under the constraint nondegeneracy condition (18), every \(V \in {\hat{\partial }}^{2} \varphi ({\overline{W}},{\bar{y}})\) is self-adjoint and positive definite on \( Ran (\mathcal{Q})\times \mathfrak {R}^n\). Hence one can obtain the desired results from [35, Theorem 3.5] by further noting the strong semismoothness of \(\Pi _{\mathcal{S}^n_+}(\cdot )\). \(\square \)

We note that the convergence results obtained in this subsection depend critically on the restriction that \(W\in \mathcal{W}= \mathrm{Ran}(\mathcal{Q})\). Without this restriction, the possible singularity of the Newton systems (15) and the unboundedness of \(\{W^j\}\) will make the convergence analysis highly challenging, if possible at all.

3.2 Semismooth Newton based inexact ABCD algorithms for (11) when \(\mathcal{K}\not =\mathcal{S}^n\)

When \(\mathcal{K}\ne \mathcal{S}^n\), we will adapt the recently developed inexact accelerated block coordinate descent (ABCD) algorithm [29] to solve the inner subproblems (11) in the augmented Lagrangian method.

The detailed steps of the ABCD algorithm to be used for solving (11) will be presented below. In this algorithm, (ZWSy) is decomposed into two groups, namely Z and (WSy). In this case, (WSy) is regarded as a single block and the corresponding subproblem in the ABCD algorithm can only be solved by an iterative method inexactly. Here, we propose to develop a semismooth Newton-CG method to solve the corresponding subproblem.

figure d

Note that in order to meet the convergence requirement of the inexact ABCD algorithm, a proximal term involving the positive parameter \(\eta \) is added in (19) to ensure the strong convexity of the objective function in the subproblem. For computational efficiency, one can always take \(\eta \) to be a small number, say \(10^{-6}\). For the subproblem (19), it can be solved by a semismooth Newton-CG algorithm similar to the one developed in Sect. 3.1. Since \(\eta >0\), the superlinear convergence of such a semismooth Newton-CG algorithm can also be proven based on the strong semismoothness of \(\Pi _{\mathcal{S}^n_+}(\cdot )\) and the symmetric positive definiteness of the corresponding generalized Hessian.

The convergence results for the above Algorithm ABCD are stated in the next theorem, whose proof essentially follows from that in [29, Theorem 3.1]. Here, we omit the proof for brevity.

Theorem 3.4

Suppose that Assumption 1 holds and \(\eta >0\). Let \(\{(Z^l,W^l,S^l,y^l)\}\) be the sequence generated by Algorithm ABCD. Then,

$$\begin{aligned}\inf _{Z}\Psi (Z,W^l,S^l,y^l) - \Psi (Z^*,W^*,S^*,y^*) = O(1/l^2)\end{aligned}$$

where \((Z^*,W^*,S^*,y^*)\) is an optimal solution of problem (11). Moreover, the sequence \(\{(Z^l,W^l,S^l,y^l)\}\) is bounded and all of its cluster points are optimal solutions to problem (11).

4 Numerical issues in Qsdpnal

In Algorithm Qsdpnal-Phase I, in order to obtain \(\widehat{W}^k\) and \(W^{k+1}\) at the kth iteration, we need to solve the following linear system of equations

$$\begin{aligned} (\mathcal{Q}+\sigma \mathcal{Q}^2) W \approx \mathcal{Q}R,\quad W\in Ran (\mathcal{Q}) \end{aligned}$$
(20)

with the residual

$$\begin{aligned} \Vert \mathcal{Q}R- (\mathcal{Q}+ \sigma \mathcal{Q}^2) W \Vert \le \varepsilon , \end{aligned}$$
(21)

where \(R\in \mathcal{S}^n\) and \(\varepsilon >0\) are given. Note that the exact solution to (20) is unique since \(\mathcal{Q}+\sigma \mathcal{Q}^2\) is positive definite on \(Ran (\mathcal{Q})\). But the linear system is typically very large even for a moderate n, say \(n= 500\). Under the high dimensional setting which we are particularly interested in, the matrix representation of \(\mathcal{Q}\) is generally not available or too expensive to be stored explicitly. Thus (20) can only be solved inexactly by an iterative method. However when \(\mathcal{Q}\) is singular (and hence \(Ran (\mathcal{Q})\ne \mathcal{S}^n\)), due to the presence of the subspace constraint \(W\in Ran (\mathcal{Q})\), it is extremely difficult to apply preconditioning to (20) while ensuring that the approximate solution is contained in \(Ran (\mathcal{Q})\). Fortunately, as shown in the next proposition, instead of solving (20) directly, we can solve a simpler and yet better conditioned linear system to overcome this difficulty.

Proposition 4.1

Let \({\widehat{W}}\) be an approximate solution to the following linear system:

$$\begin{aligned} (\mathcal{I}+ \sigma \mathcal{Q}) W \approx R \end{aligned}$$
(22)

with the residual satisfying

$$\begin{aligned} \Vert R-(\mathcal{I}+\sigma \mathcal{Q}) \widehat{W} \Vert \le \frac{\varepsilon }{{\lambda _{\max }(\mathcal{Q})}}. \end{aligned}$$

Then, \(\widehat{W}_{\mathcal{Q}} := \Pi _{Ran (\mathcal{Q})}({\widehat{W}}) \in Ran (\mathcal{Q})\) solves (20) with the residual satisfying (21). Moreover, \(\mathcal{Q}\widehat{W}_{\mathcal{Q}} = \mathcal{Q}{\widehat{W}}\) and \(\langle \widehat{W}_{\mathcal{Q}},\,\mathcal{Q}\widehat{W}_{\mathcal{Q}} \rangle = \langle {\widehat{W}},\,\mathcal{Q}{\widehat{W}} \rangle \).

Proof

First we note that the results \(\mathcal{Q}\widehat{W}_{\mathcal{Q}} = \mathcal{Q}{\widehat{W}}\) and \(\langle \widehat{W}_{\mathcal{Q}},\,\mathcal{Q}\widehat{W}_{\mathcal{Q}} \rangle = \langle {\widehat{W}},\,\mathcal{Q}{\widehat{W}} \rangle \) follow from the decomposition \(\widehat{W}= \Pi _{Ran (\mathcal{Q})}(\widehat{W}) + \Pi _{Ran (\mathcal{Q})^\perp }(\widehat{W})\). Next, by observing that

$$\begin{aligned} \Vert \mathcal{Q}R {-} (\mathcal{Q}+\sigma \mathcal{Q}^2)\widehat{W}_{\mathcal{Q}} \Vert {=} \Vert \mathcal{Q}R {-} (\mathcal{Q}+\sigma \mathcal{Q}^2){\widehat{W}} \Vert {\le } {\lambda _{\max }(\mathcal{Q})} \,\Vert R-(\mathcal{I}+\sigma \mathcal{Q}){\widehat{W}} \Vert {\le } \varepsilon , \end{aligned}$$

one can easily obtain the desired results. \(\square \)

By Proposition 4.1, in order to obtain \(\widehat{W}_{\mathcal{Q}}\), we can first apply an iterative method such as the preconditioned conjugate gradient (PCG) method to solve (22) to obtain \(\widehat{W}\) and then perform the projection step. However, by carefully analysing the steps in Qsdpnal-Phase I, we are surprised to observe that instead of explicitly computing \(\widehat{W}_{\mathcal{Q}}\), we can update the iterates in the algorithm by using only \(\mathcal{Q}\widehat{W}_{\mathcal{Q}}=\mathcal{Q}\widehat{W}\). Thus, we only need to compute \(\mathcal{Q}{\widehat{W}}\) and the potentially expensive projection step to compute \(\widehat{W}_\mathcal{Q}\) can be avoided completely.

It is important for us to emphasize the computational advantage of solving the linear system (22) over (20). First, the former only requires one evaluation of \(\mathcal{Q}(\cdot )\) whereas the latter requires two such evaluations in each PCG iteration. Second, the coefficient matrix in the former system is typically much more well-conditioned than the coefficient matrix in the latter system. More precisely, when \(\mathcal{Q}\) is positive definite, then \(\mathcal{I}+\sigma \mathcal{Q}\) is clearly better conditioned than \(\mathcal{Q}+\sigma \mathcal{Q}^2\) by a factor of \(\lambda _{\max }(\mathcal{Q})/\lambda _{\min }(\mathcal{Q})\). When \(\mathcal{Q}\) is singular, with its smallest positive eigenvalue denoted as \(\lambda _{+}(\mathcal{Q})\), then \(\mathcal{I}+\sigma \mathcal{Q}\) is better conditioned when \(\lambda _{\max }(\mathcal{Q}) \ge \lambda _+(\mathcal{Q})(1+\sigma \lambda _+(\mathcal{Q}))\). The previous inequality would obviously hold when \(\lambda _+ \le (\sqrt{4\sigma \lambda _{\max }(\mathcal{Q})+1}-1)/(2\sigma )\).

In Algorithm Qsdpal-Phase II, the subspace constraint \(W\in Ran (\mathcal{Q})\) also appears when we solve the semismooth Newton linear system (15) in Algorithm SNCG. Specifically, we need to find (dWdy) to solve the following linear system

$$\begin{aligned} V\, (dW,dy) + \varrho (0, dy) \approx (\mathcal{Q}(R_1), R_2), \quad (dW,dy)\in Ran (\mathcal{Q})\times \mathfrak {R}^m \end{aligned}$$
(23)

with the residual satisfying the following condition

$$\begin{aligned} \Vert V\, (dW,dy) + \varrho (0, dy) - (\mathcal{Q}(R_1), R_2) \Vert \le \varepsilon , \end{aligned}$$
(24)

where

$$\begin{aligned} V: = \left[ \begin{array}{c@{\quad }c} \mathcal{Q}&{}\quad \\ &{}\quad 0 \end{array} \right] + \sigma \left[ \begin{array}{c} \mathcal{Q}\\ -\mathcal{A}\end{array} \right] \mathcal{U}[\mathcal{Q}\, -\mathcal{A}^*], \end{aligned}$$

\(\mathcal{U}\) is a given self-adjoint positive semidefinite linear operator on \(\mathcal{S}^n\) and \(\varepsilon >0\), \(\sigma >0\) and \(\varrho > 0\) are given. Again, instead of solving (23) directly, we can solve a simpler linear system to compute \(\mathcal{Q}(dW)\) approximately, as shown in the next proposition. The price to pay is that we now need to solve nonsymmetric linear system instead of a symmetric one.

Proposition 4.2

Let

$$\begin{aligned} {\widehat{V}}: = \left[ \begin{array}{c@{\quad }c} \mathcal{I}&{}\quad \\ &{}\quad 0 \end{array} \right] + \sigma \left[ \begin{array}{c} \mathcal{I}\\ -\mathcal{A}\end{array} \right] \mathcal{U}[\mathcal{Q}\; -\mathcal{A}^*]. \end{aligned}$$

Suppose \((\widehat{dW}, \widehat{dy})\) is an approximate solution to the following system:

$$\begin{aligned} {\widehat{V}}\, (dW, dy) + \varrho (0, dy) \approx (R_1, R_2) \end{aligned}$$
(25)

with the residual satisfying

$$\begin{aligned} \Vert {\widehat{V}}\, (\widehat{dW}, \widehat{dy}) + \varrho (0, \widehat{dy}) - (R_1, R_2) \Vert \le \frac{\varepsilon }{{\max \{\lambda _{\max }(\mathcal{Q}),1\}}}. \end{aligned}$$

Let \(\widehat{dW}_\mathcal{Q}= \Pi _{Ran (\mathcal{Q})}(\widehat{dW}) \in Ran (\mathcal{Q})\) Then \((\widehat{dW}_\mathcal{Q},\widehat{dy} )\) solves (23) with the residual satisfying (24). Moreover, \(\mathcal{Q}\, \widehat{dW}_\mathcal{Q}= \mathcal{Q}\, \widehat{dW}\) and \(\langle \widehat{dW}_\mathcal{Q},\,\mathcal{Q}\, \widehat{dW}_\mathcal{Q} \rangle = \langle \widehat{dW},\,\mathcal{Q}\, \widehat{dW} \rangle \).

Proof

The proof that \(\mathcal{Q}\, \widehat{dW}_\mathcal{Q}= \mathcal{Q}\, \widehat{dW}\) and \(\langle \widehat{dW}_\mathcal{Q},\,\mathcal{Q}\, \widehat{dW}_\mathcal{Q} \rangle = \langle \widehat{dW},\,\mathcal{Q}\, \widehat{dW} \rangle \) is the same as in the previous proposition. Observe that \(V = Diag (\mathcal{Q},\mathcal{I}){\widehat{V}}\). Then, by using the fact that

$$\begin{aligned}&\Vert V\,(\widehat{dW}_\mathcal{Q},\widehat{dy}) + \varrho (0, \widehat{dy}) \\&\qquad - (\mathcal{Q}(R_1), R_2) \Vert = \Vert V\,(\widehat{dW},\widehat{dy})+ \varrho (0, \widehat{dy}) - (\mathcal{Q}(R_1), R_2) \Vert \\&\quad \le \Vert Diag (\mathcal{Q},\mathcal{I}) \Vert _2\,\Vert {\widehat{V}}\, (\widehat{dW}, \widehat{dy}) + \varrho (0, \widehat{dy}) - (R_1, R_2) \Vert \\&\quad \le {\max \{\lambda _{\max }(\mathcal{Q}),1\}} \frac{\varepsilon }{{\max \{\lambda _{\max }(\mathcal{Q}),1\}}} = \varepsilon , \end{aligned}$$

we obtain the desired results readily. \(\square \)

5 Adaption of QSDPNAL for least squares SDP and inequality constrained QSDP

Here we discuss how our algorithm Qsdpnal can be modified and adapted for solving least squares semidefinite programming as well as general QSDP problems with additional unstructured inequality constraints which are not captured by the polyhedral set \(\mathcal{K}.\)

5.1 The case for least squares semidefinite programming

In this subsection, we show that for least squares semidefinite programming problems, Qsdpnal can be used in a more efficient way to avoid the difficulty of handling the subspace constraint \(W\in Ran (\mathcal{Q})\).

Consider the following least squares semidefinite programming problem

$$\begin{aligned} \begin{array}{ll} \min \; \Big \{\displaystyle \frac{1}{2} \Vert \mathcal{B}X - d \Vert ^2 + \langle C,\,X \rangle \, \mid \, \mathcal{A}X = b, \; X \in \mathcal{S}^n_+\cap \mathcal{K}\Big \}, \end{array} \end{aligned}$$
(26)

where \(\mathcal{A}:\mathcal{S}^n\rightarrow \mathfrak {R}^{m}\) and \(\mathcal{B}:\mathcal{S}^n\rightarrow \mathfrak {R}^{s}\) are two linear maps, \(C\in \mathcal{S}^n\), \(b \in \mathfrak {R}^{m}\) and \(d\in \mathfrak {R}^{s}\) are given data, \(\mathcal{K}\) is a simple nonempty closed convex polyhedral set in \(\mathcal{S}^n\).

It is easy to see that (26) can be rewritten as follows

$$\begin{aligned} \begin{array}{ll} \min \;\Big \{ \displaystyle \frac{1}{2} \Vert u \Vert ^2 + \langle C,\,X \rangle \,\mid \, \mathcal{B}X - d = u,\; \mathcal{A}X = b, \; X \in \mathcal{S}^n_+\cap \mathcal{K}\Big \}. \end{array} \end{aligned}$$
(27)

The dual of (27) takes the following form

$$\begin{aligned}&\max \Big \{ -\delta _{\mathcal{K}}^*(-Z) -\frac{1}{2}\Vert \xi \Vert ^2 + \langle d,\,\xi \rangle + \langle b,\,y \rangle \mid Z +\mathcal{B}^*\xi + S +\mathcal{A}^*y \nonumber \\&\quad \qquad = C,\;\; S\in \mathcal{S}^n_+ \Big \}. \end{aligned}$$
(28)

When Qsdpnal-Phase I is applied to solve (28), instead of solving (20), the linear system corresponding to the quadratic term is given by

$$\begin{aligned} (\mathcal{I}+ \sigma \mathcal{B}\mathcal{B}^*)\xi \approx R,\end{aligned}$$
(29)

where \(R\in \mathfrak {R}^s\) and \(\sigma >0\) are given data. Correspondingly, in applying Qsdpnal-Phase II to (28), the linear system in the SNCG method is given by

$$\begin{aligned} \left( \left[ \begin{array}{cc} \mathcal{I}&{}\quad \\ &{}\quad 0 \end{array} \right] + \sigma \left[ \begin{array}{c} \mathcal{B}\\ \mathcal{A}\\ \end{array} \right] \mathcal{U}\left[ \begin{array}{cc} \mathcal{B}^* &{}\quad \mathcal{A}^*\\ \end{array} \right] \right) \left[ \begin{array}{c} d\xi \\ dy \\ \end{array} \right] \approx \left[ \begin{array}{c} R_1\\ R_2 \\ \end{array} \right] , \end{aligned}$$
(30)

where \(R_1\in \mathfrak {R}^s\) and \(R_2\in \mathfrak {R}^{m}\) are given data, \(\mathcal{U}\) is a given self-adjoint positive semidefinite linear operator on \(\mathcal{S}^n\). It is clear that just like (22), one can solve (29) efficiently via the PCG method. For (30), one can also solve it by the PCG method, which is more appealing compared to using a nonsymmetric iterative solver such as the preconditioned BiCGSTAB to solve the nonsymmetric linear system (25).

Remark 5.1

When the polyhedral constraint \(X\in \mathcal{K}\) in (26) is absent, i.e., the polyhedral convex set \(\mathcal{K}= \mathcal{S}^n\), Jiang, Sun and Toh in [14] have proposed a partial proximal point algorithm for solving the least squares semidefinite programming problem (26). Here our Algorithm Qsdpnal is built to solve the much more general class of convex composite QSDP problems.

5.2 Extension to QSDP problems with inequality constraints

Consider the following general QSDP problem:

$$\begin{aligned} \min \, \Big \{ \displaystyle \frac{1}{2} \langle X,\,\mathcal{Q}X \rangle + \langle C,\,X \rangle \mid \mathcal{A}_E X = b_E, \;\mathcal{A}_I X \le b_I, \; X \in \mathcal{S}^n_+\cap \mathcal{K}\Big \}, \end{aligned}$$
(31)

where \(\mathcal{A}_E:\mathcal{S}^n\rightarrow \mathfrak {R}^{m_E}\) and \(\mathcal{A}_I:\mathcal{S}^n\rightarrow \mathfrak {R}^{m_I}\) are two linear maps. By adding a slack variable x, we can equivalently rewrite (31) into the following standard form:

$$\begin{aligned} \begin{array}{ll} \min &{} \displaystyle \frac{1}{2} \langle X,\,\mathcal{Q}X \rangle + \langle C,\,X \rangle \\ \hbox {s.t.} &{}\mathcal{A}_E X = b_E, \quad \mathcal{A}_I X +\mathcal{D}x = b_I, \quad X \in \mathcal{S}^n_+\cap \mathcal{K}, \quad \mathcal{D}x \ge 0, \end{array} \end{aligned}$$
(32)

where \(\mathcal{D}:\mathfrak {R}^{m_I}\rightarrow \mathfrak {R}^{m_I}\) is a positive definite diagonal matrix introduced for the purpose of scaling the variable x. The dual of (32) is given by

$$\begin{aligned} \begin{array}{rllll} \max &{} \displaystyle -\delta ^*_{\mathcal{K}}(-Z) -\frac{1}{2}\langle W,\,\mathcal{Q}W \rangle + \langle b_E,\,y_E \rangle + \langle b_I,\,y_I \rangle \\ \hbox {s.t.} &{} Z - \mathcal{Q}W + S + \mathcal{A}_E^* y_E + \mathcal{A}_I^*y_I = C, \\ &{} \mathcal{D}^*(s + y_I) = 0, \quad S\in \mathcal{S}^n_+,\quad s\ge 0, \quad W\in Ran (\mathcal{Q}). \end{array} \end{aligned}$$
(33)

We can express (33) in a form which is similar to (D) as follows:

$$\begin{aligned} \begin{array}{rllll} \max &{} \displaystyle -\delta ^*_{\mathcal{K}}(-Z) -\frac{1}{2}\langle W,\,\mathcal{Q}W \rangle + \langle b_E,\,y_E \rangle + \langle b_I,\,y_I \rangle \\ \hbox {s.t.} &{} \left( \begin{array}{c} \mathcal{I}\\ 0 \end{array} \right) Z - \left( \begin{array}{c} \mathcal{Q}\\ 0 \end{array} \right) W + \left( \begin{array}{cc} \mathcal{I}&{}\quad 0 \\ 0 &{}\quad \mathcal{D}^* \end{array} \right) \left( \begin{array}{c} S \\ s \end{array} \right) + \left( \begin{array}{cc} \mathcal{A}^*_E &{}\quad \mathcal{A}_I^* \\ 0 &{}\quad \mathcal{D}^* \end{array} \right) \left( \begin{array}{c} y_E\\ y_I \end{array} \right) = \left( \begin{array}{c} C \\ 0 \end{array} \right) , \\ &{} (S,s)\in \mathcal{S}^n_+\times \mathfrak {R}^{m_I}_+, \quad W\in Ran (\mathcal{Q}). \end{array} \end{aligned}$$
(34)

We can readily extend Qsdpnal to solve the above more general form of (34), and our implementation of Qsdpnal indeed can be used to solve (34).

6 Computational experiments

In this section, we evaluate the performance of our algorithm Qsdpnal for solving large-scale QSDP problems (31). Since Qsdpnal contains two phases, we also report the numerical results obtained by running Qsdpnal-Phase I (a first-order algorithm) alone for the purpose of demonstrating the power and importance of our two-phase framework for solving difficult QSDP problems. In the numerical experiments, we measure the accuracy of an approximate optimal solution \((X,Z,W,S,y_E,y_I)\) for QSDP (31) and its dual by using the following relative KKT residual:

$$\begin{aligned} \eta _{qsdp } = \max \{\eta _P, \eta _D, \eta _Z, \eta _{S_1}, \eta _{S_2}, \eta _{I_1}, \eta _{I_2},\eta _{I_3},\eta _W\}, \end{aligned}$$
(35)

where

$$\begin{aligned}&\eta _P = \frac{\Vert b_E - \mathcal{A}_E X \Vert }{1+\Vert b_E \Vert },\quad \eta _D = \frac{\Vert Z - \mathcal{Q}W + S + \mathcal{A}_E^* y_E + \mathcal{A}_I^* y_I - C \Vert }{1 + \Vert C \Vert }, \quad \eta _{Z} = \frac{\Vert X - \Pi _{\mathcal{K}}(X-Z) \Vert }{1+\Vert X \Vert +\Vert Z \Vert }, \\&\eta _{S_1} = \frac{|\langle S,\,X \rangle |}{1+\Vert S \Vert +\Vert X \Vert }, \quad \eta _{S_2} = \frac{\Vert X - \Pi _{\mathcal{S}^n_+}(X) \Vert }{1+\Vert X \Vert },\quad \eta _{I_1} = \frac{\Vert \min (b_I - \mathcal{A}_I X,0) \Vert }{1+\Vert b_I \Vert },\\&\eta _{I_2} = \frac{\Vert \max (y_I,0) \Vert }{1+\Vert y_I \Vert }, \eta _{I_3} = \frac{|\langle b_I-\mathcal{A}_I X,\,y_I \rangle |}{1+\Vert y_I \Vert +\Vert b_I - \mathcal{A}_I X \Vert },\quad \eta _{W} = \frac{\Vert \mathcal{Q}W - \mathcal{Q}X \Vert }{1+\Vert \mathcal{Q} \Vert }. \end{aligned}$$

Additionally, we also compute the relative duality gap defined by

$$\begin{aligned} \eta _{gap } = \frac{obj _P-obj _D}{1+|obj _P|+|obj _D|}, \end{aligned}$$

where \(obj _P := \frac{1}{2}\langle X,\,\mathcal{Q}X \rangle + \langle C,\,X \rangle \) and \(obj _D := -\delta _{\mathcal{K}}^*(-Z) - \frac{1}{2}\langle W,\,\mathcal{Q}W \rangle + \langle b_E,\,y_E \rangle +\langle b_I,\,y_I \rangle \). We terminate both Qsdpnal and Qsdpnal-Phase I when \(\eta _{\mathrm{qsdp}} < 10^{-6}\) with the maximum number of iterations set at 50,000.

In our implementation of Qsdpnal, we always run Qsdpnal-Phase I first to generate a reasonably good starting point to warm start our Phase II algorithm. We terminate the Phase I algorithm and switch to the Phase II algorithm if a solution with a moderate accuracy (say a solution with \(\eta _{\mathrm{qsdp}} < 10^{-4}\)) is obtained or if the Phase I algorithm reaches the maximum number of iterations (say 1000 iterations). If the underlying problems contain inequality or polyhedral constraints, we further employ a restarting strategy similar to the one in [33], i.e., when the progress of Qsdpnal-Phase II is not satisfactory, we will restart the whole Qsdpnal algorithm by using the most recently computed \((Z,W,S,y,X,\sigma )\) as the initial point. In addition, we also adopt a dynamic tuning strategy to adjust the penalty parameter \(\sigma \) appropriately based on the progress of the primal and dual feasibilities of the computed iterates.

All our computational results are obtained from a workstation running on 64-bit Windows Operating System having 16 cores with 32 Intel Xeon E5-2650 processors at 2.60 GHz and 64 GB memory. We have implemented Qsdpnal in Matlab version 7.13.

6.1 Evaluation of Qsdpnal on the nearest correlation matrix problems

Our first test example is the problem of finding the nearest correlation matrix (NCM) to a given matrix \(G \in \mathcal{S}^n\):

$$\begin{aligned} \begin{array}{ll} \min \Big \{ \displaystyle \frac{1}{2}\Vert H\circ (X-G) \Vert ^2_F \mid \mathrm{diag}(X) \;=\; e, \; X \in \mathcal{S}^n_+\cap \mathcal{K}\Big \}, \end{array} \end{aligned}$$
(36)

where \(H\in \mathcal{S}^n\) is a nonnegative weight matrix, \(e\in \mathfrak {R}^n\) is the vector of all ones, and \(\mathcal{K}=\{W\in \mathcal{S}^n\;|\; L\le W\le U\}\) with \(L,U\in \mathcal{S}^n\) being given matrices.

In our numerical experiments, we first take a matrix \(\widehat{G}\), which is a correlation matrix generated from gene expression data from [16]. For testing purpose, we then perturb \(\widehat{G}\) to

$$\begin{aligned} G := (1 - \alpha )\widehat{G} + \alpha E, \end{aligned}$$

where \(\alpha \in (0,1)\) is a given parameter and E is a randomly generated symmetric matrix with entries uniformly distributed in \([-\,1,1]\) except for its diagonal elements which are all set to 1. The weight matrix H is generated from a weight matrix \(H_0\) used by a hedge fund company. The matrix \(H_0\) is a \(93 \times 93\) symmetric matrix with all positive entries. It has about \(24\%\) of the entries equal to \(10^{-5}\) and the rest are distributed in the interval \([2, 1.28\times 10^3].\) The Matlab code for generating the matrix H is given by

figure e

The reason for using such a weight matrix is because the resulting problems generated are more challenging to solve as opposed to a randomly generated weight matrix. We also test four more instances, namely PDidx2000, PDidx3000, PDidx5000 and PDidx10000, where the raw correlation matrix \({\widehat{G}}\) is generated from the probability of default (PD) data obtained from the RMI Credit Research InitiativeFootnote 2 at the National University of Singapore. We consider two choices of \(\mathcal{K}\), i.e., case (i): \(\mathcal{K}= \mathcal{S}^n\) and case (ii): \(\mathcal{K}= \{X\in \mathcal{S}^n\mid \, X_{ij} \ge -\,0.5, \;\forall \; i,j=1,\ldots ,n\}\).

Table 1 The performance of Qsdpnal and Qsdpnal-Phase I on H-weighted NCM problems (dual of (36)) (accuracy \(= 10^{-6}\)). In the table, “a” stands for Qsdpnal and “b” stands for Qsdpnal-Phase I, respectively. The computation time is in the format of “hours:minutes:seconds”

In Table 1, we report the numerical results obtained by Qsdpnal and Qsdpnal-Phase I in solving various instances of the H-weighted NCM problem (36). In the table, “it (subs)” denotes the number of outer iterations with subs in the parenthesis indicating the number of inner iterations of Qsdpnal-Phase II and “itSCB” stands for the total number of iterations used in Qsdpnal-Phase I. We can see from Table 1 that Qsdpnal is more efficient than the purely first-order algorithm Qsdpnal-Phase I. In particular, for the instance PDidx10000 where the matrix dimension \(n=10{,}000\), we are able to solve the problem in about 11 h while the purely first-order method Qsdpnal-Phase I needs about 60 h.

6.2 Evaluation of Qsdpnal on instances generated from BIQ problems

Based on the SDP relaxation of a binary integer quadratic (BIQ) problem considered in [28], we construct our second QSDP test example as follows:

$$\begin{aligned} \begin{array}{rl} \hbox {(QSDP-BIQ)}\;\; \min &{} \displaystyle \frac{1}{2}\langle X,\,\mathcal{Q}X \rangle + \frac{1}{2} \langle Q,\,Y \rangle + \langle c,\,x \rangle \\ \hbox {s.t.} &{} diag (Y) - x = 0, \quad \alpha = 1, \quad X = \left( \begin{array}{cc} Y &{}\quad x \\ x^T &{}\quad \alpha \\ \end{array} \right) \in \mathcal{S}^n_+, \quad X\in \mathcal{K}, \\ &{} -Y_{ij}+x_i\ge 0, \, -Y_{ij}+x_j\ge 0,\, Y_{ij}-x_i-x_j\ge -\,1,\,\\ &{} \forall \, i<j, \, j=2,\ldots ,n-1, \end{array} \end{aligned}$$

where the convex set \(\mathcal{K}= \{X \in \mathcal{S}^{n} \mid X \ge 0 \}\). Here \(\mathcal{Q}:\mathcal{S}^n\rightarrow \mathcal{S}^n\) is a self-adjoint positive semidefinite linear operator defined by

$$\begin{aligned} \mathcal{Q}(X) = \frac{1}{2}(AXB + BXA) \end{aligned}$$
(37)

with \(A,B\in \mathcal{S}^n_+\) being matrices truncated from two different large correlation matrices (generated from Russell 1000 and Russell 2000 index, respectively) fetched from Yahoo finance by Matlab. In our numerical experiments, the test data for Q and c are taken from the Biq Mac Library maintained by Wiegele, which is available at http://biqmac.uni-klu.ac.at/biqmaclib.html.

Table 2 reports the numerical results for Qsdpnal and Qsdpnal-Phase I in solving some large scale QSDP-BIQ problems. Note that from the numerical experiments conducted in [6], one can clearly conclude that Qsdpnal-Phase I (a variant of SCB-isPADMM) is the most efficient first-order algorithm for solving QSDP-BIQ problems with a large number of inequality constraints. Even then, one can observe from Table 2 that Qsdpnal is still faster than Qsdpnal-Phase I on most of the problems tested.

Table 2 Same as Table 1 but for QSDP-BIQ problems

6.3 Evaluation of Qsdpnal on instances generated from QAP problems

Next we test the following QSDP problem motivated from the SDP relaxation of a quadratic assignment problem (QAP) considered in [21]. The SDP relaxation we used is adopted from [33] but we add a convex quadratic term in the objective to modify it into a QSDP problem. Specifically, given the data matrices \(A_1,A_2\in \mathcal{S}^l\) of a QAP problem, the problem we test is given by:

$$\begin{aligned} \begin{array}{rl} \hbox {(QSDP-QAP)}\;\; \min &{} \displaystyle \frac{1}{2}\langle X,\,\mathcal{Q}X \rangle +\langle A_2 \otimes A_1,\,X \rangle \\ \mathrm{s.t.} &{} \sum _{i=1}^l X^{ii} = I, \ \langle I,\,X^{ij} \rangle = \delta _{ij} \quad \forall \, 1\le i \le j\le l, \\ &{} \langle E,\,X^{ij} \rangle = 1\quad \forall \, 1\le i \le j\le l, \quad X \in \mathcal{S}^{n}_+,\; X \in \mathcal{K}, \end{array} \end{aligned}$$

where \(n=l^2\), and \(X^{ij}\in \mathfrak {R}^{l\times l}\) denotes the (ij)-th block of X when it is partitioned uniformly into an \(l\times l\) block matrix with each block having dimension \(l\times l\). The convex set \(\mathcal{K}= \{X \in \mathcal{S}^{n} \mid X \ge 0 \}\), E is the matrix of ones, and \(\delta _{ij} = 1\) if \(i=j\), and 0 otherwise. Note that here we use the same self-adjoint positive semidefinite linear operator \(\mathcal{Q}:\mathcal{S}^n\rightarrow \mathcal{S}^n\) constructed in (37). In our numerical experiments, the test instances \((A_1,A_2)\) are taken from the QAP Library [5].

In Table 3, we present the numerical results for Qsdpnal and Qsdpnal-Phase I in solving some large scale QSDP-QAP problems. It is interesting to note that Qsdpnal can solve all the 73 difficult QSDP-QAP problems to an accuracy of \(10^{-6}\) efficiently, while the purely first-order algorithm Qsdpnal-Phase I can only solve 2 of the problems (chr20a and tai25a) to the required accuracy. The superior numerical performance of Qsdpnal over Qsdpnal-Phase I clearly demonstrates the importance and necessity of our proposed two-phase algorithm for which second-order information is incorporated in the inexact augmented Lagrangian algorithm in Phase II. Note that for QSDP-QAP problems, the iteration counts of Qsdpnal sometimes can vary on different computers. The root cause of this phenomenon is the accumulation of the rounding errors of the PCG steps used in QSDPNAL. Indeed, for these difficult problems, a moderate number (sometimes can be up to 200) of PCG steps is needed for solving the corresponding Newton system.

Table 3 Same as Table 1 but for QSDP-QAP problems

6.4 Evaluation of Qsdpnal on instances generated from sensor network localization problems

We also test the QSDP problems arising from the following sensor network localization problems with m anchors and l sensors:

$$\begin{aligned} \begin{array}{rl} \min _{u_1,\ldots ,u_l\in \mathfrak {R}^d} \Big \{ \frac{1}{2}\sum _{(i,j)\in \mathcal{N}} \big (\Vert u_i {-} u_j \Vert ^2 {-}d_{ij}^2\big )^2 \,\mid \, \Vert u_i - a_k \Vert ^2 = d_{ik}^2,\, (i,k)\in \mathcal{M}\Big \}, \end{array}\nonumber \\ \end{aligned}$$
(38)

where the location of each anchor \(a_k\in \mathfrak {R}^d\), \(k=1,\ldots ,m\) is known, and the location of each sensor \(u_i\in \mathfrak {R}^d\), \(i=1,\ldots ,l\), is to be determined. The distance measures \(\{ d_{ij} \mid (i,j)\in \mathcal{N}\}\) and \(\{ d_{ik}\mid (i,k)\in \mathcal{M}\}\) are known pair-wise distances between sensor-sensor pairs and sensor-anchor pairs, respectively. Note that our model (38) is a variant of the model studied in [3]. Let \(U = [u_1\ u_2\ \ldots u_l]\in \mathfrak {R}^{d\times l}\) be the position matrix that needs to be determined. We know that

$$\begin{aligned} \Vert u_i - u_j \Vert ^2 = e_{ij}^T U^T U e_{ij}, \qquad \Vert u_i-a_k \Vert ^2 = a_{ik}^T [U \ I_d]^T[U \ I_d]a_{ik}, \end{aligned}$$

where \(e_{ij} = e_i - e_j\) and \(a_{ik} = [e_i; -a_k]\). Here, \(e_i\) is the ith unit vector in \(\mathfrak {R}^l\), and \(I_d\) is the \(d\times d\) identity matrix. Let \(g_{ik} = a_{ik}\) for \((i,k)\in \mathcal{M}\), \(g_{ij} = [e_{ij}; \mathbf{0}_m]\) for \((i,j)\in \mathcal{N}\), and

$$\begin{aligned}V = U^T U,\qquad X = [ V \ U^T; U \ I_d ]\in \mathcal{S}^{(d+l)\times (d+l)}. \end{aligned}$$

Following the same approach in [3], we can obtain the following QSDP relaxation model with a regularization term for (38)

$$\begin{aligned} \begin{array}{rl} \min &{} \frac{1}{2}\sum _{(i,j)\in \mathcal{N}} \big (g_{ij}^T X g_{ij} - d_{ij}^2\big )^2 - \lambda \langle I_{n+d} - aa^T,\,X \rangle \\ \mathrm{s.t.} &{} g_{ik}^T X g_{ik} = d_{ik}^2,\, (i,k)\in \mathcal{M}, \quad X\succeq 0, \end{array} \end{aligned}$$
(39)

where \(\lambda \) is a given positive regularization parameter, \(a = [{\hat{e}}; {\hat{a}}]\) with \({\hat{e}} = e/\sqrt{l+m}\) and \({\hat{a}} = \sum _{k=1}^m a_k/\sqrt{l+m}\). Here \(e\in \mathfrak {R}^n\) is the vector of all ones.

The test examples are generated in the following manner. We first randomly generate l points \(\{{\hat{x}}_{i}\in \mathfrak {R}^d \mid i=1,\ldots ,l\}\) in \([-0.5,0.5]^d\). Then, the edge set \(\mathcal{N}\) is generated by considering only pairs of points that have distances less than a given positive number R, i.e.,

$$\begin{aligned} \mathcal{N}= \{(i,j)\,\mid \, \Vert {\hat{u}}_i - {\hat{u}}_j \Vert \le R, \ 1\le i < j\le l\}. \end{aligned}$$

Given m anchors \(\{ a_{k}\in \mathfrak {R}^d \mid k=1,\ldots ,m\}\), the edge set \(\mathcal{M}\) is similarly given by

$$\begin{aligned} \mathcal{M}= \{(i,k)\,\mid \, \Vert {\hat{u}}_i - a_k \Vert \le R, \ 1\le i \le l, \ 1\le k\le m\}. \end{aligned}$$

We also assume that the observed distances \(d_{ij}\) are perturbed by random noises \(\varepsilon _{ij}\) as follows:

$$\begin{aligned} d_{ij} = {\hat{d}}_{ij}|1+\tau \varepsilon _{ij}|,\quad (i,j)\in \mathcal{N}, \end{aligned}$$

where \({\hat{d}}_{ij}\) is the true distance between point i and j, \(\varepsilon _{ij}\) are assumed to be independent standard Normal random variables, \(\tau \) is the noise parameter. For the numerical experiments, we generate 10 instances where the number of sensors l ranges from 250 to 1500 and the dimension d is set to be 2 or 3. We set the noise factor \(\tau = 10\%\). The 4 anchors for the two dimensional case (\(d=2\)) are placed at

$$\begin{aligned}(\pm 0.3,\pm 0.3),\end{aligned}$$

and the positions of the anchors for the three dimensional case (\(d=3\)) are given by

$$\begin{aligned}\left( \begin{array}{cccc} 1/3 &{}\quad 2/3 &{}\quad 2/3 &{}\quad 1/3 \\ 1/3 &{}\quad 2/3 &{}\quad 1/3 &{}\quad 2/3 \\ 1/3 &{}\quad 1/3 &{}\quad 2/3 &{}\quad 2/3 \\ \end{array} \right) - 0.5 {E}, \end{aligned}$$

where E is the \(3\times 3\) matrix of all ones.

Table 4 Same as Table 1 but for the sensor network localization problems [dual of (39)]
Table 5 Same as Table 1 but for the sensor network localization problems (dual of (40))

Let \(\mathcal{N}_i = \{ p \mid (i,p)\in \mathcal{N}\}\) be the set of neighbors of the ith sensor. To further test our algorithm Qsdpnal, we also generate the following valid inequalities and add them to problem (38)

$$\begin{aligned} \Vert {\hat{u}}_i - {\hat{u}}_j \Vert \ge R,\, \forall \, (i,j)\in \widehat{\mathcal{N}}, \end{aligned}$$

where \( \widehat{\mathcal{N}} = \bigcup _{i=1}^n \{ (i,j) \mid j \in \mathcal{N}_p\backslash \mathcal{N}_i \; \hbox {for some} \; p\in \mathcal{N}_i\}.\) Then, we obtain the following QSDP relaxation model

$$\begin{aligned} \begin{array}{rl} \min &{} \frac{1}{2}\sum _{(i,j)\in \mathcal{N}} \big (g_{ij}^T X g_{ij} - d_{ij}^2\big )^2 - \lambda \langle I_{n+d} - aa^T,\,X \rangle \\ \mathrm{s.t.} &{} g_{ik}^T X g_{ik} = d_{ik}^2,\, (i,k)\in \mathcal{M}, \\ &{}g_{ij}^T X g_{ij} \ge R^2,\, (i,j)\in \widehat{\mathcal{N}},\quad X\succeq 0. \end{array} \end{aligned}$$
(40)

In Tables 4 and 5, we present the numerical results for Qsdpnal and Qsdpnal-Phase I in solving some instances of problem (39) and (40), respectively. Clearly, Qsdpnal outperforms the purely first-order algorithm Qsdpnal-Phase I by a significant margin. This superior numerical performance of Qsdpnal over Qsdpnal-Phase I again demonstrates the importance and necessity of our proposed two-phase framework.

7 Conclusions

We have designed a two-phase augmented Lagrangian based method, called Qsdpnal, for solving large scale convex quadratic semidefinite programming problems. The global and local convergence rate analysis of our algorithm is based on the classic results of proximal point algorithms [25, 26], together with the recent advances in second order variational analysis of convex composite quadratic semidefinite programming [7]. By devising novel numerical linear algebra techniques, we overcome various challenging numerical difficulties encountered in the efficient implementation of Qsdpnal. Numerical experiments on various large scale QSDPs have demonstrated the efficiency and robustness of our proposed two-phase framework in obtaining accurate solutions. Specifically, for well-posed problems, our Qsdpnal-Phase I is already powerful enough and it is not absolutely necessary to execute Qsdpnal-Phase II. On the other hand, for more difficult problems, the purely first-order Qsdpnal-Phase I algorithm may stagnate because of extremely slow local convergence. In contrast, with the activation of Qsdpnal-Phase II which has second order information wisely incorporated, our Qsdpnal algorithm can still obtain highly accurate solutions efficiently.