# Stringent axion constraints with Event Horizon Telescope polarimetric
measurements of M87⋆

Yifan Chen1 Yuxin Liu2 Ru-Sen Lu3,4,5 Yosuke Mizuno6,7 Jing Shu1,8,9,10,11,12
Xiao Xue1,8 Qiang Yuan13,14,10 Yue Zhao15

###### Abstract

The hitherto unprecedented angular resolution of the Event Horizon Telescope
(EHT) has created exciting opportunities in the search for new physics.
Recently, the linear polarization of radiation emitted near the supermassive
black hole M87⋆ was measured on four separate days, precisely enabling tests
of the existence of a dense axion cloud produced by a spinning black hole. The
presence of an axion cloud leads to a frequency-independent oscillation in the
electric vector position angle (EVPA) of this linear polarization. For a
nearly face-on M87⋆, this oscillation in the EVPA appears as a propagating
wave along the photon ring. In this paper, we leverage the azimuthal
distribution of EVPA measured by the EHT to study the axion-photon coupling.
We propose a novel differential analysis procedure to reduce the astrophysical
background, and derive stringent constraints on the existence of axions in the
previously unexplored mass window $\sim(10^{-21}-10^{-20})$ eV.

CAS Key Laboratory of Theoretical Physics, Institute of Theoretical Physics,
Chinese Academy of Sciences, Beijing 100190, China

Department of Physics, Tsinghua University, Beijing 100084, China

Shanghai Astronomical Observatory, Chinese Academy of Sciences, Shanghai
200030, China

Key Laboratory of Radio Astronomy, Chinese Academy of Sciences, Nanjing
210008, China

Max-Planck-Institut für Radioastronomie, Auf dem Hügel 69, D-53121 Bonn,
Germany

Tsung-Dao Lee Institute and School of Physics and Astronomy, Shanghai Jiao
Tong University, Shanghai, 200240, China

Institute for Theoretical Physics, Goethe University Frankfurt, Frankfurt am
Main, 60438, Germany

School of Physical Sciences, University of Chinese Academy of Sciences,
Beijing 100049, China

CAS Center for Excellence in Particle Physics, Beijing 100049, China

Center for High Energy Physics, Peking University, Beijing 100871, China

School of Fundamental Physics and Mathematical Sciences, Hangzhou Institute
for Advanced Study, University of Chinese Academy of Sciences, Hangzhou
310024, China

International Center for Theoretical Physics Asia-Pacific, Beijing/Hangzhou,
China

Key Laboratory of Dark Matter and Space Astronomy, Purple Mountain
Observatory, Chinese Academy of Sciences, Nanjing 210023, China

School of Astronomy and Space Science, University of Science and Technology of
China, Hefei 230026, China

Department of Physics and Astronomy, University of Utah, Salt Lake City, UT
84112, USA

##  1 Introduction

Via the technique of very long baseline interferometry, the Event Horizon
Telescope (EHT) reaches an unprecedented spatial resolution in the radio-
frequency band, imaging the horizon-scale structure of the supermassive black
hole (SMBH) M87⋆[1, 2, 3, 4]. Such an achievement provides unique
opportunities to study physics in extreme conditions. In particular, the EHT
measures electromagnetic radiation at a wavelength of 1.3 millimeter, which is
optimal for studying the magnetic field around such black holes via
polarization measurements. Such measurements have been performed very
recently[5], revealing the magnetic field structure near the event horizon[6].

Beyond the astrophysics in the vicinity of an SMBH, such as the accretion flow
and jet, polarization measurements can also help us probe new physics beyond
the Standard Model of particle physics. The axion is one of the best-motivated
candidates for physics beyond the Standard Model, arising initially as a
solution to the strong CP (charge-conjugation and parity) problem[7, 8, 9,
10]. Axion-like particles are furthermore generically predicted in fundamental
theories with extra dimensions[11], and are excellent dark matter
candidates[12, 13, 14]. In Ref. [15], the authors proposed that the temporal
and spatial variations of the electric vector position angle (EVPA) around the
photon ring of an SMBH can be used to study the existence of an axion cloud
produced by the superradiance mechanism[16, 17, 18], thanks to the axion-
induced birefringence effect[19, 20]. The search is sensitive to axion clouds
with non-negligible self-interaction[21, 22, 23, 24], which is complimentary
to constraints from black hole spin measurements[25].

More explicitly, the EHT collaboration presented fiducial polarimetric images
for four days (April 5/6/10/11 2017) in Ref. [5], along with the azimuthal
distribution of the EVPA, including systematic uncertainties, for two days
(April 5/11, 2017). Based on the search strategy proposed in Ref. [15] and the
information provided in Ref. [5], we adopt an improved search strategy using
differential EVPA in the time domain. Such a method can effectively reduce the
uncertainties from the astrophysical background. In addition, we include more
realistic modelling of the accretion flow and radiative transfer calculation
of polarized light.

We demonstrate that the newly released EHT polarimetric measurements provide a
powerful probe for studying the axion-photon coupling for axions masses near
$10^{-20}$ eV. Interesting constraints, surpassing those from other
measurements, can already be produced with the published EHT results. The
sensitivity can be also significantly improved when more detailed information
becomes available.

##  2 Axion Cloud-Induced Birefringence Effect

If the Compton wavelength of an ultralight boson, e.g., the axion in this
study, is comparable to the gravitational radius of a rapidly spinning Kerr
black hole, a bound state between the axions and the black hole can be
spontaneously generated by extracting the black hole’s rotational energy[16,
17, 18]. The growth of such a bound state is exponential. This is the so-
called superradiance mechanism. Such a bound state is a close analog to a
hydrogen atom, with discrete energy levels and a ‘fine structure constant’
$\alpha\equiv r_{g}/\lambda_{c}$, where $r_{g}$ is the gravitational radius of
the black hole and $\lambda_{c}$ is the reduced Compton wavelength of the
axion. The nontrivial self-interaction of the axion can halt the exponential
growth, and the peak value of the axion field may become comparable to the
decay constant $f_{a}$[21, 22, 23, 24]. In such a scenario, the axion cloud
around the black hole may lead to a region with the highest possible axion
density anywhere in the universe.

Analogously to the hydrogen atom, the axion cloud can populate states with
differing angular momentum quantum numbers, $(l,m)$. The mode with
$(l,m)=(1,1)$ is the lowest energy state amongst those satisfying the
superradiant condition. Out of all possible states populated through
superradiance, it has a peak located closest to the horizon of the BH. For an
extreme Kerr black hole, $\alpha$ needs to be smaller than $0.5$ in order for
the $(1,1)$ state to be populated. In this study we focus on the SMBH M87⋆,
and consider the axion mass window from $2\times 10^{-21}$ eV to $10^{-20}$
eV, which gives $\alpha$ from $0.1$ to $0.5$. These axions in the cloud are
non-relativistic, oscillating coherently with a frequency approximately equal
to the axion mass $m_{a}$. A tighter upper bound on $\alpha$ depends on the
spin of the black hole, as we will discuss later and in Methods. The lower
bound on $\alpha$ is set by requiring the superradiant timescale to be much
smaller than the age of the universe [26], i.e., within the range of $10^{9}$
years in this study. It corresponds to an oscillation period of the axion
cloud wavefunction shorter than $20$ days. We note that the axions in the mass
window studied here are unlikely to be the QCD axion, but rather axion-like
particles.

Due to the axion-photon coupling $g_{a\gamma}aF_{\mu\nu}\tilde{F}^{\mu\nu}/2$
where $F_{\mu\nu}$ is the field strength tensor of the photon and
$\tilde{F}^{\mu\nu}$ is the dual tensor, the temporal and spatial variations
of an axion background field induce a change in the dispersion relation of
photons. Thus the EVPA of a linearly polarized photon, labeled as $\chi$,
experiences a rotation due to the axion background as

$\Delta\chi=g_{a\gamma}[a(t_{\rm obs},\textbf{x}_{\rm obs})-a(t_{\rm
emit},\textbf{x}_{\rm emit})],$ (1)

depending only on the axion field values at the emission and observation
points[19, 20]. A generalization to curved spacetime was discussed in Ref.
[27], reaching the same conclusion. We emphasize that this simple expression
only holds for photons propagating in vacuum, when the photon wavelength is
much smaller than the axion’s Compton wavelength. In-medium effects need to be
included by solving the radiative transfer equations along the photon path in
more realistic cases.

The axion density around the Earth is negligible compared with that of an
axion cloud surrounding M87⋆, and hence can be neglected. Without including
in-medium effects, for a linearly polarized photon emitted at
$(t,r,\theta,\phi)$ in the Boyer-Lindquist (BL) coordinates of the black hole,
its EVPA shift is directly related to the wavefunction of the axion cloud[15]

$\displaystyle\Delta\chi(t,r,\theta,\phi)\approx-\frac{bcR_{11}(r)\sin\theta\cos{[\omega
t-\phi]}}{2\pi R_{11}(r_{\textrm{max}})}.$ (2)

For a fixed SMBH, the radial wave-function
$R_{11}(r)/R_{11}(r_{\textrm{max}})$ depends on the axion mass. $b\equiv
a_{\rm max}/f_{a}$ is introduced to describe the peak value of the axion
cloud; due to nontrivial self-interaction, both numerical simulations[21, 22,
23] and analytic estimates[24] indicate that $b\sim O(1)$ in the parameter
space we are interested in. The parameter $c$ relates the axion-photon
coupling $g_{a\gamma}$ to the decay constant $f_{a}$ via $c\equiv 2\pi
g_{a\gamma}f_{a}$, and it is the fundamental quantity that this work
constrains.

In reality, plasma effects also need to be accounted for to properly model the
variation of the EVPA. In particular, the axion-induced birefringent effect
should be combined with astrophysical Faraday rotation. As a consequence, the
Faraday rotation coefficient obtains an additional contribution, i.e.,
$\rho_{V}=\rho_{V}^{\textrm{FR}}-2g_{a\gamma}\frac{da}{ds}$ where $s$ is the
proper time. The first term $\rho_{V}^{\textrm{FR}}$ describes the frequency-
dependent Faraday rotation induced by the plasma effect. The second term is
from the axion field, which is an additional frequency-independent
contribution along the line-of-sight. The summation of these two effects
characterizes the phase variation in $Q+iU$, where $Q$ and $U$ are the Stokes
parameters for the linear polarization.

In this study, we model the accretion disk by the analytic radiatively
inefficient accretion flow (RIAF)[28] with a sub-Keplerian velocity
distribution and vertical magnetic field [6]. The thickness of the accretion
flow is parametrized by a dimensionless quantity $H\equiv h/R$. Here $h$ is
the height scale, and $R$ is the horizontal scale of the accretion flow. We
take $H$ as 0.3 and 0.05 for a magnetically arrested disk (MAD)[29, 30, 31,
32]. The normalization of the electron density is set to be $\sim 10^{5}$ cm-3
so that the total flux density at 230 GHz is about $0.5$ Jy[1, 2, 3, 4] and
the magnetic field strength is consistent with EHT estimates[6].

Figure 1: Illustration of the IPOLE simulation of polarized emission from a
Kerr black hole surrounded by an axion cloud. For axion parameters we take
$\alpha=0.4$, and $g_{a\gamma}a_{\textrm{max}}=3\pi/{4}$ as a benchmark. An
analytic RIAF with $H=0.3$, vertical magnetic field, and sub-Keplerian
velocity distribution are assumed. The white quivers are the EVPAs without the
axion-induced birefringence effect at each point. Different colors, ranging
from red to purple, represent the EVPA time variation when the axion cloud
exists. The $+x$ axis is taken to be aligned with the direction of jet
projection on this plane.

As an illustration, we consider the SMBH M87⋆ at a $17^{\circ}$ inclination
angle with respect to the sky plane. The quivers in Fig. 1 show the EVPA
variations using the polarized radiation transfer code IPOLE[33, 34]. The
length of each quiver is proportional to the intensity of the linear
polarization, i.e., $\sqrt{Q^{2}+U^{2}}$, and the direction indicates the
polarization direction. The white quivers show the values of EVPA without the
axion-induced birefringence effect. One oscillation period of the axion cloud
is equally divided into 16 segments, and the color of each quiver, from red to
purple, represents the time evolution.

##  3 Variations of the Azimuthal EVPA Pattern

On the sky plane, we use the polar coordinates ($\rho,\varphi$) with the
origin at the black hole center. The axis with $\varphi=0$ is taken to be
aligned with the direction of jet projection on this plane. In order to
compare with the data, we follow Ref. [5] and calculate the intensity weighted
average EVPA as a function of $\varphi$ on the sky plane,

$\langle\chi(\varphi)\rangle\equiv\frac{1}{2}\textrm{arg}\Big{(}\langle
Q\times I\rangle+i\langle U\times I\ \rangle\Big{)}.$ (3)

The intensity weighted average region is taken to be between
$\rho_{\textrm{in}}\simeq 3r_{g}$ and $\rho_{\textrm{out}}\simeq 8r_{g}$,
according to Ref. [2].

The axion-induced birefringence effect leads to an oscillation in
$\langle\chi(\varphi)\rangle$. For the $l=m=1$ state, this variation can
generically be parametrized as

$\displaystyle\Delta\langle\chi(\varphi)\rangle=-\mathcal{A}(\varphi)\cos{[\omega
t+\varphi+\delta(\varphi)]}.$ (4)

Figure 2: The relative phase $\delta(\varphi)/2\pi$ and amplitude
$\mathcal{A}(\varphi)/g_{a\gamma}a_{\textrm{max}}$ of the
$\langle\chi(\varphi)\rangle$ variation. The black hole spin is assumed to be
$0.99$, and the accretion flow is modelled as analytic RIAF using IPOLE, with
vertical magnetic field and sub-Keplerian velocity distribution. Different
choices of $H$ and $\alpha$ are shown in the plot. $\varphi=0$ corresponds to
the position angle of the jet projection.

In Fig. 2, we show results from the IPOLE calculations with $H=0.05$ and
$H=0.3$ as two representative models. We study the $\varphi-$dependence of the
relative phase $\delta$ as well as the amplitude $\mathcal{A}$ which is
normalized to $g_{a\gamma}a_{\textrm{max}}\equiv bc/2\pi$.

We note that $\delta(\varphi)$ is well approximated by a cosinusoidal
function, specifically

$\delta(\varphi)\approx-\omega\ r_{\rm ring}\
\sin{17^{\circ}}\cos{\varphi}+\delta_{0}.$ (5)

where $\delta_{0}$ is the arbitrary initial phase of the axion cloud. $r_{\rm
ring}$ is approximately the radius of the ring, i.e., $\sim 5\ r_{g}$, where
the dominant emission comes from. This indicates that $\delta(\varphi)$ arises
from the emission time delay due to the $17^{\circ}$ inclination angle between
the M87⋆ spin direction and the sky plane. In addition, such a fit is also a
reliable verification of the mapping between $\varphi$ on the sky plane and
$\phi$ in BL coordinates, as discussed in Methods.

The behaviour of $\mathcal{A}(\varphi)$ is more subtle, owing to several
aspects which must necessarily be considered. Firstly, there is an important
washout effect along the line of sight. The accretion flow is optically thin
in our study, and thus photons that reach the Earth simultaneously were
emitted at different times along the line of sight. Since the axion field
oscillates at a frequency $\omega\simeq m_{a}$, these photons experience
different axion cloud phases at their time of emission, resulting in a washout
effect for $\mathcal{A}(\varphi)$, especially when the radiation size $S_{r}$
is larger than the Compton wavelength $2\pi\lambda_{c}$ (see Methods for a
more detailed description and Figure 4 for an illustration of a case where
emissions and the amplitude of the axion field are constant within a region
with size $S_{r}$). A decrease of $H$ from $0.3$ to $0.05$ reduces this effect
slightly, and so we choose $H=0.3$ as a conservative benchmark for the rest of
the discussion.

The other important washout effect comes from the lensed photons that
experience a much longer propagation time than those directly emitted from the
accretion flow. The axion-induced EVPA variations for these photons do not add
up coherently. For a smaller value of $\alpha$ the Compton wavelength is
longer, and the washout effect hence less severe. However,
$\mathcal{A}(\varphi)/g_{a\gamma}a_{\textrm{max}}$ becomes smaller with a
smaller $\alpha$ (see the black line in Fig. 2). This is mainly because the
emission ring is more spatially separated from the axion cloud peak, and the
suppression factor $R_{11}(r)/R_{11}(r_{\textrm{max}})$ becomes smaller.

Finally, the smearing due to the finite angular resolution of the EHT
observation also leads to a washout effect along the $\varphi$-direction[15].

##  4 Differential EVPA and Axion Constraints

The EHT collaboration has released the fiducial polarimetric images from four
days, i.e., April 5, 6, 10 and 11, 2017[5]. For each of the days, there are
maps presenting the EVPA distribution as well as the linear polarization
intensity. In addition, for two of the four days, April 5 and 11, the
intensity weighted EVPA, $\langle\chi(\varphi)\rangle$, as functions of the
azimuthal angle are also provided. Along the $\varphi$-axis,
$\langle\chi(\varphi)\rangle$ is obtained by taking the average of a wedge
with an opening angle of $10^{\circ}$.

As discussed previously, we are looking for an overall pattern of EVPA
variation across the azimuthal angle of the polarized emission. It is natural
to expect that the astrophysical backgrounds of two sequential days do not
change remarkably [5]. Thus we group the 4-day observations into two pairs,
(April 5, 6) and (April 10, 11). For each pair, we study the variation of
$\langle\chi(\varphi)\rangle$ along the azimuthal direction, i.e.,
$\langle\chi(\varphi,t_{j})\rangle-\langle\chi(\varphi,t_{i})\rangle$ where
$t_{i}$ and $t_{j}$ represent the two sequential days with interval
$t_{\textrm{int}}\equiv t_{j}-t_{i}=1$ day. To investigate whether there is an
evidence of axion-induced birefringent effect we compare the
$\langle\chi(\varphi,t_{j})\rangle-\langle\chi(\varphi,t_{i})\rangle$ obtained
in each pair of days with the theoretical prediction due to the axion field.

In the fiducial linear polarization images, there are slight differences
between the two sequential days. It is not clear whether such differences are
induced by the intrinsic variation of the accretion flow or by the change of
the baseline coverage [5]. Thus in our analysis, we treat the central value of
$\langle\chi(\varphi,t_{j})\rangle-\langle\chi(\varphi,t_{i})\rangle$ as zero.
Furthermore, we assume that the reconstruction uncertainties for the two
sequential days remain the same but uncorrelated. Thus the error bar of
$\langle\chi(\varphi,t_{j})\rangle-\langle\chi(\varphi,t_{i})\rangle$ is
simply that of $\langle\chi(\varphi,t_{i})\rangle$ multiplied by a factor of
$\sqrt{2}$.

Meanwhile,
$\langle\chi(\varphi,t_{j})\rangle-\langle\chi(\varphi,t_{i})\rangle$ for the
two pairs of sequential days are related. Firstly, ${\mathcal{A}(\varphi)}$
characterizes the difference in the EVPA variation amplitude for two
sequential days, and to a good approximation ${\mathcal{A}(\varphi)}$ for the
two pairs is the same. Furthermore, the phases of the axion field at the times
of two pairs are related to each other by a relative phase difference of
($\omega\times$ 5 days). This correlation is accounted for in our analysis.

For each value of $m_{a}$, we calculate the likelihood values for different
$g_{a\gamma}a_{\textrm{max}}\equiv bc/2\pi$. Throughout the analysis, the
axion field phase $\delta_{0}$ is treated as a nuisance parameter and is
marginalized over $[0,2\pi]$. The black hole spin is assumed to be either
$0.99$ or $0.80$[35, 36, 37]. This determines the upper limit of $\alpha$ that
we can probe in this study to be $0.44$ or $0.25$ respectively. The lower
limit of $\alpha$ is taken to be 0.1. With a smaller $\alpha$, the peak of the
axion cloud is too far away from the photon ring, and the superradiance
timescale becomes longer than the age of the universe. In Fig. 3, we present
the $95\%$ credible level upper limit on the axion-photon coupling,
characterized by the value of $c$. Here we assume that the axion cloud has
saturated, i.e., $b=1$. The bound becomes weaker for smaller axion masses.
This is due to a smaller value of the suppression factor
$R_{11}(r)/R_{11}(r_{\textrm{max}})$, as well as a smaller 1-day axion field
variation due to the longer oscillation period.

Figure 3: The $95\%$ credible level upper limit (green) on the axion-photon
coupling, characterized by $c\equiv 2\pi g_{a\gamma}f_{a}$, derived from the
EHT polarimetric observations of SMBH M87⋆. The black hole spin $a_{J}$ is
assumed to be $0.99$ or $0.80$. The latter case corresponds to a smaller mass
window, which overlaps with $a_{J}=0.99$ case in the lower mass region. The
gray band at the bottom represents the uncertainty from the five different
EVPA reconstruction methods. The bounds from CAST[38], Supernova 1987A[39],
super star clusters[40], the M87 Galaxy[41], and NGC1275[42], assuming
$f_{a}=10^{15}$ GeV, are shown for comparison.

We also compare our constraints with the bounds from CAST[38], Supernova
1987A[39], super star clusters[40], the M87 Galaxy[41], and NGC1275[42]. While
all these existing studies put constraints on $g_{a\gamma}$, our result
provides a novel probe to the conversion factor, i.e., $c\equiv 2\pi
g_{a\gamma}f_{a}$. This is because the axion field saturates the largest
possible value in the axion cloud, thereby providing a useful complementarity
to the existing landscape of axion searches. In terms of the axion models, the
value of $c$ is related to the anomaly coefficients in the ultraviolet theory.
In addition, an exponentially large value of $c$ can appear in models of the
clockwork axion[43, 44]. In order to directly compare our results with others,
we take $f_{a}$ to be $10^{15}$ GeV as a benchmark, motivated by theories of
Grand Unification. For the axion mass window we consider, a large region of
previously unexplored parameter space is covered by the EHT observations. The
previous constraints are improved upon by several orders of magnitude, as
shown in Fig. 3. We note that our constraints are stronger yet for larger
values of $f_{a}$. However, they are not necessarily applicable beyond $f_{a}$
at $10^{16}$ GeV since the axion self-interaction becomes too weak to prevent
superradiance[25], and the axion field value does not necessarily saturate.

##  5 Conclusions and Future Prospects

Polarized imaging of the vicinity of SMBHs offers a unique probe to search for
axions, thanks to the EVPA oscillation of linearly polarized photons arising
from the axion-induced birefringence effect. In this study we introduced a
novel data analysis method that may significantly reduce the astrophysical
background, and applied it to four days of polarization measurements of M87⋆
by the EHT[5]. EHT observations can as a result rule out a region of the axion
mass and axion-photon coupling parameter space, which is unexplored by
previous experiments.

We emphasize that a further optimized search strategy could be applied with
improved measurements and analysis of the emitted polarization, e.g., the
upcoming EHT observations with higher time cadence or the Next Generation EHT
(ngEHT) in the future. Firstly, increasing the overall statistics would
definitely improve the sensitivity, by incorporating more available pairs of
sequential days for our differential analysis and EVPA reconstruction with
higher precision. Further gains can also be made if the results were provided
in shorter time segments within one day. Furthermore, since the axion-induced
birefringence effect is independent of the photon frequency, polarization
measurements at different frequency bands such as 345 GHz will be extremely
helpful to distinguish the axion-induced effect from Faraday rotation in the
plasma. The radial distributions of the EVPA are also valuable, and the
sensitivity could be improved by using a fuller modelling of the axion
profile. Finally, we note that the EVPA observed outside the photon ring is
free from the contamination of lensed photons, which give the dominant
contribution to the washout effect. Removing these lensed photons would help
to provide a universal signal prediction, independent of accretion flow
models. All these improvements are within expectations of either the future
EHT data release or the ngEHT with an increased baseline coverage[45].

Methods

Black Hole Superradiance Through the superradiance mechanism, a rapidly
spinning black hole can generate an exponentially growing axion cloud, if the
axion has a reduced Compton wavelength $\lambda_{c}$ comparable to the
gravitational radius of the Kerr black hole $r_{g}$[16, 17, 18, 46, 47, 48,
49, 26] (for a review see Ref. [50]). Such a process is terminated by either
the axion self-interaction or a sufficient loss of the angular momentum of the
black hole. The wave-function of the axion cloud can be written as

$a(x^{\mu})=e^{-i\omega t}e^{im\phi}S_{lm}(\theta)R_{lm}(r),$ (6)

where $x^{\mu}=[t,r,\theta,\phi]$ are the Boyer-Lindquist (BL) coordinates.
Such a bound state formed by the black hole and the axion cloud is closely
analogous to a hydrogen atom, with the coupling constant being $\alpha\equiv
r_{g}/\lambda_{c}$. The $\theta$ dependence is characterized by the spheroidal
harmonics $S_{lm}$ which simplify to $Y_{lm}$ in the non-rotating limit of the
black hole, or the non-relativistic limit of the axion cloud. $R_{lm}(r)$ is
the radial component of the wave function that vanishes at both the horizon of
the black hole and at infinity. For a benchmark axion with Compton wavelength
satisfying $\alpha=0.4$, the cloud peaks close to the region where the
dominant emissions come from[15]. Since the radius at which the axion field
reaches the maximum, $r_{\textrm{max}}$, scales as $1/\alpha^{2}$,
$r_{\textrm{max}}$ becomes larger for smaller values of $\alpha$.

The highest superradiant rate happens for $l=1,m=1$, which is the lowest
energy state amongst those satisfying the superradiance condition[26]. In this
case, for all values of $\theta$, the axion cloud wavefunction peaks at the
equatorial plane of the black hole, i.e., $\sin\theta=1$. $r_{\textrm{max}}$
becomes larger for higher modes with a bigger azimuthal number $l$. To be
conservative, we only focus on the $(1,1)$ state and do not consider higher
modes in this study.

The range of the superradiance condition for $\alpha$ is sensitive to the
black hole spin $a_{J}$, which is still uncertain for M87⋆[5]. Refs. [35, 36]
claim M87⋆ to be a nearly extremal Kerr black hole. From a recent synthetic
modeling study of M87 jet at 86 GHz, higher black hole spin is favored.[51]
Thus in this study, we take the black hole spin $a_{J}$ to be 0.99 and 0.8[37]
as two benchmarks. For a fixed azimuthal mode $m$ and black hole spin $a_{J}$,
the superradiance condition imposes an upper limit on $\alpha$[26],

$\alpha<\frac{a_{J}\ m}{2\ \left(1+\sqrt{1-a_{J}^{2}}\right)},$ (7)

With $m=1$, $\alpha$ can be at most $0.5$ for an extremal Kerr black hole and
$0.25$ if $a_{J}=0.8$. We set a lower limit on $\alpha$ of $0.1$, so that the
superradiant timescale is much shorter than the age of the universe, i.e.,
within the range of $10^{9}$ years. The black hole spin can be as low as
$a_{J}=0.5$ [26] in order to satisfy the superradiance condition for
$\alpha=0.1$. Once this is met the axion cloud profile is only slightly
influenced by the value of $a_{J}$, with $\alpha$ being fixed[52].

The robustness of the axion cloud is discussed in Ref. [11], where several
potential effects which may destroy the axion cloud are discussed. The tidal
forces from a companion star turn out to be negligible. The metric is always
dominated by the SMBH, especially for our region of interest. One may also be
concerned about the possibility of a merger with another SMBH in the past,
however, we mainly focus on the axion mass range with relatively short
timescales for superradiance. Even if such a drastic merger happened once the
axion cloud should have enough time to build up again, and thus we neglect
this possibility in our study.

With the growth of the axion cloud, the axion field value gets close to the
decay constant $f_{a}$ that governs the self-interaction of axions from the
axion potential $V(a)=m_{a}^{2}f_{a}^{2}\left(1-\cos a/f_{a}\right)$, where
$m_{a}$ is the mass of the axion. Due to nontrivial self-interactions, the
superradiance is terminated. Consequently the axion cloud enters a self-
interaction dominated regime, and black hole spin measurements would not apply
anymore [25, 53, 54, 37, 55, 56]. The fate of the axion cloud can either be a
violent bosenova or a saturated phase[21, 22, 23, 24, 57]. Interestingly, in
either case, the numerical simulations[21, 22, 23] and the analytic
estimates[24] show that the maximum of the field value $a_{\rm max}$ remains
close to $f_{a}$ as long as the saturation regime is reached. This leaves our
conclusion insensitive to this subtlety. We introduce $b\equiv a_{\rm
max}/f_{a}$ to describe the peak value of the axion cloud. We note that in
Ref. [24], the value of $b$ is shown to decrease at lower $\alpha$ and
logarithmically dependent on the mass of the black hole.

Accretion Flow and Radiative Transfer For low-luminosity active galactic
nuclei, such as Sgr A⋆ and M87⋆, the accretion flow are approximately
described as radiatively inefficient accretion flow (RIAF)[58, 59], which are
geometrically thick and optically thin at 230 GHz[59, 60, 4]. The accretion
flow thickness is characterized by a dimensionless quantity $H\equiv h/R$
where $h$ is the height scale and $R$ is the horizontal scale of the accretion
flow [28]. For a magnetically arrested disk (MAD), which well-describes
M87⋆[6], $H$ is compressed to be $0.05$ by the strong magnetic field in the
inner region ($\lesssim 10\ r_{g}$) and becomes $\sim 0.3$ in the outer
region[29, 30, 31, 32]. In this study we adopt the analytic RIAF model [28] as
a benchmark model, and vary $H$ in order to understand the uncertainties
induced by the thickness of the accretion flow. As demonstrated later, a
different choice of $H$ does not change our conclusion qualitatively.

The Stokes parameters $(I,Q,U,V)$ are generically applied to describe the
properties of macroscopic polarization (see e.g., Ref. [61]), in which $I$ is
the total intensity, $Q$ and $U$ characterize the linear polarization, and $V$
describes the circular polarization. The in-medium effects lead to mixtures
among the four Stokes components in the polarized radiative transfer equation

$\frac{d}{ds}\left(\begin{array}[]{l}I\\\ Q\\\ U\\\
V\end{array}\right)=\left(\begin{array}[]{l}j_{I}\\\ j_{Q}\\\ j_{U}\\\
j_{V}\end{array}\right)-\left(\begin{array}[]{llll}\alpha_{I}&\alpha_{Q}&\alpha_{U}&\alpha_{V}\\\
\alpha_{Q}&\alpha_{I}&\rho_{V}&\rho_{U}\\\
\alpha_{U}&-\rho_{V}&\alpha_{I}&\rho_{Q}\\\
\alpha_{V}&-\rho_{U}&-\rho_{Q}&\alpha_{I}\end{array}\right)\left(\begin{array}[]{l}I\\\
Q\\\ U\\\ V\end{array}\right),$ (8)

where $s$ is the proper time, $j_{I,Q,U,V}$ are the polarized emissivities,
$\alpha_{I,Q,U,V}$ are the absorption coefficients, and $\rho_{Q,U,V}$ are the
Faraday rotation and conversion coefficients.

The axion-induced birefringence effect can be properly included in the
radiative transfer matrix as

$\rho_{V}=\rho_{V}^{\textrm{FR}}-2g_{a\gamma}\frac{da}{ds},$ (9)

where the first term is the coefficient of the frequency-dependent Faraday
rotation from the plasma, and the second term is from the axion field which
gives a frequency-independent addition along the line-of-sight. $\rho_{V}$
characterizes the rotation of the phase in $Q+iU$[19, 20, 62, 63, 64, 65, 66,
67, 68], which is related to the EVPA through

$\chi\equiv\frac{1}{2}\mathrm{arg}(Q+iU).$ (10)

To properly model the axion-induced birefringence effect, we modify the
polarized radiative transfer equation in the general relativistic radiation
transfer code IPOLE[33, 34], as indicated in Eq. (9), with analytic RIAF
models in which $H=0.05$ and $0.3$ are implemented. For the velocity
distribution, we choose the sub-Keplerian flow as an approximation. The
magnetic field is taken to be vertical as a benchmark model[6]. In addition,
we adjust the normalization of the electron density to be $\sim 10^{5}$ cm-3
compared to the original model so that the total flux density in the image at
230 GHz is about $0.5$ Jy[1, 2, 3, 4] and the magnetic field strength is
consistent with the EHT estimate[6]. We also perform a more comprehensive
study in order to investigate the effects of various choices in the RIAF
model, such as the direction of the magnetic field (e.g., toroidal or radial)
and the velocity distributions. We find that varying these parameters does not
affect our conclusion qualitatively.

The accretion flow, on the other hand, may also be affected by the black hole
spin. Taking sub-Keplerian RIAF as the benchmark model, we compare the axion
cloud induced EVPA time variations with different choices of the black hole
spin, $a_{J}=0.5$ and $a_{J}=0.8$. We set the value of $\alpha$ to be close to
0.1 in order to satisfy the superradiance condition Eq. (7). We find that the
EVPA variations remain qualitatively the same as those in the scenario with
$a_{J}=0.99$. This is due to the fact that the line-of-sight washout effect
becomes negligible for a lower value of $\alpha$, i.e., longer Compton
wavelength. More details will be discussed later in the Line-of-Sight Washout
Effect Section in Methods.

In order to compare with EHT data, we need to map the sky plane coordinates
($\rho,\varphi$) to the BL coordinates of the SMBH. This can be done through
ray-tracing in IPOLE. For an MAD, the dominant emission comes from the region
near the equatorial plane of the black hole. Combined with the fact that the
brightest region is around $5\ r_{g}$ away from the center of the black hole,
for SMBH M87⋆ whose orientation is almost face-on, $\varphi$ can be directly
mapped to $-\phi$ in BL coordinates to a good approximation. The minus sign is
due to the fact that the spin direction of M87⋆ points away from the Earth,
i.e., M87⋆ rotates clockwise on the sky plane. In addition, for the region of
interest in this study $\rho$ can be approximately mapped to $r$ in BL
coordinates as well; $\rho\simeq r$.

There are also photons that propagate around the black hole several times
before reaching the Earth due to lensing effects[69, 70, 71, 72], which can
influence the polarization as well[73]. For the total intensity they
contribute subdominantly, providing $\sim 10$% at most. However, if one uses
the intensity weighted EVPA as the observable, their contribution is non-
negligible and can lead to a noticeable washout of the axion-induced
birefringence, which contributes to the asymmetry along $\varphi$ in Fig. 2.
We note that such a washout effect can be largely removed if the detailed EVPA
distribution is provided at different $\rho$.

Data Characterization To calculate
$\langle\chi(\varphi,t_{j})\rangle-\langle\chi(\varphi,t_{i})\rangle$, one has
to take into account the observation time in each day, i.e.,
$t_{\textrm{obs}}\simeq 6$ hours. Using the parametrization in Eq. (4), we
have

$\displaystyle\langle\chi(\varphi,t_{j})\rangle-\langle\chi(\varphi,t_{i})\rangle{}$
(11) $\displaystyle=$
$\displaystyle\frac{\mathcal{A}(\varphi)}{t_{\textrm{obs}}}\int^{t_{\textrm{obs}}/2}_{-t_{\textrm{obs}}/2}\\{\cos{[\omega(t_{i}+\delta
t)+\varphi+\delta(\varphi)]}{}$ $\displaystyle-$
$\displaystyle\cos{[\omega(t_{j}+\delta t)+\varphi+\delta(\varphi)]}\\}\
d\delta t{}$ $\displaystyle=$
$\displaystyle\widetilde{\mathcal{A}(\varphi)}\sin{[\omega(t_{i}+t_{\textrm{int}}/2)+\varphi+\delta(\varphi)]}$

where $\widetilde{\mathcal{A}(\varphi)}=2\mathcal{A}(\varphi)\sin{[\omega
t_{\textrm{int}}/2]}\sin{[\omega t_{\textrm{obs}}/2]}/(\omega
t_{\textrm{obs}}/2)$. The factor $\sin{[\omega t_{\textrm{obs}}/2]}/(\omega
t_{\textrm{obs}}/2)$ represents the washout effect due to the time averaging
over the observation time of each day, while $\sin{[\omega
t_{\textrm{int}}/2]}$ represents how much the axion cloud has changed during
the time interval of a given day. For the parameter space we are interested
in, the axion oscillation period is larger than one day. Thus $\sin{[\omega
t_{\textrm{int}}/2]}$ contributes as a suppression factor, which makes the
constraints in the lower mass region weaker in Fig. 3. Finally, we note that
one can absorb $\omega(t_{i}+t_{\textrm{int}}/2)$ into the phase of the axion
cloud $\delta_{0}$, which is a nuisance parameter in the analysis.

In Fig. 8 of Ref. [5], $\langle\chi(\varphi)\rangle$ is constructed using five
different methods. The obtained results do not perfectly agree with each
other, reflecting possible differences in the systematic uncertainties of each
analysis. However, we are mainly interested in the time variation of the EVPA.
We therefore assume that these systematics can be largely eliminated for this
differential study.

The reconstruction of $\langle\chi(\varphi)\rangle$ from the data is subtle.
For example, there are nontrivial leakages between the polarization modes in
the measurements, characterized by the so-called D-term. These can lead to
uncertainties in $\langle\chi(\varphi)\rangle$. For some values of $\varphi$
(particularly when the polarized intensity is low), the reconstruction gives
ambiguous results, which appear as bifurcations in the figure. In our analysis
we apply a conservative approach, removing the range of $\varphi$ where
reconstruction ambiguities appear. We choose a bin-size of $10^{\circ}$ in
order to reduce the correlations among different azimuthal angles. We only
keep the bins whose EVPA distribution can be properly fit by a Gaussian
function without ambiguous bifurcations. For example, in the results produced
by the polsolve method[74], the left bins have azimuthal angles ranging
between 30∘ to 90∘ and 170∘ to 330∘ for the April 5 data, and 30∘ to 310∘ for
the April 11 data. Effectively we then have $53$ bins in total. For each bin,
we fit the stripe width by a Gaussian function to obtain an estimation of the
measurement error. The errors roughly range from $\pm 3^{\circ}$ to $\pm
15^{\circ}$. For other methods the uncertainties in the regions with strong
intensity are nearly the same, and thus they give comparable axion constraints
as those shown in Fig. 3.

Statistics We use Bayesian statistics to derive the 95% credible level (C.L.)
upper limits on the axion-photon coupling, characterized by $c$, for different
axion masses $m_{a}$ (or equivalently, $\alpha$, for a given black hole mass).
The marginalized posterior of $c$ is written as

$\Pr\left(\log_{10}c|\boldsymbol{d},m_{a}\right)=\frac{1}{\rm
Const}\int_{0}^{2\pi}\frac{{\rm
d}\delta_{0}}{2\pi}\prod_{i}\frac{1}{\sqrt{2\pi}\sigma_{i}}e^{-\left(d_{i}-d^{0}_{i}(c,m_{a},\delta_{0})\right)^{2}/\left(2\sigma_{i}^{2}\right)},$
(12)

where we assume that the priors of the initial phase $\delta_{0}$ and
$\log_{10}c$ are uniform. The denominator, ${\rm Const}$, is the normalization
factor which does not need to be calculated in our case. In the exponent
$d_{i}$ represents the EVPA variation in a sequential-day pair in the
experimental data, while the sub-index $i$ runs over both the azimuthal angle
bins and the two pairs, i.e., $\langle\chi(\varphi,{\rm
day}6)\rangle-\langle\chi(\varphi,{\rm day5})\rangle$ and
$\langle\chi(\varphi,{\rm day11})\rangle-\langle\chi(\varphi,{\rm
day10})\rangle$. The parameter $d_{i}^{0}(c,m_{a},\delta_{0})$ is the
theoretical prediction of the EVPA variation, derived from Eq. (11), while
$\sigma_{i}$ characterizes the uncertainty in the data. As stated in Ref. [5],
no significant EVPA variations are observed in any sequential-day pairs, which
indicates ${d_{i}}=0$. We then perform the integration on the marginalized
posterior in order to obtain the cumulative probability of $\log_{10}c_{\rm
ul}$, where $c_{\rm ul}$ is the upper limit of c to achieve a corresponding
probability value,

$\Pr\left(\log_{10}c<\log_{10}c_{\rm
ul}|\boldsymbol{d}=0,m_{a}\right)=\int_{\log_{10}c_{\rm min}}^{\log_{10}c_{\rm
ul}}\Pr\left(\log_{10}c|\boldsymbol{d}=0,m_{a}\right){\rm d}\log_{10}c.$ (13)

Here we choose $c_{\rm min}=\alpha_{\rm EM}\simeq 1/137$, given by the
scenario with one species of charged fermion contributing to this anomaly
vertex. Here $\alpha_{\rm EM}$ is the electromagnetic fine structure constant.
A lower value of $c_{\rm min}$ is possible and it will lead to tighter
constraints. The 95% C.L. upper limit for $\log_{10}c$, denoted as
$\log_{10}c_{\rm 95\%}$, is calculated by inversely solving the following
equation

$95\%=\frac{\Pr\left(\log_{10}c<\log_{10}c_{\rm
95\%}|\boldsymbol{d}=0,m_{a}\right)}{\Pr\left(\log_{10}c<\log_{10}c_{\rm
max}|\boldsymbol{d}=0,m_{a}\right)}$ (14)

where we choose $c_{\rm max}$ to be a large number, such as $10^{3}$. We note
that our result is not sensitive to this choice, and the normalization factor
${\rm Const}$ is also automatically cancelled in this calculation.

Of course, there are uncertainties from the time-dependent astrophysical
background. The time variation of the accretion flow is not well understood,
and consequently it is not included in our simulation discussed above. This
leads to the major subtlety when we compare results from simulations with
observations. For M87⋆ with mass $6.5\times 10^{9}$ solar masses[1, 2, 3, 4],
the typical time scale is 5 days for light propagating near the innermost
stable circular orbit (ISCO). In addition, for gas in the accretion flow with
a sub-Keplerian velocity distribution, the associated time scale is
approximately one month at $r\simeq 5r_{g}$. Thus it is reasonable to expect
that the astrophysical features at large scales, comparable to the size of the
accretion flow, remain approximately unchanged over a time scale of one day.
The differential EVPA for two sequential days, i.e.,
$\langle\chi(\varphi,t_{j})\rangle-\langle\chi(\varphi,t_{i})\rangle$, is an
ideal observable with the astrophysical uncertainties being highly suppressed.

To qualitatively estimate this uncertainty among the azimuthal angle bins
selected in our analysis, we find the common ones shared in April 5 and April
11 data, and calculate the differences between the average values of
$\langle\chi(\varphi)\rangle$. Assuming the accretion flow dynamics lead to an
approximately linear variation during the 6-day interval, we divide the
difference in each bin by a factor of 6. This provides a rough estimate of the
variation induced by the astrophysical background. By comparing it with the
error bar derived for
$\langle\chi(\varphi,t_{j})\rangle-\langle\chi(\varphi,t_{i})\rangle$, we find
that the astrophysical background uncertainty is generally smaller than that
from the EVPA reconstruction. This justifies the validity of our proposed
analysis strategy.

Line of Sight Washout Effect Here we investigate in detail how the integral
along the line of sight leads to a washout effect. As discussed previously,
the axion-induced birefringence can be incorporated via a modification of the
radiative transfer matrix. To gain some intuition, we simplify the problem by
ignoring in-medium effects, keeping only the source terms and the axion
effect. Then the evolution of the linear polarization can be written as

$\frac{d\Big{(}Q+i\ U\Big{)}}{ds}=j_{Q}+i\
j_{U}-i2g_{a\gamma}\frac{da}{ds}\Big{(}Q+i\ U\Big{)}.$ (15)

This can be generally solved via

$\displaystyle Q(s_{f})+i\ U(s_{f})={}$
$\displaystyle\int_{s_{i}}^{s_{f}}e^{i2g_{a\gamma}\Big{(}a(s_{f})-a(s)\Big{)}}\Big{(}j_{Q}(s)+i\
j_{U}(s)\Big{)}ds,$ (16)

where $s_{i}$ and $s_{f}$ are the initial and final points along the line of
sight. Further simplifying, we assume the radiation source terms, $j_{Q}$ and
$j_{U}$, are constant in a finite region. Thus the washout effect is
characterized by the axion-dependent integral in Eq. (5). For a qualitative
estimation, we take $a(s)$ to be a coherently oscillating background with a
constant amplitude $a_{0}$ over the same region. The resulting washout effect
on $\mathcal{A}$, defined in Eq. (4), is shown in Figure 4, as a function of
the size of the radiation source $S_{r}$, normalized by the axion Compton
wavelength $2\pi\lambda_{c}$. Here we see that the washout effect is
negligible if $\lambda_{c}\gg S_{r}$, and it becomes sizable when these two
scales are comparable.

Figure 4: Washout effect on the oscillation amplitude of the EVPA as a
function of the size of the radiation source $S_{r}$, normalized by the axion
Compton wavelength $2\pi\lambda_{c}$. We assume the radiation source terms,
$j_{Q}$ and $j_{U}$, are constant in a finite region and take the axion field
to be a coherently oscillating background with a constant amplitude $a_{0}$
over the region.

In a realistic scenario like the optically thin accretion flow around M87⋆,
$S_{r}$ is determined by the geometric thickness of the accretion flow. The
washout effect is not important if the accretion flow satisfies
$r_{\textrm{ring}}H<2\pi\lambda_{c}$. Taking $\alpha\equiv
r_{g}/\lambda_{c}=0.4$ and $r_{\textrm{ring}}\simeq 5r_{g}$, this condition
becomes $H\ll 3$, which is easily satisfied in our RIAF model. For smaller
$\alpha$, due to the much larger $\lambda_{c}$, this washout effect along the
line of sight is further reduced.

Furthermore, there are also contributions from lensed photons; since the
dominant emission comes from around the equatorial plane, the observed photon
ring contains radiation which has propagated around the black hole several
times. Since the axion cloud had different phases when these photons were
emitted, they also lead to washout effects to the EVPA variations, as shown in
Fig. 2. We note that in more realistic cases, such as the accretion flow in
the general relativistic magnetohydrodynamic simulations, the lensed photons
are typically less polarized than the direct emission due to magnetic
turbulence [73]. Thus using the analytic RIAF as a benchmark in this study
serves as a conservative estimation.

We are grateful to Nick Houston, Samuel Liebersbach and Dimitrios Psaltis for
careful reading and useful comments on the manuscript, and Chunlong Li, Ye-Fei
Yuan, Shan-Shan Zhao and Zihan Zhou for useful discussions. Y.C. is supported
by the China Postdoctoral Science Foundation under Grants No. 2020T130661, No.
2020M680688, the International Postdoctoral Exchange Fellowship Program, and
by the National Natural Science Foundation of China (NSFC) under Grants No.
12047557. R.-S.L. is supported by the Max Planck Partner Group of the MPG and
the Chinese Academy of Sciences (CAS), the NSFC under Grant No. 11933007, the
Research Program of Fundamental and Frontier Sciences of CAS under Grant No.
ZDBS-LY-SLH011, and the Shanghai Pilot Program for Basic Research ? Chinese
Academy of Science, Shanghai Branch (JCYJ-SHFY-2021-013). Y.M. is supported by
the ERC Synergy Grant “BlackHoleCam: Imaging the Event Horizon of Black Holes”
under Grant No. 610058. J.S. is supported by the NSFC under Grants No.
12025507, No. 11690022, No. 11947302, by the Strategic Priority Research
Program and Key Research Program of Frontier Science of CAS under Grants No.
XDB21010200, No. XDB23010000, and No. ZDBS-LY-7003 and CAS project for Young
Scientists in Basic Research YSBR-006. Q.Y. is supported by the NSFC under
Grants No. 11722328, No. 11851305, by the Key Research Program of CAS under
Grant No. XDPB15, and by the Program for Innovative Talents and Entrepreneur
in Jiangsu. Y.Z. is supported by U.S. Department of Energy under Award No.
DESC0009959. Y.C. would like to thank the SHAO and TDLI for their kind
hospitality. Y.Z. would like to thank the ITP-CAS for their kind hospitality.

JS, QY and YZ initiated this study, YC, XX and YZ developed the method, XX, YL
and YC analyzed the data with important contribution from YM and RSL, YM
offered guidance on accretion flow models, YC and YZ wrote the initial draft,
with contributions from QY and JS. All authors have reviewed, discussed, and
commented on the modeling, data analysis, and the manuscript. Correspondence
and requests for materials should be addressed to YC (yifan.chen@itp.ac.cn),
YM (mizuno@sjtu.edu.cn), JS (jshu@itp.ac.cn), QY (yuanq@pmo.ac.cn), and YZ
(zhaoyue@physics.utah.edu).

The data of polarimetric measurements used in this paper is drawn from the
publicly available publication of Event Horizon Telescope collaboration [5].
The data that support the plots within this paper and other findings of this
study can be found at https://github.com/XueXiao-Physics/Axion_EHT_2021.

The simulation codes used in this study are a modified version of publicly
available code IPOLE [33, 34] (https://github.com/moscibrodzka/ipole). The
data analysis codes can be found at
https://github.com/XueXiao-Physics/Axion_EHT_2021.

The authors declare no competing interests.

## References

  * [1] Event Horizon Telescope Collaboration et al. First M87 Event Horizon Telescope Results. I. The Shadow of the Supermassive Black Hole.  Astrophys. J. Lett., 875, L1 (2019).
  * [2] Event Horizon Telescope Collaboration et al. First M87 Event Horizon Telescope Results. IV. Imaging the Central Supermassive Black Hole.  Astrophys. J. Lett., 875, L4 (2019).
  * [3] Event Horizon Telescope Collaboration et al. First M87 Event Horizon Telescope Results. VI. The Shadow and Mass of the Central Black Hole.  Astrophys. J. Lett., 875, L6 (2019).
  * [4] Event Horizon Telescope Collaboration et al. First M87 Event Horizon Telescope Results. V. Physical Origin of the Asymmetric Ring.  Astrophys. J. Lett., 875, L5 (2019).
  * [5] Event Horizon Telescope Collaboration et al. First m87 event horizon telescope results. VII. polarization of the ring.  Astrophys. J. Lett., 910, L12 (2021).
  * [6] Event Horizon Telescope Collaboration et al. First m87 event horizon telescope results. VIII. magnetic field structure near the event horizon.  Astrophys. J. Lett., 910, L13 (2021).
  * [7] Peccei, R. D. & Quinn, H. R.  CP Conservation in the Presence of Instantons.  Phys. Rev. Lett., 38, 1440-1443 (1977).
  * [8] Peccei, R. D. & Quinn, H. R.  Constraints Imposed by CP Conservation in the Presence of Instantons.  Phys. Rev. D, 16, 1791-1797 (1977).
  * [9] Weinberg, S.  A New Light Boson?  Phys. Rev. Lett., 40, 223-226 (1978).
  * [10] Wilczek, F.  Problem of Strong $P$ and $T$ Invariance in the Presence of Instantons.  Phys. Rev. Lett., 40, 279-282 (1978).
  * [11] Arvanitaki, A., Dimopoulos, S., Dubovsky, S., Kaloper, N. & March-Russell, J.  String Axiverse.  Phys. Rev. D, 81, 123530 (2010).
  * [12] Preskill, J., Wise, M. B. & Wilczek, F.  Cosmology of the Invisible Axion.  Phys. Lett. B, 120, 127-132 (1983).
  * [13] Abbott, L. F. & Sikivie, P.  A Cosmological Bound on the Invisible Axion.  Phys. Lett. B, 120, 133-136 (1983).
  * [14] Dine, M. & Fischler, W.  The Not So Harmless Axion.  Phys. Lett. B, 120, 137-141 (1983).
  * [15] Chen, Y., Shu, J., Xue, X., Yuan, Q. & Zhao, Y.  Probing Axions with Event Horizon Telescope Polarimetric Measurements.  Phys. Rev. Lett., 124, 061102 (2020).
  * [16] Penrose, R. & Floyd, R. M.  Extraction of rotational energy from a black hole.  Nature, 229, 177-179 (1971).
  * [17] Zel’Dovich, Y. B.  Generation of Waves by a Rotating Body.  J. Exp. Theor. Phys. Lett, 14, 180-181 (1971).
  * [18] Press, W. H. & Teukolsky, S. A.  Floating Orbits, Superradiant Scattering and the Black-hole Bomb.  Nature, 238, 211-212 (1972).
  * [19] Carroll, S. M., Field, G. B. & Jackiw, R.  Limits on a Lorentz and Parity Violating Modification of Electrodynamics.  Phys. Rev. D, 41, 1231 (1990).
  * [20] Harari, D. & Sikivie, P.  Effects of a Nambu-Goldstone boson on the polarization of radio galaxies and the cosmic microwave background.  Phys. Lett. B, 289, 67-72 (1992).
  * [21] Yoshino, H. & Kodama, H.  Bosenova collapse of axion cloud around a rotating black hole.  Prog. Theor. Phys., 128, 153-190 (2012).
  * [22] Yoshino, H. & Kodama, H.  Gravitational radiation from an axion cloud around a black hole: Superradiant phase.  PTEP, 2014, 043E02 (2014).
  * [23] Yoshino, H. & Kodama, H.  The bosenova and axiverse.  Class. Quant. Grav., 32, 214001 (2015).
  * [24] Baryakhtar, M., Galanis, M., Lasenby, R. & Simon, O.  Black hole superradiance of self-interacting scalar fields.  Phys. Rev. D, 103, 095019 (2021).
  * [25] Arvanitaki, A. & Dubovsky, S.  Exploring the String Axiverse with Precision Black Hole Physics.  Phys. Rev. D, 83, 044026 (2011).
  * [26] Dolan, S. R.  Instability of the massive Klein-Gordon field on the Kerr spacetime.  Phys. Rev. D, 76, 084001 (2007).
  * [27] Schwarz, D. J., Goswami, J. & Basu, A.  Geometric optics in the presence of axionlike particles in curved spacetime.  Phys. Rev. D, 103, L081306 (2021).
  * [28] Pu, H.-Y. & Broderick, A. E.  Probing the innermost accretion flow geometry of Sgr A* with Event Horizon Telescope.  Astrophys. J., 863, 148 (2018).
  * [29] Igumenshchev, I. V., Narayan, R. & Abramowicz, M. A.  Three-dimensional mhd simulations of radiatively inefficient accretion flows.  Astrophys. J., 592, 1042-1059 (2003).
  * [30] Narayan, R., Igumenshchev, I. V. & Abramowicz, M. A.  Magnetically arrested disk: an energetically efficient accretion flow.  Publ. Astron. Soc. Jap., 55, L69 (2003).
  * [31] McKinney, J. C., Tchekhovskoy, A. & Blandford, R. D.  General Relativistic Magnetohydrodynamic Simulations of Magnetically Choked Accretion Flows around Black Holes.  Mon. Not. Roy. Astron. Soc., 423, 3083 (2012).
  * [32] Tchekhovskoy, A.  Launching of Active Galactic Nuclei Jets.  Astrophysics and Space Science Library, 414, 45 (2015).
  * [33] Moscibrodzka, M. & Gammie, C. F.  ipole – semi-analytic scheme for relativistic polarized radiative transport.  Mon. Not. Roy. Astron. Soc., 475, 43-54 (2018).
  * [34] Noble, S. C., Leung, P. K., Gammie, C. F. & Book, L. G.  Simulating the Emission and Outflows from Accretion Disks.  Class. Quant. Grav., 24, S259-S274 (2007).
  * [35] Tamburini, F., Thidé, B. & Valle, M. D.  Measurement of the spin of the M87 black hole from its observed twisted light.  Mon. Not. Roy. Astron. Soc., 492, L22-L27 (2020).
  * [36] Feng, J. & Wu, Q.  Constraint on the black-hole spin of M87 from the accretion-jet model.  Mon. Not. Roy. Astron. Soc., 470, 612 (2017).
  * [37] Davoudiasl, H. & Denton, P. B.  Ultralight Boson Dark Matter and Event Horizon Telescope Observations of M87*.  Phys. Rev. Lett., 123, 021102 (2019).
  * [38] Anastassopoulos, V. et al. New CAST Limit on the Axion-Photon Interaction.  Nature Phys., 13, 584-590 (2017).
  * [39] Payez, A. et al. Revisiting the SN1987A gamma-ray limit on ultralight axion-like particles.  J. Cosmol. Astropart. Phys., 02, 006 (2015).
  * [40] Dessert, C., Foster, J. W. & Safdi, B. R.  X-ray Searches for Axions from Super Star Clusters.  Phys. Rev. Lett., 125, 261102 (2020).
  * [41] Marsh, M. C. D. et al. A New Bound on Axion-Like Particles.  J. Cosmol. Astropart. Phys., 12, 036 (2017).
  * [42] Reynolds, C. S. et al. Astrophysical Limits on Very Light Axion-like Particles from Chandra Grating Spectroscopy of NGC 1275.  Astrophys. J., 890, 59 (2020).
  * [43] Kaplan, D. E. & Rattazzi, R.  Large field excursions and approximate discrete symmetries from a clockwork axion.  Phys. Rev. D, 93, 085007 (2016).
  * [44] Farina, M., Pappadopulo, D., Rompineve, F. & Tesi, A.  The photo-philic QCD axion.  J. High Energy Phys., 01, 095 (2017).
  * [45] Raymond, A. W. et al. Evaluation of New Submillimeter VLBI Sites for the Event Horizon Telescope.  Astrophys. J. Supp., 253, 5 (2021).
  * [46] Damour, T., Deruelle, N. & Ruffini, R.  On Quantum Resonances in Stationary Geometries.  Lett. Nuovo Cim., 15, 257-262 (1976).
  * [47] Zouros, T. J. M. & Eardley, D. M.  Instabilities of massive scalar perturbations of a rotating black hole.  Annals Phys., 118, 139-155 (1979).
  * [48] Detweiler, S. L.  Klein-Gordon equation and rotating black holes.  Phys. Rev. D, 22, 2323-2326 (1980).
  * [49] Strafuss, M. J. & Khanna, G.  Massive scalar field instability in Kerr spacetime.  Phys. Rev. D, 71, 024034 (2005).
  * [50] Brito, R., Cardoso, V. & Pani, P.  Superradiance: New Frontiers in Black Hole Physics.  Lect. Notes Phys., 906, 1-237 (2015).
  * [51] Cruz-Osorio, A. et al. State-of-the-art Energetic and Morphological Modelling of the Launching Site of the M87 Jet.  Nat. Astron., in press (2021).
  * [52] Amorim, A. et al. Scalar field effects on the orbit of S2 star.  Mon. Not. R. Astron. Soc., 489, 4606-4621 (2019).
  * [53] Arvanitaki, A., Baryakhtar, M. & Huang, X.  Discovering the QCD Axion with Black Holes and Gravitational Waves.  Phys. Rev. D, 91, 084011 (2015).
  * [54] Brito, R., Cardoso, V. & Pani, P.  Black holes as particle detectors: evolution of superradiant instabilities.  Class. Quant. Grav., 32, 134001 (2015).
  * [55] Stott, M. J.  Ultralight Bosonic Field Mass Bounds from Astrophysical Black Hole Spin.  Arxiv Preprint, arXiv:2009.07206 (2020).
  * [56] Ünal, C., Pacucci, F. & Loeb, A.  Properties of ultralight bosons from heavy quasar spins via superradiance.  J. Cosmol. Astropart. Phys., 05, 007 (2021).
  * [57] Omiya, H., Takahashi, T. & Tanaka, T.  Renormalization group analysis of superradiant growth of self-interacting axion cloud.  PTEP, 2021, 043E02 (2021).
  * [58] Narayan, R., Kato, S. & Honma, F.  Global structure and dynamics of advection-dominated accretion flows around black holes.  Astrophys. J., 476, 49 (1997).
  * [59] Yuan, F. & Narayan, R.  Hot Accretion Flows Around Black Holes.  Ann. Rev. Astron. Astrophys., 52, 529-588 (2014).
  * [60] Prieto, M. A., Fernandez-Ontiveros, J. A., Markoff, S., Espada, D. & Gonzalez-Martin, O.  The central parsecs of M87: jet emission and an elusive accretion disc.  Mon. Not. Roy. Astron. Soc., 457, 3801-3816 (2016).
  * [61] Trippe, S.  Polarization and Polarimetry.  J. Kor. Astron. Soc., 47, 15-39 (2014).
  * [62] Plascencia, A. D. & Urbano, A.  Black hole superradiance and polarization-dependent bending of light.  J. Cosmol. Astropart. Phys., 04, 059 (2018).
  * [63] Ivanov, M. M. et al. Constraining the photon coupling of ultra-light dark-matter axion-like particles by polarization variations of parsec-scale jets in active galaxies.  J. Cosmol. Astropart. Phys., 02, 059 (2019).
  * [64] Fujita, T., Tazaki, R. & Toma, K.  Hunting Axion Dark Matter with Protoplanetary Disk Polarimetry.  Phys. Rev. Lett., 122, 191101 (2019).
  * [65] Liu, T., Smoot, G. & Zhao, Y.  Detecting axionlike dark matter with linearly polarized pulsar light.  Phys. Rev. D, 101, 063012 (2020).
  * [66] Fedderke, M. A., Graham, P. W. & Rajendran, S.  Axion Dark Matter Detection with CMB Polarization.  Phys. Rev. D, 100, 015040 (2019).
  * [67] Caputo, A. et al. Constraints on millicharged dark matter and axionlike particles from timing of radio waves.  Phys. Rev. D, 100, 063515 (2019).
  * [68] Yuan, G.-W. et al. Testing the ALP-photon coupling with polarization measurements of Sagittarius A∗.  J. Cosmol. Astropart. Phys., 03, 018 (2021).
  * [69] Johannsen, T. & Psaltis, D.  Testing the No-Hair Theorem with Observations in the Electromagnetic Spectrum: II. Black-Hole Images.  Astrophys. J., 718, 446-454 (2010).
  * [70] Gralla, S. E., Holz, D. E. & Wald, R. M.  Black Hole Shadows, Photon Rings, and Lensing Rings.  Phys. Rev. D, 100, 024018 (2019).
  * [71] Johnson, M. D. et al. Universal interferometric signatures of a black hole’s photon ring.  Sci. Adv., 6, eaaz1310 (2020).
  * [72] Gralla, S. E. & Lupsasca, A.  Lensing by Kerr Black Holes.  Phys. Rev. D, 101, 044031 (2020).
  * [73] Jiménez-Rosales, A. et al. Relative depolarization of the black hole photon ring in GRMHD models of Sgr A* and M87*.  Mon. Not. Roy. Astron. Soc., 503, 4563-4575 (2021).
  * [74] Marti-Vidal, I., Mus, A., Janssen, M., de Vicente, P. & Gonzalez, J.  Polarization calibration techniques for the new-generation VLBI.  Astron. Astrophys., 646, A52 (2021).


# Improving API Documentation Comprehensibility via Continuous Optimization
and Multilingual SDK

Shujun Wang<EMAIL_ADDRESS>Alibaba GroupBeijingChina100000 ,
Yongqiang Tian<EMAIL_ADDRESS>Alibaba GroupBeijingChina100000 and
Dengcheng He<EMAIL_ADDRESS>Alibaba GroupHangZhouChina100000

###### Abstract.

Optimizing and maintaining up-to-date API documentation is a challenging
problem for evolving OpenAPIs. In this poster, we propose a data-driven
continuous optimization solution and multilingual SDK generation scheme to
improve the comprehensibility of API documentation. We compute the correlation
between API integrity and API trial success rate. Based on this, we partition
the API to ensure that each API has a correct optimization direction. Then, we
propose a fine-grained(i.e., parameter level) continuous optimization solution
to annotate problems in API documents in real-time. Based on the above
resolutions, we can provide theoretical analysis and support for the
optimization and management of API documents. Finally, we explore the crucial
challenges of OpenAPIs and introduce a tailored solution, TeaDSL, a multi-
language SDK solution for all OpenAPI gateways. TeaDSL is a domain-specific
language that expresses OpenAPI gateways, generating SDKs, code samples, and
test cases. The experiments evaluated on the online system show that this
work’s approach significantly improves the user experience of learning
OpenAPIs.

API, Data-driven, Optimization, Real-time

##  1\. Introduction

Application Programming Interfaces (APIs) play an essential role in modern
software development(Huang et al., 2018). OpenAPI indicates a behavior where
producers offer Application Programming Interfaces (APIs) to help end-users
access their data, resources, and services. With the help of OpenAPIs,
developers can complete their tasks more efficiently(Gu et al., 2016). Thus,
OpenAPI has received extensive attention from industry and academia(Zhong et
al., 2020; Nguyen et al., 2017; Wen et al., 2019; Shen et al., 2020). Table 1
exhibits a fragment of API documentation. Researchers identified the
documentation of APIs as the primary source of information and the critical
obstacle to API usability. In this regard, researchers have identified the
qualities of ”good API documentation” as follows: complete, correct, includes
thorough explanations and code examples, and provides consistent presentation
and organization.

Table 1. A Fragment of API Documenration Parameter | Type | Required | Description | Example
---|---|---|---|---
TemplateCode | String | Yes | Message Template ID | SMS_123456
PhoneNumber | String | Yes | Phone Number | 186****9602

As of January 2023, Alibaba Cloud lists over 14500 OpenAPIs for web
services(https://next.api.aliyun.com/home), and these APIs currently serve
hundreds of thousands of users. Based on an ocean of users interacting with
the API documentation, we detected that the ”Comprehensibility” of the
documentation should also be a component of ”good documentation.” Actually,
”Comprehensibility” is an empirical challenge for end-users since the
knowledge gap between API designers and API users(Lamothe, 2020). We continue
to optimize the API documentation based on user feedback to mind this gap.
However, the feedback-based document optimization solution has two significant
shortcomings: The amount of feedback within a period is limited, and user
feedback is usually coarse-grained, such as ”document problem” and ”document
unclear.”

Besides, many researchers have pointed out that multilingual SDK code samples
are essential to API documentation. However, existing work for SDK generation
mainly focuses on generating isolated SDKs. In this case, the SDK and OpenAPI
gateway are highly coupled, which means that any change in the OpenAPI gateway
will cause all SDKs to be rewritten.

Figure 1. Traditional SDK Generation

Inspired above, we investigated TeaDSL111https://github.com/aliyun/darabonba
222https://github.com/aliyun/darabonba-openapi, a multi-language SDK solution
for all OpenAPI gateways. Different existing SDK generation principles, our
method decouple SDK from gateways(See Figure 2).

Figure 2. TeaDSL SDK Generation

In summary, the contributions are outlined as follows:

  1. (1)

We design an API workbench(https://next.api.alibabacloud.com) to help users
learn and use APIs, and we are willing to share all the data on this
workbench.

  2. (2)

We explore a user experience-first method to set massive API documents’
optimization order and plan.

  3. (3)

We present a real-time, fine-grained, and continuous method for evolving API
documentation.

  4. (4)

We propose TeaDSL, which can be used as an intermediate language that supports
different API gateways. TeaDSL allows the generation of SDKs in different
languages with unified intermediate representation.

##  2\. Four-quadrant Management

In this section, we propose a four-quadrant management method to arrange the
order of API optimization. The abscissa is the document coverage rate, and the
ordinate is the API trial success rate.

Figure 3. API Four-quadrant Management

Each point in Figure 3 represents an API. The API of the third quadrant should
be governed first (i.e., improve document coverage). APIs in the fourth
quadrant should be manually intervened. The governance measures for these APIs
may improve the quality of documents. The governance priority of APIs in the
first and second quadrants can be lower.

##  3\. Fine-grained Optimization

Take the Alibaba Cloud OpenAPI developer portal as an example. Many users
learn to call and debug API through the description of the document on the
portal. Hence, the User’s debugging record (input parameters entered by the
User) represents the User’s understanding of the document. If a parameter’s
description or example is not clear enough, the User will frequently make
mistakes in the parameter’s input. Thus, our core idea is:

Comparing the correct parameter input and incorrect input of the same User
calling the same API, the difference between the parameters is that users are
prone to errors.

We divide the errors into two categories:

  * •

The parameter sequence is different between the correct and wrong calls. For
instance, some parameters are missing from the wrong parameter sequence.

  * •

The parameter value is different between the correct call and the wrong call.

We employ a running example to illustrate our algorithm. Assuming that we have
a valid request(See #Correct) and a wrong request(See #Wrong) from the same
User, we first split all request parameters to the finest granularity. For
example, we translate ”TemplateParam”:”{”code”: ”123123”}” to
”TemplateParam.code”: ”123123”. After that, we will compare the difference
between the correct request and the wrong request. Crucially, we use ”-” to
indicate that the reason for the request error is the lack of parameters and
”+” to indicate that there are extra parameters.

A Running Example

⬇

1#Correct

2{

3 "PhoneNumbers":"177xxxx9887",

4 "SignName":Peking University Hospital,

5 "TemplateCode":"SMS_180240289",

6 "TemplateParam":"{"code":"123123"}"

7}

8#Wrong

9{

10 "PhoneNumbers":"157xxxx0621",

11 "SignName": Peking University,

12 "TemplateCode": successful endoscopy

13}

After the algorithm is processed, the output is,

⬇

1[

2 ’-TemplateParam’, #TemplateParam is missing

3 ’-TemplateParam.code’,

4 ’PhoneNumbers’, #PhoneNumbers are different

5 ’SignName’,

6 ’TemplateCode’

7]

##  4\. TeaDSL

Swagger is currently a general solution for generating multilingual SDKs.
However, Swagger only serves RESTful style APIs, making it impossible for many
other styles to use Swagger. For example, Alibaba Cloud has many different
styles of API gateways, different signature algorithms, and serialization
formats, all of which are not RESTful OpenAPIs. To overcome this problem, we
explore the crucial challenges of OpenAPIs and introduce a tailored solution,
TeaDSL, a multi-language SDK solution for all OpenAPI gateways. TeaDSL is a
domain-specific language expressing OpenAPI gateways, generating SDKs, code
samples, and test cases.

As shown in Figure 4, there are two stages in TeaDSL: OpenAPI Parsing and
TeaDSL Translating. TeaDSL, in the first stage, is to extract all semantics of
the OpenAPI gateway description(e.g., protocol, port, request, and response)
to build TeaDSL. Then, TeaDSL will be translated into multiple programming
language SDKs.

Figure 4. TeaDSL Architecture

###  4.1. OpenAPI Parsing

####  4.1.1. Abstract Module

We first propose a high-level abstract approach to model all OpenAPI gateways.
We investigated that all the OpenAPIs provide services based on the HTTP
protocol stack. Thus, we model OpenAPI gateways as follows:

⬇

1{

2 protocol: string, //HTTP or HTTPS

3 port: number, //TCP port

4 host: string, //domain

5 request: {

6 method: string, //HTTP method

7 pathname: string, //path name

8 query: map[string]string, //query string

9 headers: map[string]string, //headers

10 body: readable //request body

11 },

12 response: {

13 statusCode: number, //HTTP method

14 statusMessage: string, //path name

15 headers: map[string]string, //headers

16 body: readable //response body

17 },

18}

TeaDSL obeys HTTP-oriented programming principles.

####  4.1.2. Serialization Module

In this subsection, we introduce how to support different serialization
formats. In TeaDSL, we introduce the concept of model to describe data
structure. For example,

⬇

1model User {

2 username: string(pattern=’[a-zA-Z1-9]’),

3 age: number(pattern=’\\\d+’, min=18,max=99)

4}

Based on the concept of model, we can declare a serialization method as
follows:

⬇

1type @toJSONString = (User): string

Notice that we declare the behavior, not the specific implementation.
Individual performance is guaranteed before the final operation.

Finally, we use TeaDSL to package OpenAPI request/response into a method
similar to programming code, for instance:

⬇

1import Util;

2api getUser(username: string): User {

3 __request.method = ’GET’;

4 __request.pathname = ‘/users/${username}‘;

5 __request.headers = {

6 host = ’hostname’,

7 };

8} returns {

9 var body = Util.readAsJSON(__response.body);

10 return body;

11}

####  4.1.3. Logic Module

To make TeaDSL logical, we directly introduce process control(e.g., if/else
if) in the programming language to express complex logic.

####  4.1.4. Transactional Module

Transactional expression, unlike processing request and response with
sequence. Thus, we can express it through configuration.

###  4.2. TeaDSL Translating

This subsection emphasizes the problem of translating TeaDSL into multiple
programming language SDKs. Unlike existing template-based methods to generate
code, TeaDSL is a DSL code with grammar, morphology, and semantic rules.

As shown in Figure4, our TeaDSL translating stage comprises three modules,
i.e., Lexical Analysis, Grammatical analysis, and Semantic Analysis.

##  5\. Related Work

Several papers in the existing literature have focused on identifying the
characteristics that make an API usable based on case studies. Robillard
studied API usability by surveying 83 software developers at Microsoft
(Robillard and DeLine, 2011). They found that $78\%$ of the survey
participants read API documentation to learn the APIs, $55\%$ used code
examples, $34\%$ experimented with the APIs, $30\%$ read articles, and $29\%$
asked colleagues. Robillard et al. found that the most severe API learning
obstacles are related to API documentation. They suggested the following
requirements as must-haves for API documentation: include good examples, be
complete, support many example usage scenarios, be conveniently organized, and
include relevant design elements. Myers et al. also recognized documentation
as a critical component for API usability and suggested using examples in the
documentation to answer API-related questions (Myers and Stylos, 2016). Zibran
et al. found that $27.3\%$ of the reported bugs are API documentation bugs
studying repositories for 562 API usability-related bugs from five different
projects(Zibran et al., 2011). Scheller et al. provided a framework for
measuring API usability based on the number and types of different objects and
methods that the API provides(Scheller and Kühn, 2015).

Swagger Codegen can simplify the build process by generating server stubs and
client SDKs for any API defined with the OpenAPI (formerly known as Swagger)
specification(The OpenAPI Specification (OAS) defines a standard, language-
agnostic interface to RESTful APIs).

##  6\. Evaluation and Discussion

  1. (1)

Four-quadrant Management: We use the correlation between API completeness (API
document coverage) and API trial success rate to construct a four-quadrant
management plan for API governance and optimization. Related engineers in the
actual industrial scene have widely praised the solution.

  2. (2)

Continuous Documentation Optimization: We employ a simple case to demonstrate
our fine-grained document optimization solution, for example., API
DescribeInstances is used to query the detailed information of one or more ECS
instances. The success rate of this API call is only 52.6%.

Table 2. Error Analysis Errorcode | Parameter | Rate
---|---|---
InvalidParameter | +InstanceIds | 0.21
InvalidParameter | InstanceIds | 0.14
InvalidParameter | RegionId | 0.11

As shown in Table 1, We found that InstanceIds is an important cause of API
call errors (about 35%). In the original document, this parameter is non-
required. Its description is ”Instance ID. The value can be composed of
multiple instance IDs to form a JSON array, up to 100 IDs are supported, and
the IDs are separated by a comma (,)”. Its example is:
[”i-bp67acfmxazb4p****”, ”i-bp67acfmxazb4p****”]. Through further analysis of
the correct and incorrect calls of the User, when there is only one instance
id, the User’s input is no longer in the form of an array, such as
”i-bp67acfmxazb4p****” instead of [”i-bp67acfmxazb4p****”]. We changed the
example of this parameter to [”i-bp67acfmxazb4p****”], and now the success
rate of this API call is about 76%.

  3. (3)

Availability of TeaDSL : As shown in Figure 5, more than 40,000 users use the
SDK generated by TeaDSL to call API. TeaDSL supports the generation of 7
programming languages. We guarantee the availability of SDK generated by
TeaDSL¿99% (provided that the metadata is entered correctly).

  4. (4)

TeaDSL vs Swagger : When the input metadata meets the requirements, TeaDSL and
Swagger can ensure the SDK’s correctness. Therefore, we compare these two
tools in terms of user experience, such as usability, ease of use, stability,
etc. By analyzing more than 100 developer feedback, we found that the overall
evaluation of TeaDSL is better than Swagger.

Figure 5. TeaDSL UV

## CONCLUSIONS

OpenAPIs play an essential role in modern software development. With the help
of APIs, developers can complete their tasks more efficiently. However, ”Ease
of use OpenAPIs” is an empirical challenge for end-users of the knowledge gap
between API designers and API users. To mind this gap, we develop an OpenAPI
workbench to help end-users learn and debug OpenAPIs. Specifically, we present
a data-driven and fine-grained API documentation continuous optimization
solution. We employ TeaDSL to generate multilingual SDK to enrich API
documentation. The main features of TeaDSL are that it supports OpenAPIs of
different styles and the generation of SDKs and code samples in multiple
languages. The ultimate goal is consistency in all OpenAPI usage scenarios,
such as definition, documentation, SDK generation, and CLI support. Based on
the Alibaba Cloud Open Platform, we extend TeaDSL through integration with
more accessible tools to build a more compatible ecosystem than Swagger.

## Acknowledgments

This work was supported by Alibaba Group through Alibaba Innovative Research
Program.

## References

  * (1)
  * Gu et al. (2016) Xiaodong Gu, Hongyu Zhang, Dongmei Zhang, and Sunghun Kim. 2016.  Deep API learning. In _Proceedings of the 24th ACM SIGSOFT International Symposium on Foundations of Software Engineering, FSE 2016, Seattle, WA, USA, November 13-18, 2016_ , Thomas Zimmermann, Jane Cleland-Huang, and Zhendong Su (Eds.). ACM, 631–642.  https://doi.org/10.1145/2950290.2950334
  * Huang et al. (2018) Qiao Huang, Xin Xia, Zhenchang Xing, David Lo, and Xinyu Wang. 2018.  API method recommendation without worrying about the task-API knowledge gap. In _2018 33rd IEEE/ACM International Conference on Automated Software Engineering (ASE)_. IEEE, 293–304.
  * Lamothe (2020) Maxime Lamothe. 2020\.  Bridging the divide between API users and API developers by mining public code repositories. In _ICSE ’20: 42nd International Conference on Software Engineering, Companion Volume, Seoul, South Korea, 27 June - 19 July, 2020_ , Gregg Rothermel and Doo-Hwan Bae (Eds.). ACM, 178–181.  https://doi.org/10.1145/3377812.3382124
  * Myers and Stylos (2016) Brad A Myers and Jeffrey Stylos. 2016.  Improving API usability.  _Commun. ACM_ 59, 6 (2016), 62–69.
  * Nguyen et al. (2017) Trong Duc Nguyen, Anh Tuan Nguyen, Hung Dang Phan, and Tien N. Nguyen. 2017.  Exploring API embedding for API usages and applications. In _Proceedings of the 39th International Conference on Software Engineering, ICSE 2017, Buenos Aires, Argentina, May 20-28, 2017_ , Sebastián Uchitel, Alessandro Orso, and Martin P. Robillard (Eds.). IEEE / ACM, 438–449.  https://doi.org/10.1109/ICSE.2017.47
  * Robillard and DeLine (2011) Martin P Robillard and Robert DeLine. 2011.  A field study of API learning obstacles.  _Empirical Software Engineering_ 16, 6 (2011), 703–732.
  * Scheller and Kühn (2015) Thomas Scheller and Eva Kühn. 2015.  Automated measurement of API usability: The API concepts framework.  _Information and Software Technology_ 61 (2015), 145–162.
  * Shen et al. (2020) Qi Shen, Shijun Wu, Yanzhen Zou, Zixiao Zhu, and Bing Xie. 2020.  From API to NLI: A new interface for library reuse.  _J. Syst. Softw._ 169 (2020), 110728.  https://doi.org/10.1016/j.jss.2020.110728
  * Wen et al. (2019) Ming Wen, Yepang Liu, Rongxin Wu, Xuan Xie, Shing-Chi Cheung, and Zhendong Su. 2019\.  Exposing library API misuses via mutation analysis. In _Proceedings of the 41st International Conference on Software Engineering, ICSE 2019, Montreal, QC, Canada, May 25-31, 2019_ , Joanne M. Atlee, Tevfik Bultan, and Jon Whittle (Eds.). IEEE / ACM, 866–877.  https://doi.org/10.1109/ICSE.2019.00093
  * Zhong et al. (2020) Hao Zhong, Na Meng, Zexuan Li, and Li Jia. 2020\.  An empirical study on API parameter rules. In _ICSE ’20: 42nd International Conference on Software Engineering, Seoul, South Korea, 27 June - 19 July, 2020_ , Gregg Rothermel and Doo-Hwan Bae (Eds.). ACM, 899–911.  https://doi.org/10.1145/3377811.3380922
  * Zibran et al. (2011) Minhaz F Zibran, Farjana Z Eishita, and Chanchal K Roy. 2011\.  Useful, but usable? factors affecting the usability of APIs. In _2011 18th Working Conference on Reverse Engineering_. IEEE, 151–155.