# Procrustes problem for the inverse eigenvalue problem of normal (skew)
$J$-Hamiltonian matrices and normal $J$-symplectic matrices

S. Gigola111Departamento de Matemática. Facultad de Ingeniería. Universidad de
Buenos Aires. Buenos Aires, Argentina. E-mail<EMAIL_ADDRESS>L.
Lebtahi222Facultat de Ciències Matemàtiques, Departament de Matemàtiques,
Universitat de València. Valencia, Spain. E-mail<EMAIL_ADDRESS>N.
Thome333Instituto Universitario de Matemática Multidiscilpinar. Universitat
Politècnica de València. Valencia, Spain. E-mail<EMAIL_ADDRESS>
###### Abstract

A square complex matrix $A$ is called (skew) $J$-Hamiltonian if $AJ$ is (skew)
hermitian where $J$ is a real normal matrix such that $J^{2}=-I$, where $I$ is
the identity matrix. In this paper, we solve the Procrustes problem to find
normal (skew) $J$-Hamiltonian solutions for the inverse eigenvalue problem. In
addition, a similar problem is investigated for normal $J$-symplectic
matrices.

Keywords: Inverse eigenvalue problem, (skew) $J$-Hamiltonian matrix,
$J$-symplectic matrix, Moore-Penrose inverse, Procrustes problem.

AMS subject classification: Primary: 15A09; Secondary: 15A24

##  1 Introduction

Inverse eigenvalue problems arise as important tools in several research
subjects such as structural design, parameter identification, modeling, etc.
[5, 13, 30]. Inverse eigenvalue problems consist of the construction of a
matrix $A$ with a determined structure and a specified spectrum. In the
literature, these problems were studied under certain constraints on $A$ as in
[1, 7, 10, 21, 22, 26, 27, 28, 30, 31]. For instance, by using hermitian
generalized Hamiltonian matrices, the associated inverse eigenvalue problem
was solved in [31]. Moreover, in [1], the general solution of the inverse
eigenvalue problem for hermitian generalized skew Hamiltonian matrices was
given and the expression of the solution for the optimal approximation problem
was obtained. For symplectic matrices and several factorizations related to
them, we refer the reader to [29].

An optimal approximation problem is known as a Procrustes problem. The name of
Procrustes come from Greek mythology, where a bandit made the visitors of his
refuge his victims when they went to bed stretching their limbs or cutting
them off, fitting them then to the bed. In a recent interesting book [25],
this expression is used to refer the modern society as the back cover says:
”It represents Taleb’s view of modern civilization’s hubristic side
effects–modifying humans to satisfy technology, blaming reality for not
fitting economic models, inventing diseases to sell drugs, defining
intelligence as what can be tested in a classroom, and convincing people that
employment is not slavery.”.

Our interest is to study the Procrustes problem associated to a specific class
of matrices ($J$-Hamiltonian, skew $J$-Hamiltonian, and $J$-symplectic
matrices as we will detail in what follows.

It is remarkable that Hamiltonian matrices play an important role in several
engineering areas such as optimal quadratic linear control [20, 24],
$H_{\infty}$ optimization [33] and the solution of algebraic Riccati equations
[2, 16], among others. In [17], symplectic matrices are studied from a point
of view of their connection with predetermined left eigenvalues.

Specifically, for given $k\times k$ real matrices $A,B,$ and $C$ with $B$ and
$C$ being symmetric matrices, the algebraic Riccati equation
$XA+A^{T}X-XBX+C=O$ has solution $X=-VU^{-1}$, where the block matrix
$\left[\begin{array}[]{c}U\\\ V\end{array}\right]$ spans an $H$-invariant
subspace of the corresponding subspace for the Hamiltonian matrix given by
$H=\left[\begin{array}[]{cc}A&B\\\ C&-A^{T}\end{array}\right]$ provided that
$U$ is nonsingular [15]. We recall that a $2k\times 2k$ real matrix $G$ is
Hamiltonian if the product $G\left[\begin{array}[]{cc}O&I_{k}\\\
-I_{k}&O\end{array}\right]$ is symmetric, where $I_{k}$ will stand for the
$k\times k$ identity matrix. Moreover, $H$ determines the form of all the
Hamiltonian matrices.

On the other hand, important applications for symplectic matrices arise mainly
in Mathematical Physics in areas such as quantum mechanics. For instance,
symplectic matrices give the phase-space representation of Gaussian
transformations in quantum photonics [4]. In addition, Linear Quadratic
Control Problem [20] requires this kind of matrices in their investigations.

The symbols ${\mathbb{C}}^{m\times n}$ and ${\mathbb{R}}^{m\times n}$ stand
for the sets of $m\times n$ complex real matrices. The symbols $M^{*}$ and
$M^{\dagger}$ will denote the conjugate transpose and the Moore-Penrose
inverse of a matrix $M$, respectively. We remind that for a given rectangular
complex matrix $M\in{\mathbb{C}}^{m\times n}$, its Moore-Penrose inverse is
the (unique) matrix $M^{\dagger}\in{\mathbb{C}}^{n\times m}$ that satisfies
$MM^{\dagger}M=M$, $M^{\dagger}MM^{\dagger}=M^{\dagger}$,
$(MM^{\dagger})^{*}=MM^{\dagger}$, and $(M^{\dagger}M)^{*}=M^{\dagger}M$. This
matrix always exists [3]. We also need the following notation for both
specified orthogonal projectors: $Q_{M}=I_{n}-M^{\dagger}M$ and
$P_{M}=I_{m}-MM^{\dagger}$. It is worth noting that $M^{\dagger}P_{M}=O$ and
$P_{M}(M^{\dagger})^{*}=O$. We will use the inner product given by $\langle
A,B\rangle={\rm trace}(AB^{*})$ for $A,B\in{\mathbb{C}}^{n\times n}$ and the
Frobenius norm of $A$ given by $\|A\|_{F}=\sqrt{\langle A,A\rangle}$. The
symbol $\sigma(A)$ denotes the spectrum of the matrix
$A\in{\mathbb{C}}^{n\times n}$.

Let $J\in{\mathbb{R}}^{n\times n}$ be a normal matrix such that
$J^{2}=-I_{n}$. It is well known that a matrix $A\in{\mathbb{C}}^{n\times n}$
is called $J$-Hamiltonian if $(AJ)^{*}=AJ$ [11]. Moreover,
$A\in{\mathbb{C}}^{n\times n}$ is called skew $J$-Hamiltonian if
$(AJ)^{*}=-AJ$.

On the other hand, a matrix $A\in{\mathbb{C}}^{n\times n}$ is called
$J$-symplectic if $A^{*}JA=J$. Every $J$-symplectic matrix $A$ is nonsingular,
with determinant satisfying $|\det(A)|=1$ and its inverse is given by
$A^{-1}=J^{-1}A^{*}J=-JA^{*}J$ since $J$ is skew-hermitian. Even more, it is
well-known [23, 6, 19] that $\det(A)=1$, which means that the algebraic
multiplicities of the eigenvalues 1 and $-1$ are both even. For some
applications of symplectic matrices, we refer the reader for example to [18].

Throughout all this paper, we will consider a fixed real normal matrix $J$
such that $J^{2}=-I$, where $I$ denotes the identity matrix of adequate size.

Observe that, if $A\in{\mathbb{C}}^{n\times n}$ then the spectral condition
for $A$ to be $J$-Hamiltonian is that $\lambda\in\sigma(A)$ if and only if
$-\bar{\lambda}\in\sigma(A)$, that is, $\lambda\in\sigma(A)$ implies
$\\{\lambda,-\bar{\lambda}\\}\subseteq\sigma(A)$. Even more, when
$A\in{\mathbb{R}}^{n\times n}$, the condition $\lambda\in\sigma(A)$ implies
$\\{\lambda,-\lambda,\bar{\lambda},-\bar{\lambda}\\}\subseteq\sigma(A)$, since
in real polynomials non-real roots appear in pairs of the type $a\pm bi$. This
fact forces the values of the diagonal of the given matrix $D$ have to obey
these symmetry properties. Notice that for

$A=\left[\begin{array}[]{rc}2i&i\\\ -i&2i\end{array}\right]\qquad\text{ and
}\qquad J=\left[\begin{array}[]{cr}i&0\\\ 0&-i\end{array}\right]$

we have that the normal matrix $A$ is $J$-Hamiltonian and
$\sigma(A)=\\{1+2i,-1+2i\\}$. Thus, $\lambda\in\sigma(A)$ does not imply
$\bar{\lambda}\in\sigma(A)$.

Otherwise, if $A\in{\mathbb{C}}^{n\times n}$ is skew $J$-Hamiltonian then
$\lambda\in\sigma(A)$ if and only if $\bar{\lambda}\in\sigma(A)$, that is, if
$\lambda\in\sigma(A)$ then $\\{\lambda,\bar{\lambda}\\}\subseteq\sigma(A)$.
However, in general, $\lambda\in\sigma(A)$ does not imply
$-\lambda\in\sigma(A)$ as the following example shows:

$A=\left[\begin{array}[]{rc}3/2&i/2\\\ -i/2&3/2\end{array}\right]\qquad\text{
and }\qquad J=\left[\begin{array}[]{rc}0&1\\\ -1&0\end{array}\right].$

This skew $J$-Hamiltonian matrix $A$ satisfies $1\in\sigma(A)=\\{1,2\\}$ but
$-1\notin\sigma(A)$.

On the other hand, the spectral condition for $A$ to be $J$-symplectic is that
$\lambda\in\sigma(A)$ implies
$\displaystyle\left\\{\lambda,\bar{\lambda},\frac{1}{\lambda},\frac{1}{\bar{\lambda}}\right\\}\subseteq\sigma(A)$.

For a given full-column rank matrix $X\in{\mathbb{C}}^{n\times m}$ and a given
diagonal matrix $D\in{\mathbb{C}}^{m\times m}$, we introduce the set ${\cal
S}$ of all solutions of the inverse eigenvalue problem $AX=XD$, that is,

${\cal S}=\\{A\in{\mathbb{C}}^{n\times n}:AX=XD\\}.$ (1)

The set ${\cal S}$ when the unknown $A$ is a normal $J$-Hamiltonian matrix was
found in [11], when the unknown $A$ is a normal skew $J$-Hamiltonian matrix,
the set ${\cal S}$ was found in [32]. However, the set ${\cal S}$ for $A$
being a normal $J$-symplectic matrix was not found to our acknowledgement.

We will consider the following sets:

${\cal NJH}:=\\{A\in{\mathbb{C}}^{n\times n}:AA^{*}=A^{*}A,(AJ)^{*}=AJ\\},$
${\cal NJSH}:=\\{A\in{\mathbb{C}}^{n\times n}:AA^{*}=A^{*}A,(AJ)^{*}=-AJ\\},$

and

${\cal NJS}:=\\{A\in{\mathbb{C}}^{n\times n}:AA^{*}=A^{*}A,A^{*}JA=J\\}.$

Statement problems: This paper solves the Procrustes problem associated to
normal (respectively, skew) $J$-Hamiltonian matrices, as well as, to normal
$J$-symplectic matrices. That is, assuming that ${\cal S}\neq\emptyset$, for a
given matrix $\widetilde{A}\in{\mathbb{C}}^{n\times n}$, we study the
existence and uniqueness of matrices $\widehat{A}\in{\cal S}\cap{\cal T}$ such
that

$\min_{A\in{\cal S}\cap{\cal
T}}\|\widetilde{A}-A\|_{F}=\|\widetilde{A}-\widehat{A}\|_{F},$ (2)

for each one of the following cases: ${\cal T}={\cal NJH}$ or ${\cal T}={\cal
NJSH}$, or ${\cal T}={\cal NJS}$.

This paper is organized as follows. Section 2 solves the Procrustes problem
for normal $J$-Hamiltonian matrices. Section 3 is dedicated to solve the
Procrustes problem corresponding to normal skew $J$-Hamiltonian matrices.
Finally, in Section 4, we present and solve the inverse eigenvalue problem and
the Procrustes problem associated to normal $J$-symplectic matrices, as well
as a numerical example is provided.

##  2 Optimization problem for normal $J$-Hamiltonian matrices

Throughout this section, for a given full-column rank matrix
$X\in{\mathbb{C}}^{n\times m}$, a given diagonal matrix
$D\in{\mathbb{C}}^{m\times m}$, and a given matrix
$\widetilde{A}\in{\mathbb{C}}^{n\times n}$, assuming that ${\cal
S}\neq\emptyset$ in (1), we treat the existence and uniqueness problem of
finding $\widehat{A}\in{\cal S}\cap{\cal NJH}$ such that

$\min_{A\in{\cal S}\cap{\cal
NJH}}\|\widetilde{A}-A\|_{F}=\|\widetilde{A}-\widehat{A}\|_{F}.$ (3)

###### Remark 1

As it is well known, the (general) classical eigenvalue problem has not always
a solution. However, with respect to the inverse eigenvalue problem, we note
that diagonalizable (even singular) matrices give rise to a wide class of
matrices that may appear in (1), which can be constructed by different
matrices $X$ and $D$. For instance, ${\cal S}\neq\emptyset$ for fixed diagonal
matrices $X,D$ (because $A=D$ provides, trivially, a solution); whence we can
assure that infinitely many solutions are found (since all matrices $B$ such
that $B(PX)=(PX)D$ belong to ${\cal S}$, for any nonsingular matrix $P$).
Given that the set of diagonalizable matrices is dense in the set of all
matrices [12], we conclude that, in practice, it is quite common to find
situations where matrices solving (1) do appear (for example, all matrices of
index 1). In addition, ${\cal S}$ also contains matrices satisfying
$AA^{*}=A^{*}A$ and $(AJ)^{*}=AJ$, for example, matrices having the form of
the direct sum $D_{1}\oplus(-D_{1}^{*})$, for $D_{1}$ being a diagonal matrix
of adequate size.

### Uniqueness of solution of Procrustes problem for ${\cal T}={\cal NJH}$

Once the existence of solution of (3) is proven, for a non-empty set ${\cal
S}\cap{\cal NJH}$, we have that

${\cal S}\cap{\cal NJH}=A_{0}+\\{A\in{\mathbb{C}}^{n\times n}:AX=0\\}$

is an affine subspace of ${\mathbb{C}}^{n\times n}$ (with the canonical affine
structure [9]) for any $A_{0}\in{\cal S}\cap{\cal NJH}$. By [9, p. 245], the
uniqueness of solution of (3) is guaranteed since that the distance of a point
to an affine subspace is always attained in a single point.

From now on, we focus our efforts on the proof of the existence problem.

### The general expression for matrices $A\in{\cal S}\cap{\cal NJH}$

Since $J^{2}=-I_{n}$, it is clear that $n=2k$ for some positive integer $k$.
Then, there exists a unitary matrix $U\in{\mathbb{C}}^{n\times n}$ such that

$J=U\left[\begin{array}[]{cc}iI_{k}&O\\\ O&-iI_{k}\end{array}\right]U^{*}.$
(4)

Let us consider the following partition

$X=U\left[\begin{array}[]{c}X_{1}\\\ X_{2}\end{array}\right],$

where $X_{1},X_{2}\in{\mathbb{C}}^{k\times m}$. The general normal
$J$-Hamiltonian solution of the inverse eigenvalue problem (1) is given by
(see [11, Theorem 2])

$A=U\left[\begin{array}[]{cc}A_{11}&A_{12}\\\
A_{12}^{*}&A_{22}\end{array}\right]U^{*},$ (5)

where

$A_{12}=X_{1}DQ_{X_{1}}\left(X_{2}Q_{X_{1}}\right)^{\dagger}+Y_{12}P_{X_{2}Q_{X_{1}}},$
(6)

for arbitrary $Y_{12}\in{\mathbb{C}}^{k\times k}$,

$\displaystyle A_{11}$ $\displaystyle=$
$\displaystyle\left[X_{1}D-X_{1}DQ_{X_{1}}\left(X_{2}Q_{X_{1}}\right)^{\dagger}X_{2}-Y_{12}P_{X_{2}Q_{X_{1}}}X_{2}\right]X_{1}^{\dagger}+$
(7)
$\displaystyle+(X_{1}^{\dagger})^{*}X_{2}^{*}P_{X_{2}Q_{X_{1}}}Y_{12}^{*}P_{X_{1}}+P_{X_{1}}Y_{11}P_{X_{1}},$

and

$\displaystyle A_{22}$ $\displaystyle=$
$\displaystyle\left[X_{2}D-\left(Q_{X_{1}}X_{2}^{*}\right)^{\dagger}Q_{X_{1}}D^{*}X_{1}^{*}X_{1}-P_{X_{2}Q_{X_{1}}}Y_{12}^{*}X_{1}\right]X_{2}^{\dagger}+$
(8)
$\displaystyle+(X_{2}^{\dagger})^{*}\left[X_{1}^{*}X_{1}DQ_{X_{1}}\left(X_{2}Q_{X_{1}}\right)^{\dagger}-X_{1}^{*}Y_{12}P_{X_{2}Q_{X_{1}}}\right]P_{X_{2}}+P_{X_{2}}Y_{22}P_{X_{2}},$

for arbitrary skew-hermitian $Y_{11},Y_{22}\in{\mathbb{C}}^{k\times k}$ under
the following conditions:

$X_{1}DQ_{X_{1}}Q_{X_{2}Q_{X_{1}}}=O,$ (9)
$\left[X_{1}D-X_{1}DQ_{X_{1}}(X_{2}Q_{X_{1}})^{\dagger}X_{2}-Y_{12}P_{X_{2}Q_{X_{1}}}\,X_{2}\right]Q_{X_{1}}=O,$
(10)
$\left[X_{2}D-(Q_{X_{1}}X_{2}^{*})^{\dagger}Q_{X_{1}}D^{*}X_{1}^{*}X_{1}-P_{X_{2}Q_{X_{1}}}Y_{12}^{*}X_{1}\right]Q_{X_{2}}=O,$
(11)

$A_{11}A_{12}=A_{12}A_{22}$, and the matrices

$X_{1}^{*}\left(X_{1}D-A_{12}X_{2}\right)\quad\text{and}\quad
X_{2}^{*}\left(X_{2}D-A_{12}^{*}X_{1}\right)$ (12)

are skew-hermitian.

Note that the condition (12) is equivalent to
$X_{1}^{*}X_{1}D-X_{2}^{*}X_{2}D$ is skew-hermitian.

In order to find an optimal solution $\widehat{A}$, as we have stated in (3),
we first transform the problem into a more simple one.

### The simplified problem

Let $\widetilde{A}\in{\mathbb{C}}^{n\times n}$ be an arbitrary given matrix
such that $U^{*}\widetilde{A}U$ is partitioned as

$U^{*}\widetilde{A}U=\left[\begin{array}[]{cc}\widetilde{A}_{11}&\widetilde{A}_{12}\\\
\widetilde{A}_{21}&\widetilde{A}_{22}\end{array}\right],$ (13)

where $\widetilde{A}_{ij}\in{\mathbb{C}}^{k\times k}$ and $U$ is the same
matrix as in (4). Since Frobenius norm is unitarily invariant, by using the
matrix $A\in{\cal S}\cap{\cal NJH}$ given in (5), we obtain

$\displaystyle\|\widetilde{A}-A\|^{2}_{F}$ $\displaystyle=$
$\displaystyle\|U^{*}\widetilde{A}U-U^{*}AU\|_{F}^{2}$ $\displaystyle=$
$\displaystyle\|\widetilde{A}_{11}-A_{11}\|_{F}^{2}+\|\widetilde{A}_{12}-A_{12}\|_{F}^{2}+\|\widetilde{A}_{21}-A_{12}^{*}\|_{F}^{2}+\|\widetilde{A}_{22}-A_{22}\|_{F}^{2}.$

Now, we study each of these four norms separately.

### Explicit form of the solution

Next results are needed in order to minimize the norm of some matrices with
special structures. We quote Lemma 1 in [27] with a slight modification.

###### Lemma 1

Let $B\in{\mathbb{C}}^{q\times m}$, $P_{1}\in{\mathbb{C}}^{q\times q}$, and
$P_{2}\in{\mathbb{C}}^{m\times m}$ where $P_{i}^{2}=P_{i}=P_{i}^{*}$ for
$i=1,2$. Then the following statements hold:

  1. (i)

there exists the minimum of $\|B-P_{1}EP_{2}\|_{F}$ for $E$ ranging the set
${\mathbb{C}}^{q\times m}$.

  2. (ii)

This minimum is attained in $E$ if and only if $E$ satisfies
$P_{1}(B-E)P_{2}=O$.

  3. (iii)

$\displaystyle\min_{E\in{\mathbb{C}}^{q\times
m}}\|B-P_{1}EP_{2}\|_{F}=\|B-P_{1}BP_{2}\|_{F}.$

###### Lemma 2

Let $M\in{\mathbb{C}}^{m\times n}$. The equation $P_{M}YP_{M}=O$ has always a
(nontrivial) skew-hermitian solution $Y\in{\mathbb{C}}^{n\times m}$.

Proof. It follows as an immediate consequence of applying [14, Theorem 2.4] to
$iX$ with $C=O$ and $A=B=P_{M}$. $\blacksquare$

Now, we are ready to give the explicit solution to problem (3). Assume that
${\cal S}\cap{\cal NJH}\neq\emptyset$.

We start by studying $\|\widetilde{A}_{12}-A_{12}\|_{F}^{2}$ since it contains
the arbitrary matrix $Y_{12}$ that also appears in the expressions of $A_{11}$
and $A_{22}$.

Under the condition (9), by using expression (6) of $A_{12}$, Lemma 1 assures
that

$\|\widetilde{A}_{12}-A_{12}\|_{F}^{2}=\left\|\widetilde{A}_{12}-X_{1}DQ_{X_{1}}\left(X_{2}Q_{X_{1}}\right)^{\dagger}-Y_{12}P_{X_{2}Q_{X_{1}}}\right\|_{F}^{2}$

attains its minimum in $Y_{12}$ if and only if $Y_{12}$ satisfies

$\left[\widetilde{A}_{12}-X_{1}DQ_{X_{1}}\left(X_{2}Q_{X_{1}}\right)^{\dagger}-Y_{12}\right]P_{X_{2}Q_{X_{1}}}=O.$

Since $\left(X_{2}Q_{X_{1}}\right)^{\dagger}P_{X_{2}Q_{X_{1}}}=O$, the last
equality simplifies to

$(\widetilde{A}_{12}-Y_{12})P_{X_{2}Q_{X_{1}}}=O.$ (14)

In this case,

$\min_{A_{12}\in{\mathbb{C}}^{k\times
k}}\|\widetilde{A}_{12}-A_{12}\|_{F}^{2}=\left\|\left[\widetilde{A}_{12}X_{2}-X_{1}D\right]Q_{X_{1}}\left(X_{2}Q_{X_{1}}\right)^{\dagger}\right\|_{F}^{2},$

since $R-RP_{M}=RMM^{\dagger}$ for arbitrary matrices $R$ and $M$ of adequate
sizes.

Recalling that the Frobenius norm is invariant under taking adjoint and
applying the last result to

$\|\widetilde{A}_{21}-A_{12}^{*}\|_{F}^{2}=\|((\widetilde{A}_{21})^{*}-A_{12})^{*}\|_{F}^{2}=\|(\widetilde{A}_{21})^{*}-A_{12}\|_{F}^{2}$

we have

$\min_{A_{12}\in{\mathbb{C}}^{k\times
k}}\|(\widetilde{A}_{21})^{*}-A_{12}\|_{F}^{2}=\left\|\left[(\widetilde{A}_{21})^{*}X_{2}-X_{1}D\right]Q_{X_{1}}\left(X_{2}Q_{X_{1}}\right)^{\dagger}\right\|_{F}^{2}$

if and only if $Y_{12}$ satisfies

$((\widetilde{A}_{21})^{*}-Y_{12})P_{X_{2}Q_{X_{1}}}=O.$ (15)

From (6) we obtain

$\widehat{A}_{12}=X_{1}DQ_{X_{1}}\left(X_{2}Q_{X_{1}}\right)^{\dagger}+\widetilde{A}_{12}P_{X_{2}Q_{X_{1}}}.$
(16)

It is clear that from (14) and (15) we get

$\widetilde{A}_{12}P_{X_{2}Q_{X_{1}}}=Y_{12}P_{X_{2}Q_{X_{1}}}=(\widetilde{A}_{21})^{*}P_{X_{2}Q_{X_{1}}}.$

Conversely, if
$\widetilde{A}_{12}P_{X_{2}Q_{X_{1}}}=(\widetilde{A}_{21})^{*}P_{X_{2}Q_{X_{1}}}=:Z$,
post-multiplying both sides by $P_{X_{2}Q_{X_{1}}}$ we get

$\widetilde{A}_{12}P_{X_{2}Q_{X_{1}}}=(\widetilde{A}_{21})^{*}P_{X_{2}Q_{X_{1}}}=ZP_{X_{2}Q_{X_{1}}}.$

Now, $Y_{12}:=Z$ satisfies (14) and (15).

Since
$Y_{12}P_{X_{2}Q_{X_{1}}}=\widetilde{A}_{12}P_{X_{2}Q_{X_{1}}}=(\widetilde{A}_{21})^{*}P_{X_{2}Q_{X_{1}}}$,
the conditions (10) and (11) are equivalent to

$\left[X_{1}D-X_{1}DQ_{X_{1}}(X_{2}Q_{X_{1}})^{\dagger}X_{2}-\widetilde{A}_{12}P_{X_{2}Q_{X_{1}}}X_{2}\right]Q_{X_{1}}=O$
(17)

and

$\left[X_{2}D-(Q_{X_{1}}X_{2}^{*})^{\dagger}Q_{X_{1}}D^{*}X_{1}^{*}X_{1}-P_{X_{2}Q_{X_{1}}}\widetilde{A}_{21}X_{1}\right]Q_{X_{2}}=O,$
(18)

respectively. Moreover, expression (7) gives

$\displaystyle\|\widetilde{A}_{11}-A_{11}\|_{F}^{2}$ $\displaystyle=$
$\displaystyle\left\|\widetilde{A}_{11}-\left[X_{1}D-X_{1}DQ_{X_{1}}\left(X_{2}Q_{X_{1}}\right)^{\dagger}X_{2}-\widetilde{A}_{12}P_{X_{2}Q_{X_{1}}}X_{2}\right]X_{1}^{\dagger}-\right.$
$\displaystyle\left.-(X_{1}^{\dagger})^{*}X_{2}^{*}P_{X_{2}Q_{X_{1}}}\widetilde{A}_{21}P_{X_{1}}-P_{X_{1}}Y_{11}P_{X_{1}}\right\|_{F}^{2}.$

Denoting by $R$ the fixed terms in the last norm, that is,

$\displaystyle R$ $\displaystyle=$
$\displaystyle\widetilde{A}_{11}-\left[X_{1}D-X_{1}DQ_{X_{1}}\left(X_{2}Q_{X_{1}}\right)^{\dagger}X_{2}-\widetilde{A}_{12}P_{X_{2}Q_{X_{1}}}X_{2}\right]X_{1}^{\dagger}-$
$\displaystyle-(X_{1}^{\dagger})^{*}X_{2}^{*}P_{X_{2}Q_{X_{1}}}\widetilde{A}_{21}P_{X_{1}},$

Lemma 1 ensures that $\|\widetilde{A}_{11}-A_{11}\|_{F}^{2}$ attains its
minimum in $Y_{11}$ if and only if $P_{X_{1}}(R-Y_{11})P_{X_{1}}=O$, which is
equivalent to

$P_{X_{1}}(\widetilde{A}_{11}-Y_{11})P_{X_{1}}=O,$ (19)

since $X_{1}^{\dagger}P_{X_{1}}=O$ and $P_{X_{1}}(X_{1}^{\dagger})^{*}=O$. In
this case,

$\min_{A_{11}\in{\mathbb{C}}^{k\times
k}}\|\widetilde{A}_{11}-A_{11}\|_{F}^{2}=\|R-P_{X_{1}}\widetilde{A}_{11}P_{X_{1}}\|_{F}^{2}.$

Then, by using (7) we obtain

$\displaystyle\widehat{A}_{11}$ $\displaystyle=$
$\displaystyle\left[X_{1}D-X_{1}DQ_{X_{1}}\left(X_{2}Q_{X_{1}}\right)^{\dagger}\,X_{2}-\widetilde{A}_{12}P_{X_{2}Q_{X_{1}}}X_{2}\right]X_{1}^{\dagger}+$
(20)
$\displaystyle+(X_{1}^{\dagger})^{*}X_{2}^{*}P_{X_{2}Q_{X_{1}}}\widetilde{A}_{21}P_{X_{1}}+P_{X_{1}}\widetilde{A}_{11}P_{X_{1}}.$

By Lemma 2, (19) has always a skew-hermitian solution
$\widetilde{A}_{11}-Y_{11}$ for a skew-hermitian $Y_{11}$. Then,
$\widetilde{A}_{11}$ is skew-hermitian as well.

Conversely, if $\widetilde{A}_{11}$ is skew-hermitian then equation
$P_{X_{1}}CP_{X_{1}}=O$ has a skew-hermitian solution $C$. Setting
$Y_{11}:=\widetilde{A}_{11}-C$, we get that $Y_{11}$ is a skew-hermitian
matrix that satisfies (19).

A similar reasoning allows us to say that the minimum of
$\|\widetilde{A}_{22}-A_{22}\|_{F}^{2}$ is attained in $Y_{22}$ if and only if
$P_{X_{2}}(\widetilde{A}_{22}-Y_{22})P_{X_{2}}=O$ which is equivalent to
$\widetilde{A}_{22}$ is skew-hermitian. Finally, from (8) the last norm is
minimized by

$\displaystyle\widehat{A}_{22}$ $\displaystyle=$
$\displaystyle\left[X_{2}D-\left(Q_{X_{1})}X_{2}^{*}\right)^{\dagger}Q_{X_{1}}D^{*}X_{1}^{*}X_{1}-P_{X_{2}Q_{X_{1}}}\widetilde{A}_{21}X_{1}\right]X_{2}^{\dagger}+$
(21)
$\displaystyle+(X_{2}^{\dagger})^{*}\left[X_{1}^{*}X_{1}DQ_{X_{1}}\left(X_{2}Q_{X_{1}}\right)^{\dagger}-X_{1}^{*}\widetilde{A}_{12}P_{X_{2}Q_{X_{1}}}\right]P_{X_{2}}+P_{X_{2}}\widetilde{A}_{22}P_{X_{2}}.$

The results obtained can be summarized in the following theorem.

###### Theorem 1

Let $\widetilde{A}\in{\mathbb{C}}^{n\times n}$ be a partitioned matrix as in
(13) and assume that ${\cal S}\cap{\cal NJH}\neq\emptyset$. Then the problem
(3) has a unique solution $\widehat{A}\in{\cal S}\cap{\cal NJH}$ if and only
if $\widetilde{A}_{11}$, $\widetilde{A}_{22}$, and
$X_{1}^{*}X_{1}D-X_{2}^{*}X_{2}D$ are skew-hermitian, (9), (17), (18), and
$(\widetilde{A}_{12}-(\widetilde{A}_{21})^{*})P_{X_{2}Q_{X_{1}}}=O$ are
satisfied and if we define $\widehat{A}_{11}$, $\widehat{A}_{12}$, and
$\widehat{A}_{22}$ by (20), (16) and (21), respectively, the condition
$\widehat{A}_{11}\widehat{A}_{12}=\widehat{A}_{12}\widehat{A}_{22}$ must be
fulfilled. In this case, the (unique) optimal solution is given by

$\widehat{A}=U\left[\begin{array}[]{cc}\widehat{A}_{11}&\widehat{A}_{12}\\\
(\widehat{A}_{12})^{*}&\widehat{A}_{22}\end{array}\right]U^{*}.$

By using the condition given in the statement of Theorem 1, we notice that

$\widehat{A}_{12}=X_{1}DQ_{X_{1}}\left(X_{2}Q_{X_{1}}\right)^{\dagger}+(\widetilde{A}_{21})^{*}P_{X_{2}Q_{X_{1}}}$

gives an alternative expression for $\widehat{A}_{12}$.

###### Remark 2

It is well known that the set ${\cal S}$ is wide enough for Hermitian and
generalized skew-Hamiltonian matrices as it was established in [1], and for
normal skew $J$-Hamiltonian matrices as showed in [11, 32], for the particular
matrix $J=\left[\begin{array}[]{cc}O&I_{k}\\\ -I_{k}&O\end{array}\right]$. It
is clear that all these cases are particular ones of normal matrices. So, it
is natural that the set ${\cal S}$ for ${\cal NJH}$ must be wider.

### Algorithm and numerical examples

The algorithm presented below indicates a procedure that solves the Procrustes
problem associated to the inverse eigenvalue problem stated in this
subsection.

> Algorithm 1
>
> Input: Matrices $\widetilde{A},J,X$, and $D$ such that $J^{2}=-I_{n}$ and
> $X$ and $D$ constrained to the condition ${\cal S}\cap{\cal
> NJH}\neq\emptyset$.
>
> Output: The optimal matrix $\widehat{A}$ that solves Problem (3).
>
> Step 1
>
>
> Diagonalize $J=U(iI_{k}\oplus-iI_{k})U^{*}$.
>
> Step 2
>
>
> Partition $U^{*}X=\left[\begin{array}[]{c}X_{1}\\\ X_{2}\end{array}\right]$.
>
> Step 3
>
>
> Partition
> $U^{*}\widetilde{A}U=\left[\begin{array}[]{cc}\widetilde{A}_{11}&\widetilde{A}_{12}\\\
> \widetilde{A}_{21}&\widetilde{A}_{22}\end{array}\right]$.
>
> Step 4
>
>
> Compute $P=I_{m}-X_{1}^{\dagger}X_{1}$ and $T=I_{m}-X_{2}^{\dagger}X_{2}$.
>
> Step 5
>
>
> Compute $L=I_{m}-(X_{2}P)^{\dagger}X_{2}P$ and
> $Q=I_{k}-X_{2}P(X_{2}P)^{\dagger}$.
>
> Step 6
>
>
> Compute
> $M=X_{1}D-X_{1}DP\left(X_{2}P\right)^{\dagger}\,X_{2}-\widetilde{A}_{12}Q\,X_{2}$
> and
> $N=X_{2}D-\left(PX_{2}^{*}\right)^{\dagger}PD^{*}X_{1}^{*}X_{1}-Q\widetilde{A}_{21}X_{1}$.
>
> Step 7
>
>
> If $\widetilde{A}_{11}$ is not skew-hermitian or $\widetilde{A}_{22}$ is not
> skew-hermitian, go to Step 18.
>
> Step 8
>
>
> If $X_{1}^{*}X_{1}D-X_{2}^{*}X_{2}D$ is not skew-hermitian, go to Step 18.
>
> Step 9
>
>
> If $(\widetilde{A}_{12}-(\widetilde{A}_{21})^{*})Q\neq O$ or $X_{1}DPL\neq
> O$, go to Step 18.
>
> Step 10
>
>
> If $MP\neq O$ or $NT\neq O$, go to Step 18.
>
> Step 11
>
>
> Compute $R=I_{k}-X_{1}X_{1}^{\dagger}$ and $S=I_{k}-X_{2}X_{2}^{\dagger}$.
>
> Step 12
>
>
> Compute
> $\widehat{A}_{11}=MX_{1}^{\dagger}+(X_{1}^{\dagger})^{*}X_{2}^{*}Q\widetilde{A}_{21}R+R\widetilde{A}_{11}R$.
>
> Step 13
>
>
> Compute
> $\widehat{A}_{12}=X_{1}DP\left(X_{2}P\right)^{\dagger}+\widetilde{A}_{12}Q$.
>
> Step 14
>
>
> Compute
> $\widehat{A}_{22}=NX_{2}^{\dagger}+(X_{2}^{\dagger})^{*}\left[X_{1}^{*}X_{1}DP\left(X_{2}P\right)^{\dagger}-X_{1}^{*}\widetilde{A}_{12}Q\right]S+S\widetilde{A}_{22}S$.
>
> Step 15
>
>
> If $\widehat{A}_{11}\widehat{A}_{12}-\widehat{A}_{12}\widehat{A}_{22}\neq
> O$, go to Step 18.
>
> Step 16
>
>
> Compute
> $\widehat{A}=U\left[\begin{array}[]{cc}\widehat{A}_{11}&\widehat{A}_{12}\\\
> (\widehat{A}_{12})^{*}&\widehat{A}_{22}\end{array}\right]U^{*}$.
>
> Step 17
>
>
> Go to End.
>
> Step 18
>
>
> ”There is not a normal $J$-Hamiltonian matrix $\widehat{A}$ such that
> $\displaystyle\min_{A\in{\cal
> S}}\|\widetilde{A}-A\|_{F}=\|\widetilde{A}-\widehat{A}\|_{F}$”.
>
> End
>

###### Remark 3

We have used MATLAB R2022a and MATHEMATICA 13.1 packages. Our worked examples
have been considered for matrices of small sizes by using symbolic
computations.

In what follows, we present some illustrative examples.

###### Example 1

Let consider the matrix

$J=\left[\begin{array}[]{ccrr}0&0&-1&0\\\ 0&0&0&-1\\\ 1&0&0&0\\\
0&1&0&0\end{array}\right]=U\left[\begin{array}[]{ccrr}i&0&0&0\\\ 0&i&0&0\\\
0&0&-i&0\\\ 0&0&0&-i\end{array}\right]U^{*},$

where

$U=\frac{1}{\sqrt{2}}\left[\begin{array}[]{ccrr}i&0&-i&0\\\ 0&i&0&-i\\\
1&0&1&0\\\ 0&1&0&1\\\ \end{array}\right].$

Moreover, we consider the matrices

$X=\left[\begin{array}[]{rcr}-\sqrt{2}&\sqrt{2}&0\\\
0&0&-\frac{ia}{\sqrt{2}}\\\ \sqrt{2}&\sqrt{2}&0\\\ 0&0&\frac{a}{\sqrt{2}}\\\
\end{array}\right],\text{ with }a\in\mathbb{C},\qquad
D=\left[\begin{array}[]{ccr}1+i&0&0\\\ 0&-1+i&0\\\ 0&0&i\end{array}\right],$

and infinitely many data depending on parameters $b,h,k,z\in\mathbb{C}$ given
by

$\widetilde{A}=\frac{1}{2}\left[\begin{array}[]{cccc}5i-2{\rm
Re}(h)&-z-\bar{b}-i\sqrt{3}&9-2{\rm Im}(h)&-iz+i\bar{b}+3\sqrt{3}\\\
-b-\bar{z}-i\sqrt{3}&7i-2k&3\sqrt{3}-ib+i\bar{z}&3\\\ -9-{\rm
Im}(h)&-3\sqrt{3}-iz+i\bar{b}&5i+2{\rm Re}(h)&z+\bar{b}-i\sqrt{3}\\\
-3\sqrt{3}-ib+i\bar{z}&-3&b+\bar{z}-i\sqrt{3}&7i+2k\\\ \end{array}\right]$

Applying Algorithm 1 we get

$X_{1}=\left[\begin{array}[]{ccc}1+i&1-i&0\\\ 0&0&0\\\
\end{array}\right],\quad X_{2}=\left[\begin{array}[]{ccc}1-i&1+i&0\\\ 0&0&a\\\
\end{array}\right],$ $P=\frac{1}{2}\left[\begin{array}[]{rcc}1&i&0\\\
-i&1&0\\\ 0&0&2\end{array}\right],\qquad
T=\frac{1}{2}\left[\begin{array}[]{crc}1&-i&0\\\ i&1&0\\\
0&0&0\end{array}\right],$ $L=\frac{1}{2}\left[\begin{array}[]{crc}1&-i&0\\\
i&1&0\\\ 0&0&0\end{array}\right],\qquad Q=\left[\begin{array}[]{cc}0&0\\\
0&0\end{array}\right],$ $M=\left[\begin{array}[]{ccc}-1+i&1+i&0\\\
0&0&0\end{array}\right],\qquad N=\left[\begin{array}[]{ccc}1+i&-1+i&0\\\
0&0&ia\end{array}\right],$ $R=\left[\begin{array}[]{cc}0&0\\\
0&1\end{array}\right]\qquad\text{ and }\qquad
S=\left[\begin{array}[]{cc}0&0\\\ 0&0\end{array}\right].$

Step 7 is satisfied since

$\widetilde{A}_{11}=\left[\begin{array}[]{cc}-2i&-2i\sqrt{3}\\\
-2i\sqrt{3}&2i\end{array}\right]\quad\text{ and
}\quad\widetilde{A}_{22}=\left[\begin{array}[]{cc}7i&i\sqrt{3}\\\
i\sqrt{3}&5i\end{array}\right]$

are skew-hermitian. Now,

$X_{1}^{*}X_{1}D-X_{2}^{*}X_{2}D=\left[\begin{array}[]{ccc}0&4+4i&0\\\
-4+4i&0&0\\\ 0&0&-ia\bar{a}\end{array}\right]$

is skew-hermitian, so Step 8 is satisfied.

Moreover, Step 9 is valid because
$(\widetilde{A}_{12}-(\widetilde{A}_{21})^{*})Q=O$ and $X_{1}DPL=O$ where

$\widetilde{A}_{12}=\left[\begin{array}[]{cc}h&\bar{b}\\\
\bar{z}&k\end{array}\right]\quad\text{ and
}\quad\widetilde{A}_{21}=\left[\begin{array}[]{rr}\bar{h}&z\\\
b&k\end{array}\right].$

Furthermore, $MP=O$, $NT=O$. Hence, Step 10 is satisfied.

After doing the computations of $\widehat{A}_{11}$, $\widehat{A}_{12}$, and
$\widehat{A}_{22}$ we have that
$\widehat{A}_{11}\widehat{A}_{12}=\widehat{A}_{12}\widehat{A}_{22}$ and

$\widehat{A}=\frac{1}{2}\left[\begin{array}[]{rcrr}2i&0&-2&0\\\ 0&3i&0&-1\\\
-2&0&2i&0\\\ 0&1&0&3i\end{array}\right].$

We can easily check that the matrix $\widehat{A}$ is normal $J$-Hamiltonian
and satisfies the equation $AX=XD$.

###### Example 2

Let consider the matrices $J$ and $U$ given in the previous example and
consider also the matrices

$\widetilde{A}=\frac{1}{2}\left[\begin{array}[]{cccc}5i-2{\rm
Re}(h)&-i\sqrt{3}-z+i&9-2{\rm Im}(h)&3\sqrt{3}-iz+1\\\
-i\sqrt{3}-i-\bar{z}&-4+7i&3\sqrt{3}+1+i\bar{z}&3\\\ -9-2{\rm
Im}(h)&-3\sqrt{3}-iz+1&5i+2{\rm Re}(h)&-i\sqrt{3}+z-i\\\
-3\sqrt{3}+1+i\bar{z}&-3&-i\sqrt{3}+i+\bar{z}&4+7i\end{array}\right],\quad
h,z\in{\mathbb{C}},$ $X=\left[\begin{array}[]{ccc}-\sqrt{2}&\sqrt{2}&0\\\
0&0&0\\\ \sqrt{2}&\sqrt{2}&0\\\ 0&0&i\sqrt{2}\end{array}\right],\qquad
D=\left[\begin{array}[]{ccc}1+i&0&0\\\ 0&-1+i&0\\\ 0&0&2i\end{array}\right].$

Steps 7, 8, and 9 are satisfied, $MP=O$ but since
$NT=\left[\begin{array}[]{ccc}0&0&0\\\ 1-i&-1-i&0\\\ \end{array}\right]\neq
O$, Step 10 is not satisfied. Hence, the Algorithm ensures that the problem
has no solution.

##  3 The normal skew $J$-Hamiltonian case

This section deals with the optimization problem for normal skew
$J$-Hamiltonian matrices. For a given full-column rank matrix
$X\in{\mathbb{C}}^{n\times m}$ and a diagonal matrix
$D\in{\mathbb{C}}^{m\times m}$, throughout this section, we denote by ${\cal
S}\cap{\cal NJSH}$ the set of all the solutions $A\in{\mathbb{C}}^{n\times n}$
of $AX=XD$ for $A$ being a normal skew $J$-Hamiltonian matrix.

By using the same notation as in Section 2, the structure of the normal skew
$J$-Hamiltonian matrices is given by (see [32, Lemma 1])

$A=U\left[\begin{array}[]{rc}A_{11}&A_{12}\\\
-A_{12}^{*}&A_{22}\end{array}\right]U^{*},$

where $A_{11}$ and $A_{22}$ are hermitian, $A_{11}A_{12}=A_{12}A_{22}$ and $U$
is a unitary matrix diagonalizing matrix $J$.

Notice that for a given normal skew $J$-Hamiltonian matrix
$A\in{\mathbb{C}}^{n\times n}$, it is easy to see that the matrix $B:=iA$ is
also normal and, moreover, $B$ is $J$-Hamiltonian. Furthermore, the matrix
equation $AX=XD$ is equivalent to $BX=X\widetilde{D}$, where
$\widetilde{D}=iD$. Observe that, if $D$ satisfies the restriction on the
spectrum of the skew $J$-Hamiltonian matrix $A$ (that is, if
$\lambda\in\sigma(A)$ then $\\{\lambda,\bar{\lambda}\\}\subseteq\sigma(A)$),
the restriction on the spectrum of $\widetilde{D}$ is also satisfied (that is,
if $\lambda\in\sigma(B)$ then
$\\{\lambda,-\lambda,\bar{\lambda},-\bar{\lambda}\\}\subseteq\sigma(B)$).

Then, the general form of matrices in ${\cal S}\cap{\cal NJSH}$ is obtained by
applying [11, Theorem 2] to $B=iA$ and $\widetilde{D}=iD$. The following
result gives necessary and sufficient conditions that ensure the existence of
solutions of the inverse eigenvalue problem for matrices having the structure
considered in this section.

###### Theorem 2

Let $X\in{\mathbb{C}}^{n\times m}$ be a full-column rank matrix,
$D\in{\mathbb{C}}^{m\times m}$ be a diagonal matrix and
$J\in{\mathbb{R}}^{n\times n}$ be a normal matrix such that $J^{2}=-I_{n}$,
where $n=2k$. Consider the partition
$X=U\left[\begin{array}[]{cc}X_{1}^{*}&X_{2}^{*}\end{array}\right]^{*}$ where
$X_{1},X_{2}\in{\mathbb{C}}^{k\times m}$. Then there exists $A\in{\cal
S}\cap{\cal NJSH}$ if and only if the conditions:
$(X_{1}D-A_{12}\,X_{2})Q_{X_{1}}=O$,

$\left[X_{1}D-X_{1}DQ_{X_{1}}(X_{2}Q_{X_{1}})^{\dagger}\,X_{2}-Y_{12}P_{X_{2}Q_{X_{1}}}X_{2}\right]Q_{X_{1}}=O,$
$\left[X_{2}D+(Q_{X_{1}}X_{2}^{*})^{\dagger}Q_{X_{1}}D^{*}X_{1}^{*}X_{1}+P_{X_{2}Q_{X_{1}}}Y_{12}^{*}X_{1}\right]Q_{X_{2}}=O,$

$X_{1}^{*}X_{1}D-X_{2}^{*}X_{2}D$ is hermitian, and
$A_{11}A_{12}=A_{12}A_{22}$ hold. In this case, the general solution is given
by

$A=U\left[\begin{array}[]{rc}A_{11}&A_{12}\\\
-A_{12}^{*}&A_{22}\end{array}\right]U^{*},$

with

$A_{11}=\left[X_{1}D-X_{1}DQ_{X_{1}}(X_{2}Q_{X_{1}})^{\dagger}X_{2}-Y_{12}P_{X_{2}Q_{X_{1}}}X_{2}\right]X_{1}^{\dagger}+(X_{1}^{\dagger})^{*}X_{2}^{*}P_{X_{2}Q_{X_{1}}}Y_{12}^{*}P_{X_{1}}+P_{X_{1}}Y_{11}P_{X_{1}},$
$A_{12}=X_{1}DQ_{X_{1}}(X_{2}Q_{X_{1}})^{\dagger}+Y_{12}P_{X_{2}Q_{X_{1}}},$

and

$\displaystyle A_{22}$ $\displaystyle=$
$\displaystyle\left[X_{2}D+(Q_{X_{1}}X_{2}^{*})^{\dagger}Q_{X_{1}}D^{*}X_{1}^{*}X_{1}+P_{X_{2}Q_{X_{1}}}Y_{12}^{*}X_{1}\right]X_{2}^{\dagger}+$
$\displaystyle+(X_{2}^{\dagger})^{*}\left[X_{1}^{*}X_{1}DQ_{X_{1}}(X_{2}Q_{X_{1}})^{\dagger}+X_{1}^{*}Y_{12}P_{X_{2}Q_{X_{1}}}\right]P_{X_{2}}+P_{X_{2}}Y_{22}P_{X_{2}},$

where $Y_{11},Y_{22}\in{\mathbb{C}}^{k\times k}$ are arbitrary hermitian
matrices and $Y_{12}\in{\mathbb{C}}^{k\times k}$ is an arbitrary matrix.

Now, the Procrustes problem associated to the matrices in ${\cal S}\cap{\cal
NJSH}$ is solved by applying Theorem 1 to $B=iA$ and $\widetilde{D}=iD$.
Summarizing, we establish the following theorem.

###### Theorem 3

Let $\widetilde{A}\in{\mathbb{C}}^{n\times n}$ be a partitioned matrix as in
(13) and assume that ${\cal S}\cap{\cal NJSH}\neq\emptyset$. Then the problem
stated in (2) has a unique solution $\widehat{A}\in{\cal S}\cap{\cal NJSH}$ if
and only if the matrices $\widetilde{A}_{11}$, $\widetilde{A}_{22}$, and
$X_{1}^{*}X_{1}D-X_{2}^{*}X_{2}D$ are hermitian,
$(X_{1}D-A_{12}\,X_{2})Q_{X_{1}}=O$,

$\left[X_{1}D-X_{1}DQ_{X_{1}}(X_{2}Q_{X_{1}})^{\dagger}X_{2}-\widetilde{A}_{12}P_{X_{2}Q_{X_{1}}}X_{2}\right]Q_{X_{1}}=O,$
$\left[X_{2}D+(Q_{X_{1}}X_{2}^{*})^{\dagger}Q_{X_{1}}D^{*}X_{1}^{*}X_{1}-P_{X_{2}Q_{X_{1}}}\widetilde{A}_{21}X_{1}\right]Q_{X_{2}}=O,$

$(\widetilde{A}_{12}+(\widetilde{A}_{21})^{*})P_{X_{2}Q_{X_{1}}}=O$ hold; and
if we define

$\widehat{A}_{11}=\left[X_{1}D-X_{1}DQ_{X_{1}}\left(X_{2}Q_{X_{1}}\right)^{\dagger}X_{2}-\widetilde{A}_{12}P_{X_{2}Q_{X_{1}}}X_{2}\right]X_{1}^{\dagger}+(X_{1}^{\dagger})^{*}X_{2}^{*}P_{X_{2}Q_{X_{1}}}\widetilde{A}_{21}Q_{X_{1}}+P_{X_{1}}\widetilde{A}_{11}P_{X_{1}},$
$\widehat{A}_{12}=X_{1}DQ_{X_{1}}\left(X_{2}Q_{X_{1}}\right)^{\dagger}+\widetilde{A}_{12}P_{X_{2}Q_{X_{1}}},$

and

$\displaystyle\widehat{A}_{22}$ $\displaystyle=$
$\displaystyle\left[X_{2}D+\left(Q_{X_{1})}X_{2}^{*}\right)^{\dagger}Q_{X_{1}}D^{*}X_{1}^{*}X_{1}+P_{X_{2}Q_{X_{1}}}\widetilde{A}_{21}X_{1}\right]X_{2}^{\dagger}+$
$\displaystyle+(X_{2}^{\dagger})^{*}\left[X_{1}^{*}X_{1}DQ_{X_{1}}\left(X_{2}Q_{X_{1}}\right)^{\dagger}-X_{1}^{*}\widetilde{A}_{12}P_{X_{2}Q_{X_{1}}}\right]P_{X_{2}}+P_{X_{2}}\widetilde{A}_{22}P_{X_{2}},$

then the condition
$\widehat{A}_{11}\widehat{A}_{12}=\widehat{A}_{12}\widehat{A}_{22}$ must also
be fulfilled.

In this case, the unique optimal solution is given by

$\widehat{A}=U\left[\begin{array}[]{cc}\widehat{A}_{11}&\widehat{A}_{12}\\\
-(\widehat{A}_{12})^{*}&\widehat{A}_{22}\end{array}\right]U^{*}.$

### Algorithm and numerical examples

This subsection presents an algorithm to solve the Procrustes problem related
to the inverse eigenvalue problem stated. For this case, it reads more
simplified. We also present some numerical examples.

> Algorithm 2
>
> Input: Matrices $\widetilde{A},J,X$, and $D$ such that $J^{2}=-I_{n}$ and
> $X$ and $D$ constrained to the condition ${\cal S}\cap{\cal
> NJSH}\neq\emptyset$.
>
> Output: The optimal matrix $\widehat{A}$ that solves Problem (2) for ${\cal
> T}={\cal NJSH}$.
>
> Step 1
>
>
> Compute $\widetilde{D}=iD$.
>
> Step 2
>
>
> Apply Algorithm 1 to $\widetilde{A},J,X$, and $\widetilde{D}$ obtaining the
> normal $J$-Hamiltonian $\widehat{B}$.
>
> Step 3
>
>
> The optimal solution is $\widehat{A}=-i\widehat{B}$ provided that ${\cal
> S}\cap{\cal NJSH}\neq\emptyset$
>
> End
>

Now, we provide some numerical examples.

###### Example 3

Let consider the same matrices $J$, $U$, and $X$ as in Example 1. Moreover, we
consider the matrices

$D=\left[\begin{array}[]{ccr}1+i&0&0\\\ 0&1-i&0\\\
0&0&1\end{array}\right],\qquad\widetilde{A}=\frac{1}{4}\left[\begin{array}[]{rccc}-2h+7-2i&1-2i&-2-3i-2ih&2-i\\\
-3-2i&-7&-2+3i&-i\\\ -2+7i-2ih&2+i&2h+11+2i&1+10i\\\
-2+5i&i&5-6i&17\end{array}\right],$

with $h\in\mathbb{C}$. Since matrix $X$ remains unchanged, by applying
Algorithm 2 we get the same values for the matrices $X_{1}$, $X_{2}$, $P$,
$T$, $L$, $Q$, $R$, and $S$. Now, we have

$M=\left[\begin{array}[]{ccc}1+i&1-i&0\\\ 0&0&0\end{array}\right],\qquad
N=\left[\begin{array}[]{ccc}1-i&1+i&0\\\ 0&0&a\end{array}\right].$

Steps 7 and 9 are satisfied since

$\widetilde{A}_{11}=\left[\begin{array}[]{cr}1&i\\\
-i&1\end{array}\right]\quad\text{ and
}\quad\widetilde{A}_{22}=\frac{1}{4}\left[\begin{array}[]{cc}11+2\sqrt{3}&-2+\sqrt{3}+4i\\\
-2+\sqrt{3}-4i&9-2\sqrt{3}\end{array}\right]$

are hermitian and, moreover,
$(\widetilde{A}_{12}+(\widetilde{A}_{21})^{*})Q=O$ and $X_{1}DPL=O$ where

$\widetilde{A}_{12}=\left[\begin{array}[]{cc}1+i&i\\\
2&3\end{array}\right]\quad\text{ and
}\quad\widetilde{A}_{21}=\left[\begin{array}[]{rr}h&2i\\\
-i&3\end{array}\right].$

Furthermore, $MP=O$, $NT=O$, and

$X_{1}^{*}X_{1}D-X_{2}^{*}X_{2}D=\left[\begin{array}[]{ccr}0&-4-4i&0\\\
-4+4i&0&0\\\ 0&0&-a\bar{a}\end{array}\right]$

is hermitian. Thus, Steps 8 and 10 are satisfied.

After doing the computations of $\widehat{A}_{11}$, $\widehat{A}_{12}$, and
$\widehat{A}_{22}$ we have that
$\widehat{A}_{11}\widehat{A}_{12}=\widehat{A}_{12}\widehat{A}_{22}$ and

$\widehat{A}=\left[\begin{array}[]{rcrc}1&0&-i&0\\\ 0&1&0&0\\\ -i&0&1&0\\\
0&0&0&1\end{array}\right].$

We can easily check that the matrix $\widehat{A}$ is normal skew
$J$-Hamiltonian and satisfies the equation $AX=XD$. Furthermore, the value of
the norm is

$\|\widetilde{A}-\widehat{A}\|_{F}=\sqrt{|h|^{2}-2{\rm Re}(h)+45},$

and its minimum value is attained for $h=1$ and equals $2\sqrt{11}=6.63325$.

###### Example 4

Let consider the matrices $J$, $U$, and $\widetilde{A}$ given in Example 3 and
also consider the matrices

$X=\left[\begin{array}[]{rcr}-\sqrt{2}&\sqrt{2}&0\\\ 0&0&0\\\
\sqrt{2}&\sqrt{2}&0\\\ 0&0&i\sqrt{2}\\\ \end{array}\right]\quad\text{and}\quad
D=\left[\begin{array}[]{ccc}1+i&0&0\\\ 0&1-i&0\\\ 0&0&2\end{array}\right].$

Step 7 is satisfied, $X_{1}DPL=O$ but since
$(\widetilde{A}_{12}+(\widetilde{A}_{21})^{*})Q=\left[\begin{array}[]{cc}0&2i\\\
0&6\end{array}\right]\neq O$, Step 9 is not satisfied. Hence, Algorithm 2
ensures that the Procrustes problem has no solution.

##  4 The normal $J$-symplectic case

This section deals with the inverse eigenvalue problem for normal
$J$-symplectic matrices and the associated optimization problem. In order to
solve them, we need to recall some results about the Cayley transform.

Let $A\in{\mathbb{C}}^{n\times n}$ such that $\det(I_{n}+A)\neq 0$, that is,
$-1$ is not an eigenvalue of $A$. The Cayley transform of $A$ is the matrix
given by [8]

$A^{C}:=\left(I_{n}-A\right)\left(I_{n}+A\right)^{-1}.$ (22)

We recall some useful properties:

  1. (i)

if $A^{C}$ is the Cayley transform of some matrix $A\in{\mathbb{C}}^{n\times
n}$, then the matrix $I_{n}+A^{C}$ is nonsingular.

  2. (ii)

$\left(I_{n}-A\right)\left(I_{n}+A\right)^{-1}=\left(I_{n}+A\right)^{-1}\left(I_{n}-A\right)$.

  3. (iii)

$A^{C}$ satisfies (22) if and only if
$A=\left(I_{n}-A^{C}\right)\left(I_{n}+A^{C}\right)^{-1}$.

  4. (iv)

The Cayley transform, $A\mapsto A^{C}$, is an involution on the set of
matrices $A\in{\mathbb{C}}^{n\times n}$ such that $I_{n}+A$ is nonsingular,
that is, $M=A^{C}$ if and only if $A=M^{C}$.

  5. (v)

$A$ and $A^{C}$ commute.

  6. (vi)

$(A^{C})^{*}=(A^{*})^{C}$.

In this section, we will consider a fixed normal matrix
$J\in{\mathbb{R}}^{2n\times 2n}$ such that $J^{2}=-I_{2n}$.

###### Lemma 3

Let $A\in{\mathbb{C}}^{2n\times 2n}$ such that $\det(I_{2n}+A)\neq 0$. Then
$A$ is normal and $J$-symplectic if and only if $A^{C}$ is normal and
$J$-Hamiltonian.

Proof. It is easy to prove that $A$ is normal if and only if $(I_{2n}+A)^{-1}$
is normal. By using (22), we get the equality
$(I_{2n}+A^{C})(I_{2n}+A)=2I_{2n}$. Then, $A$ normal is equivalent to
$I_{2n}+A^{C}$ is normal. And, finally, $A$ normal if and only if $A^{C}$ is
normal.

Now, for a given $J$-symplectic $A\in{\mathbb{C}}^{2n\times 2n}$, substituting
$A=\left(I_{2n}-A^{C}\right)\left(I_{2n}+A^{C}\right)^{-1}$ in $A^{*}JA=J$, we
get

$\left(\left(I_{2n}+A^{C}\right)^{*}\right)^{-1}\left(I_{2n}-A^{C}\right)^{*}J\left(I_{2n}-A^{C}\right)\left(I_{2n}+A^{C}\right)^{-1}=J.$

Premultiplying by $\left(I_{2n}+A^{C}\right)^{*}$ and postmultiplying by
$I_{2n}+A^{C}$ we have

$\left(I_{2n}-A^{C}\right)^{*}J\left(I_{2n}-A^{C}\right)=(I_{2n}+A^{C})^{*}J\left(I_{2n}+A^{C}\right).$

Operating and using that $J^{-1}=J^{*}=-J$, we arrive at
$JA^{C}=\left(JA^{C}\right)^{*}$, that is, $A^{C}$ is $J$-Hamiltonian.

On the other hand, let $A^{C}$ be $J$-Hamiltonian, that is,
$JA^{C}=\left(JA^{C}\right)^{*}$. Since
$A=\left(I_{2n}-A^{C}\right)\left(I_{2n}+A^{C}\right)^{-1}$, and by using that
$J^{-1}=J^{*}=-J$, we have

$\displaystyle A^{*}JA$ $\displaystyle=$
$\displaystyle\left(\left(I_{2n}+A^{C}\right)^{-1}\right)^{*}\left(I_{2n}-A^{C}\right)^{*}J\left(I_{2n}-A^{C}\right)\left(I_{2n}+A^{C}\right)^{-1}$
$\displaystyle=$
$\displaystyle-\left(\left(I_{2n}+A^{C}\right)^{*}\right)^{-1}\left(I_{2n}-A^{C}\right)^{*}J^{*}\left(I_{2n}-A^{C}\right)\left(I_{2n}+A^{C}\right)^{-1}$
$\displaystyle=$
$\displaystyle-\left(\left(I_{2n}+A^{C}\right)^{*}\right)^{-1}\left(J^{*}-(JA^{C})^{*}\right)\left(I_{2n}-A^{C}\right)\left(I_{2n}+A^{C}\right)^{-1}$
$\displaystyle=$
$\displaystyle-\left(\left(I_{2n}+A^{C}\right)^{*}\right)^{-1}\left(-J-JA^{C}\right)\left(I_{2n}-A^{C}\right)\left(I_{2n}+A^{C}\right)^{-1}$
$\displaystyle=$
$\displaystyle\left(\left(I_{2n}+A^{C}\right)^{*}\right)^{-1}J\left(I_{2n}+A^{C}\right)\left(I_{2n}-A^{C}\right)\left(I_{2n}+A^{C}\right)^{-1}.$

Now, by using property (ii), we get

$\displaystyle A^{*}JA$ $\displaystyle=$
$\displaystyle\left(\left(I_{2n}+A^{C}\right)^{*}\right)^{-1}J\left(I_{2n}-A^{C}\right)=\left(\left(I_{2n}+A^{C}\right)^{*}\right)^{-1}\left(J-JA^{C}\right)$
$\displaystyle=$
$\displaystyle\left(\left(I_{2n}+A^{C}\right)^{*}\right)^{-1}\left(-J^{*}-(JA^{C})^{*}\right)=-\left(\left(I_{2n}+A^{C}\right)^{*}\right)^{-1}\left(J+JA^{C}\right)^{*}$
$\displaystyle=$
$\displaystyle-\left(\left(I_{2n}+A^{C}\right)^{*}\right)^{-1}\left(I_{2n}+A^{C}\right)^{*}J^{*}=-J^{*}=J.$

$\blacksquare$

For a given normal $J$-symplectic matrix $A\in{\mathbb{C}}^{2n\times 2n}$ such
that $\det(I_{2n}+A)\neq 0$, we have that matrix $A^{C}$ is also normal and
$J$-Hamiltonian. There exists a unitary matrix $U\in{\mathbb{C}}^{2n\times
2n}$ such that

$J=U\left[\begin{array}[]{cc}iI_{n}&O\\\ O&-iI_{n}\end{array}\right]U^{*}.$
(23)

For that matrix $U$, we consider the partition of matrix $A^{C}$ as follows

$A^{C}=U\left[\begin{array}[]{cc}A_{11}&A_{12}\\\
A_{21}&A_{22}\end{array}\right]U^{*}.$

Applying [11, Theorem 1] to matrix $A^{C}$ and using that
$A=\left(I_{2n}-A^{C}\right)\left(I_{2n}+A^{C}\right)^{-1}$, the general
expression of $A$ is given by

$A=U\left[\begin{array}[]{cc}I_{n}-A_{11}&-A_{12}\\\
-A_{12}^{*}&I_{n}-A_{22}\end{array}\right]\left[\begin{array}[]{cc}I_{n}+A_{11}&A_{12}\\\
A_{12}^{*}&I_{n}+A_{22}\end{array}\right]^{-1}U^{*},$

where $A_{11}^{*}=-A_{11}$, $A_{22}^{*}=-A_{22}$, and
$A_{11}A_{12}=A_{12}A_{22}$.

Furthermore, for a given full-column rank matrix $X\in{\mathbb{C}}^{2n\times
2m}$ and a diagonal matrix $D\in{\mathbb{C}}^{2m\times 2m}$, throughout this
section, we denote by ${\cal S}\cap{\cal NJS}$ the set of all the solutions
$A\in{\mathbb{C}}^{2n\times 2n}$ of $AX=XD$ for $A$ being normal
$J$-symplectic such that $\det(I_{2n}+A)\neq 0$. By substituting matrix $A$ by
$\left(I_{2n}-A^{C}\right)\left(I_{2n}+A^{C}\right)^{-1}$ in the matrix
equation $AX=XD$, we get $X(I_{2m}-D)=A^{C}X(I_{2m}+D)$. Since
$\det(I_{2n}+A)\neq 0$, $-1$ is not an eigenvalue of $A$, so $I_{2m}+D$ is
nonsingular. Thus

$AX=XD\ \Longleftrightarrow\ A^{C}X=XD^{C}.$

As observed in the previous case, if $D$ satisfies the restriction on the
spectrum of the $J$-symplectic matrix $A$, the restriction on the spectrum of
$D^{C}=\left(I_{2m}-D\right)\left(I_{2m}+D\right)^{-1}$ is also satisfied,
that is, if $\lambda\in\sigma(A)$ such that $\lambda\neq-1$ then
$\displaystyle\left\\{\frac{1-\lambda}{1+\lambda},-\frac{1-\bar{\lambda}}{1+\bar{\lambda}}\right\\}\in\sigma(A^{C})$.

Then, the general form of normal $J$-symplectic matrices (such that $-1$ is
not an eigenvalue), solution of the inverse eigenvalue problem given by (1),
is obtained by applying [11, Theorem 2] to $A^{C}$ and $D^{C}$. The necessary
and sufficient conditions that assure the existence of solutions of the
inverse eigenvalue problem are given in the following result.

###### Theorem 4

Let $X\in{\mathbb{C}}^{2n\times 2m}$ be a full-column rank matrix,
$D\in{\mathbb{C}}^{2m\times 2m}$ be a diagonal matrix and
$J\in{\mathbb{R}}^{2n\times 2n}$ be a normal matrix such that $J^{2}=-I_{2n}$.
Consider the partition
$X=U\left[\begin{array}[]{cc}X_{1}^{*}&X_{2}^{*}\end{array}\right]^{*}$ where
$X_{1},X_{2}\in{\mathbb{C}}^{n\times 2m}$. Then there exists a normal
$J$-symplectic matrix $A$, solution of the problem (1), if and only if the
conditions: $X_{1}D^{C}Q_{X_{1}}Q_{X_{2}Q_{X_{1}}}=O$,

$\left[X_{1}D^{C}-X_{1}D^{C}Q_{X_{1}}(X_{2}Q_{X_{1}})^{\dagger}\,X_{2}-Y_{12}P_{X_{2}Q_{X_{1}}}X_{2}\right]Q_{X_{1}}=O,$
$\left[X_{2}D^{C}-(Q_{X_{1}}X_{2}^{*})^{\dagger}Q_{X_{1}}(D^{C})^{*}X_{1}^{*}X_{1}-P_{X_{2}Q_{X_{1}}}Y_{12}^{*}X_{1}\right]Q_{X_{2}}=O,$

$X_{1}^{*}X_{1}D^{C}-X_{2}^{*}X_{2}D^{C}$ is skew-hermitian, and
$A_{11}A_{12}=A_{12}A_{22}$ hold. In this case, the general solution is given
by

$A=U\left[\begin{array}[]{cc}I_{n}-A_{11}&-A_{12}\\\
-A_{12}^{*}&I_{n}-A_{22}\end{array}\right]\left[\begin{array}[]{cc}I_{n}+A_{11}&A_{12}\\\
A_{12}^{*}&I_{n}+A_{22}\end{array}\right]^{-1}U^{*},$

with

$\displaystyle A_{11}$ $\displaystyle=$
$\displaystyle\left[X_{1}D^{C}-X_{1}D^{C}Q_{X_{1}}(X_{2}Q_{X_{1}})^{\dagger}X_{2}-Y_{12}P_{X_{2}Q_{X_{1}}}X_{2}\right]X_{1}^{\dagger}+(X_{1}^{\dagger})^{*}X_{2}^{*}P_{X_{2}Q_{X_{1}}}Y_{12}^{*}P_{X_{1}}+$
$\displaystyle+P_{X_{1}}Y_{11}P_{X_{1}},$
$A_{12}=X_{1}D^{C}Q_{X_{1}}(X_{2}Q_{X_{1}})^{\dagger}+Y_{12}P_{X_{2}Q_{X_{1}}},$

and

$\displaystyle A_{22}$ $\displaystyle=$
$\displaystyle\left[X_{2}D^{C}-(Q_{X_{1}}X_{2}^{*})^{\dagger}Q_{X_{1}}(D^{C})^{*}X_{1}^{*}X_{1}-P_{X_{2}Q_{X_{1}}}Y_{12}^{*}X_{1}\right]X_{2}^{\dagger}+$
$\displaystyle+(X_{2}^{\dagger})^{*}\left[X_{1}^{*}X_{1}D^{C}Q_{X_{1}}(X_{2}Q_{X_{1}})^{\dagger}-X_{1}^{*}Y_{12}P_{X_{2}Q_{X_{1}}}\right]P_{X_{2}}+P_{X_{2}}Y_{22}P_{X_{2}},$

where $Y_{11},Y_{22}\in{\mathbb{C}}^{n\times n}$ are arbitrary skew-hermitian
matrices and $Y_{12}\in{\mathbb{C}}^{n\times n}$ is an arbitrary matrix.

Now, let $\widetilde{A}\in{\mathbb{C}}^{2n\times 2n}$ be an arbitrary matrix
such that $U^{*}\widetilde{A}U$ is partitioned as

$U^{*}\widetilde{A}U=\left[\begin{array}[]{cc}\widetilde{A}_{11}&\widetilde{A}_{12}\\\
\widetilde{A}_{21}&\widetilde{A}_{22}\end{array}\right],$ (24)

where $\widetilde{A}_{ij}\in{\mathbb{C}}^{n\times n}$ and $U$ is the same
matrix as in (23). Assuming that ${\cal S}\cap{\cal NJH}\neq\emptyset$ and
applying Theorem 1 to $A^{C}$ and $D^{C}$, the Procrustes problem associated
to the matrices in ${\cal S}\cap{\cal NJS}$ can be completely solved. The
results are summarized in the following theorem.

###### Theorem 5

Let $\widetilde{A}\in{\mathbb{C}}^{2n\times 2n}$ be a partitioned matrix as in
(24) and assume that ${\cal S}\cap{\cal NJS}\neq\emptyset$. There exists a
unique solution $\widehat{A}$ normal and $J$-symplectic of (2) that also
satisfies problem (1) if and only if the matrices $\widetilde{A}_{11}$,
$\widetilde{A}_{22}$, and $X_{1}^{*}X_{1}D^{C}-X_{2}^{*}X_{2}D^{C}$ are skew-
hermitian, and the following conditions:
$X_{1}D^{C}Q_{X_{1}}Q_{X_{2}Q_{X_{1}}}=O$,

$\left[X_{1}D^{C}-X_{1}D^{C}Q_{X_{1}}(X_{2}Q_{X_{1}})^{\dagger}X_{2}-\widetilde{A}_{12}P_{X_{2}Q_{X_{1}}}X_{2}\right]Q_{X_{1}}=O,$
$\left[X_{2}D^{C}-(Q_{X_{1}}X_{2}^{*})^{\dagger}Q_{X_{1}}(D^{C})^{*}X_{1}^{*}X_{1}-P_{X_{2}Q_{X_{1}}}\widetilde{A}_{21}X_{1}\right]Q_{X_{2}}=O,$

$(\widetilde{A}_{12}-(\widetilde{A}_{21})^{*})P_{X_{2}Q_{X_{1}}}=O$ hold; and
if we define

$\displaystyle\widehat{A}_{11}$ $\displaystyle=$
$\displaystyle\left[X_{1}D^{C}-X_{1}D^{C}Q_{X_{1}}\left(X_{2}Q_{X_{1}}\right)^{\dagger}X_{2}-\widetilde{A}_{12}P_{X_{2}Q_{X_{1}}}X_{2}\right]X_{1}^{\dagger}+$
$\displaystyle+(X_{1}^{\dagger})^{*}X_{2}^{*}P_{X_{2}Q_{X_{1}}}\widetilde{A}_{21}P_{X_{1}}+P_{X_{1}}\widetilde{A}_{11}P_{X_{1}},$
$\displaystyle\widehat{A}_{22}$ $\displaystyle=$
$\displaystyle\left[X_{2}D^{C}-\left(Q_{X_{1}}X_{2}^{*}\right)^{\dagger}Q_{X_{1}}(D^{C})^{*}X_{1}^{*}X_{1}-P_{X_{2}Q_{X_{1}}}\widetilde{A}_{21}X_{1}\right]X_{2}^{\dagger}+$
$\displaystyle+(X_{2}^{\dagger})^{*}\left[X_{1}^{*}X_{1}D^{C}Q_{X_{1}}\left(X_{2}Q_{X_{1}}\right)^{\dagger}-X_{1}^{*}\widetilde{A}_{12}P_{X_{2}Q_{X_{1}}}\right]P_{X_{2}}+P_{X_{2}}\widetilde{A}_{22}P_{X_{2}},$

and

$\widehat{A}_{12}=X_{1}D^{C}Q_{X_{1}}\left(X_{2}Q_{X_{1}}\right)^{\dagger}+\widetilde{A}_{12}P_{X_{2}Q_{X_{1}}},$

then the condition
$\widehat{A}_{11}\widehat{A}_{12}=\widehat{A}_{12}\widehat{A}_{22}$ must be
fulfilled. In this case, the unique optimal solution is given by

$\widehat{A}=U\left[\begin{array}[]{cc}I_{n}-\widehat{A}_{11}&-\widehat{A}_{12}\\\
-\widehat{A}_{12}^{*}&I_{n}-\widehat{A}_{22}\end{array}\right]\left[\begin{array}[]{cc}I_{n}+\widehat{A}_{11}&\widehat{A}_{12}\\\
\widehat{A}_{12}^{*}&I_{n}+\widehat{A}_{22}\end{array}\right]^{-1}U^{*}.$

### Algorithm and numerical example

The following algorithm allows to solve the Procrustes problem related to the
inverse eigenvalue problem for normal $J$-symplectic matrices.

> Algorithm 3
>
> Input: Matrices $\widetilde{A},J,X$, and $D$ such that $J^{2}=-I_{2n}$ and
> $X$ and $D$ constrained to the condition ${\cal S}\cap{\cal
> NJS}\neq\emptyset$.
>
> Output: The optimal matrix $\widehat{A}$ that solves Problem (2) for ${\cal
> T}={\cal NJS}$.
>
> Step 1
>
>
> Compute $D^{C}=(I_{2m}-D)(I_{2m}+D)^{-1}$.
>
> Step 2
>
>
> Apply Algorithm 1 to $\widetilde{A},J,X$, and $D^{C}$ obtaining the normal
> $J$-Hamiltonian matrix $\widehat{B}$.
>
> Step 3
>
>
> The optimal solution is
> $\widehat{A}=(I_{2n}-\widehat{B})(I_{2n}+\widehat{B})^{-1}$.
>
> End
>

###### Example 5

Let consider the matrix

$J=\left[\begin{array}[]{ccrr}0&0&-1&0\\\ 0&0&0&-1\\\ 1&0&0&0\\\
0&1&0&0\end{array}\right]=U\left[\begin{array}[]{ccrr}i&0&0&0\\\ 0&i&0&0\\\
0&0&-i&0\\\ 0&0&0&-i\end{array}\right]U^{*},$

where

$U=\frac{1}{\sqrt{2}}\left[\begin{array}[]{ccrr}0&i&-i&0\\\ i&0&0&-i\\\
0&1&1&0\\\ 1&0&0&1\\\ \end{array}\right].$

Moreover, we consider the matrices

$X=\frac{1}{\sqrt{2}}\left[\begin{array}[]{rcrc}0&ia&0&ig\\\ 0&ia&0&-ig\\\
0&-a&0&g\\\ 0&a&0&g\\\ \end{array}\right],\text{ with }a,g\in\mathbb{C},\quad
D=\left[\begin{array}[]{cccc}1-i&0&0&0\\\ 0&1+i&0&0\\\
0&0&\frac{1}{2}-\frac{i}{2}&0\\\
0&0&0&\frac{1}{2}+\frac{i}{2}\end{array}\right],$
$\text{and}\quad\widetilde{A}=\left[\begin{array}[]{cccc}3i&-\frac{1}{5}-i&3&3\\\
-\frac{1}{5}-i&3i&3&3\\\ -3&-3&3i&\frac{1}{5}-i\\\
-3&-3&\frac{1}{5}-i&3i\end{array}\right].$

It can be easily checked that

$D^{C}=\dfrac{1}{5}\left[\begin{array}[]{cccc}-1+2i&0&0&0\\\ 0&-1-2i&0&0\\\
0&0&1+2i&0\\\ 0&0&0&1-2i\end{array}\right].$

Applying Algorithm 1 to $\widetilde{A},J,X$, and $D^{C}$ we get

$X_{1}=\left[\begin{array}[]{cccc}0&a&0&0\\\ 0&0&0&g\\\
\end{array}\right],\quad X_{2}=\left[\begin{array}[]{cccc}0&-a&0&0\\\
0&0&0&g\\\ \end{array}\right],$ $P=\left[\begin{array}[]{cccc}1&0&0&0\\\
0&0&0&0\\\ 0&0&1&0\\\ 0&0&0&0\end{array}\right],\quad
T=\left[\begin{array}[]{cccc}1&0&0&0\\\ 0&0&0&0\\\ 0&0&1&0\\\
0&0&0&0\end{array}\right],$ $L=\left[\begin{array}[]{cccc}1&0&0&0\\\
0&1&0&0\\\ 0&0&1&0\\\ 0&0&0&1\end{array}\right],\quad
Q=\left[\begin{array}[]{cc}1&0\\\ 0&1\end{array}\right],\quad
M=\frac{2}{5}\left[\begin{array}[]{cccc}0&-ia&0&0\\\
0&0&0&-ig\end{array}\right],$
$N=\frac{2}{5}\left[\begin{array}[]{cccc}0&ia&0&0\\\
0&0&0&-ig\end{array}\right],\quad R=\left[\begin{array}[]{cc}0&0\\\
0&0\end{array}\right]\quad\;and\;\quad S=\left[\begin{array}[]{cc}0&0\\\
0&0\end{array}\right].$

Step 7 of Algorithm 1 is satisfied since

$\widetilde{A}_{11}=\left[\begin{array}[]{cr}0&-4i\\\
-4i&0\end{array}\right]\quad\text{ and
}\quad\widetilde{A}_{22}=\left[\begin{array}[]{cc}6i&2i\\\
2i&6i\end{array}\right]$

are both skew-hermitian.

Since $X_{1}^{*}X_{1}D^{C}-X_{2}^{*}X_{2}D^{C}=O$, this matrix is skew-
hermitian, so Step 8 is satisfied.

As

$\widetilde{A}_{12}=\widetilde{A}_{21}=\frac{1}{5}\left[\begin{array}[]{cc}1&0\\\
0&1\end{array}\right]$

Step 9 is fullfilled because
$(\widetilde{A}_{12}-(\widetilde{A}_{21})^{*})Q=O$ and $X_{1}D^{C}PL=O$.

Moreover, $MP=O$ and $NT=O$, so Step 10 is satisfied.

Carrying out the calculation of $\widehat{A}_{11}$, $\widehat{A}_{12}$, and
$\widehat{A}_{22}$ we have that
$\widehat{A}_{11}\widehat{A}_{12}=\widehat{A}_{12}\widehat{A}_{22}$ and

$\widehat{B}=\dfrac{1}{5}\left[\begin{array}[]{cccc}-2i&-1&0&0\\\
-1&-2i&0&0\\\ 0&0&-2i&i\\\ 0&0&1&-2i\end{array}\right].$

This matrix $\widehat{B}$ is normal $J$-Hamiltonian and satisfies the equation
$AX=XD^{C}$.

Finally, the optimal solution is

$\widehat{A}=\dfrac{1}{4}\left[\begin{array}[]{cccc}3+3i&1+i&0&0\\\
1+i&3+3i&0&0\\\ 0&0&3+3i&-1-i\\\ 0&0&-1-i&3+3i\end{array}\right]$

which is normal $J$-symplectic and satisfies the equation $AX=XD$.

The matrix equation for an undamped mass-spring system with $n$ degrees of
freedom looks like

$M\ddot{X}+KX=O,$

where $Y$ is a time-dependent vector that describes the motion,
$M=\textnormal{diag}(m_{1},m_{2},\cdots,m_{n})$ is the mass matrix and

$K=\left[\begin{array}[]{ccccccc}k_{1}+k_{2}&-k_{2}&0&\cdots&0&0&0\\\
-k_{2}&k_{2}+k_{3}&-k_{3}&\dots&0&0&0\\\ 0&-k_{3}&k_{3}+k_{4}&\dots&0&0&0\\\
\vdots&\vdots&\vdots&\ddots&\vdots&\vdots&\vdots\\\
0&0&0&\cdots&k_{n-2}+k_{n-1}&-k_{n-1}&0\\\
0&0&0&\cdots&-k_{n-1}&k_{n-1}+k_{n}&-k_{n}\\\ 0&0&0&\cdots&0&-k_{n}&k_{n}\\\
\end{array}\right]$

is the stiffness matrix which is tridiagonal. Both are symmetric and the mass
and stiffness parameters must be positive.

Since we seek harmonic solutions for $Y$, it has the form $Y=[y_{1}\ y_{2}\
\cdots\ y_{n}]$ where $y_{j}=b_{j}\sin(\omega t)$. Substituting into the
motion equation we get

$M(-\omega^{2})Y+KY=0$

Given that the matrix $M$ is nonsingular, we can rewrite the last equation as

$M^{-1}KY=\omega^{2}Y.$

This problem can be regarded as an eigenvector and eigenvalue problem where
the unknown matrix to find is $K$.

Let $X$ be the matrix whose columns are the eigenvectors and $D$ the diagonal
matrix whose elements are the eigenvalue. In this case, the general matrix
equation becomes $AX=XD$ where $A=M^{-1}K$.

Let consider the input matrices

$M=\left[\begin{array}[]{cc}\sqrt{2}&0\\\
0&\sqrt{2}\end{array}\right],\;X=\left[\begin{array}[]{cc}1/\sqrt{2}&-1/\sqrt{2}\\\
1/\sqrt{2}&1/\sqrt{2}\end{array}\right],\;D=\frac{1}{2}\left[\begin{array}[]{cc}\sqrt{6}-\sqrt{2}&0\\\
0&\sqrt{6}+\sqrt{2}\end{array}\right],\;J=\left[\begin{array}[]{cc}0&1\\\
-1&0\end{array}\right].$

The eigenvalues of $J$ are $i$ and $-i$,
$U=\dfrac{1}{\sqrt{2}}\left[\begin{array}[]{cc}1&-i\\\
i&-1\end{array}\right]$, and

$A=\dfrac{1}{2}\left[\begin{array}[]{cc}\sqrt{6}&-\sqrt{2}\\\
-\sqrt{2}&\sqrt{6}\end{array}\right].$

Then, $K=MA=\dfrac{1}{2}\left[\begin{array}[]{cc}\sqrt{3}&0\\\
0&\sqrt{3}\end{array}\right].$

## Acknowledgements

The first and third authors were partially supported by Universidad de Buenos
Aires, Argentina (EXP-UBA: 13.019/2017, 20020170100350BA). The third author is
partially supported by Ministerio de Ciencia e Innovación of Spain (Grant Red
de Excelencia RED2022-134176-T).

## References

  * [1] Bai Z. The solvability conditions for the inverse eigenvalue problem of Hermitian and generalized skew-Hamiltonian matrices and its approximation, Inverse Problems, 19(5), 1185-1194 (2003)
  * [2] Benner P. Contributions to the Numerical Solution of Algebraic Riccati Equations and Related Eigenvalue Problems, Logos-Verlag, Berlin, Germany, 1997 (Also: Dissertation, Fakultät für Mathematik, TU Chemnitz-Zwickau, (1997))
  * [3] Ben-Israel A., Greville T. Generalized inverses: theory and applications, John Wiley $\&$ Sons, Second Edition, Springer-Verlag, New York, 2003.
  * [4] Chakhmakhchyan L., Cerf N.J. Simulating arbitrary Gaussian circuits with linear optics, Physical Review A 98, 2018.
  * [5] Chu M.T. Inverse eigenvalue problem, SIAM Review 40, 1-39, (1998)
  * [6] Dopico F.M., Johnson C.R. Complementary bases in symplectic matrices and a proof that their determinant is one, Linear Algebra and its Applications, 419, 772-778 (2006)
  * [7] Eberle E., Maciel M.C. Finding the closest Toeplitz matrix, Computational and Applied Mathematics, 22, 1, 1-18, (2003)
  * [8] Fallat S.M., Tsatsomeros M.J. On the Cayley transform of positivity classes of matrices, The Electronic Journal of Linear Algebra, 9, 190-196, (2002)
  * [9] Gallier J. Geometric Methods and Applications For Computer Science and Engineering, Second Edition, Springer, Berlin, 2011.
  * [10] Gigola S., Lebtahi L., Thome, N. The inverse eigenvalue problem for a Hermitian reflexive matrix and the optimization problem, Journal of Computational and Applied Mathematics, 291, 449-457 (2016)
  * [11] Gigola S., Lebtahi L., Thome N. Inverse eigenvalue problem for normal $J$-Hamiltonian matrices, Applied Mathematics Letters, 48, 36-40 (2015)
  * [12] Horn R.A., Johnson C.R. Matrix analysis, Second Edition, Cambridge, New York, 2013.
  * [13] Joseph K.T. Inverse eigenvalue problem in structural design, AIAA J., 10, 2890-2896 (1992)
  * [14] Khatri C.G., Mitra S.K. Hermitian and nonnegative definite solutions of linear matrix equations, SIAM J. Appl. Math., 31(4), 579-585 (1976)
  * [15] Ku${\rm\check{c}}$era V. A review of the matrix Riccati equation, Kybernetika, 9(1), 42-61 (1973)
  * [16] Laub A. Invariant subspace methods for the numerical solution of Riccati equations. In: Bittanti S., Laub A.J., Willems J.C. (eds) The Riccati Equation. Communications and Control Engineering Series. Springer, Berlin, Heidelberg, 1991.
  * [17] Macías-Virgós E., Pereira-Sáez M.J. Symplectic matrices with predetermined left eigenvalues, Linear Algebra and its Applications, 432, 347-350 (2010)
  * [18] Macías-Virgós E., Pereira-Sáez M.J., Tanré D. Cayley transform on Stiefel manifolds, Journal of Geometry and Physics, 123, 53-60 (2018)
  * [19] Mackey D.S., Mackey N. On the determinant of symplectic matrices, Numerical Analysis Report, 422, Manchester Centre for Computational Mathematics, Manchester, England, (2003)
  * [20] Mehrmann V. The autonomous linear quadratic control problem, theory and numerical solution, Lecture Notes in Control and Information Sciences, vol 163, Springer-Verlag, Heidelberg, (July 1991)
  * [21] Nazari A.M., Sherafat F. On the inverse eigenvalue problem for nonnegative matrices of order two to five, Linear Algebra and its Applications, 436, 7, 1771-1790 (2012)
  * [22] Nazari A.M., Mashayekhi A., Nezami A. On the inverse eigenvalue problem of symmetric nonnegative matrices, Mathematical Sciences, 14, 11-19 (2020)
  * [23] Rim D. An elementary proof that symplectic matrices have determinant one, Advances in Dynamical Systems and Applications, 12, 1, 15-20 (2017)
  * [24] Sima V. Algorithms for linear-quadratic optimization, Pure Appl. Math., 200, Marcel Dekker, New York, (1996)
  * [25] Taleb N.N. The Bed of Procrustes: Philosophical and Practical Aphorisms, Random House $\&$ Penguin, 2010.
  * [26] Torre-Mayo J., Abril-Raymundo M.R., Alarcia-Estevez E., Marijuan C., Pisonero M. The nonnegative inverse eigenvalue problem from the coefficients of the characteristic polynomial. EBL Digraphs Linear Algebra Appl. 426, 729-773 (2007)
  * [27] Trench W.F. Inverse eigen problems and associated approximation problems for matrices with generalized symmetry or skew symmetry, Linear Algebra and its Applications, 380, 199-211 (2004)
  * [28] Trench W.F. Hermitian, hermitian $R$-symmetric, and hermitian $R$-skew symmetric Procrustes problems, Linear Algebra and its Applications, 387, 83-98 (2004)
  * [29] Xu H. An SVD-like matrix decomposition and its applications; Linear Algebra and its Applications, 368, 1-24 (2003)
  * [30] Zhang L. A class of inverse eigenvalue problems of symmetric matrices, Numer. Math. J. Chin. Univ., 12(1), 65-71 (1990)
  * [31] Zhang Z., Hu X., Zhang L. The solvability conditions for the inverse eigenproblem of hermitian-generalized Hamiltonian matrices, Inverse Problems, 18, 1369-1376 (2002)
  * [32] Zhao J., Zhang J. The solvability conditions for the inverse eigenvalue problem of normal skew $J$-Hamiltonian matrices, Journal of Inequalities and Applications, 74 (2018)
  * [33] Zhou K., Doyle J., Glover K. Robust and optimal control, Prentice-Hall, Upper Saddle River, NJ, 1995.