solution of the [$D$-`OSMC`]{}problem is given by $X=Y\,
      W^{-1}$.

In our context, $D=\operatorname{Diag}(d_1,\ldots,d_n)$ is any diagonal invertible matrix. So, we extend [@DBLP:conf/issac/ChistovIK97] and show that [$D$-`OSMC`]{}is equivalent to

1.  Finding an invertible matrix $Y \in \operatorname{GL}_n({{\mathbb}{K}})$ such that: $$\begin{aligned}
     \label{eq:smc} Y^{-1}\cdot H_i \cdot Y=H^{\prime}_i
        & \text{ and } &D\,Y^{-1}D^{-1}\cdot H_i^{\operatorname{T}} \cdot
        D\,YD^{-1}={H^{\prime}_i}^{\operatorname{T}} \quad \forall\,i, 1 \leq i \leq m.
      \end{aligned}$$

2.  Computing the square-root $W$ of the matrix $Z=D\,Y \cdot
      Y^{\operatorname{T}}D^{-1}$. Then, the solution of the [$D$-`OSMC`]{}problem is given by $X=Y\, W^{-1}$.

In our case, the $H_i$’s (resp. $H^{\prime}_i$’s) are symmetric (Hessian matrices). Thus, condition  yields a system of *linear* equations and one polynomial inequation: $$\label{eq:lin}
  H_1\cdot Y=Y\cdot H^{\prime}_1,\ldots,H_m \cdot Y = Y\cdot H^{\prime}_m
  \text{ and }\det(Y)\neq 0.$$ From now on, we shall denote by ${\mathcal}{O}_n({{\mathbb}{L}}, D)$ the set of $D$-orthogonal matrices with coefficients in ${{\mathbb}{L}}$.

Let $V \subset {{\mathbb}{K}}^{n \times n}$ be the linear subspace of matrices defined by these linear equations. The [`SMC`]{}problem is then equivalent to recovering an invertible matrix in $V$; in other words we have to solve a particular instance of Edmonds’ problem ([@edm67]). Note that, if the representation of the algebra spanned by $\{H_{1}^{-1}H_{i}\}_{1\leq i\leq m} $ is *irreducible*, we know that $V$ has 