# What does lie at the Milky Way centre? Insights from the S2 star orbit
precession

C. R. Argüelles,1,2,3 M. F. Mestre,1,4E. A. Becerra-Vergara,2,4,5 V. Crespi,1
A. Krut,2,3 J. A. Rueda2,3,6,7 R. Ruffini2,3,6,7
1Fac. de Ciencias Astron. y Geofísicas, Universidad Nacional de La Plata,
Paseo del Bosque, B1900FWA La Plata, Argentina
2ICRANet, Piazza della Repubblica 10, 65122 Pescara, Italy
3ICRA, Dip. di Fisica, Sapienza Università di Roma, P.le Aldo Moro 5, 00185
Rome, Italy
4Instituto de Astrofísica de La Plata, UNLP $\&$ CONICET, Paseo del Bosque,
B1900FWA La Plata, Argentina
5GIRG, Escuela de Física, Universidad Industrial de Santander, 680002
Bucaramanga, Colombia
6ICRANet-Ferrara, Dip. di Fisica e Scienze della Terra, Università degli Studi
di Ferrara, Via Saragat 1, 44122 Ferrara, Italy
7INAF, Istituto de Astrofisica e Planetologia Spaziali, Via Fosso del
Cavaliere 100, 00133 Rome, Italy E-mail<EMAIL_ADDRESS>(CRA)

(Accepted XXX. Received YYY; in original form ZZZ)

###### Abstract

It has been recently demonstrated that both, a classical Schwarzschild black
hole (BH), and a dense concentration of self-gravitating fermionic dark matter
(DM) placed at the Galaxy centre, can explain the precise astrometric data
(positions and radial velocities) of the S-stars orbiting Sgr A*. This result
encompasses the 17 best resolved S-stars, and includes the test of general
relativistic effects such as the gravitational redshift in the S2-star. In
addition, the DM model features another remarkable result: the dense core of
fermions is the central region of a continuous density distribution of DM
whose diluted halo explains the Galactic rotation curve. In this Letter, we
complement the above findings by analyzing in both models the relativistic
periapsis precession of the S2-star orbit. While the Schwarzschild BH scenario
predicts a unique prograde precession for S2, in the DM scenario it can be
either retrograde or prograde, depending on the amount of DM mass enclosed
within the S2 orbit, which in turn is a function of the DM fermion mass. We
show that all the current and publicly available data of S2 can not
discriminate between the two models, but upcoming S2 astrometry close to next
apocentre passage could potentially establish if Sgr A* is governed by a
classical BH or by a quantum DM system.

###### keywords:

Galaxy: centre – Galaxy: structure – dark matter – stars: kinematics and
dynamics

††pubyear: 2021††pagerange: What does lie at the Milky Way centre? Insights
from the S2 star orbit precession–References

##  1 Introduction

The most effective method to explore the nature of the supermassive compact
object at the centre of our Galaxy, Sgr A*, has been the tracing of the orbits
of the S-cluster stars. This astrometric data acquisition has been performed
by two leading groups, one of which started a significant progress in
constraining the central object mass (Eckart & Genzel, 1997; Schödel et al.,
2002; Gillessen & et al., 2009; Genzel & et al., 2010; Gillessen et al.,
2017). More recently this group has incorporated the GRAVITY instrument of the
VLT, allowing to detect the gravitational redshift of the S2-star (Gravity
Collaboration et al., 2018a); the detection of flares or hot spots close to
Sgr A* (Gravity Collaboration et al., 2018b); and the detection of the
relativistic precession of the S2-star orbit (Gravity Collaboration et al.,
2020). In parallel a second group reached similar constraints to the mass of
the central compact object in Sgr A* (Ghez & et al., 1998, 2005, 2008; Boehle
et al., 2016), mainly operating with the Keck, Gemini North and Subaru
Telescopes, using the Adaptative Optics technique. This group has recently
confirmed the detection of the S2-star relativistic redshift (Do et al.,
2019), converging with the first group in an estimate of the central object
mass of about $4\times 10^{6}M_{\odot}$.

From this two observational campaigns, the inference on the nature of Sgr A*
has been reached on the ground of novel theoretical understandings. A recent
important result has been obtained in Matsumoto et al. (2020), by re-
considering the flare emissions around SgrA*, emphasizing both, that their
motion is not purely geodesic, and establishing a limit on the spin of a
putative Kerr BH mass of $|a|<0.5$. Soon after, in Becerra-Vergara et al.
(2020), it was introduced an alternative model to the classical BH in Sgr A*
by re-interpreting it as a high concentration of quantum self-gravitating DM
made of fermions of about $56$ keV/c2 rest mass. This alternative approach can
explain the astrometric data of both the S2-star and the G2 object with
similar accuracy than the Schwarzschild BH scenario, but without introducing a
drag force on G2 which is needed in the BH case to reconcile it with the G2
post-pericentre passage velocity data. An underlying assumption about the
nature of such a DM quantum core is its absence of rotation, which is well
supported by recent upper bounds on the spin of the central BH of $a<0.1$,
based on the spatial distribution of the S-stars (Fragione & Loeb, 2020). The
first results obtained in Becerra-Vergara et al. (2020) within the DM scenario
have been further extended in Becerra-Vergara et al. (2021) by considering the
17 best resolved stars orbiting Sgr A*, achieving an equally good fit than in
the BH paradigm. Remarkably, such a dense DM core is the central region of a
continuous distribution of DM whose diluted halo explains the Galactic
rotation curves (Argüelles & et al., 2018; Becerra-Vergara et al., 2020,
2021). Core-halo DM distributions of this kind are obtained from the solution
of the Einstein equations for a self-gravitating, finite-temperature fluid of
fermions in equilibrium following the Ruffini-Argüelles-Rueda (RAR) model
(Ruffini et al., 2015; Argüelles & et al., 2016; Gómez et al., 2016; Gómez &
Rueda, 2017; Argüelles & et al., 2018, 2019; Penacchioni & et al., 2020; Yunis
& et al., 2020; Becerra-Vergara et al., 2020, 2021; Argüelles & et al., 2021).
These novel core-halo DM profiles, as the ones applied in this Letter, have
been shown to form and remain stable in cosmological time-scales, when
accounting for the quantum nature of the particles within proper relaxation
mechanisms of collisionless fermions (Argüelles & et al., 2021).

In this Letter, we focus the attention solely on the S2-star, which has been
continuously monitored in the last $27$ years, and shows one of the most
compact orbits around Sgr A* with an orbital period of about
$16\text{\,}\mathrm{yr}$ and a pericentre of $0.56\text{\,}\mathrm{mpc}$ (i.e.
about $1450$ Schwarzschild radii of the
$4\text{\times}{10}^{6}\text{\,}\mathrm{M_{\odot}}$ central object). Even
though it is relatively far from Sgr A* where relativistic effects are feeble
and hard to detect, S2 is currently considered the best tracer of the Sgr A*
gravitational potential. Being its most precise astrometric data taken around
pericentre passages, see e.g. Gravity Collaboration et al. (2018a, 2020); Do
et al. (2019).

With the aim of making progress in disentangling the nature of Sgr A*, we
analyze here the relativistic periapsis precession of the S2-star in the above
BH and DM scenarios. As the main result of this work, it is shown that the
precession of the S2-star within the RAR DM model can be either retrograde or
prograde depending upon the amount of DM mass enclosed within the orbit. The
latter is shown to be a function of the mass of the DM fermion (hereafter
darkino). In particular, we show that for a $56$ keV/$c^{2}$ darkino mass the
RAR model predicts a retrograde S2 orbit precession, while for a slightly
larger darkino mass of $58$ keV/$c^{2}$, it predicts a prograde precession.
The latter very much similar to the Schwarzschild BH case. By fitting all the
publicly available S2 astrometric data, we conclude that none of the above
scenarios about the nature of Sgr A* can be currently discriminated. This is
mainly due to the large eccentricity of the S2 orbit, implying that its
cumulative precession has a better chance of detectability away from the
pericentre passage and closer to apocentre (Parsa & et al., 2017).
Consequently, we assess at which epoch during the S2 orbital motion these
scenarios can be disentangled, being the S2 high precision data beyond $2019$
of utmost importance for this task.

##  2 Precession of the S2 orbit

In both models here considered for Sgr A*, the spherically symmetric spacetime
metric can be written as

$ds^{2}=A(r)c^{2}dt^{2}-B(r)dr^{2}-r^{2}\left(d\theta^{2}+\sin^{2}{\theta}d\phi^{2}\right),$
(1)

where ($r$,$\theta$,$\phi$) are the spherical coordinates, $c$ the speed of
light, and $A(r)$, $B(r)$ are the metric functions to be found by solving the
Einstein field equations. For the Schwarzschild BH model, such equations can
be solved analytically leading to: $A(r)=1-2GM_{\rm{BH}}/(c^{2}r)$ and
$B(r)=1/A(r)$, where $G$ is the gravitational constant and $M_{\rm BH}$ the BH
mass. For the RAR DM model, the system of Einstein equations is solved
numerically for $A(r)$ and $B(r)$, together with the Tolman and Klein
thermodynamic equilibrium conditions, and the (particle) energy conservation
along geodesics (Argüelles & et al., 2018). These metric potentials are not
analytic and their radial dependence depend on the boundary-value problem
specified to have solutions that agree with the galaxy observables. A solution
of the RAR DM model for the case of the Milky Way, with specific boundary
conditions that agree either with the overall rotation curve, the orbits of
the 17 best resolved S-cluster stars and the G2 object, was presented in
Becerra-Vergara et al. (2020, 2021) for a darkino mass of $56$ keV/$c^{2}$.

A necessary condition to be fulfilled by the RAR DM profiles in order to
explain the S2 orbit, is that the corresponding DM core radius ($r_{c}$) be
smaller than the S2 pericentre (which for the case of $m=56$ keV/$c^{2}$ is
$r_{c}\approx 0.4$ mpc $<r_{p(S_{2})}=0.56$ mpc). However, as first understood
in Argüelles & et al. (2018), and further detailed here, more compact DM cores
with $r_{c}<r_{p(S_{2})}$ (with fixed Milky Way halo boundary conditions) can
also explain the S-cluster stellar orbits for different darkino masses. Thus,
in this Letter we explore other Milky Way RAR profiles from $m=55$ keV/$c^{2}$
to $m=60$ keV/$c^{2}$, which will be essential to compare the properties of
the S2 orbit precession for different central DM concentrations.

The equations of motion of a test particle in the spacetime metric eq. 1,
assuming without loss of generality the motion on the plane $\theta=\pi/2$,
are given by

$\displaystyle\dot{t}=\dfrac{E}{c^{2}\
A(r)},\qquad\qquad\dot{\phi}=\dfrac{L}{r^{2}},$ (2)
$\displaystyle\ddot{r}=\dfrac{1}{2\ B(r)}\left[-A^{\prime}(r)\ c^{2}\
\dot{t}^{2}-B^{\prime}(r)\ \dot{r}^{2}+2\ r\ \dot{\phi}^{2}\right],$

where $E$ and $L$ are the conserved energy and the angular momentum of the
test particle per-unit-mass, the overdot stands for derivative with respect to
the proper time $\tau$, while the superscript comma (′) denotes derivative
with respect to the radial coordinate $r$. We perform the numerical
integration of eqs. (2) with a Dormand-Prince algorithm (Strehmel, 1988),
implemented as DOP853 by the Python library SCIPY (Virtanen et al., 2020). In
addition, the appropriate initial conditions have been chosen in such a way
that the test particle motion starts at the apocentre, i.e., $t(\tau_{0})=0$,
$\phi(\tau_{0})=\pi$, $r(\tau_{0})=r_{a}$, and $\dot{r}(\tau_{0})=0$. We
integrate the equations for a sufficiently long time which assures that the
particle performs more than two consecutive orbits, so we can compute the net
precession of the real orbit over two consecutive cycles. For instance,
denoting the time of apocentre in two consecutive orbits respectively as
$t_{\rm apo1}$ and $t_{\rm apo2}$, the precession of the real orbit over those
two cycles is $\Delta\phi=\phi(t_{\rm apo2})-\phi(t_{\rm apo1})$.

Figure 1: Relativistic periapsis precession $\Delta\phi$ per orbit as a
function of the darkino mass as predicted by the RAR DM models for the
S2-star. The precession is retrograde for $m<56.4$ keV/$c^{2}$ while it
becomes prograde for $m>56.4$ keV/$c^{2}$ (see also table 1).

We start by analyzing the effects of different DM core concentrations with
corresponding darkino masses, on the precession $\Delta\phi$ (as defined
above) for the S2-star. For this task, we use all the publicly available
astrometric measurements (Do et al., 2019) which include data obtained from
the instruments NIRC on Keck I ($1995$–$2005$) and NIRC2 on Keck II
($2005$–$2018$). In fig. 1, we show $\Delta\phi$ as a function of the darkino
mass $m$, within a narrow particle mass range around $56$ keV/c2. In the BH
case, the precession of the orbit per cycle is given by the well-known
expression $\Delta\phi_{\rm BH}=6\pi GM_{\rm BH}/[c^{2}a(1-e^{2})]$, which is
always prograde ($\Delta\phi>0$) and for a $4.07\times 10^{6}M_{\odot}$ BH
mass and the S2 orbital parameters gives $\approx 12$ arcmin. In the DM case,
$\Delta\phi$ has no analytic expression, but the numerical solutions show that
it increases non-linearly from negative to positive (i.e. from retrograde to
prograde) with the darkino mass (see fig. 1).

Given the DM quantum core is surrounded by an extended and more diluted DM
mass, there are two competing effects in the RAR model which lead to three
different possibilities for the S2 orbit precession. The effects can be
roughly separated into a prograde effect caused by the gravitational potential
of the DM core lying inside the S2 pericentre (similar to a relativistic
point-like source), and a retrograde effect caused by the gravitational
potential generated by the extended mass between the pericentre radius
$r_{p}$, and the apocentre radius $r_{a}$, i.e. $\Delta M_{\rm
DM}=\int_{r_{p}}^{r_{a}}4\pi r^{2}\rho_{\rm DM}(r)dr$. Due to the scaling
behavior of the core-halo RAR profiles with the underlying four free
parameters of the theory (Argüelles & et al., 2018, 2019), both effects are
related to each other. That is, the larger the darkino mass the more compact
is the DM core (resembling more and more the BH case (Argüelles & et al.,
2018)), with consequent less extended mass fraction $\Delta M_{\rm DM}/M_{c}$.
The above leads to: (i) Prograde precession ($\Delta\phi>0$) as shown in fig.
1 and occurring for $m>56.4$ keV/$c^{2}$ with a corresponding DM core mass of
$M_{c}=3.50\times 10^{6}M_{\odot}$. In this case, the retrograde effect due to
the extended DM mass $\Delta M_{\rm DM}/M_{c}$ is not enough to compensate for
the prograde one; (ii) Null precession ($\Delta\phi=0$) occurring for $m=56.4$
keV/$c^{2}$ with $M_{c}=3.50\times 10^{6}M_{\odot}$ when the above two effects
balance each other; (iii) Retrograde precession ($\Delta\phi<0$), as shown in
fig. 1 for $m<56.4$ keV/$c^{2}$ when the fraction of the DM core mass $\Delta
M_{\rm DM}/M_{c}$ between $r_{p(S_{2})}$ and $r_{a(S_{2})}$ is large enough.
As detailed in table 1, such a threshold value of $\Delta M_{\rm DM}/M_{c}$
below which its associated retrograde effect becomes negligible (and thus the
precession is always prograde) is $\sim 0.1\%$.

Then, we proceed to compare the predictions on the periapsis precession of the
S2-orbit analogous to that of fig. 1, i.e. calculated at apocentre, but in the
plane of the sky ($\Delta\phi_{\rm sky}$) for $7$ different models: a
Schwarzschild BH, and $6$ RAR DM models for the Milky Way (i.e. already
reproducing its rotation curve) with $m$ from $55$ and up to $60$ keV/$c^{2}$.
The obtained values of $\Delta\phi_{\rm sky}$ are given in last column of
table 1, together with each set of free model parameters (e.g. $M_{\rm BH}$
for the BH model and $M_{c}$ for RAR at each given $m$) which best fits the
astrometry data of S2. Some a posteriori model properties including the DM
core radius $r_{c}$ and the extended DM mass fraction $\Delta M_{\rm
DM}/M_{c}$ are included in the table. The best-fit models are obtained
following the procedure of Becerra-Vergara et al. (2020), where the full set
of best-fit orbital parameters of S2 (for $m=56$ keV$/c^{2}$) can be also
found.

Figure 2 shows the relativistic precession of S2 projected orbit, in a right
ascension - declination plot. It can be there seen that while the positions in
the plane of the sky nearly coincide about the last pericentre passage in the
three models, they can be differentiated close to next apocentre.
Specifically, the upper right panel evidences the difference at apocentre
between the prograde case (as for the BH and RAR model with $m=58$
keV/$c^{2}$), and the retrograde case (i.e. RAR model with $m=56$
keV/$c^{2}$).

The same conclusion can be better evidenced, and quantified, by showing the S2
orbit precession effects in right ascension (X) as a function of time, as
predicted by each of the above two models. This is plotted in fig. 3 showing
the clear difference in X between two consecutive periods, each one starting
at about the pericentre passage. The first period is shown by the short-dashed
red curve, and the second period is shown by the long-dashed blue curve which
extends beyond the last pericentre passage, where the predicted precession in
each model is more evident. Indeed, the BH case (left pannel) shows a prograde
trend with a maximal shift of $\Delta$X $\approx 0.7$ mas at $2026.0$ with
respect to the former period (and being $\approx 0.4$ mas at $2021.2$); while
the RAR ($m=56$ keV/$c^{2}$) case (right panel) shows a retrograde trend with
a maximal shift of $\Delta$X $\approx 0.3$ mas at $2026.3$ with respect to the
former period (being $\Delta$X $\approx 0.2$ mas at $2021.2$).

Unfortunately, the publicly available data in the relevant time-window of fig.
3 are only a few data points within the $1st$ period (shown in blue dots and
obtained from Do et al. (2019)), where the large error bars impede to
discriminate between the models. Even if the improved S2 astrometric
resolution obtained by the GRAVITY Collaboration between $2018$ and $2019.7$
reaches the $0.1$ mas (though not yet public), it covers the range around
pericentre passage where the predicted $\Delta$X in both models is too low to
safely discriminate between these models.

Table 1: Comparison of the BH and RAR DM models that best fit of all the
publicly available data of the S2 orbit. The $2nd$ column shows the central
object mass, $M_{\rm CO}$. For the Schwarzschild BH model, $M_{\rm CO}=M_{\rm
BH}$, while for the RAR model, $M_{\rm CO}=M_{c}$, with $M_{c}$ the DM core
mass. The $3rd$ column shows the radius of the central object, $r_{c}$. For
the Schwarzschild BH model, $r_{c}$ is given by the event horizon radius,
$R_{\rm Sch}=2GM_{\rm BH}/c^{2}$. The $4th$ column shows the DM mass enclosed
within the S2 orbit, $\Delta M_{\rm DM}/M_{\rm CO}$. The best fitting
pericentre and apocentre radii of the S2 orbit are given, respectively, in the
$5th$ and $6th$ column. The values of the average reduced-$\chi^{2}$ of the
best fits, defined as in Becerra-Vergara et al., 2020, are given in the $7th$
column. The last two columns shows, respectively, the model predictions of the
periapsis precession of the real orbit, $\Delta\phi$, and of the sky-projected
orbit, $\Delta\phi_{\rm sky}$.

Model |  |  | $M_{\rm CO}$
---
$\left[10^{6}M_{\odot}\right]$
|  | $r_{c}$
---
$\left[\rm mpc\right]$
| $\Delta M_{\rm DM}/M_{\rm CO}$ |  |  | $r_{p}$
---
$\left[\rm as\right]$
|  | $r_{a}$
---
$\left[\rm as\right]$
|  | $\langle\bar{\chi}^{2}\rangle$
---
|  | $\Delta\phi$
---
$\left[\rm arcmin\right]$
|  | $\Delta\phi_{\rm sky}$
---
$\left[\rm arcmin\right]$
I | RAR ($m=55$ keV/$c^{2}$) |  | $3.55$ |  | $0.446$ |  | $1.39\times 10^{-2}$ |  | $0.01417$ |  | $0.23723$ |  | $2.9719$ |  | $-26.3845$ |  | $-32.1116$
II | RAR ($m=56$ keV/$c^{2}$) |  | $3.50$ |  | $0.427$ |  | $5.99\times 10^{-3}$ |  | $0.01418$ |  | $0.23618$ |  | $3.0725$ |  | $-4.9064$ |  | $-5.9421$
III | RAR ($m=57$ keV/$c^{2}$) |  | $3.50$ |  | $0.407$ |  | $2.21\times 10^{-3}$ |  | $0.01417$ |  | $0.23617$ |  | $3.2766$ |  | $4.8063$ |  | $5.8236$
IV | RAR ($m=58$ keV/$c^{2}$) |  | $3.50$ |  | $0.389$ |  | $7.13\times 10^{-4}$ |  | $0.01424$ |  | $0.23609$ |  | $3.2814$ |  | $7.7800$ |  | $9.4243$
V | RAR ($m=59$ keV/$c^{2}$) |  | $3.50$ |  | $0.371$ |  | $2.93\times 10^{-4}$ |  | $0.01418$ |  | $0.23613$ |  | $3.3356$ |  | $9.0456$ |  | $10.9613$
VI | RAR ($m=60$ keV/$c^{2}$) |  | $3.50$ |  | $0.355$ |  | $1.08\times 10^{-4}$ |  | $0.01423$ |  | $0.23610$ |  | $3.3343$ |  | $9.8052$ |  | $11.8764$
| BH |  | $4.07$ |  | $3.89\times 10^{-4}$ |  | $0$ |  | $0.01427$ |  | $0.23623$ |  | $3.3586$ |  | $11.9501$ |  | $14.4947$

##  3 Discussion and Conclusions

In this Letter, we have demonstrated that unlike the classical Schwarzschild
BH prograde precession for the S2 orbit, when assuming a quantum DM nature for
Sgr A* according to the RAR model, it can be either retrograde or prograde
depending on the amount of DM mass enclosed within the S2 orbit. Such a trend,
in turn, depends on the darkino mass. We have clearly shown that within
current astrometric resolution for S2, upcoming data close to the next
apocentre passage have a good chance to validate one of the above predicted
directions of the orbital precession. Such a confirmation is essential to
unveil the classical versus the quantum nature of Sgr A* .

Finally, we outline some astrophysical and cosmological consequences of the
RAR DM model, in addition to the present results. The RAR model predicts a
mechanism for supermassive BH formation in the high-redshift Universe when the
dense core of DM reaches its critical mass for gravitational collapse
(Argüelles & et al., 2021). For a darkino mass of about $50$ keV/$c^{2}$, such
a critical mass is $\sim 10^{8}{M_{\odot}}$. This numerical value can be
affected by additional accretion of baryonic matter on the darkino core.
Furthermore, the RAR model provides as well the quantum nature and mass of the
DM particles, and the morphology of the DM profiles on inner halo scales. As
recently shown in Argüelles & et al. (2021), the formation of core - halo RAR
DM profiles is predicted within violent relaxation mechanisms with the
following key properties: (i) they form and remain stable within cosmological
time-scales; (ii) they are Universal, ranging from the scales of dwarfs up to
the galaxy cluster scales (Argüelles & et al., 2019); and (iii) on inner halo
scales, the RAR density profiles develop an extended plateau (similar to
Burkert profiles), thereby not suffering from the core-cusp problem associated
with the standard $\Lambda$CDM cosmology (see e.g. Bullock & Boylan-Kolchin,
2017).

Figure 2: Relativistic precession of S2 in the projected orbit on the plane of
the sky as predicted in the BH and RAR DM models. While it is prograde for the
BH and RAR ($m=58$ keV$/c^{2}$) (in dashed black and green respectively), it
is retrograde for the RAR DM model ($m=56$ keV$/c^{2}$) (in dashed red). The
solid (theoretical) curves and gray (data) points correspond to the first
period ($\approx 1994$–$2010$) while the dashed (theoretical) curves and cyan
(data) points to the second period ($\approx 2010$–$2026$). Right panels: zoom
of the region around apocentre (top panel) and pericentre (bottom panel). The
astrometric measurements are taken from Do et al. (2019). Figure 3:
Relativistic precession of S2 as manifested in the right ascension as a
function of time after last pericentre passage, where effects are more
prominent. BH model (Left panel) and RAR model for $m=56$ keV$/c^{2}$ (Right
panel).

## Acknowledgements

C.R.A was supported by CONICET of Argentina, the ANPCyT (grant
PICT-2018-03743) and ICRANet. E.A.B-V. thanks financial support from
COLCIENCIAS, ICRANet–IRAP-PhD. and UIS.

## Data Availability

The astrometric data used in this work were obtained from Do et al. (2019),
and the data here generated are available in Table 1.

## References

  * Argüelles & et al. (2016) Argüelles C. R., et al. 2016, J. Cosmol. Astropart. Phys., 4, 038
  * Argüelles & et al. (2018) Argüelles C. R., et al. 2018, , 21, 82
  * Argüelles & et al. (2019) Argüelles C. R., et al. 2019, , 24, 100278
  * Argüelles & et al. (2021) Argüelles C. R., et al. 2021, MNRAS, 502, 4227
  * Becerra-Vergara et al. (2020) Becerra-Vergara E. A., Argüelles C. R., Krut A., Rueda J. A., Ruffini R., 2020, A&A, 641, A34
  * Becerra-Vergara et al. (2021) Becerra-Vergara E. A., Argüelles C. R., Krut A., Rueda J. A., Ruffini R., 2021, MNRAS, 505, L64
  * Boehle et al. (2016) Boehle A., et al., 2016, ApJ, 830, 17
  * Bullock & Boylan-Kolchin (2017) Bullock J. S., Boylan-Kolchin M., 2017, ARA&A, 55, 343
  * Do et al. (2019) Do T., et al., 2019, Science, 365, 664
  * Eckart & Genzel (1997) Eckart A., Genzel R., 1997, MNRAS, 284, 576
  * Fragione & Loeb (2020) Fragione G., Loeb A., 2020, ApJ, 901, L32
  * Genzel & et al. (2010) Genzel R., et al. 2010, Rev. Mod. Phys., 82, 3121
  * Ghez & et al. (1998) Ghez A. M., et al. 1998, ApJ, 509, 678
  * Ghez & et al. (2005) Ghez A. M., et al. 2005, ApJ, 620, 744
  * Ghez & et al. (2008) Ghez A. M., et al. 2008, ApJ, 689, 1044
  * Gillessen & et al. (2009) Gillessen S., et al. 2009, ApJ, 692, 1075
  * Gillessen et al. (2017) Gillessen S., et al., 2017, ApJ, 837, 30
  * Gómez & Rueda (2017) Gómez L. G., Rueda J. A., 2017, Phys. Rev. D, 96, 063001
  * Gómez et al. (2016) Gómez L. G., Argüelles C. R., et al. 2016, Phys. Rev. D, 94, 123004
  * Gravity Collaboration et al. (2018a) Gravity Collaboration et al., 2018a, A&A, 615, L15
  * Gravity Collaboration et al. (2018b) Gravity Collaboration et al., 2018b, A&A, 618, L10
  * Gravity Collaboration et al. (2020) Gravity Collaboration et al., 2020, A&A, 636, L5
  * Matsumoto et al. (2020) Matsumoto T., Chan C.-H., Piran T., 2020, MNRAS, 497, 2385
  * Parsa & et al. (2017) Parsa M., et al. 2017, ApJ, 845, 22
  * Penacchioni & et al. (2020) Penacchioni A. V., et al. 2020, , 80, 183
  * Ruffini et al. (2015) Ruffini R., Argüelles C. R., Rueda J. A., 2015, MNRAS, 451, 622
  * Schödel et al. (2002) Schödel R., et al., 2002, Nature, 419, 694
  * Strehmel (1988) Strehmel K., 1988, , 68, 260
  * Virtanen et al. (2020) Virtanen P., et al., 2020, Nature Methods, 17, 261
  * Yunis & et al. (2020) Yunis R., et al. 2020, , 30, 100699


# Quantum Sparse Coding and Decoding Based on Quantum Network

Xun Ji  National Laboratory of Solid State Microstructure, School of Physics,
and Collaborative Innovation Center of Advanced Microstructures, Nanjing
University, Nanjing 210093, China  Institute for Brain Sciences and Kuang
Yaming Honors School, Nanjing University, Nanjing 210023, China  Hefei
National Laboratory, Hefei 230088, China  Qin Liu  National Laboratory of
Solid State Microstructure, School of Physics, and Collaborative Innovation
Center of Advanced Microstructures, Nanjing University, Nanjing 210093, China
Institute for Brain Sciences and Kuang Yaming Honors School, Nanjing
University, Nanjing 210023, China  Hefei National Laboratory, Hefei 230088,
China  Shan Huang  National Laboratory of Solid State Microstructure, School
of Physics, and Collaborative Innovation Center of Advanced Microstructures,
Nanjing University, Nanjing 210093, China  Institute for Brain Sciences and
Kuang Yaming Honors School, Nanjing University, Nanjing 210023, China  Hefei
National Laboratory, Hefei 230088, China  Andi Chen  National Laboratory of
Solid State Microstructure, School of Physics, and Collaborative Innovation
Center of Advanced Microstructures, Nanjing University, Nanjing 210093, China
Institute for Brain Sciences and Kuang Yaming Honors School, Nanjing
University, Nanjing 210023, China  Hefei National Laboratory, Hefei 230088,
China  Shengjun Wu<EMAIL_ADDRESS>National Laboratory of Solid State
Microstructure, School of Physics, and Collaborative Innovation Center of
Advanced Microstructures, Nanjing University, Nanjing 210093, China  Institute
for Brain Sciences and Kuang Yaming Honors School, Nanjing University, Nanjing
210023, China  Hefei National Laboratory, Hefei 230088, China

###### Abstract

Sparse coding provides a versatile framework for efficiently capturing and
representing crucial data (information) concisely, which plays an essential
role in various computer science fields, including data compression, feature
extraction, and general signal processing. In this study, we propose a
symmetric quantum neural network for realizing sparse coding and decoding
algorithms. Our networks consist of multi-layer, two-level unitary
transformations that are naturally suited for optical circuits. Each gate is
described by two real parameters, corresponding to reflectivity and phase
shift. Specifically, the two networks can be efficiently trained together or
separately using a quantum natural gradient descent algorithm, either
simultaneously or independently. Utilizing the trained model, we achieve
sparse coding and decoding of binary and grayscale images in classical
problems, as well as that of complex quantum states in quantum problems
separately. The results demonstrate an accuracy of 98.77% for image
reconstruction and a fidelity of 97.68% for quantum state revivification. Our
quantum sparse coding and decoding model offers improved generalization and
robustness compared to the classical model, laying the groundwork for
widespread practical applications in the emerging quantum era.

Introduction
In the classical field of machine learning and data analysis algorithms, the
corresponding machine learning task is accomplished by combining supervised or
unsupervised training on data WOS:000355286600030 . In quantum machine
learning, various quantum versions of machine learning algorithms have also
been proposed and developed immediately, including quantum support vector
machines, quantum principal component analysis, quantum neural networks (QNN),
and other quantum machine learning algorithms WOS:000410555900032 ;
WOS:000341820700013 ; WOS:000500574300022 . Additionally, for rapidly evolving
quantum neural network algorithms, classical optimizers are utilized to train
multi-layer parameterized quantum gates in order to achieve desired learning
tasks WOS:000993620700002 . Therefore, combined with Classical Sparse Coding
(CSC) and quantum computation theory, an efficient quantum algorithm based on
QNN can be designed to realize quantum sparse coding and decoding
WOS:000493128300001 ; WOS:A1995QT40100017 ; WOS:000261782000008 ;
bellante2022quantum .

Sparse coding and decoding refers to compressing high-dimensional data sets
into their lower-dimensional representations sparsely and reconstructing
higher-dimensional data sets from low-dimensional ones WOS:000961147200001 ;
WOS:000406868800017 ; WOS:000258641500006 , which plays a crucial role in the
fields of image compression, storage and processing WOS:000085444700052 ;
WOS:000486237600006 ; WOS:000277884900014 . Sparse coding originates from the
fact that the receptive field of the visual stripe cortex produces a sparse
response to visual information. To be specific, most neurons of the visual
stripe cortex are in a static resting state, while a small number of neurons
are in the stimulated state WOS:A1996UQ65700051 . Mathematically, based on
data structure analysis, digital image processing, and advanced algebra, CSC
algorithms are developed gradually, where an overcomplete dictionary set is
trained by various training algorithms, and sparse representation is a linear
combination of the overcomplete dictionary set and active neurons in a high-
dimensional space originally with redundant information WOS:000277884900014 .
More explicitly, the sparse solutions of underdetermined equations are able to
compress the data to a certain extent allowing little information loss of
restoration. Currently, CSC algorithms have been implemented by hardware
friendly, owing to their simple linear matrix operation in classical computer.

In contrast, quantum computing is an emerging frontier with higher information
security and faster parallel acceleration. Specifically, quantum algorithms
are expected for its potential advantages in quantum transmission, storage and
encryption WOS:000343620500001 ; WOS:000431301800015 ; WOS:000454369600010 ;
WOS:000514356400004 ; WOS:000209372300002 ; WOS:000340140200011 ;
WOS:000646064000002 ; WOS:000888558600009 ; WOS:000685625800001 ;
WOS:000935994100004 . Therefore, with the breakthrough of quantum machine
learning algorithms and quantum circuits WOS:000410555900033 ;
WOS:000390793900027 ; WOS:000476555600001 , more cutting-edge quantum
algorithms are gradually moving toward hardware WOS:000940796200001 ;
WOS:000711864600001 ; WOS:000367200400001 ; WOS:000340611600001 ;
WOS:A1994NV63100015 ; WOS:000830702800001 ; WOS:000604141000011 ;
WOS:000471037100002 ; WOS:000491132700075 ; WOS:000467374300005 ;
WOS:000466034400001 ; WOS:000457547900068 , which is currently a possible
development that challenges Moore’s Law WOS:000888210300020 . Meanwhile, there
is no efficient CSC algorithm to handle quantum states. Inspired by CSC
algorithms WOS:000486237600006  and quantum circuit models WOS:000390793900027
; WOS:A1995QT40100017 , we propose a quantum algorithm named Quantum Sparse
Coding and Decoding (QSCD), which can sparsely code quantum states from high
to low dimensional Hilbert space and then decode them inversely. Specifically,
the quantum networks are trained by gradient-based descent method
WOS:000444202100003 ; WOS:000246314600001 ; WOS:001001538500030 , and can be
realized by universal multi-port design interferometers in optical quantum
circuits WOS:000390793900027 ; WOS:000316614600026 ; WOS:000289982600014 . The
simulations fully demonstrate that our QSCD algorithm is able to deal with the
real and complex quantum states efficiently, which can be applied to further
industrial problems as a cutting-edge technology.

Figure 1: The QSCD algorithm for grayscale image reconstruction. In the one
iteration, for image data, \scriptsize{1}⃝ the classical information in a
binary or grayscale image is converted into a column vector $X_{m}$ with
$X_{m}\in[0,1]$, encoded into amplitude $r_{mn}\in[0,1]$ and phase
$\phi_{mn}\in[0,2\pi]$ of the real quantum state with $\phi_{mn}=0$.
\scriptsize{2}⃝ The coded quantum state $\left|\psi_{m}\right\rangle$ is input
into the coding and decoding network. \scriptsize{3}⃝ Then according to the
measurement of the output real state, the amplitude is inversely decoded into
the classical information $\hat{X}_{m}$ with reconstruction image pixel
$\hat{x}_{mn}$. Similarly, for complex quantum states
$\sum_{n=0}^{N-1}r_{mn}e^{i\phi_{mn}}|n\rangle$ in polar coordinates,
corresponding to amplitude $r_{mn}$ and phase $\phi_{mn}$ in (a), it also can
be directly input into the network. During the training process, (b) the
probability amplitude $\left|R_{mn}\right|^{2}$ can be measured, which is
shown in the polar coordinate form in the framework. Surely, for the trained
quantum network, the sparse coding and decoding of the quantum states can be
achieved without immediate measurement.

Results
Preliminary. In classical information processing, data bits are encoded into
binary electrical signals such as the “high” and “low” values of electric
potential, facilitating convenient sparse representation and retrieval based
on electrical circuits. As for the quantum information processing, the quantum
counterpart of bits are two-dimensional quantum states, that is, quantum bits
(qubits). Physical realizations of qubits include two-level atoms, two
distinct optical modes, etc. Taking the grayscale image reconstruction as an
example, our proposal of QSCD is illustrated in Fig. 1. Consider $M$ grayscale
images consisting of $N$ pixels, and let $x_{mn}\in[0,1]$ denote the $n$th
pixel of the $m$th grayscale image. From each grayscale image one then obtains
a normalized $N$-dimensional row vector $\left\\{r_{mn}\right\\}$, where, with
$\sigma_{m}=\sqrt{\sum_{n}(x_{mn})^{2}}$,

$r_{mn}=\frac{x_{mn}}{\sigma_{m}}$ (1)

are the normalized pixels which satisfy $\sum_{n=0}^{N-1}r_{mn}^{2}=1$ for all
$m=1,\cdots,M$. It is worth noting that $\left\\{r_{mn}\right\\}$ alone does
not contain the complete information of the original pixels, but when combined
with the normalization factor $\sigma_{m}$, all the pixels of the $m$th
grayscale image can be fully reconstructed.

In quantum sparse coding of grayscale images, we only need to focus on the
normalized pixel vector $\left\\{r_{mn}\right\\}$ as it contributes to almost
all the cost associated with image transmission and storage. It is convenient
to write a general $N$-dimensional quantum state in the computational basis as
follows

$\displaystyle\left|\psi\right\rangle=\sum_{n=0}^{N-1}r_{n}e^{i\phi_{n}}|n\rangle.$
(2)

Here, each basis state $|n\rangle\in\\{|00\cdots 00\rangle,\ |00\cdots
01\rangle,\ \ldots,\\\ \ |11\cdots 11\rangle\\}$ corresponds to the binary
representation of an integer $n\in[0,N-1]$, and the expansion coefficients are
normalized, $\sum_{n}r_{n}^{2}=1$. In this way, classical information can be
properly encoded into the expansion coefficients $\\{r_{n}e^{i\phi_{n}}\\}$ of
$\ket{\psi}$ which, further serves as an input of our quantum sparse coding
network. In particular, the quantum representation of normalized pixel vectors
$\\{\psi_{m}\\}$ now become
$\ket{\psi_{m}}=\sum_{n}r_{mn}e^{i\phi_{mn}}|n\rangle$, with phase parameters
being 0, $\phi_{mn}=0$.

We proceed to detail our network architecture. Our sparse coding network aims
to transform a collection of $N$-dimensional quantum states into lower
dimensional ones while preserving, as much as possible, the information
encoded in the input states. Considering that distinct classical information
must be encoded in orthogonal states to be perfectly distinguishable under
quantum measurements, our basic assumption in this work is that a coding
network preserves orthogonality. In other words, we focus on quantum networks
that implement unitary transformations. Furthermore, our main interest is in
two particular types of quantum network structures, called Order type and
Cross type. Order type links quantum gates sequentially, while Cross type
interconnects them in a cross-pattern. Numerical analyses show Order type
excels at lower layers, whereas Cross type is better for deeper networks (see
supplementary information I).

General unitary transformations on an $N$-dimensional Hilbert space
$\mathcal{H}_{N}$ can be factored into a series of unitaries on 2-dimensional
subspaces of $\mathcal{H}_{N}$ (single-qubit gates), which leave quantum
states in the respective $(N-2)$-dimensional complementary subspaces
invariant. Each specific factoring then determines a specific network
structure, and the network parameters are exactly the variables describing
individual single-qubit unitary gates. Notably, the network structures based
on different ways of factoring unitary transformations may have different
advantages and limitations. In the following, our discussions will revolve
around the optimal factoring proposed in Cross-type network (see supplementary
information I), which is comparatively more efficient for deep networks. Its
physical realization based on optical circuits consists of $l_{E}$ layers of
unitary gates on two neighboring optical modes, involving approximately
$(N-1)l_{E}$ unitary gates in total WOS:000390793900027 . More specifically, a
unitary gate $U_{n}$ on two optical modes $\\{\ket{n},\ \ket{n+1}\\}$ can be
implemented by a phase shifter at one mode (with phase parameter
$\alpha_{n}\in[0,2\pi]$) followed by a two-mode Mach-Zehnder interferometer
(with parameter $\theta_{n}\in[0,\pi/2]$)

$\displaystyle
U_{n}\ket{n}=e^{i\alpha_{n}}(\cos\theta_{n}|n\rangle+\sin\theta_{n}|n+1\rangle),$
$\displaystyle
U_{n}\ket{n+1}=-\sin\theta_{n}|n\rangle+\cos\theta_{n}|n+1\rangle.$ (3)

Each layer of our coding network consists of $N/2$ parallel single-qubit
unitary gates on the optical modes $\\{\ket{2(k-1)},\ket{2k-1}\\}\
(k=1,2,\cdots,N/2)$, followed by another $N/2-1$ parallel single-qubit unitary
gates on the modes $\\{\ket{2k-1)},\ket{2k}\\}\ (k=1,2,\cdots,N/2-1)$ (see
Fig. 1 for an example and supplementary information I for more details). Then,
the $l$-th layer of our coding network implements the transformation

$\displaystyle U_{E}^{(l)}=$ $\displaystyle U_{0}U_{2}\cdots
U_{N-2}U_{1}U_{3}\cdots U_{N-3}$ $\displaystyle=$
$\displaystyle\prod_{k=1}^{N-1}U_{k}\left(\theta_{k}^{l},\alpha_{k}^{l}\right),$
(4)

The overall coding network then essentially implements $l_{E}$ unitary
transformations consecutively

$\displaystyle T_{E}=U_{E}^{(l_{E})}U_{E}^{(l_{E}-1)}\cdots
U_{E}^{(1)}:=\prod_{l=1}^{l_{E}}U_{E}^{(l)},$ (5)

which is described by $2l_{E}\times(N-1)$ real parameters WOS:000390793900027
. In supplementary I, we also discuss another network structure and compare it
with the above one numerically.

As for the decoding network, a direct choice is simply the mirror inversion of
the coding network, which performs the inverse transformation to recover the
initial states from the output of the coding network. However, if some input
state (2) is not transformed into the output space completely, say a
$d$-dimensional Hilbert space $\mathcal{H}_{d}$ spanned by the last $d$
optical modes, then the actual outputs are described by the (unnormalized)
states

$\displaystyle\ket{\chi_{m}}=P_{0}T_{E}|\psi_{m}\rangle=P_{0}T_{E}\sum_{n=0}^{N-1}r_{mn}e^{i\phi_{mn}}|n\rangle,$
(6)

with $P_{0}=\sum_{n=0}^{d-1}|n\rangle\langle n|$ the projector onto
$\mathcal{H}_{d}$. This projector is critical for realizing sparse coding. It
retains prominent features of the initial set of states while discarding
unimportant information. In accordance, input photons of the decoding network
are prepared into the normalized states
$\\{\braket{\chi_{m}}{\chi_{m}}^{-\frac{1}{2}}\ket{\chi_{m}}\\}$ which, after
some decoding transformation $T_{D}$, become

$\begin{split}\left|\Psi_{m}\right\rangle=&\frac{1}{\sqrt{\braket{\chi_{m}}{\chi_{m}}}}T_{D}\ket{\chi_{m}}=\sum_{n=0}^{N-1}R_{mn}e^{i\varphi_{mn}}|n\rangle.\end{split}$
(7)

In the above, $\\{R_{mn}\\}$ are real parameters, and $R_{mn}^{2}$ is the
probability of detecting a photon at the $n$th output mode when prepared in
the $m$th initial state.

We introduce the overall loss function $L$ for reconstructing the initial
states $\\{\ket{\psi_{m}}\\}$ from outputs of the decoding network as follows

$\displaystyle L=\sum_{m=1}^{M}\sum_{n=0}^{N-1}\left(JJ^{*}\right),$ (8)

where $J=R_{mn}e^{i\varphi_{mn}}-r_{mn}e^{i\phi_{mn}}$. With this loss
function, we can update the parameters in our network during the training
process to minimize potential errors. In the ideal case $L=0$, the information
encoded in the initial states can be fully extracted without error. If the
classical information is encoded only in the real coefficients $\\{r_{mn}\\}$
of the initial states $\\{\ket{\psi_{m}}\\}$ (2) and the decoding network
implements the inverse transformation, a simpler and more convenient loss
function is

$\displaystyle
L_{inv}=1-\braket{\chi_{m}}{\chi_{m}}=\braket{\psi_{m}}{T_{E}^{-1}P_{1}T_{E}}{\psi_{m}},$
(9)

with $P_{1}=\sum_{n=d}^{N-1}|n\rangle\langle n|$ denoting the projection onto
the subspace of $\mathcal{H}_{N}$ that is complementary to the output space
$\mathcal{H}_{d}$. Note that $P_{0}$ and $P_{1}$ sum up to the identity
operator on $\mathcal{H}_{N}$ and quantum states are normalized
$\braket{\psi_{m}}{T_{E}^{-1}P_{0}T_{E}}{\psi_{m}}+\braket{\psi_{m}}{T_{E}^{-1}P_{1}T_{E}}{\psi_{m}}=1$,
thus $L_{inv}$ is exactly the probability that output photons are not detected
at the last $d$ modes. $L_{inv}=0$ necessarily means that the encoding network
successfully transforms all the initial states into the output space
$\mathcal{H}_{d}$, $\ket{\chi_{m}}=T_{E}\ket{\psi_{m}}$, and the decoding
network would perfectly recover those initial states.

We remark here that if the initial states span a space with a dimension larger
than the dimension $d$ of the output space, the loss function $L_{inv}$ would
never approach 0 in the training process. Consequently, there is also no
reason to believe that a decoding network implementing the inverse
transformation $T_{D}=T_{E}^{-1}$ is optimal for minimizing $L_{inv}$ or,
equivalently, maximizing the fidelity between the initial states and final
states. This is in fact a much more general situation. To mitigate error, we
may properly train the decoding network to exploit, besides the features of
individual input states, also the structure of the input set. Moreover,
properly extending the depths of our coding and decoding networks is expected
to further enhance the overall fidelity.

In conclusion, we fashion the decoding network of the QSCD algorithm either by
inverting the coding network or through parameter training of the decoding
network. In the case of the decoding network with parameter training, the QSCD
algorithm can be smoothly implemented in experiments, ensuring that parameter
values remain within their designated range. Additionally, our approach to
updating network parameters allows for concurrent updating of both the sparse
coding network and the decoding network, solely through measuring the output
states of the decoding network, eliminating the need for intermediate state
measurements.

Image Reconstruction. For sparse coding and decoding of classical image
information, the QSCD can be realized more efficiently. As shown in Fig. 2,
firstly, the $D_{1}\times D_{2}$-dimensional binary or grayscale image is
converted into a column vector $X_{m}$ with $N\times 1$ dimension $\left(N\geq
D_{1}D_{2}>N/2,N=2^{q},q\in\mathbb{N}^{+}\right)$. Further, $X_{m}$ is encoded
to a $N$-dimensional real quantum state $\left(\forall
j\in\left[D_{1}D_{2},N-1\right],x_{mn}\equiv 0\right)$, so $M$ pictures are
encoded to be the $N\times M$-dimensional matrix $X$. With
$\sum_{n=0}^{N-1}\left(r_{mn}\right)^{2}=1$ and setting all $\phi_{mn}=0$, the
encoded quantum state can be represented as
$\left|\psi_{m}\right\rangle=\sum_{n=0}^{N-1}r_{mn}|n\rangle$ (see
supplementary information IV and V). The probability amplitude is equal to the
normalized value of the image grayscale value corresponding to Eq. (1). The
code $r_{mn}$ can be obtained to facilitate the preparation of quantum states.

To see the performance of our network numerically, next we apply it to the
$5\times 5$ binary images of the 26 English capital letters as shown in Fig.
2a. Each binary image requires 5 qubits to be faithfully represented
$\left(D_{1}D_{2}=25,N=2^{5}\right)$. We choose a coding network with depth
$l_{E}=20$ and a decoding network with depth $l_{D}=25$, the number of sparse
coding channels is $d=4$. Thus, the coding network and decoding network
involve $480$ and $600$ rotation parameters $\theta_{k}^{l}$, respectively
(see supplementary information II). Further, we set the learning rate to be
$\eta=0.01$ and update the network parameters through 150 iterations. In each
iteration, the output states of the decoding network are described by Eq. (7),
with which we are able to compute the respective loss function according to
Eq. (8). After each iteration, we then utilize the Quantum Natural Gradient
Descent (QNGD) algorithm (see supplementary information III) to update the
network parameters to reduce loss. The evolution of the real quantum states
can be implemented by optical circuits to train and adjust the quantum gate
parameters (see Methods). On the basis of the decrease of the loss function
(Fig. 2c.), the reconstruction loss gradually tends to 0, and the gradient
renewal of $\theta$ gradually approaches 0 (Fig. 2d), with the parameters
$\theta$ gradually leveling off in the ranges of
$\left[0,\frac{\pi}{2}\right]$. Eventually, the quantum network training is
completed. The measurement results of output quantum states are converted to
classical data $\hat{x}_{mn}$ (Fig. 2b):

$\displaystyle\hat{x}_{mn}=\sigma_{m}R_{mn},$ (10)

where $\sigma_{m}=(\sum_{n}x_{mn}^{2})^{1/2}$ is normalization factor of the
respective pixel vector $X_{m}$ as defined in Eq. (1). The implementations
mean that the classical information can be sparsely encoded and decoded
through the QSCD algorithm, where the data flow is $X_{m}\rightarrow
r_{mn}\rightarrow\left|\psi_{m}\right\rangle\rightarrow
T_{D}P_{1}T_{E}\left|\psi_{m}\right\rangle\rightarrow
R_{mn}\rightarrow\widehat{X}_{m}$. Undoubtedly, it also makes sense to achieve
sparse coding and decoding of high-frequency or low-frequency signals, which
provides effective ideas for pattern recognition.

Figure 2: Image reconstruction based on QSCD algorithm. $\mathbf{a}$ The input
image with binary value in $\\{0,1\\}$. $\mathbf{b}$ The output image with
grayscale value in the range of $[0,1]$. During actually measuring the output
quantum state in each iteration, the output of each iteration is always a real
number in the range of $[0,1]$ owing to the floating parameters. Therefore,
the reconstruction results of binary images are gray images, which illustrates
the training adaptability of the network. $\mathbf{c}$ The update gradients of
$\theta$ in 300 training iterations. At about the 100th training iteration,
the quantum gate parameters tend to be stable with the gradients almost 0.
$\mathbf{d}$ The distribution of optimal $\theta$. This distribution conforms
to a normal distribution. $\mathbf{e}$ The loss of training network with
$N\times M$-dimensional matrix $X$. The minimum MSE loss $L$ is 0.00873.
$\mathbf{f}$ The training process of the sample letter ”Y”
$\left(X_{25}\right)$. The probability amplitude $R_{25}$ eventually tends to
be in the range of $[-1,1]$. $\mathbf{g}$ The similarity of overall samples
(”A”-”Z”) between input images and output images in each iteration. After 300
training iterations that run for $895.234\mathrm{\leavevmode\nobreak\ s}$ (CPU
runs), the final similarity between input and output images is $98.77\%$.
Figure 3: Sparse coding and decoding for complex quantum states. $\mathbf{a}$
The input and output quantum states. The amplitude and phase of the input and
output quantum states are presented by measurement in polar coordinates.
$\mathbf{b}$ The amplitude error $E_{amp}$ and phase error $E_{pha}$ in
training iterations. The minimum amplitude error $\min E_{amp}=1.01\times
10^{-4}$, The minimum phase error $\min E_{pha}=0.0143$. $\mathbf{c}$ The
complex error in polar coordinates. The minimum complex error is $\min
E_{{complex}}=(0.99+i)10^{-4}$. $\mathbf{d}$ The amplitude and phase error of
50 quantum state samples. The amplitude and phase error of 50 quantum state
samples are given by calculation. $\mathbf{e}$ ALL of $\theta$ and $\alpha$
and their gradients in the decoding network. $\mathbf{f}$ The distribution of
optimal $\theta$ and $\alpha$. $\mathbf{g}$ The fidelity of training samples.
The fidelity of the final quantum states is $97.68\%$.

Sparse Coding and Decoding for Complex Quantum States. For solving quantum
problems, sparse coding and decoding of quantum states play a significant role
in quantum cryptography. we achieve the simulation of sparse coding and
decoding for complex quantum states in this section. Firstly, we generate 50
3-qubit quantum states in 8-dimensional Hilbert space ( $q=3,N=8,M=50$ ) as
samples, and then they are input into the $T_{E}$ and $T_{D}$ (or $T_{E}^{-1}$
) to train parameters. Set network parameters:
$l_{E}=10,l_{D}=12,\eta=0.01,d=4$ and $Ite=500$. By measuring the output
states of the decoding network in each training iteration, the loss is
calculated, so as to update the quantum gate parameters in Eq. (7). Obviously,
we need to train both the phase shift $\alpha_{k}^{l}$ and reflectivity
$\cos\theta_{k}^{l}$ (see supplementary information II, Fig. 3a). Therefore,
the quantum network needs to be trained with $140$ parameters
$\left(\theta_{k}^{l},\alpha_{k}^{l}\right)$ of the coding network and $168$
parameters $\left(\hat{\theta}_{k}^{l},\hat{\alpha}_{k}^{l}\right)$ of the
decoding network. In the quantum sparse coding network $T_{E}$, only 4 output
optical circuits are connected to the decoding network $T_{D}$. The amplitude
error $E_{\rm amp}$ and phase error $E_{\rm pha}$ are defined as $E_{\rm
amp}=$ $\sum_{m=1}^{M}\sum_{n=0}^{N-1}\left(R_{mn}-r_{mn}\right)^{2},E_{\rm
pha}=\sum_{m=1}^{M}\sum_{n=0}^{N-1}\left(\varphi_{mn}-\phi_{mn}\right)^{2}$.
As shown in Fig. 3b, Fig. 3c and Fig. 3d, the $R_{mn}$ and $\varphi_{mn}$ of
the output quantum states are measured, and the error between output and input
quantum states is obtained. Obviously, the initial phase error is
significantly larger than the amplitude error (Fig. 3b), because for each
quantum state in a quantum circuit, the probability amplitude $R_{mn}$ is much
less than 1 (even most of which is in the range of $[0.1,0.2])$. Furthermore,
$R_{mn}$ and $\varphi_{mn}$ error of the final states will gradually range to
0 during continuous training. Finally, after 500 training iterations, the
output states are similar to the input states in amplitude and phase. Another
more intuitive error in polar coordinates in Fig. 3c, represents the complex
error $\left(E_{{\rm complex}}=E_{\rm amp}e^{iE_{\rm pha}}\right)$, which
gradually tends to 0 with the slope around 0 in Fig. 3c.After training, the
optimal results are obtained, in which input states and output states are
similar in Fig. 3a. Therefore, the error of the ultimate reconstruction will
be calculated, and then $E_{\rm amp}$ and $E_{\rm pha}$ of the overall samples
are extremely close to 0 in Fig. 3d. For the QSCD algorithm, only $R_{mn}$ and
$\varphi_{mn}$ of the output quantum states are measured. Therefore, sparse
coding and decoding of quantum states are able to be implemented in integrated
optical circuits, simutaneously the elimination of the intermediate
measurement can greatly reduce the system error. Using QSCD to achieve sparse
coding and decoding of quantum states guarantees the transmission efficiency
of quantum information.

Discussion
Generally, the QSCD algorithm can be implemented in physical hardware
efficiently. It can achieve sparse coding and decoding by encoding classical
image data (derived from the pixels of binary and grayscale images) into the
amplitude of real quantum states. Furthermore, complex quantum states can also
be sparsely coded and decoded by the QSCD algorithm through quantum unitary
transformation and adaptive quantum natural gradient descent algorithm.

The superiority of the QSCD algorithm over traditional QNN based on
Hamiltonian evolution is embodied in its lower computation complexity, better
hardware-friendly performance, and ability to deal with higher dimensional
information. The current optical quantum computing devices are more suitable
for sparse quantum unitary transformation in our QSCD network, which increases
the experimental efficiency and is expected to solve more quantum problems
such as calculating eigenstates. Moreover, the differences between QSCD and
CSC root in their computation frameworks, where the QSCD is constructed by
multiple sparse matrices with the same dimensions, and the CSC is composed of
one matrix full of weight parameters. In more detail, the two real parameters
are updated together in each sparse matrix in the QSCD algorithm,
nevertheless, the full weights are adjusted in a dictionary set in the CSC
algorithm.

Methods
Quantum Gate Design. In this paper, the QSCD algorithm is realized through
quantum optical circuits. Specifically, a universal multi-port interferometer
can be programmed to achieve any linear transformation between two channels by
implementing a quantum gate $U_{(k,k+1)}$ in port $k$ and $k+1$, abbreviated
to $U_{k}$. These interferometers typically consist of a regular grid of beam
splitters and phase shifters and are manufactured directly with an integrated
photon architecture and off-the-shelf scalability. At present, the standard
design of universal multiport interferometers is based on the decomposing from
any $N\times N$ unitary matrix to a linear combination of two-dimensional
beam-splitting transform sequence WOS:000390793900027 . Compared with the
traditional design, the main advantage of this design is only half the optical
depth and more anti-optical loss (see supplementary information I).

$\displaystyle{\bf Input:}\ {X,l_{E},l_{D}\text{ to get
}[M,N]\leftarrow\operatorname{size}(X)}$ $\displaystyle{\bf Output:}\
{\left(\theta_{k}^{l_{E}},\alpha_{k}^{l_{E}}\right),\left(\theta_{k}^{l_{D}},\alpha_{k}^{l_{D}}\right),g_{E},g_{D},L,\widehat{X}_{i}}$
$\displaystyle{\bf Initialize}\
(\theta,\alpha)\leftarrow(\pi/3,2\pi/3),\text{Ite}=150,\eta=0.01,d=4$
$\displaystyle\textbf{for}\ {m=1:M}$
$\displaystyle\left|\psi_{m}\right\rangle\leftarrow X_{m}$ end
$\displaystyle\left[\Big{(}\theta_{k}^{l_{E}},\alpha_{k}^{l_{E}}\Big{)},\left(\theta_{k}^{l_{D}},\alpha_{k}^{l_{D}}\right),g_{E},g_{D},L\right]$
$\displaystyle=\operatorname{trainQSCD}\left(l_{E},l_{D},|\psi\rangle,(\theta,\alpha),{Ite},\eta,d\right)$
$\displaystyle\textbf{For}\ {m=1:M}$
$\displaystyle\left|\hat{\Psi}_{m}\right\rangle=T_{D}\left(\theta_{k}^{l_{D}},\alpha_{k}^{l_{D}}\right)P_{1}T_{E}\left(\theta_{k}^{l_{E}},\alpha_{k}^{l_{E}}\right)\left|\psi_{m}\right\rangle$
$\displaystyle\widehat{X}_{m}\leftarrow\left|\hat{\Psi}_{m}\right\rangle$
$\displaystyle{\bf end}$

Algorithm 1 Calculate the Quantum Sparse Coding and Decoding with respect to
the $X$.

$\displaystyle{\bf Input:}\
l_{E},l_{D},|\psi\rangle,\left(\theta,\alpha\right),Ite,\eta,d\text{ to get
}[M,N]$ $\displaystyle{\bf Output:}\
\left(\theta_{k}^{l_{E}},\alpha_{k}^{l_{E}}\right),\left(\theta_{k}^{l_{D}},\alpha_{k}^{l_{D}}\right),g_{E},g_{D},L$
$\displaystyle{\bf Initialize}\ \varDelta=10^{-8}$
$\displaystyle\left|\hat{\Psi}\right\rangle=T_{D}\left(\theta,\alpha\right)P_{1}T_{E}\left(\theta,\alpha\right)|\psi\rangle$
$\displaystyle\textbf{Update:}\
\left(\theta_{k}^{l_{E}},\alpha_{k}^{l_{E}}\right)$
$\displaystyle\textbf{for}\ {i=1:Ite}$ $\displaystyle
L=\left(R_{mn}-r_{mn}\right)^{2}$ $\displaystyle\textbf{for}\ {l=1:l_{E}}$
$\displaystyle\textbf{for}\ {k=1:N}$
$\displaystyle\partial\theta_{k}^{l}=\left[T_{D}P_{1}T_{E}\left(\theta_{k}^{l}+\varDelta,\alpha_{k}^{l}\right)-T_{D}P_{1}T_{E}\left(\theta_{k}^{l},\alpha_{k}^{l}\right)\right]/\varDelta$
$\displaystyle\partial\alpha_{k}^{l}=\left[T_{D}P_{1}T_{E}\left(\theta_{k}^{l},\alpha_{k}^{l}+\varDelta\right)-T_{D}P_{1}T_{E}\left(\theta_{k}^{l},\alpha_{k}^{l}\right)\right]/\varDelta$
$\displaystyle
g_{E}\left(\theta_{k}^{l}\right)=sum\left(L\cdot\partial\left(\theta_{k}^{l}\right)\right)/\left(M\times
N\right)$ $\displaystyle
g_{E}\left(\alpha_{k}^{l}\right)=sum\left(L\cdot\partial\left(\alpha_{k}^{l}\right)\right)/\left(M\times
N\right)$ $\displaystyle\theta_{k}^{l}=\theta_{k}^{l}-\eta
g_{E}\left(\theta_{k}^{l}\right),\alpha_{k}^{l}=\alpha_{k}^{l}-\eta
g_{E}\left(\alpha_{k}^{l}\right)$ $\displaystyle{\bf end}$ $\displaystyle{\bf
end}$ $\displaystyle\textbf{same way to calculate}\ g_{D}\ \textbf{to update}\
\left(\theta_{k}^{l_{D}},\alpha_{k}^{l_{D}}\right)\ $

Algorithm 2 Calculate the loss function and the gradients to update
$(\theta,\alpha)$, trainQSCD.

$\displaystyle{\bf Input:}\ \left(\theta,\alpha\right),[M,N]\hskip
284.52756pt$ $\displaystyle{\bf Output:}\ T_{E},T_{D}$ $\displaystyle{\bf
Initialize}\ U_{k},U_{E},T_{E},U_{E},T_{E}$ $\displaystyle\textbf{for}\
{l=1:M}$ $\displaystyle\theta\leftarrow\theta^{l},\alpha\leftarrow\alpha^{l}$
$\displaystyle\textbf{for}\ {k=1:N-1}$ $\displaystyle
U_{E}^{\left(l\right)}=U_{E}^{\left(l\right)}U_{k}(\theta_{k}^{l},\alpha_{k}^{l})$
$\displaystyle{\bf end}$ $\displaystyle T_{E}=T_{E}U_{E}^{\left(l\right)}$
$\displaystyle\textbf{Reset:}\ U_{E}$ $\displaystyle{\bf end}$
$\displaystyle\textbf{same way to construct}\ U_{D},T_{D}\ $

Algorithm 3 Construct the quantum network $T_{E}$ and $T_{D}$.

QSCD Algorithm. According to the theory of the QSCD algorithm, the main
program can be summarized as Algorithm. 1. The main simulation programs are
parameter training and quantum gate construction, which are simulated with
Matlab programming language. As shown in Algorithm. 1, for classical image
data, there are data-to-state coding function and training function
(trainQSCD). Given parameter initialization, the $r$ and $\phi$ of quantum
states are input to train $(\theta,\alpha)$ of quantum network by Algorithm.
2. After that, the program is presented in Algorithm. 3. is called, then the
output result is obtained by implementing the coding and decoding process
$T_{D}P_{1}T_{E}$. Finally, the program returns reconstruction results and
procedure parameters.

Quantum Natural Gradient Descent Algorithm. The $\operatorname{trainQSCD}$
pseudocode calculates the gradient of the $(\theta,\alpha)$, which is denoted
as the gradient $g_{E}$ for network $T_{E}$ and $g_{D}$ for network $T_{E}$.
In the process, the quantum natural gradient of quantum gate parameters
$(\theta,\alpha)$ is calculated by the QNGD algorithm WOS:000940796200001 .
Afterward, based on the update of parameter gradients, the renewal of
parameters will be acted upon in the next training iteration. It is noticed
that the parameters $(\theta,\alpha)$ are updated at the same time, but the
adjustment of the reflectivity $\theta$ will not affect the adjustment of the
phase $\alpha$ (see supplementary information II).

Quantum Network Construction. Constructed with multi-layer rotation gate
$U_{k}$, the network $T_{E}$ and $T_{D}$ can also be combined into a quantum
network of any depth separately in Algorithm. 3. The quantum network
construction gives out the form of the unitary transformation, which can be in
Order type and Cross type (see supplementary information I). In the network
$T_{D}$, the transformation $U_{D}$ needs to be connected in reverse order of
$U_{E}$ in sparse coding network $T_{E}$.

CODE AVAILABILITY
Some of the simulation code can be found in
https://github.com/Jixun97/QSCD.git. The complete code used for simulations is
available from the corresponding authors upon reasonable request.

ACKNOWLEDGMENTS
This work is supported by the National Natural Science Foundation of China
(No. 12175104), the National Key Research and Development Program of China
(No. 2023YFC2205802), and the Innovation Program for Quantum Science and
Technology (No. 2021ZD0301701).

AUTHOR CONTRIBUTIONS
X.J. and Q.L. and S.H. contributed equally. S.W. directed and supervised the
project. S.W., X.J., and Q.L. proposed the QSCD algorithm and designed the
implementations. X.J. performed the numerical simulation and analyzed the data
with the assistance of Q.L., S.H., and A.C.. Q.L. and X.J. provided
theoretical support under the guidance of S.W.. A.C. and Q.L. provided data
support. X.J., Q.L., and S.H. wrote and revised the manuscript with feedback
from all authors.

ADDITIONAL INFORMATION
Supplementary information:  Supplementary Information to: Quantum Sparse
Coding and Decoding Based on Quantum Network.
Supplementary training demo video: A gray image training process is based on
the QSCD algorithm.
Competing interests:  The authors declare no competing interests.

## References

  * (1) LeCun, Y., Bengio, Y. & Hinton, G.  Deep learning.  _Nature_ 521, 436–444 (2015).
  * (2) Biamonte, J. _et al._ Quantum machine learning.  _Nature_ 549, 195–202 (2017).
  * (3) Lloyd, S., Mohseni, M. & Rebentrost, P.  Quantum principal component analysis.  _Nat. Phys._ 10, 631–633 (2014).
  * (4) Cong, I., Choi, S. & Lukin, M. D.  Quantum convolutional neural networks.  _Nat. Phys._ 15, 1273–1278 (2019).
  * (5) Zhou, M.-G. _et al._ Quantum neural network for quantum neural computing.  _Research_ 6, 0134 (2023).
  * (6) Lu, H. _et al._ Experimental quantum network coding.  _npj Quantum Inf._ 5, 89 (2019).
  * (7) Schumacher, B.  Quantum coding.  _Phys. Rev. A_ 51, 2738–2747 (1995).
  * (8) Dennis, E., Kitaev, A., Landahl, A. & Preskill, J.  Topological quantum memory.  _J. Math. Phys._ 43, 4452–4505 (2002).
  * (9) Bellante, A. & Zanero, S.  Quantum matching pursuit: A quantum algorithm for sparse representations.  _Phys. Rev. A_ 105, 022414 (2022).
  * (10) Robotka, H. _et al._ Sparse ensemble neural code for a complete vocal repertoire.  _Cell Rep._ 42, 112034 (2023).
  * (11) Sheridan, P. M. _et al._ Sparse coding with memristor networks.  _Nat. Nanotechnol._ 12, 784–789 (2017).
  * (12) Rozell, C. J., Johnson, D. H., Baraniuk, R. G. & Olshausen, B. A.  Sparse coding via thresholding and local competition in neural circuits.  _Neural Comput._ 20, 2526–2563 (2008).
  * (13) Vinje, W. & Gallant, J.  Sparse coding and decorrelation in primary visual cortex during natural vision.  _Science_ 287, 1273–1276 (2000).
  * (14) Ji, X., Hu, X., Zhou, Y., Dong, Z. & Duan, S.  Adaptive sparse coding based on memristive neural network with applications.  _Cogn. Neurodyn._ 13, 475–488 (2019).
  * (15) Wright, J. _et al._ Sparse representation for computer vision and pattern recognition.  _Proc. Inst. Electr. Eng._ 98, 1031–1044 (2010).
  * (16) Olshausen, B. & Field, D.  Emergence of simple-cell receptive field properties by learning a sparse code for natural images.  _Nature_ 381, 607–609 (1996).
  * (17) Cao, H., Cao, F. & Wang, D.  Quantum artificial neural networks with applications.  _Inf. Sci._ 290, 1–6 (2015).
  * (18) Torlai, G. _et al._ Neural-network quantum state tomography.  _Nat. Phys._ 14, 447–450 (2018).
  * (19) Gao, X., Zhang, Z. Y. & Duan, L. M.  A quantum machine learning algorithm based on generative models.  _Sci. Adv._ 4, eaat9004 (2018).
  * (20) Beer, K. _et al._ Training deep quantum neural networks.  _Nat. Commun._ 11, 808 (2020).
  * (21) Miller, D. A. B.  Self-configuring universal linear optical component.  _Photonics Res._ 1, 1–15 (2013).
  * (22) Spagnolo, N. _et al._ Experimental validation of photonic boson sampling.  _Nat. Photonics_ 8, 615–620 (2014).
  * (23) Schuld, M., Sweke, R. & Meyer, J. J.  Effect of data encoding on the expressive power of variational quantum-machine-learning models.  _Phys. Rev. A_ 103, 032430 (2021).
  * (24) Abbas, A. _et al._ The power of quantum neural networks.  _Nat. Comput. Sci._ 1, 403–409 (2021).
  * (25) Liu, J. _et al._ Hybrid quantum-classical convolutional neural networks.  _Sci. China Phys. Mech._ 64, 290311 (2021).
  * (26) Zhou, L., Lin, J., Jing, Y. & Yuan, Z.  Twin-field quantum key distribution without optical frequency dissemination.  _Nat. Commun._ 14, 928 (2023).
  * (27) Harrow, A. W. & Montanaro, A.  Quantum computational supremacy.  _Nature_ 549, 203–209 (2017).
  * (28) Clements, W. R., Humphreys, P. C., Metcalf, B. J., Kolthammer, W. S. & Walmsley, I. A.  Optimal design for universal multiport interferometers.  _Optica_ 3, 1460–1465 (2016).
  * (29) Steinbrecher, G. R., Olson, J. P., Englund, D. & Carolan, J.  Quantum optical neural networks.  _npj Quantum Inf._ 5, 60 (2019).
  * (30) Pan, X. _et al._ Experimental quantum end-to-end learning on a superconducting processor.  _npj Quantum Inf._ 9, 18 (2023).
  * (31) Meitei, O. R. _et al._ Gate-free state preparation for fast variational quantum eigensolver simulations.  _npj Quantum Inf._ 7, 155 (2021).
  * (32) Graydon, O.  Birth of the programmable optical chip.  _Nat. Photonics_ 10, 1 (2016).
  * (33) Peruzzo, A. _et al._ A variational eigenvalue solver on a photonic quantum processor.  _Nat. Commun._ 5, 4213 (2014).
  * (34) Reck, M., Zeilinger, A., Bernstein, H. J. & Bertani, P.  Experimental realization of any discrete unitary operator.  _Phys. Rev. Lett._ 73, 58 (1994).
  * (35) Rudolph, M. S. _et al._ Generation of high-resolution handwritten digits with an ion-trap quantum computer.  _Phys. Rev. X_ 12, 031010 (2022).
  * (36) Du, Y., Hsieh, M.-H., Liu, T. & Tao, D.  Expressive power of parametrized quantum circuits.  _Phys. Rev. Res._ 2, 033125 (2020).
  * (37) Benedetti, M. _et al._ A generative modeling approach for benchmarking and training shallow quantum circuits.  _npj Quantum Inf._ 5, 45 (2019).
  * (38) Zhu, D. _et al._ Training of quantum circuits on a hybrid quantum computer.  _Sci. Adv._ 5, eaaw9918 (2019).
  * (39) Zeng, J., Wu, Y., Liu, J.-G., Wang, L. & Hu, J.  Learning and inference on generative adversarial quantum circuits.  _Phys. Rev. A_ 99, 052306 (2019).
  * (40) Tacchino, F., Macchiavello, C., Gerace, D. & Bajoni, D.  An artificial neuron implemented on an actual quantum processor.  _npj Quantum Inf._ 5, 26 (2019).
  * (41) Hu, L. _et al._ Quantum generative adversarial learning in a superconducting quantum circuit.  _Sci. Adv._ 5, eaav2761 (2019).
  * (42) Cerezo, M., Verdon, G., Huang, H.-Y., Cincio, L. & Coles, P. J.  Challenges and opportunities in quantum machine learning.  _Nat. Comput. Sci._ 2, 567–576 (2022).
  * (43) Mitarai, K., Negoro, M., Kitagawa, M. & Fujii, K.  Quantum circuit learning.  _Phys. Rev. A_ 98, 032309 (2018).
  * (44) Shafee, F.  Neural networks with quantum gated nodes.  _Eng. Appl. Artif. Intell._ 20, 429–437 (2007).
  * (45) Concha, D., Pereira, L., Zambrano, L. & Delgado, A.  Training a quantum measurement device to discriminate unknown non-orthogonal quantum states.  _Sci. Rep._ 13, 7460 (2023).
  * (46) Metcalf, B. J. _et al._ Multiphoton quantum interference in a multiport integrated photonic device.  _Nat. Commun._ 4, 1356 (2013).
  * (47) Peruzzo, A., Laing, A., Politi, A., Rudolph, T. & O’Brien, J. L.  Multimode quantum interference of photons in multiport integrated devices.  _Nat. Commun._ 2, 224 (2011).