## 2 Theoretical Development
### The Gradient Flow Method  
The gradient flow method described in [40] is briefly presented first and then applied to complex and realistic cases.  
Let \(\xi\in\mathbf{G}^{n\times n}\) denote a real symmetric matrix with distinct eigenvalues \(\{\gamma_{1},\gamma_{2},\ldots,\gamma_{n}\}\). In this paper, \(\xi=\mathbf{J}_{\text{s}}\). According to the orthogonal similarity transforms, all matrices that have the same eigenvalues as \(\xi\) can be defined by the following matrix set  
\[\mathbf{Q}(\xi)=\Big{\{}\mathbf{V}\xi\mathbf{V}^{\text{T}}\Big{\}} \tag{7}\]  
where \(\mathbf{V}\)  
where the entries in \(\mathbf{Z}_{L}\) are the same as those in \(\mathbf{Z}\), except those at the matrix entry locations that do not belong to \(L\) are set identically at zero; and \(L^{s}\) represents all locations that do not belong to \(L\). Then, the projection \(\mathbf{P}(\mathbf{Z})\) of any matrix \(\mathbf{Z}\) onto the affine subspace \(\mathbf{N}(L,\delta)\) is given by  
\[\mathbf{P}(\mathbf{Z})=\mathbf{C}_{L}+\mathbf{Z}_{L^{s}} \tag{10}\]  
where \(\mathbf{C}_{L}\) is a constant matrix in \(\mathbf{N}(L,\delta)\) with zero entries at all locations corresponding to \(L^{s}\) and known entries at all other locations.  
A function can be defined to minimize the distance between \(\mathbf{Z}\) and \(\mathbf{N}(L,\delta)\) by  
\[f(\mathbf{Z})=\frac{1}{2}\langle\mathbf{Z}-\mathrm{P}(\mathbf{Z}),\mathbf{Z} -\mathrm{P}(\mathbf{Z})\rangle \tag{11}\]  
where \(\langle\mathbf{Z}-\mathrm{P}(\mathbf{Z}),\mathbf{Z}-\mathrm{P}(\mathbf{Z})\rangle\) denotes the Frobenius inner product and \(\mathbf{Z}-\mathrm{P}(\mathbf{Z})=\mathbf{Z}_{L}-\mathbf{C}_{L}\).  
Since \(\mathbf{Z}\) belongs to \(\mathbf{Q}(\xi)\), \(\mathbf{Z}\) can be expressed as \(\mathbf{Z}=\mathbf{V}\xi\mathbf{V}^{\mathrm{T}}\). Then, this minimization with the objective function \(f(\mathbf{Z})\) can be rewritten in terms of \(\mathbf{V}\) as follows:  
\[h(\mathbf{V})=\frac{1}{2}\Big{\langle}\mathbf{V}\xi\mathbf{V}^{\mathrm{T}}- \mathrm{P}\Big{(}\mathbf{V}\xi\mathbf{V}^{\mathrm{T}}\Big{)},\mathbf{V}\xi \mathbf{V}^{\mathrm{T}}-\mathrm{P}\Big{(}\mathbf{V}\xi\mathbf{V}^{\mathrm{T} }\Big{)}\Big{\rangle}. \tag{12}\]  
The gradient \(\
abla_{h}\) of objective function \(h\) is given as:  
\[\
abla_{h}=\Big{(}\mathbf{V}\xi\mathbf{V}^{\mathrm{T}}-\mathrm{P}\Big{(} \mathbf{V}\xi\mathbf{V}^{\mathrm{T}}\Big{)}\Big{)}\mathbf{V}\xi-\Big{(} \mathbf{V}\xi\mathbf{V}^{\mathrm{T}}\Big{)}^{\mathrm{T}}\Big{(}\mathbf{V}\xi \mathbf{V}^{\mathrm{T}}-\mathrm{P}\Big{(}\mathbf{V}\xi\mathbf{V}^{\mathrm{T} }\Big{)}\Big{)}\mathbf{V}. \tag{13}\]  
Then, a gradient flow \(h(\mathbf{V})\) can be defined by  
\[\frac{\mathrm{d}\mathbf{V}}{\mathrm{d}t}=\Big{[}\mathbf{Z}^{\mathrm{T}}, \mathbf{Z}-\mathrm{P}(\mathbf{Z})\Big{]}\mathbf{V} \tag{14}\]  
where \(\Big{[}\mathbf{Z}-\mathrm{P}(\mathbf{Z}),\mathbf{Z}^{\mathrm{T}}\Big{]}\) denotes the Lie bracket commutator, i.e., \([\mathbf{B},\mathbf{G}]=\mathbf{B}\mathbf{G}-\mathbf{G}\mathbf{B}\).  
The system of ordinary differential Equation (14) can be readily integrated from a starting point, say, \(\mathbf{V}(0)=\mathbf{I}\) (the identity matrix). The integration termination criterion of Equation (14) can be chosen as follows:  
\[\min\{\Big{\|}\mathbf{Z}(t_{k})-\mathrm{P}(\mathbf{Z}(t_{k}))\big{\|}_{ \mathrm{F}^{\prime}}\Big{\|}\Big{[}\mathbf{Z}(t_{k})^{\mathrm{T}},\mathbf{Z}( t_{k})-\mathrm{P}(\mathbf{Z}(t_{k}))\Big{]}\Big{\|}_{\mathrm{F}}\}\leq 10^{-8} \tag{15}\]  
where \(\|\.\|_{\mathrm{F}}\) denotes the Frobenius norm of a matrix. It should be noted that if a solution does not exist, a least-squares solution can be obtained from the formulation.  
Combining Equations (14) and (15), orthogonal matrix \(\mathbf{V}\) and matrix \(\mathbf{Z}\) can be obtained. Then, the matrix can be obtained by \(\mathbf{Z}=\mathbf{J}\) according to the definition of Equation (7).