# Light-tunable charge density wave orders in MoTe2 and WTe2 single layers

Giovanni Marini  Graphene Labs, Fondazione Istituto Italiano di Tecnologia,
Via Morego, I-16163 Genova, Italy<EMAIL_ADDRESS>Matteo Calandra
Department of Physics, University of Trento, Via Sommarive 14, 38123 Povo,
Italy  Graphene Labs, Fondazione Istituto Italiano di Tecnologia, Via Morego,
I-16163 Genova, Italy<EMAIL_ADDRESS>
###### Abstract

By using constrained density functional theory modeling, we demonstrate that
ultrafast optical pumping unveils hidden charge orders in group VI monolayer
transition metal ditellurides. We show that irradiation of the insulating 2H
phases stabilizes multiple transient charge density wave orders with light-
tunable distortion, periodicity, electronic structure and bandgap. Moreover,
optical pumping of the semimetallic 1T′ phases generates a transient charge
ordered metallic phase composed of 2D diamond clusters. For each transient
phase we identify the critical fluence at which it is observed and the
specific optical and Raman fingerprints to directly compare with future
ultrafast pump-probe experiments. Our work demonstrates that it is possible to
stabilize charge density waves even in insulating 2D transition metal
dichalcogenides by ultrafast irradiation.

Designing and manipulating broken symmetry states with laser light is an
appealing perspective as it can lead to the discovery of hidden ordered states
and enable control over a broad range of material properties Lloyd-Hughes  _et
al._ (2021); Maiuri  _et al._ (2020). Few layers transition metal
dichalcogenides (TMDs) are an ideal class of materials for ultrafast
investigations, mainly for two reasons. First, metallic dichalcogenides
display the occurrence of competing orders such as charge density wave (CDW)
phases and superconductivity. Second, insulating TMDs normally do not display
charge ordering but have typical gaps in the $1-2.5$ eV rangeRasmussen and
Thygesen (2015), ideal for optical pumping . Inducing CDW in insulating
dichalcogenides is important as it could lead to new low dimensional phases
with unexpected topological and correlation properties.

Particularly relevant are MoTe2 and WTe2 as the barrier existing between the
2H and the 1T′ phase is lower compared to the other compounds of the family
Qian  _et al._ (2014). The most stable MoTe2 polytype is the 2H, however it
has been shown that a transition towards the 1T′ can be selectively activated
in ultrathin layers by means of electrostatic doping Wang  _et al._ (2017),
tensile strain Song  _et al._ (2016a) and laser irradiation Cho  _et al._
(2015). Conversely, WTe2 is stable in the 1T′ polytype and the metastable 2H
phase has been synthesized only recently Li  _et al._ (2020); Sokolikova and
Mattevi (2020).

Most of the work carried out on irradiated MoTe2 concerns the irreversible
2H-1T′ phase transition. However, irreversible phase transitions are only a
small part of the broken symmetry charge ordered states available after laser
irradiation, as reversible transition towards transient phases can occur;
these can be detected either by ultrafast X-ray diffraction at X-ray free
electron laser facilitiesMatsubara  _et al._ (2016) or by pump-probe
experiments to measure optical or Raman spectra after the electronic
excitationFerrante  _et al._ (2018); Huang  _et al._ (1998).

Phase transitions under ultrafast irradiation have been observed for
conventional semiconductors under intense ultrafast irradiationSiders (1999);
Rousse  _et al._ (2001) (non-thermal melting), in phase-change
materialsMatsubara  _et al._ (2016) and have been proposed to occur in
ferroelectrics Paillard  _et al._ (2019). However, in most of these cases, the
ordered phase is present in the ground state and suppressed by irradiation.
Very few detections of hidden CDW orders (i.e. the ordered phase is a
transient state induced by light) have been devised or demonstratedKogar  _et
al._ (2020). Furthermore, it is unclear if hidden orders are present in single
layer dichalcogenides and at what fluence they can be observed.

In this work we demonstrate the occurrence of multiple charge ordered
transient states in MoTe2 and WTe2 single layers after ultrafast irradiation
of the 2H and 1T′ phases in the high-excitation density regime ($n_{e}\geq
10^{14}$ $~{}e^{-}/$cm2, where $n_{e}$ represents the photocarrier
concentration (PC)). Moreover we show the occurrence of a light-induced
bandgap closing in the 2H phases. Finally, we identify specific spectroscopic
fingerprints of each phase that will allow its detection in future ultrafast
experiments. We investigate the effect of laser irradiation within density
functional theory (DFT). In the case of insulators, we suitably constrain the
occupations of the Kohn-Sham conduction eigenstates in order to mimic the
thermalized photocarrier population. This approach has been described in Ref.
Tangney and Fahy (2002) and we refer to it as constrained DFT (cDFT). We
implemented the cDFT technique as well as the calculation of forces and stress
tensor in the presence of an electron-hole plasma within the Quantum ESPRESSO
distributionGiannozzi  _et al._ (2009, 2020). In the case of metals and
semimetals (1T′ phases), the radiative electron-hole recombination is
fastSchmitt  _et al._ (2008); Hajlaoui  _et al._ (2012), thus laser excitation
is simulated employing Fermi-Dirac occupations at high temperature. All the
simulation details are reported in the Supplemental Material (SM), which
includes Refs.Scherpelz  _et al._ (2016); Perdew  _et al._ (1996); Monkhorst
and Pack (1976); Naylor  _et al._ (2017); Kan  _et al._ (2015); Heyd  _et al._
(2003); Heyd and Scuseria (2004); Splendiani  _et al._ (2010); Yuan and Huang
(2015); Chernikov  _et al._ (2015); Haug and Koch (2009); Palummo  _et al._
(2015); Pan  _et al._ (2019); Froehlicher  _et al._ (2016); Ruppert  _et al._
(2014); Huang  _et al._ (2016); Alfè (2009); Kokalj (1999); Momma and Izumi
(2011); Li  _et al._ (2011); Erben  _et al._ (2020); Laturia  _et al._ (2018);
Sohier  _et al._ (2017); Marzari  _et al._ (1999); Kolobov  _et al._ (2016);
Krishnamoorthy  _et al._ (2018); Song  _et al._ (2016b); Lee  _et al._ (2016);
Cao  _et al._ (2017); Kim  _et al._ (2016); Yang  _et al._ (2019).

Figure 1: Schematic representation of hidden orders in monolayer
dichalcogenides. Upper panel: 2H-MoTe2 as a function of the PC ($f.u.$). Mo
clusterization is represented by green bonds. At $n_{e}=0.25~{}e^{-}/f.u.$
$(n_{e}=1~{}e^{-}/f.u.)$ the energy gain associated to the 2H $\rightarrow$
2H′ (2H $\rightarrow$ 2H′′) distortion is $107.2$ (583.1) meV$/f.u.$ , while
the 2H ${}^{\prime}\rightarrow$ 2H${}_{b}^{\prime}$
(2H${}^{\prime\prime}\rightarrow$ 2H${}_{a}^{{}^{\prime\prime}}$) distortion
has an energy gain of only $3.1$ (6.6) meV/$f.u.$ . Lower panel: 1T′-WTe2 as a
function of the PC ($f.u.$). Numbers in the crystal structure images represent
atomic distances in Å. For the relation between fluence and PC see SM.

The main results of our paper are summarized in Figs. 1,2. First, we find that
light induces a progressive formation of CDW order in 2H-MoTe2 (and 2H-WTe2),
starting already at $n_{e}=0.1~{}e^{-}$ per formula unit ($f.u.$). The hidden
CDW order, labeled 2H′, arises from an imaginary phonon frequency in
correspondence to the $\mathbf{M}$-point of the Brillouin zone (BZ) and
involves clustering of three Mo atoms (the soft phonon pattern involves the
displacement of Mo atoms only, see Fig. 2 (b)). The 2H′ phase is in turn prone
to structural instabilities, in particular two lower symmetry phases compete;
we refer to them as 2H${}^{\prime}_{a}$ and 2H${}^{\prime}_{b}$. Most
importantly, the 2H′ phase, and the derived $a$ and $b$ distorted structures,
display a progressive bandgap closing with increasing PC and transition to a
metallic state at $n_{e}=0.25~{}e^{-}/f.u.$ (see Figs. 2 (d),(e)). At
$n_{e}=1~{}e^{-}/f.u.$ (still reachable by current laser sources) a new
$2\times 1$ CDW appears, composed of alternating anisotropically compressed
and expanded stripes of hexagons. We label this phase
2H${}^{{}^{\prime\prime}}$. The 2H${}^{{}^{\prime\prime}}$ phase is in turn
unstable and relaxes towards a lower symmetry structure, named
2H${{}^{\prime\prime}_{a}}$ phase.

Second, pumping on top of the 1T′-MoTe2 and 1T′-WTe2 phases at $n_{e}\approx
1~{}e^{-}/f.u.$ stabilizes a $2\times 2$ hidden CDW order composed of 2D
diamond clusters of transition metal atoms (see Fig. 1 bottom right), that we
label 1T′′. In the absence of optical pumping, this CDW structure has been
found as metastable and competing with the 1T′ phase in MoS2Calandra (2013)
and has been occasionally detected in some MoS2 single layersYang  _et al._
(1991). Thus, laser light can be used to reveal hidden charge density wave
orders, hard to stabilize in standard thermochemical conditions. Finally, we
note that energy transfer from the electrons to the lattice could reduce the
effective temperature to be considered in the simulations, suggesting that the
critical PC for the stabilization of the 1T′′ phase is somewhat
underestimated.

Figure 2:  Panels a,b,c: Phonon frequencies as a function of PC for 2H-MoTe2
at $\mathbf{\Gamma}$,$\mathbf{M}$,$\mathbf{K}$ points of the BZ, respectively.
Raman active modes at $\mathbf{\Gamma}$ are depicted in red. The lowest
eigenvector at the M-point is schematically depicted in panel b. Panel d:
electronic bandgap as a function of PC. Panel e: density of states for the
2H${}^{\prime}_{a}$ phase of MoTe2 at $n_{e}=0.1$ and $0.15~{}e^{-}/f.u.$ .

We now study the mechanism destabilizing the 2H structures in detail (for the
analysis of the CDW formation in 1T′ phases see SM). We consider MoTe2, but
similar results for WTe2 are shown in the SM. We perform supercell finite
difference calculations of the phonon frequencies at specific high-symmetry
points. The results are plotted in Fig. 2 ((a), (b), (c)). Raman active
phonons at $\mathbf{\Gamma}$ are plotted in red. At low PCs, in a single-
valley direct gap semiconductor, momentum and energy conservation enforce that
only zone center phonons can be excited. Typically, if free internal
coordinates are present, this results in displacive excitation of coherent
Raman phonons. MoTe2 is a two-valley semiconductor and phonon excitations at
${\bf\Gamma}$ and K are both possible. As it can be seen in Fig.2 (a) the
A${}_{1}^{\prime}$ mode softens under weak photoexcitation. Recently it was
suggested that phonon softenings at $\mathbf{\Gamma}$ drive the irreversible
2H-1T′ transition in monolayer MoTe2Peng  _et al._ (2020). However, we find
that even at large PCs $\mathbf{\Gamma}$ frequencies never become imaginary
(Fig. 2(a)), invalidating this claim. We find that a critical PC of
$n_{e}\approx 1.75~{}e^{-}/f.u.$, corresponding to a high fluence of 31.41
mJ/cm2, is needed to destabilize $\mathbf{\Gamma}$ phonons, suggesting that
other concomitant mechanisms such as Te vacancy creation are involved in the
irreversible 2H$\to$1T′transition Si  _et al._ (2019). At higher PCs
instabilities can also occur at other phonon momenta. Already at
$n_{e}=0.1~{}e^{-}/f.u.$, $\bf{M}$-point phonons are strongly imaginary. In
order to understand the mechanism responsible for the formation of the 2H′
phases and to decouple the role of conduction and valence states in the CDW
formation we also calculate the phonon frequency spectrum within a rigid
doping approximation, simulating an electron charge excess or deficiency. The
rigid doping calculations show that both conduction and valence states
contribute to the $\bf{M}$-point phonon softening observed in cDFT (see Fig.
S7 of SM).

As mentioned earlier, both 2H′ and 2H′′ phases present additional structural
instabilities (see Figs. S8, S9 of SM). Concerning the 2H′, we observe a
competition between a 4$\times$4 (2H${}^{\prime}_{a}$) and 2$\sqrt{3}\times
2\sqrt{3}$ (2H${}^{\prime}_{b}$) periodical distortion. The
2H${}^{\prime}_{a}$ phase is more stable for $0.1~{}e^{-}/f.u.\leq n_{e}\leq
0.2~{}e^{-}/f.u.$ , while the 2H${}^{\prime}_{b}$ is more stable at
$n_{e}=0.25~{}e^{-}/f.u.$. At $n_{e}=1~{}e^{-}/f.u.$, the 2H′′ instability
(Fig. S5 of the SM, bottom right panel) leads to the 2H${}^{\prime\prime}_{a}$
phase, having a 4$\times$2 periodicity. This further distortion produces an
energy gain of 6.6 meV$/f.u.$ with respect to the 2H′′ phase. We underline
that the 2H′ $\rightarrow$ 2H${}^{\prime}_{b}$ and 2H′′ $\rightarrow$
2H${}^{\prime\prime}_{a}$ represent minor distortions relatively to the 2H
$\rightarrow$ 2H′ and 2H $\rightarrow$ 2H′′ distortions respectively, as
demonstrated by the relative energy gain: at $n_{e}=0.25~{}e^{-}/f.u.$ we
calculate an energy gain of 107.2 meV$/f.u.$ for the 2H $\rightarrow$ 2H′
distortion against an energy gain of 3.1 meV$/f.u.$ for the 2H′ $\rightarrow$
2H${}^{\prime}_{b}$ distortion; similarly, at $n_{e}=1~{}e^{-}/f.u.$ we
calculate an energy gain of 583.1 meV$/f.u.$ for the 2H $\rightarrow$ 2H′′
distortion against 6.6 meV$/f.u.$ for the 2H′′ $\rightarrow$
2H${}_{a}^{\prime\prime}$ distortion. Whereas, this is not the case for the
2H${}^{\prime}_{a}$ phase: at $n_{e}=0.15~{}e^{-}/f.u.$ we calculate
comparable energy gains for the 2H $\rightarrow$ 2H′ ($\approx$ 20 meV$/f.u.$)
and the 2H′ $\rightarrow$ 2H${}^{\prime}_{a}$ distortion ($\approx$ 29
meV$/f.u.$).

Figure 3: Panel a: Imaginary part of $\epsilon(\omega)$ evaluated at
$n_{e}=0,0.25$ and $1~{}e^{-}/f.u.$ for 2H-MoTe2 and its distorted phases.
Panel b: Kohn-Sham eigenvalues along the 2H high symmetry BZ path for 2H′
MoTe2 at $n_{e}=0.25~{}e^{-}/f.u.$ , projected onto atomic $d$-orbitals. Black
dashed line (grey line) represents the valence (conduction) $quasi$-Fermi
level. Panel c: Calculated Raman frequencies (black lines) for 1T′-MoTe2 (top)
and WTe2 (bottom), compared with the experimental Raman spectrum (cyan shaded
region) for 1T′-MoTe2Naylor  _et al._ (2016) and 1T′-WTe2Jiang  _et al._
(2016). Red dashed lines represent the Raman frequencies of the 1T′′ phase at
$n_{e}=1~{}e^{-}/f.u.$. Panel d: Kohn-Sham eigenvalues along the 1T′ high
symmetry BZ path for 1T′′-WTe2 at $n_{e}=1~{}e^{-}/f.u.$, projected onto
atomic $d$-orbitals.

Having understood the mechanism leading to CDW formation, we identify possible
spectroscopic signatures of the transient phases. In the case of the 2H′ and
2H${}^{{}^{\prime\prime}}$ structures, we calculate the imaginary part of the
dielectric function $\epsilon(\omega)$ allowing both for valence to valence
and conduction to conduction optical transitions (absent in the ground state)
on top of the valence to conduction ones. In Fig.3 (a) , we consider both 2H′,
2H′′ phases (solid lines) and their respective distortions (dashed lines) at
$n_{e}=0.25$ and $1e^{-}/f.u.$ (see also Fig. S10 of SM). For the ground state
(i.e. no pumping), our results (see Figs. S11,S12 of SM) are in good agreement
with previously published $ab$-$initio$ resultsKumar and Ahluwalia (2012)111In
Ref.Kumar and Ahluwalia (2012) the intensity of the monolayer dielectric
function is incorrectly renormalized due to the presence of the vacuum, an
effect that in the paper is incorrectly attributed to the reduced number of
bands.. The excited state configuration displays a metallic behaviour (Drude
peak) both in MoTe2 and WTe2 (see Fig. 3 (a) for MoTe2 and Figs. S11-S14 of SM
for WTe2 as well as data on reflectance, energy loss and decomposition of
Im$\\{\epsilon(\omega)\\}$ over optical transitions), which can be recognized
from the low-frequency divergence of $\epsilon(\omega)$. This is related to
the occurrence of an electron-hole plasma. The main changes in the dielectric
function with increasing PC are observed below 2 eV. In particular, the peak
observed in the ground state at 1.7 eV, attributed to the valence-conduction
optical transition (Fig. S4 of SM, black arrow), is red-shifted to 1.5 eV at
$n_{e}=0.25~{}e^{-}/f.u.$, as expected observing the corresponding electronic
transition at the $\mathbf{\Gamma}$-point (see Fig. 3 (b)). Furthermore, its
intensity is notably reduced. At $n_{e}=1~{}e^{-}/f.u.$ this peak is absent,
while a new peak at 0.95 eV not directly related to the valence-conduction
contribution appears. Thus, monitoring the evolution of the peak detected at
$1.7$ eV in the ground state as a function of the PC is equivalent to track
the bandgap closing. The 2H${}^{\prime}_{a}$, 2H${}^{\prime}_{b}$ and
2H${}^{\prime\prime}_{a}$ distortions slightly modify the optical response of
the parent structures (see Fig. S10 of SM), causing a small red-shift of the
1.5 eV peak for the case of 2H′ phase (down to 1.45 eV) and of the 0.95 eV
peak (down to 0.89 eV) for the 2H′′ phase and changing the Drude peak
intensity.

For what concerns the 1T′ and 1T${}^{{}^{\prime\prime}}$ phases, a clear
distinction between the two occurs in Raman spectra. The calculated Raman
frequencies are shown in Fig.3 (c) for 1T′-MoTe2 and 1T′-WTe2, and for
photoexcited 1T${}^{{}^{\prime\prime}}$-MoTe2 and
1T${}^{{}^{\prime\prime}}$-WTe2. Those are compared to the experimental ground
state Raman data from Refs. Jiang  _et al._ (2016); Naylor  _et al._ (2016).
For 1T′-MoTe2, the agreement between theory and experiments is excellent. For
the 1T′-WTe2 phase an overall red-shift ($\approx$ 2-3 % of the value) of the
phonon frequencies with respect to the experiment occurs, consistently with
previous calculationsMa  _et al._ (2016) (see Tab. S4 and the discussion in
the SM). We focus on the highest-energy most intense peaks (above $225$ cm-1
for 1T′-WTe2 and above $200$ cm-1 for 1T′-MoTe2), due to phonon modes of A1g
and A2g symmetries. The two peaks are well separated in 1T′-MoTe2 and they are
strongly overlapping in 1T′-WTe2, in good agreement with what found in
experiments, demonstrating the reliability of our Raman calculations. In the
1T${}^{{}^{\prime\prime}}$ phase these two modes are completely absent. Thus,
the structural transition is marked by the disappearance of these peaks in
both compounds. The calculated Kohn-Sham eigenvalues for 1T′′-WTe2 are
depicted in Fig.3 (d): a completely different band structure with respect to
1T′-WTe2 is observed (see also Figs. S17,S18 of SM).

In conclusion, by using first principles calculations we have shown that light
can be used to unveil hidden CDW order in the transient states of MoTe2 and
WTe2 phases. Pumping on the 2H phases leads first to the stabilization of the
2H${}^{\prime}_{a}$ CDW (4$\times$4 spatial periodicity), then to the
2H${}^{\prime}_{b}$ CDW (2$\sqrt{3}\times 2\sqrt{3}$ periodicity), and finally
to the 2H${}^{\prime\prime}_{a}$ phase (4$\times$2 periodicity). Most
important, the 2H${}^{\prime}_{a}$ reconstruction shows an electronic gap that
is progressively reduced as a function of fluence, showing a light tunable
bandgap closing. Thus, inducing a photocarrier population in the 2H-MoTe2
leads to the following successive transitions: 2H (insulating, no-CDW)$\to$
2H${}^{\prime}_{a}$ (gapped, 4$\times$4 CDW)$\to$ 2H${}^{\prime}_{b}$
(gapless, 2$\times$2 CDW)$\to$ 2H${}^{\prime\prime}_{a}$ (gapless 4$\times$2).
Given the similar results obtained for MoTe2 and WTe2, we speculate that
similar 2H $\rightarrow$ 2H′ $\rightarrow$ 2H′′ structural transformations
occur in other 2D insulating dichalcogenides. We also show that pumping on the
1T′ at $n_{e}=1~{}e^{-}/f.u.$ leads to the transient distorted 1T′′ phase.
This new structure is characterized by diamond shaped Mo(W) clusters and a
2$\times$2 periodicity. For each hidden order we identify the spectroscopic
fingerprints paving the way to ultrafast measurements of transient states in
monolayer dichalcogenides.

Finally, we have shown that the charge ordered phases occurring after laser
irradiation are different from those commonly observed in the ground state of
metallic transition metal dichalcogenides, such as NbSe2 or TiSe2. Our work
opens to the detection of new unexpected structural instabilities in this
family of compounds.

###### Acknowledgements.

We acknowledge support from the European Union’s Horizon 2020 research and
innovation programme Graphene Flagship under grant agreement No 881603. We
acknowledge the CINECA award under the ISCRA initiative, for the availability
of high performance computing resources and support. We acknowledge PRACE for
awarding us access to Joliot-Curie at GENCI@CEA, France (project file number
2021240020).

## References

  * Lloyd-Hughes  _et al._ (2021) J. Lloyd-Hughes, P. Oppeneer, T. P. dos Santos, A. Schleife, S. Meng, M. A. Sentef, M. Ruggenthaler, A. Rubio, I. Radu, M. Murnane, X. Shi, H. Kapteyn, B. Stadtmüller, K. M. Dani, F. da Jornada, E. Prinz, M. Aeschlimann, R. Milot, M. Burdanova, J. Boland, T. L. Cocker, and F. A. Hegmann, Journal of Physics: Condensed Matter (2021).
  * Maiuri  _et al._ (2020) M. Maiuri, M. Garavelli, and G. Cerullo, Journal of the American Chemical Society 142, 3 (2020), pMID: 31800225, https://doi.org/10.1021/jacs.9b10533 .
  * Rasmussen and Thygesen (2015) F. A. Rasmussen and K. S. Thygesen, The Journal of Physical Chemistry C 119, 13169 (2015), https://doi.org/10.1021/acs.jpcc.5b02950 .
  * Qian  _et al._ (2014) X. Qian, J. Liu, L. Fu, and J. Li, Science 346, 1344 (2014), https://science.sciencemag.org/content/346/6215/1344 .
  * Wang  _et al._ (2017) Y. Wang, J. Xiao, H. Zhu, Y. Li, Y. Alsaid, K. Y. Fong, Y. Zhou, S. Wang, W. Shi, Y. Wang, A. Zettl, E. J. Reed, and X. Zhang, Nature 550, 487 (2017).
  * Song  _et al._ (2016a) S. Song, D. H. Keum, S. Cho, D. Perello, Y. Kim, and Y. H. Lee, Nano Letters 16, 188 (2016a), pMID: 26713902, https://doi.org/10.1021/acs.nanolett.5b03481 .
  * Cho  _et al._ (2015) S. Cho, S. Kim, J. H. Kim, J. Zhao, J. Seok, D. H. Keum, J. Baik, D.-H. Choe, K. J. Chang, K. Suenaga, S. W. Kim, Y. H. Lee, and H. Yang, Science 349, 625 (2015), https://science.sciencemag.org/content/349/6248/625 .
  * Li  _et al._ (2020) S. Li, F.-c. Lei, X. Peng, R.-q. Wang, J.-f. Xie, Y.-p. Wu, and D.-s. Li, Inorganic Chemistry 59, 11935 (2020), pMID: 32815362, https://doi.org/10.1021/acs.inorgchem.0c02049 .
  * Sokolikova and Mattevi (2020) M. S. Sokolikova and C. Mattevi, Chem. Soc. Rev. 49, 3952 (2020).
  * Matsubara  _et al._ (2016) E. Matsubara, S. Okada, T. Ichitsubo, T. Kawaguchi, A. Hirata, P. F. Guan, K. Tokuda, K. Tanimura, T. Matsunaga, M. W. Chen, and N. Yamada, Phys. Rev. Lett. 117, 135501 (2016).
  * Ferrante  _et al._ (2018) C. Ferrante, A. Virga, L. Benfatto, M. Martinati, D. De Fazio, U. Sassi, C. Fasolato, A. K. Ott, P. Postorino, D. Yoon, G. Cerullo, F. Mauri, A. C. Ferrari, and T. Scopigno, Nature Communications 9, 308 (2018).
  * Huang  _et al._ (1998) L. Huang, J. P. Callan, E. N. Glezer, and E. Mazur, Phys. Rev. Lett. 80, 185 (1998).
  * Siders (1999) C. W. Siders, Science 286, 1340 (1999).
  * Rousse  _et al._ (2001) A. Rousse, C. Rischel, S. Fourmaux, I. Uschmann, S. Sebban, G. Grillon, P. Balcou, E. Förster, J. Geindre, P. Audebert, J. Gauthier, and D. Hulin, Nature 410, 65 (2001).
  * Paillard  _et al._ (2019) C. Paillard, E. Torun, L. Wirtz, J. Íñiguez, and L. Bellaiche, Phys. Rev. Lett. 123, 087601 (2019).
  * Kogar  _et al._ (2020) A. Kogar, A. Zong, P. E. Dolgirev, X. Shen, J. Straquadine, Y.-Q. Bie, X. Wang, T. Rohwer, I.-C. Tung, Y. Yang, R. Li, J. Yang, S. Weathersby, S. Park, M. E. Kozina, E. J. Sie, H. Wen, P. Jarillo-Herrero, I. R. Fisher, X. Wang, and N. Gedik, Nature Physics 16, 159 (2020).
  * Tangney and Fahy (2002) P. Tangney and S. Fahy, Phys. Rev. B 65, 054302 (2002).
  * Giannozzi  _et al._ (2009) P. Giannozzi, S. Baroni, N. Bonini, M. Calandra, R. Car, C. Cavazzoni, D. Ceresoli, G. L. Chiarotti, M. Cococcioni, I. Dabo, A. D. Corso, S. de Gironcoli, S. Fabris, G. Fratesi, R. Gebauer, U. Gerstmann, C. Gougoussis, A. Kokalj, M. Lazzeri, L. Martin-Samos, N. Marzari, F. Mauri, R. Mazzarello, S. Paolini, A. Pasquarello, L. Paulatto, C. Sbraccia, S. Scandolo, G. Sclauzero, A. P. Seitsonen, A. Smogunov, P. Umari, and R. M. Wentzcovitch, Journal of Physics: Condensed Matter 21, 395502 (2009).
  * Giannozzi  _et al._ (2020) P. Giannozzi, O. Baseggio, P. Bonfà, D. Brunato, R. Car, I. Carnimeo, C. Cavazzoni, S. de Gironcoli, P. Delugas, F. Ferrari Ruffino, A. Ferretti, N. Marzari, I. Timrov, A. Urru, and S. Baroni, The Journal of Chemical Physics 152, 154105 (2020), https://doi.org/10.1063/5.0005082 .
  * Schmitt  _et al._ (2008) F. Schmitt, P. S. Kirchmann, U. Bovensiepen, R. G. Moore, L. Rettig, M. Krenz, J.-H. Chu, N. Ru, L. Perfetti, D. H. Lu, M. Wolf, I. R. Fisher, and Z.-X. Shen, Science 321, 1649 (2008), https://science.sciencemag.org/content/321/5896/1649 .
  * Hajlaoui  _et al._ (2012) M. Hajlaoui, E. Papalazarou, J. Mauchain, G. Lantz, N. Moisan, D. Boschetto, Z. Jiang, I. Miotkowski, Y. P. Chen, A. Taleb-Ibrahimi, L. Perfetti, and M. Marsi, Nano Letters 12, 3532 (2012), pMID: 22658088, https://doi.org/10.1021/nl301035x .
  * Scherpelz  _et al._ (2016) P. Scherpelz, M. Govoni, I. Hamada, and G. Galli, Journal of Chemical Theory and Computation 12, 3523 (2016), pMID: 27331614, https://doi.org/10.1021/acs.jctc.6b00114 .
  * Perdew  _et al._ (1996) J. P. Perdew, K. Burke, and M. Ernzerhof, Physical Review Letters 77, 3865 (1996).
  * Monkhorst and Pack (1976) H. J. Monkhorst and J. D. Pack, Physical Review B 13, 5188 (1976).
  * Naylor  _et al._ (2017) C. H. Naylor, W. M. Parkin, Z. Gao, H. Kang, M. Noyan, R. B. Wexler, L. Z. Tan, Y. Kim, C. E. Kehayias, F. Streller, Y. R. Zhou, R. Carpick, Z. Luo, Y. W. Park, A. M. Rappe, M. Drndić, J. M. Kikkawa, and A. T. C. Johnson, 2D Materials 4, 021008 (2017).
  * Kan  _et al._ (2015) M. Kan, H. G. Nam, Y. H. Lee, and Q. Sun, Phys. Chem. Chem. Phys. 17, 14866 (2015).
  * Heyd  _et al._ (2003) J. Heyd, G. E. Scuseria, and M. Ernzerhof, The Journal of Chemical Physics 118, 8207 (2003), https://doi.org/10.1063/1.1564060 .
  * Heyd and Scuseria (2004) J. Heyd and G. E. Scuseria, The Journal of Chemical Physics 121, 1187 (2004), https://doi.org/10.1063/1.1760074 .
  * Splendiani  _et al._ (2010) A. Splendiani, L. Sun, Y. Zhang, T. Li, J. Kim, C.-Y. Chim, G. Galli, and F. Wang, Nano Letters 10, 1271 (2010), pMID: 20229981, https://doi.org/10.1021/nl903868w .
  * Yuan and Huang (2015) L. Yuan and L. Huang, Nanoscale 7, 7402 (2015).
  * Chernikov  _et al._ (2015) A. Chernikov, C. Ruppert, H. M. Hill, A. F. Rigosi, and T. F. Heinz, Nature Photonics 9, 466 (2015).
  * Haug and Koch (2009) H. Haug and S. W. Koch,  _Quantum Theory of the Optical and Electronic Properties of Semiconductors_, 5th ed. (WORLD SCIENTIFIC, 2009) https://www.worldscientific.com/doi/pdf/10.1142/7184 .
  * Palummo  _et al._ (2015) M. Palummo, M. Bernardi, and J. C. Grossman, Nano Letters 15, 2794 (2015), pMID: 25798735, https://doi.org/10.1021/nl503799t .
  * Pan  _et al._ (2019) S. Pan, W. Kong, J. Liu, X. Ge, P. Zereshki, S. Hao, D. He, Y. Wang, and H. Zhao, ACS Applied Nano Materials 2, 459 (2019), https://doi.org/10.1021/acsanm.8b02008 .
  * Froehlicher  _et al._ (2016) G. Froehlicher, E. Lorchat, and S. Berciaud, Phys. Rev. B 94, 085429 (2016).
  * Ruppert  _et al._ (2014) C. Ruppert, O. B. Aslan, and T. F. Heinz, Nano Letters 14, 6231 (2014), pMID: 25302768, https://doi.org/10.1021/nl502557g .
  * Huang  _et al._ (2016) H. H. Huang, X. Fan, D. J. Singh, H. Chen, Q. Jiang, and W. T. Zheng, Phys. Chem. Chem. Phys. 18, 4086 (2016).
  * Alfè (2009) D. Alfè, Computer Physics Communications 180, 2622 (2009).
  * Kokalj (1999) A. Kokalj, Journal of Molecular Graphics and Modelling 17, 176 (1999).
  * Momma and Izumi (2011) K. Momma and F. Izumi, Journal of Applied Crystallography 44, 1272 (2011).
  * Li  _et al._ (2011) X.-B. Li, X. Q. Liu, X. Liu, D. Han, Z. Zhang, X. D. Han, H.-B. Sun, and S. B. Zhang, Phys. Rev. Lett. 107, 015501 (2011).
  * Erben  _et al._ (2020) D. Erben, A. Steinhoff, M. Lorke, and F. Jahnke, Optical nonlinearities in the excited carrier density of atomically thin transition metal dichalcogenides (2020), arXiv:2012.07642 [cond-mat.mes-hall] .
  * Laturia  _et al._ (2018) A. Laturia, M. L. Van de Put, and W. G. Vandenberghe, npj 2D Materials and Applications 2, 6 (2018).
  * Sohier  _et al._ (2017) T. Sohier, M. Calandra, and F. Mauri, Phys. Rev. B 96, 075448 (2017).
  * Marzari  _et al._ (1999) N. Marzari, D. Vanderbilt, A. De Vita, and M. C. Payne, Phys. Rev. Lett. 82, 3296 (1999).
  * Kolobov  _et al._ (2016) A. V. Kolobov, P. Fons, and J. Tominaga, Phys. Rev. B 94, 094114 (2016).
  * Krishnamoorthy  _et al._ (2018) A. Krishnamoorthy, L. Bassman, R. K. Kalia, A. Nakano, F. Shimojo, and P. Vashishta, Nanoscale 10, 2742 (2018).
  * Song  _et al._ (2016b) Q. Song, H. Wang, X. Xu, X. Pan, Y. Wang, F. Song, X. Wan, and L. Dai, RSC Adv. 6, 103830 (2016b).
  * Lee  _et al._ (2016) J. Lee, F. Ye, Z. Wang, R. Yang, J. Hu, Z. Mao, J. Wei, and P. X.-L. Feng, Nanoscale 8, 7854 (2016).
  * Cao  _et al._ (2017) Y. Cao, N. Sheremetyeva, L. Liang, H. Yuan, T. Zhong, V. Meunier, and M. Pan, 2D Materials 4, 035024 (2017).
  * Kim  _et al._ (2016) Y. Kim, Y. I. Jhon, J. Park, J. H. Kim, S. Lee, and Y. M. Jhon, Nanoscale 8, 2309 (2016).
  * Yang  _et al._ (2019) W. Yang, Z.-Y. Yuan, Y.-Q. Luo, Y. Yang, F.-W. Zheng, Z.-H. Hu, X.-H. Wang, Y.-A. Liu, and P. Zhang, Phys. Rev. B 99, 235401 (2019).
  * Calandra (2013) M. Calandra, Phys. Rev. B 88, 245428 (2013).
  * Yang  _et al._ (1991) D. Yang, S. J. Sandoval, W. M. R. Divigalpitiya, J. C. Irwin, and R. F. Frindt, Phys. Rev. B 43, 12053 (1991).
  * Peng  _et al._ (2020) B. Peng, H. Zhang, W. Chen, B. Hou, Z.-J. Qiu, H. Shao, H. Zhu, B. Monserrat, D. Fu, H. Weng, and C. M. Soukoulis, npj 2D Materials and Applications 4, 14 (2020).
  * Si  _et al._ (2019) C. Si, D. Choe, W. Xie, H. Wang, Z. Sun, J. Bang, and S. Zhang, Nano Letters 19, 3612 (2019), pMID: 31096752, https://doi.org/10.1021/acs.nanolett.9b00613 .
  * Naylor  _et al._ (2016) C. H. Naylor, W. M. Parkin, J. Ping, Z. Gao, Y. R. Zhou, Y. Kim, F. Streller, R. W. Carpick, A. M. Rappe, M. Drndić, J. M. Kikkawa, and A. T. C. Johnson, Nano Letters 16, 4297 (2016), pMID: 27223343, https://doi.org/10.1021/acs.nanolett.6b01342 .
  * Jiang  _et al._ (2016) Y. C. Jiang, J. Gao, and L. Wang, Scientific Reports 6, 19624 (2016).
  * Kumar and Ahluwalia (2012) A. Kumar and P. K. Ahluwalia, Physica B Condensed Matter 407, 4627 (2012).
  * Note (1) In Ref.Kumar and Ahluwalia (2012) the intensity of the monolayer dielectric function is incorrectly renormalized due to the presence of the vacuum, an effect that in the paper is incorrectly attributed to the reduced number of bands.
  * Ma  _et al._ (2016) J. Ma, Y. Chen, Z. Han, and W. Li, 2D Materials 3, 045010 (2016).


This work is supported by the National Natural Science Foundation of China
(62071240), the Innovation Program for Quantum Science and Technology
(2021ZD0302902), and the Priority Academic Program Development of Jiangsu
Higher Education Institutions (PAPD).

Corresponding author: Wenjie Liu (email: wenjiel@163.com).

# Quantum image segmentation based on grayscale morphology

WENJIE LIU 1,2  LU WANG3, AND MENGMENG CUI.1  School of Computer and Software,
Nanjing University of Information Science and Technology, Nanjing 210044,
China  Engineering Research Center of Digital Forensics, Ministry of
Education,Nanjing University of Information Science and Technology, Nanjing
210044, China  School of Automation, Nanjing University of Information Science
and Technology, Nanjing 210044, China

###### Abstract

The classical image segmentation algorithm based on grayscale morphology can
effectively segment images with uneven illumination, but with the increase of
the image data, the real-time problem will emerge. In order to solve this
problem, a quantum image segmentation algorithm is proposed in this paper,
which can use quantum mechanism to simultaneously perform morphological
operations on all pixels in a grayscale image, and then quickly segment the
image into a binary image. In addition, several quantum circuit units,
including dilation, erosion, bottom hat transformation, top hat
transformation, etc., are designed in detail, and then they are combined
together to construct the complete quantum circuits for segmenting the NEQR
images. For a $2^{n}\times 2^{n}$ image with $q$ grayscale levels, the
complexity of our algorithm can be reduced to O$(n^{2}+q)$, which is an
exponential speedup than the classic counterparts. Finally, the experiment is
conducted on IBM Q to show the feasibility of our algorithm in the noisy
intermediate-scale quantum (NISQ) era.

###### Index Terms:

Quantum image processing, grayscale morphology, quantum image segmentation,
NEQR, IBM Q

=-15pt

##  I Introduction

The image processing technology is the basis of computer vision, and it is
widely used in many fields. With the improvement of the performance of image
acquisition devices, the quality of images is getting better and better, and
the amount of data is also increasing, which also requires more computing
power while the image is being processed. However, due to the limitation of
some factors, the development of classical computers is close to the limit, so
it will consume a lot of time when processing large-scale data, which will
lead to the emergence of real-time problem. In recent years, quantum image
processing, as an interdisciplinary subject of image processing and quantum
computing, has received extensive attention from researchers [1, 2, 3]. Due to
the unique superposition and entanglement properties of quantum computing,
quantum image processing can achieve at most an exponential speedup than its
classical counterpart, which is very meaningful.

Quantum image representation model is the primary task of quantum image
processing [4, 5]. At present, scholars have done a lot of research in this
area and proposed many quantum image representation models. The most commonly
used methods can be mainly divided into two types, and one is to encode the
image color information into the probability amplitude, for example, the
flexible representation of quantum image (FRQI) [6], the multi-channel RGB
images representation of quantum images (MCQI) [7], a normal arbitrary
superposition state of quantum image (NASS) [8] and quantum probability image
encoding representation (QPIE) [9]. This encoding method can efficiently
encode images using fewer qubits, but it also makes it more difficult to
retrieve images. To solve this problem, a novel enhanced quantum
representation (NEQR) [10] is proposed, which is an encoding method that uses
some sequences of qubits to encode images, which encodes the position
information and the grayscale value information into three entangled qubit
sequences, such that images can be retrieved quickly with few measurements.
Therefore, the NEQR model is widely used due to its simplicity of operation.
By improving the position information and color information, a series of
encoding methods have been proposed, such as an improved NEQR (INEQR) [11], a
generalized model of NEQR (GNEQR) [12], and a novel quantum representation of
color digital images (NCQI) [13]. With the development of quantum image
representation models, corresponding quantum image processing algorithms have
also developed rapidly, such as geometrical transformation of quantum image
[14, 15, 16], quantum image steganography based on least significant bit (LSB)
[17], feature extraction of quantum image [12], quantum image watermarking
[18, 19, 20, 21, 11], quantum image filtering [22], quantum image scaling
[23], quantum image matching [24], quantum image edge detection [25, 26, 27,
28, 29, 30], quantum image segmentation [31, 32, 33, 34, 35, 36], etc.

Image segmentation is the basis of image processing. Although classical image
segmentation algorithms are relatively mature, quantum image segmentation
algorithms are still in their infancy. In 2014, Caraiman et al [32]. proposed
a histogram-based quantum image segmentation algorithm to segment the image
according to the distribution of pixel grayscale values in the histogram,
which can achieve exponential acceleration than the classical algorithm, but
there is no specific oracle implementation circuit. One year later, they [33]
proposed a quantum image segmentation algorithm based on a single threshold
and gave an oracle circuit. However, due to the high quantum cost, the
algorithm could not be simulated in the noise mesoscale quantum (NISQ) era. In
2018, Chakraborty et al. [34] designed a multiple quantum circuit for
threshold based color image segmentation, which is a meaningful research on
color image segmentation. In 2019, Xia et al. [35] designed a quantum
comparator and binarized the quantum image using a single threshold. They
designed a detailed segmentation circuit, but its complexity is still too
high. In 2020, Yuan et al. [36] proposed a double threshold quantum image
segmentation algorithm based on the quantum comparator they designed. Because
of its low quantum cost, it is feasible in this NISQ era. However, the above
research only uses the threshold value to segment the image, and does not
consider the influence of illumination, which is invalid for complex image
(image with uneven illumination) segmentation. In the real world, the
influence of uneven illumination on images is everywhere, which brings great
challenges to image segmentation. Classical image segmentation algorithms have
done a lot of research to solve this problem, but its complexity is very high,
and the real-time problem is gradually emerging. The existing quantum image
segmentation methods do not consider the impact of illumination on the image,
so they cannot segment the image containing uneven illumination, which is
inappropriate in practical use. Therefore, a quantum version algorithm is
needed to solve this problem. Morphology is a new image processing theory, and
Yuan et al. [37] first conducted research on quantum morphology image
processing. They focused on the dilation and erosion of quantum binary images
and grayscale images, but the complexity was exponential, which is very high.
In 2016, Yuan et al. [38] improved their algorithm to reduce the complexity to
the polynomial level, but it is not used to solve specific problems. In 2019,
Fan et al. [39] used the basic knowledge of grayscale morphology to study
gradient images, which further expands the quantum image morphology research.
After that, Li et al. [40] made practical applications of morphological
theory, such as edge detection, image enhancement. As far as we know,
morphological theory can also be well applied to image segmentation with
uneven illumination. In the grayscale level image, the top-hat transform
structure element moves below the grayscale level to obtain the open operation
image. Then we subtract the open operation image from the original image, and
the background can be removed.The bottom-hap transform structure element moves
above the grayscale level to obtain a closed operation image. Then we subtract
the original image from the closed operation image, and the background can be
removed. Therefore, the morphological operation can well remove the uneven
illumination in the image, which is beyond other methods. However, each pixel
in the image needs to be processed individually, so it requires a lot of
computation time when the scale of image increase, which leads to the real-
time problem. In order to solve the problem, a quantum image segmentation
algorithm using the grayscale morphology theory is proposed. Unlike classical
methods, quantum methods can take advantage of the parallelism of quantum
computing to process the quantum superposition state pixels of the input
image, which greatly speeds up the classical counterpart.

In a nutshell, the main contributions of this work are as follows:

  * •

A quantum image segmentation algorithm based on grayscale morphology is
firstly proposed, which can use quantum mechanism to simultaneously perform
morphological operations on all pixels in a grayscale image and quickly
segment the image with uneven lighting into a binary image.

  * •

Several specific quantum circuit units, including dilation, erosion, bottom
hat transformation, top hat transformation, etc., are designed in detail by
using fewer qubits and quantum gates. And then based on these units, the
complete quantum circuits are designed to segment the NEQR images.

  * •

We verify the superiority and feasibility of our proposed algorithm by
analyzing the circuit complexity and performing simulation experiments on IBM
Q, respectively.

The rest of this paper is organized as follows. Section II introduces the
principle of the NEQR representation model and the classical grayscale
morphology. In Sect. III, some basic quantum operation modules are introduced,
then, a series of quantum circuit units are designed and some relevant quantum
states equations are given. Section IV analyzes the circuit complexity of our
algorithm and the experiment is shown in Sect. V. Finally, the conclusion is
drawn in Sect. VI.

##  II Related work

###  II-A NEQR

The NEQR model stores the grayscale information (C) and positional information
(Y and X) of a classical image in three qubit sequences respectively, and
entangles the position and grayscale information to form a complete quantum
image. For a classical image with a size of $2^{n}\times 2^{n}$ and a
grayscale range of $[0,2^{q}-1]$, $2n$ qubits are required to store the
position information of the Y-axis and X-axis. Then, $q$ qubits are required
to store the grayscale value information. The expression is shown in Eq. 1
[10].

$\displaystyle\lvert{\rm{I}}\rangle$
$\displaystyle=\frac{1}{{{2^{n}}}}\sum\limits_{Y=0}^{{2^{n}}-1}{\sum\limits_{X=0}^{{2^{n}}-1}{\lvert{{C_{YX}}}\rangle\otimes\lvert
Y\rangle\lvert X\rangle}}$ (1)
$\displaystyle=\frac{1}{{{2^{n}}}}\sum\limits_{YX=0}^{{2^{2n}}-1}{\mathop{\otimes}\limits_{k=0}^{q-1}\lvert{C^{K}_{YX}}\rangle\mathop{\otimes}\limits\lvert{YX}\rangle}$

where
$\lvert{{C_{YX}}}\rangle=\lvert{C_{YX}^{q-1},C_{YX}^{q-2},{\cdots}C_{YX}^{1}C_{YX}^{0}}\rangle$
represents the quantum image gray-scale values,
$C_{YX}^{k}\in\left\\{{0,1}\right\\}$, $k=q-1,q-2,\cdots,0$.
$\lvert{YX}\rangle=\lvert Y\rangle\lvert
X\rangle=\lvert{{Y_{n-1}},{Y_{n-2}},\cdots{Y_{0}}}\rangle\lvert{{X_{n-1}},{X_{n-2}},\cdots{X_{0}}}\rangle$
represents the position of the pixel in a quantum image,
${Y_{t}},{X_{t}}\in\left\\{{0,1}\right\\}$.

Figure II-A shows an example of a grayscale image of size $2\times 2$, and the
corresponding NEQR expression of which is given as follows.

$\displaystyle\lvert I\rangle$ $\displaystyle=\frac{1}{2}\left({\lvert
0\rangle\lvert{00}\rangle+\lvert{100}\rangle\lvert{01}\rangle+\lvert{200}\rangle\lvert{10}\rangle+\lvert{255}\rangle\lvert{11}\rangle}\right)$
(2)
$\displaystyle=\frac{1}{2}\left(\begin{array}[]{l}\lvert{00000000}\rangle\lvert{00}\rangle+\lvert{01100100}\rangle\lvert{01}\rangle\\\
+\lvert{11001000}\rangle\lvert{10}\rangle+\lvert{11111111}\rangle\lvert{11}\rangle\end{array}\right)$

[t!](topskip=0pt, botskip=0pt, midskip=0pt)Fig1 An example of $2\times 2$
image.

###  II-B Classical grayscale morphology

####  II-B1 Grayscale dilation and erosion

Grayscale morphology is extended from binary morphology, which allows
grayscale images to be processed with morphological operations as well.
Grayscale morphology also includes two basic operations: dilation and erosion,
but the original “AND” and “OR” operations are turned into a problem of
finding local extremes. The formula expression is as follows.

$[F\oplus{B_{N}}](x,y)=\mathop{\max}\limits_{(s,t)\in{D_{{B_{N}}}}}\left\\{{F(x-s,y-t)+{B_{N}}(s,t)}\right\\}$
(3)

where ${{B_{N}}}$ represents the origin symmetric transformation of the non-
flat structure element $\mathop{{B_{N}}}\limits^{\wedge}$, and ${D_{{B_{N}}}}$
represents the region of ${{B_{N}}}$. $x$ and $y$ are incremented so that the
midpoint of ${{B_{N}}}$ can access every pixel in $F$. However, non-flat
structure element will increase the amount of calculation and affect the
result image. Therefore, in practical use, flat structure elements are often
used to perform the grayscale dilation operation. At this time, ${{B_{N}}=0}$,
and the dilation operation is simplified as follows.

$[F\oplus
B](x,y)=\mathop{\max}\limits_{(s,t)\in{D_{B}}}\left\\{{F(x-s,y-t)}\right\\}$
(4)

where $F$ represents the original image, $B$ represents the structure element,
and $D_{B}$ represents the region of $B$. In this case, the dilation operation
is to find the maximum value of the overlapping area of $F$ and $B$, and
assign it to the center pixel of the overlapping area.

Similar to the dilation operation, the erosion operation can be expressed as
follows.

$[F\Theta{B_{N}}](x,y)=\mathop{\min}\limits_{(s,t)\in{D_{{B_{N}}}}}\left\\{{F(x+s,y+t)-{B_{N}}(s,t)}\right\\}$
(5)

Among them, ${{B_{N}}}$ represents the non-flat structure element, and
${D_{{B_{N}}}}$ represents the region of ${{B_{N}}}$. Also in practical use,
flat structure elements are often used for grayscale erosion operation. In
this case, ${{B_{N}}}=0$, and the erosion operation is simplified as follows.

$[F\Theta
B](x,y)=\mathop{\min}\limits_{(s,t)\in{D_{B}}}\left\\{{F(x+s,y+t)}\right\\}$
(6)

where $F$ represents the original image, $B$ represents the structure element,
and $D_{B}$ represents the region of $B$. In this case, the erosion operation
is to find the minimum value of the overlapping area of $F$ and $B$, and
assign it to the center pixel of the overlapping area. We use different
structure elements for different images to get better results, and the
commonly used structuring elements are shown in Fig. 1.

Figure 1: The schematic diagram of the structuring windows.

####  II-B2 Bottom hat transformation and top hat transformation

In the practical application of image segmentation, there will be uneven light
in the image, which will make it difficult to find the objects and bring
errors to the segmentation. Morphological bottom hat and top hat
transformation can solve this problem very well. As shown in Fig. 2, it is an
image with uneven background illumination. When the image is directly
segmented, part of the text will be lost; when the bottom hat transformation
is used, the background with uneven illumination in the image is deleted. So
that the complete text information can be obtained by performing the
binaryzation operation.

The bottom hat transformation of the grayscale image $F$ is defined as the
result of the image closing operation minus the original image. Specifically,
the image is first dilated and then eroded, and finally we subtract the
original image from the processed image. The bottom hat transformation can get
the dark area in the original image, so it is also called the black bottom hat
transformation. The definitions are as follows.

${B_{hat}}(F)=F\bullet B-F=[(F\oplus B)\Theta B]-F$ (7)

The top hat transformation of grayscale image $F$ is defined as the original
image minus the result image of the opening operation. Firstly, the image is
eroded, then it is dilated, and finally we subtract the previously obtained
image from the original image. The top hat transformation can get the bright
area in the original image, so it is also called the white top hat
transformation, and it can be expressed as follows.

${T_{hat}}(F)=F-(F\circ B)=F-[(F\Theta B)\oplus B]$ (8)

Figure 2: Segmentation of unevenly illuminated image.

##  III Quantum image segmentation algorithm based on grayscale morphology

###  III-A Quantum operations

  1. (1)

Quantum comparator

The quantum comparator can compare the numerical magnitudes of two binary
qubit sequences. It takes two qubit sequences $\lvert A\rangle$ and $\lvert
B\rangle$ as input and outputs the two sequences and their comparison result
$y$. Inspired by the quantum bit string comparator (QBSC) [41], our comparator
also compares bit-by-bit. The comparison results for each bit are processed
using three auxiliary qubits. If $A\geq B$, then $y=0$; if $A<B$, then $y=1$.
The detailed quantum circuit diagram is shown in Fig. I. Compared with the
existing quantum comparators, our comparators use fewer quantum gates and
fewer qubits, as shown in Tab. I, which is very necessary in this NISQ era.

For further sorting operation, we use a CSWAP gate at the output of the
comparator to control the output order of $A$ and $B$, as shown in the Fig. 3,
QCS means ${A^{\prime}}\geq{B^{\prime}}$, QCL means
${A^{\prime}}<{B^{\prime}}$.

TABLE I:  Comparison of different quantum comparators. Quantum comparators | Auxiliary qubits | Quantum cost
---|---|---
QBSC [41] | $3n-1$ | $30n-15$
QC [36] | 5 | $28n-15$
Our comparator | 3 | $18n-3$

[t!](topskip=0pt, botskip=0pt, midskip=0pt)[width=15 cm]Fig4 Implementation
circuit of the quantum comparator.

(a) QCS

(b) QCL

Figure 3: Implementation circuit of the QCS and QCL.

  2. (2)

Quantum subtractor operation

The quantum subtractor can realize the subtraction operation of two binary
qubit sequences $A$ and $B$. It takes $A$ and $B$ as inputs and outputs the
result of $A-B$. By performing a bit-by-bit subtraction operation on
${a_{0}}-{b_{0}},{a_{1}}-{b_{1}},...,{a_{n-1}}-{b_{n-1}}$, and retaining the
borrow information for the next bit, the subtract operation can be completed
using 2 auxiliary qubits. The specific implementation circuit is shown in Fig.
2.

[t!](topskip=0pt, botskip=0pt, midskip=0pt)[width=15 cm]Fig6 Implementation
circuit of the quantum subtractor.

  3. (3)

Cycle shift transformation

The quantum image cyclic shift transformation $(CT)$ operation [15] can shift
the positions of all pixels in an image, so that each pixel in the image can
obtain its neighbor pixels at the same time. For example, if we move the image
up by one unit $(CT_{y+})$, then the pixels in the image change from $S(X,Y)$
to $S(X,Y+1)$. The unitary operation for cyclic shift of a $2^{n}\times 2^{n}$
NEQR image is shown below.

$\mathrm{CT}(X\pm)\lvert
I\rangle=\frac{1}{2^{n}}\sum_{Y=0}^{2^{n}-1}\sum_{X=0}^{2^{n}-1}\lvert
CT_{YX^{\prime}}\rangle\lvert Y\rangle\lvert(X\pm 1)\bmod 2^{n}\rangle$ (9)
$\mathrm{CT}(Y\pm)\lvert
I\rangle=\frac{1}{2^{n}}\sum_{Y=0}^{2^{n}-1}\sum_{X=0}^{2^{n}-1}\lvert
CT_{Y^{\prime}X}\rangle\lvert(Y\pm 1)\bmod 2^{n}\rangle\lvert X\rangle$ (10)

where $X^{\prime}=(X\mp 1)\bmod 2^{n}$, $Y^{\prime}=(Y\mp 1)\bmod 2^{n}$,
$\mathrm{CT}_{(X+)}\,\&\,\mathrm{CT}_{(Y+)}=\left[{\begin{array}[]{*{20}{c}}0&1\\\
{I_{2}^{n}-1}&0\end{array}}\right]$,
$\mathrm{CT}_{(X-)}\,\&\,\mathrm{CT}_{(Y-)}=\left[{\begin{array}[]{*{20}{c}}0&{I_{2}^{n}-1}\\\
1&0\end{array}}\right]$. Figure 4 shows a schematic diagram of the X-axis
cyclic shift transformation.

Figure 4: The schematic diagram of the X-axis cyclic shift transformation.

  4. (4)

Quantum copy operation

In order to copy the grayscale value of the image, we need to use the Copy
operation [42] to complete. It is implemented with CNOT gates and auxiliary
qubits. The circuit is shown in Fig. 5, $\lvert x\rangle$ represents the
original value and $\lvert 0\rangle$ is used to store the copied value.

Figure 5: The quantum circuit realization of Copy operation.

###  III-B The quantum image segmentation algorithm

In order to achieve the segmentation of images with uneven illumination, our
proposed quantum image segmentation algorithm can be described as Algorithm 1.

In the second step, we use the cyclic shift operation to shift the original
image $\lvert I\rangle$ one unit in four directions: up, down, left, and
right. Each translation requires the CT operation on the position qubits of
$\lvert I\rangle$. Then we prepare the image set according to the $\lvert
I\rangle$ preparation method. After the preparation, we use CT operation to
restore the position to the position information of $\lvert I\rangle$. In this
way, five images can be obtained after four CT operation, and their position
information shares the position qubits of $\lvert I\rangle$. For an image
containing bright backgrounds and dark targets, we need to perform a bottom-
hat transformation on it. That is, we first perform the dilation operation on
the original image to get the image $\lvert G\rangle$, then we cycle shift
$\lvert G\rangle$ to get an image set, then we perform the erosion operation
on $\lvert G\rangle$ to get the image $\lvert F\rangle$, and finally we
subtract the original image $\lvert I\rangle$ from image $\lvert F\rangle$. On
the contrary, for the image containing dark background and bright target, we
need to perform top-hat transformation on it. In other words, the original
image is first eroded to get the image $\lvert G\rangle$, then $\lvert
G\rangle$ is cyclically shifted to get the image set, then the dilation
operation is performed on $\lvert G\rangle$ to get the image $\lvert
F\rangle$, and finally we subtract $\lvert F\rangle$ from the original image
$\lvert I\rangle$. After the morphological operation, the uneven light in the
image can be deleted. At this time, the object can be segmented by binary
operation. The complete process is shown in Fig. 6.

Algorithm 1 The quantum image segmentation algorithm.

1: Preparing the quantum image $\lvert I\rangle$ based on NEQR model.

2: Using the cyclic shift operation to prepare a quantum image set of $\lvert
I\rangle$.

3: Using the quantum image set, the NEQR image $\lvert I\rangle$ is
morphologically processed by dilation/erosion operation, and the result image
is named $\lvert G\rangle$.

4: Using the cyclic shift operation again to prepare the quantum image set of
$\lvert G\rangle$.

5: Using the quantum image set of $\lvert G\rangle$, the NEQR image $\lvert
G\rangle$ is processed by erosion/dilation operation, and the result image is
named $\lvert F\rangle$.

6: Using the subtractor to make $\lvert F\rangle-\lvert I\rangle$ / $\lvert
I\rangle-\lvert F\rangle$, then the top hat transform/bottom hat transform
result $\lvert B\rangle$ is obtained.

7: Using the comparator and the segmentation operation to segment $\lvert
B\rangle$, and finally the binary image $\lvert S\rangle$ is obtained.

8: The quantum measurement operation is performed to retrieve the classical
image, and the algorithm ends.)

Figure 6: The workflow of our proposed algorithm.

###  III-C Quantum circuit implementation of the algorithm

  1. (1)

Quantum image preparation

According to the NEQR model, $2n$ qubits are needed to store the position
information, and $q$ qubits are needed to store the grayscale value
information. In addition, additional $4q$ qubits are also required to store
the grayscale values of the 4-neighborhood pixels. Because the neighborhood
window will be shuffled after grayscale morphological processing, in order to
process the original image later, we still need additional $q$ qubits to store
the grayscale information of the original image. The quantum state expression
is as follows.

$\begin{array}[]{l}{\lvert 0\rangle^{\otimes
5q}}\otimes\lvert{{I_{YX}}}\rangle=\frac{1}{{{2^{n}}}}\sum\limits_{Y=0}^{{2^{n}}-1}{\sum\limits_{X=0}^{{2^{n}}-1}{{{\lvert
0\rangle}^{\otimes 5q}}\lvert{{C_{YX}}}\rangle}}\lvert Y\rangle\lvert
X\rangle\\\
\begin{array}[]{*{20}{c}}{}\hfil&{}\hfil&{\begin{array}[]{*{20}{c}}&{}=\end{array}}\end{array}\frac{1}{{{2^{n}}}}\sum\limits_{Y=0}^{{2^{n}}-1}{\sum\limits_{X=0}^{{2^{n}}-1}{{{\lvert
0\rangle}^{\otimes q}}}}\cdots{\lvert 0\rangle^{\otimes q}}\lvert
Y\rangle\lvert X\rangle\end{array}$ (11)

  2. (2)

Quantum image cycle shift transformation

In order to be able to process all pixels in the image at the same time, we
perform cyclic shift transformation on the NEQR image according to the
structure element window, so that we can get a quantum image set, as shown in
Tab. II. In this way, the pixels at the same position (Y, X) in the image set
are composed of the neighborhood pixels of the structure element window of the
original image. In this way, when we process the pixels in the same position
in the image set, we can process all the pixels in the structure element area.
We take a $3\times 3$ image as an example, as shown in Fig. 7, and the images
are stored in the quantum registers in the superposition state. In order to
get the neighborhood pixels, we use the cyclic shift transformation to move
the original image up, down, left, right, and store it in the auxiliary
qubit(four other quantum registers). In this way, we can process all the
neighboring pixels at once.

Furthermore, before proceeding to the next step, we need to copy the original
image into auxiliary qubits, so that the original image can be manipulated
again after the dilation and erosion operation. The quantum state expression
of the quantum image set after cyclic shift transformation is shown below.

TABLE II: Specific operations for shifting the image. 1\. Input: the original
NEQR image
$\lvert{I_{YX}}\rangle$,$\lvert{{I_{YX}}}\rangle=\frac{1}{{{2^{n}}}}\sum\limits_{Y=0}^{{2^{n}}-1}{\sum\limits_{X=0}^{{2^{n}}-1}{\lvert{{C_{YX}}}\rangle}}\lvert
Y\rangle\lvert X\rangle$
---
2\. Shift ${I_{YX}}$one unit upward,
then$\lvert{{I_{Y+1X}}}\rangle=\frac{1}{{{2^{n}}}}\\!\sum\limits_{Y=0}^{{2^{n}}-1}\\!{\sum\limits_{X=0}^{{2^{n}}-1}{\lvert{{C_{Y+1X}}}\rangle}}\lvert
Y\rangle\lvert X\rangle$
3\. Shift${I_{YX}}$one unit downward,
then$\lvert{{I_{Y-1X}}}\rangle=\frac{1}{{{2^{n}}}}\sum\limits_{Y=0}^{{2^{n}}-1}{\sum\limits_{X=0}^{{2^{n}}-1}{\lvert{{C_{Y-1X}}}\rangle}}\lvert
Y\rangle\lvert X\rangle$
4\. Shift${I_{YX}}$ one unit leftward, then
then$\lvert{{I_{YX+1}}}\rangle=\frac{1}{{{2^{n}}}}\sum\limits_{Y=0}^{{2^{n}}-1}{\sum\limits_{X=0}^{{2^{n}}-1}{\lvert{{C_{YX+1}}}\rangle}}\lvert
Y\rangle\lvert X\rangle$
5\. Shift${I_{YX}}$one unit rightward, then
$\lvert{{I_{YX-1}}}\rangle=\frac{1}{{{2^{n}}}}\sum\limits_{Y=0}^{{2^{n}}-1}{\sum\limits_{X=0}^{{2^{n}}-1}{\lvert{{C_{YX-1}}}\rangle}}\lvert
Y\rangle\lvert X\rangle$

$\displaystyle\frac{1}{{{2^{n}}}}\sum\limits_{Y=0}^{{2^{n}}-1}{\sum\limits_{X=0}^{{2^{n}}-1}{\lvert{{C_{Y+1X}}}\rangle}}\otimes\lvert{{C_{YX+1}}}\rangle\otimes\lvert{{C_{Y-1X}}}\rangle$
(12)
$\displaystyle\otimes\lvert{{C_{YX-1}}}\rangle\otimes\lvert{{C_{YX}}}\rangle\otimes\lvert{{C_{YX}}}\rangle\otimes\lvert
Y\rangle\lvert X\rangle$

Figure 7: Schematic diagram of quantum image cyclic shift transformation.

  3. (3)

Bottom hat transform/Top hat transform

When performing the bottom hat transformation operation, we need to dilate the
image first, then erode the image, and finally subtract the original image.
The top hat transformation first erode the image, then dilate the image, and
finally use the original image subtract the result image of the previous step.
When performing the dilation operation on the image, we need to perform a
cycle shift operation on the original image according to the method in the
previous step to obtain the neighborhood window pixels. Then the QCL module is
used to find the pixel with the largest grayscale in the neighborhood window.
After performing the reset operation on other neighborhood pixels, we copy its
maximum grayscale value to the original image (the center point of the
neighborhood window) using the copy operation. This completes the dilation
operation, and the specific circuit is shown in the Fig. 8(a). When performing
the erosion operation, we also need to perform a cycle shift operation on the
original image, and then use the QCS module to find the pixel with the
smallest grayscale value in the neighborhood window, and finally copy it to
the original image, so that the image can be processed with erosion operation,
and the specific circuit is shown in the Fig. 8(b).

Figure 8: The implementation circuit for dilation and erosion operations.

We combine these two operations and use auxiliary qubits to replicate the
original image for subsequent operations. Then, the obtained image and the
original image are subtracted by the quantum subtractor, so that the bottom
hat transformation or the top hat transformation can be performed. The
specific quantum circuit is shown in Fig. 9.

(a) The implementation circuit for bottom hat transformation.

(b) The implementation circuit for top hat transformation.

Figure 9: The implementation circuit for bottom hat transformation and top hat
transformation.

  4. (4)

Quantum image binaryzation

After the bottom hat transformation or the top hat transformation, we can
remove the uneven lighting in the image. At this time, the binaryzation
operation of the image can get better results. We use a QC to compare the
grayscale value of the image after morphologically transformation with the
threshold we set, and convert the grayscale value of pixels greater than or
equal to the threshold to 1, and the others to 0. Since we only measure the
qubit $c_{0}$ we need at the end, no operations are required for
$c_{q-1},...,c_{1}$, and if the QC output $y=0$ and $c_{0}=0$, then we use
CNOT gate and Toffoli gate to set $c_{0}$ to 1. If the QC output $y=1$ and
$c_{0}=1$, we use CNOT gate and Toffoli gate to set $c_{0}$ to 0. Finally, we
can get a binary image, and the specific binaryzation circuit is shown in Fig.
10. The complete quantum circuits of grayscale morphological image
segmentation are shown in Fig. 11.

Figure 10: The implementation circuit of quantum binaryzation.

(a) Bottom hat transformation segmentation.

(b) Top hat transformation segmentation.

Figure 11: The complete implementation circuits for grayscale morphological
segmentation.

##  IV Circuit complexity analysis

In quantum image processing, the complexity of the algorithm is determined by
the basic quantum logic gates used in the circuit, and single-qubit gates and
double-qubit gates can form arbitrarily complex quantum logic gates [43].
Therefore, in this paper, the number of single/double-qubit quantum logic
gates is used to calculate the complexity of the circuit, and their complexity
are set as unit 1. Therefore, the complexity of a NOT gate, a reset gate or a
CNOT gate is 1. A Toffoli gate can be composed of 5 two-qubit gates, so its
complexity is 5 [43]. The quantum cost of different quantum circuits are shown
in Tab. III. Taking a digital image of size $2^{n}\times 2^{n}$ and grayscale
value of $[0,2^{q}-1]$ as an example, we will discuss the complexity of the
circuit as follows.

TABLE III: The quantum cost and complexity of different quantum circuit. Module | Quantum Cost | Complexity
---|---|---
Quantum comparator | $18q-13$ | O($q$)
Quantum subtractor | $27q-43$ | O($q$)
Cycle shift transformation | $n^{2}$ | O($n^{2}$)
Quantum copy operation | $q$ | O($q$)
QCS/QCL | $21q-13$ | O($q$)
Dilation/Erosion | $n^{2}+7q$ | O($n^{2}+q$)
Binaryzation | $2q+13$ | O($q$)

In the research of quantum image processing, we are dealing with quantum
images, but since it cannot be obtained directly at this stage, it is
necessary to prepare digital images into quantum images. Therefore, the
complexity of the process of preparing the quantum image is not calculated in
the complexity of the quantum image processing algorithm [26, 28], so we
consider the complexity of this stage to be 0.

When the quantum image is cyclically shifted, we need to use the CT operation
to prepare the quantum image set, and the complexity of this operation is
O($n^{2}$) [44]. In addition, we also need a Copy operation ($q$ CNOT gates)
to copy the original image into auxiliary qubits for backup, which has a
complexity of O($q$). So, the complexity of a CT operation is O($n^{2}+q$).

The quantum operations used to perform a bottom-hat or top-hat transform on an
image are roughly the same, including a copy operation, a dilation operation,
an erosion operation, and a subtraction operation. The dilation or erosion
operation includes a cyclic shift operation, 4 QCL (QCS) operations, $q$ reset
operations and 1 Copy operation (q CNOT gates). The complexity of a QCL or a
QCS is O($q$), and the complexity of a reset operation and a copy operation is
also O($q$). So the complexity of the dilation or erosion operation is
O($n^{2}+q+4q+q+q$)=O($n^{2}+q$), and the complexity of the subtractor
operation is also O($q$). So the complexity of bottom hat transformation or
top hat transformation is O($q+n^{2}+q+n^{2}+q+q$)=O($n^{2}+q$).

The quantum binaryzation circuit includes a quantum comparator, two CNOT
gates, a reset gate and two Toffoli gates. In addition, $q$ NOT gates are
required to set the threshold, and the complexity of a quantum comparator is
O($q$), so the overall complexity of this part is O($q+2+1+10+q$)=O($q$).

According to the above complexity analysis, we can know that the complexity of
the quantum image segmentation algorithm based on grayscale morphology is
O($q+n^{2}+q+q$)=O($n^{2}+q$). The classical grayscale morphological image
segmentation needs to process each pixel separately, so its complexity is not
less than O($2^{2n}$). Therefore our algorithm can achieve exponential speedup
than the classical algorithm, which can better solve the real-time problem
encountered by the classical algorithm.

In addition, our algorithm is compared with other well-known segmentation
algorithms. For convenience, we simplify the algorithm in [32, 34] to HIS and
MQCTIS, and the comparison results are shown in Tab. IV. HIS needs to count
the grayscale value of each pixel in the image, and then select an appropriate
threshold according to the histogram. Therefore, its complexity is
O($\sqrt{{2^{2n}}t}$), which includes retrieval of $t$ object pixels [32]. In
order to achieve multi-level threshold of color image segmentation, MQCTIS
uses the logic of quantum oracle or quantum black box, and the quantum oracle
circuit is built using a quantum string comparator, some basic quantum gates
and a set of fredkin gates, which requires the complexity of the algorithm to
be O($2^{2n}log2^{2n}$), where $2^{2n}$ is the number of pixels in the image.
Therefore, the complexity of our proposed segmentation algorithm is far lower
than the above segmentation algorithms.

TABLE IV: Complexity comparison of different algorithms. Algorithm | Complexity |
---|---|---
HIS [32] | O($\sqrt{{2^{2n}}t}$) |
MQCTIS [34] | O($2^{2n}log2^{2n}$) |
Proposed algorithm | O($n^{2}+q$) |

##  V Experiment

IBM opened a quantum cloud computing platform IBM Q (IBM Quantum Experience)
[45] in 2017, which includes a quantum toolkit Qiskit [46], so researchers can
use Qiskit to create, compile, and run quantum computing program on quantum
computers or simulators. Users can compile the Python language into the
OpenQASM language through the environment created by Qiskit and anaconda, and
then create a quantum circuit. After running the quantum circuit on IBM Q and
measuring it, we can get the probability histogram of the qubit sequence.
There are currently a total of 24 quantum computers and 5 quantum simulators
on IBM Q and they support up to 8192 executions of quantum circuits. But
because of the preciousness of qubits, we can only use quantum computers with
5 qubits, which is far from enough. So we can only use the quantum simulator
’ibm_qasm_simulator’ to run our quantum circuits, which has 32 qubits and
supports all the quantum logic gates we use. When used, it is mainly called by
the statement
“backend=IBMQ.get_provider(‘ibm-q’).get_backend(‘ibmq_qasm_simulator’)”.

Figure 12: The Schematic of original image.

(a) The probability histogram of bottom hat transformation.

(b) The probability histogram of top hat transformation

Figure 13: The probability histograms of bottom hat transformation and top hat
transformation.

(a) The schematic diagram of the resulting image of bottom hat transformation.

(b) The schematic diagram of the resulting image of top hat transformation.

Figure 14: The schematic diagram of the resulting image of bottom hat
transformation and top hat transformation.

In order to verify the feasibility of our algorithm on IBM Q, without
affecting the experimental results, we selected a classical image whose size
is $4\times 4$ and the grayscale value is [0,7]. The schematic diagram of the
image is as shown in Fig. 12. Y and X represent the coordinates of the pixel,
and the grayscale value information has been marked in the figure.

According to the $4\times 4$ image given above, we perform bottom hat
transformation segmentation and top hat transformation segmentation on it
respectively to demonstrate the feasibility of our algorithm. Since the task
time of ibm_qasm_simulator is limited to 10000 seconds (about 2.7 hours), in
order to reduce the running time of the circuit, we only measure the required
qubits (the grayscale value information and the position information of the
image). Figure 13 is the probability histogram of the resulting image, where
the abscissa is the measured qubit sequence, and the ordinate is the
probability of each qubit sequence. In the order from top to bottom, the third
qubit is the gray value of the resulting image pixel (C=0 or 1), and the next
four qubits are the corresponding position YX. The rest of the qubits are used
to make up the complete circuit and we do not need to pay attention to the
result. Figure 14 is the schematic diagram of the result image after top hat
transformation and the bottom hat transformation. As can be seen from Fig. 13
and Fig. 14, our algorithm can accurately achieve the function of grayscale
morphological segmentation.

##  VI Conclusion

While various morphological algorithms are quite mature in classical image
processing, how to use quantum mechanisms to improve processing efficiency is
still in its infancy. In order to solve the real-time problem of segmenting
the uneven illumination image, a quantum image segmentation algorithm based on
grayscale morphology is firstly proposed, which uses quantum mechanism to
perform grayscale morphology process on all pixels in an image at the same
time, and then quickly segment a grayscale image into a binary image. The
complexity of our algorithm has been greatly improved compared with other
algorithms.

In the image segmentation algorithm based on morphology, the selection of
structure elements will influence the segmentation effect to a certain extent.
In this paper, we just consider one simple scenario, i.e., using a fixed
cross-shaped structure element. Therefore, how to adaptively select the
appropriate structure elements according to the image characteristics is one
of our future work.

## References

  * [1] F. Yan, A. M. Iliyasu, and P. Q. Le, “Quantum image processing: A review of advances in its security technologies,” Int. J. Quantum Inf., vol. 15, no. 3, 2017, Art. no. 1730001, doi: 10.1142/S0219749917300017.
  * [2] Y. Cai, L. U. Xiao, and N. Jiang, “A survey on quantum image processing,” Chin. J. Electron., vol. 27, no. 4, pp. 56–65, 2018, doi: 10.1049/cje.2018.02.012.
  * [3] S. Chakraborty, S. B. Mandal, and S. H. Shaikh, “Quantum image processing: Challenges and future research issues,” Int. J. Inf. Technol., vol. 14, pp. 475–489, 2022, doi: 10.1007/s41870-018-0227-8.
  * [4] S. E. Venegas-Andraca and S. Bose, “Storing, processing, and retrieving an image using quantum mechanics,” Proc. SPIE, vol. 5105, 2003, pp. 137–147, doi: 10.1117/12.485960.
  * [5] S. E. Venegas-Andraca and J. L. Ball, “Processing images in entangled quantum systems,” Quantum Inf. Process., vol. 9, no. 1, pp. 1–11, 2010, doi: 10.1007/s11128-009-0123-z.
  * [6] P. Q. Le, F. Dong, and K. Hirota, “A flexible representation of quantum images for polynomial preparation,” Quantum Inf. Process., vol. 10, no. 1, pp. 63–84, 2011, doi: 10.1007/s11128-010-0177-y.
  * [7] B. Sun, A. M. Iliyasu, F. Yan, F. Dong, and K. Hirota, “An RGB multi-channel representation for images on quantum computers,” Adv. Comput. Intell. Inform., vol. 17, no. 3, pp. 404–417, 2013, doi: 10.20965/jaciii.2013.p0404.
  * [8] H. S. Li, Q. Zhu, and R. G. Zhou, “Multi-dimensional color image storage and retrieval for a normal arbitrary quantum superposition state,” Quantum Inf. Process., vol. 13, no. 4, pp. 991–1011, 2014, doi: 10.1007/s11128-013-0705-7.
  * [9] X. W. Yao, H. Wang, Z. Liao, and M. C. Chen, “Quantum image processing and its application to edge detection: Theory and experiment,” Phys. Rev. X, vol. 7, no. 3, 2017, Art. no. 31041, doi: 10.1103/PhysRevX.7.031041.
  * [10] Y. Zhang, L. Kai, Y. Gao, and M. Wang, “NEQR: A novel enhanced quantum representation of digital images,” Quantum Inf. Process., vol. 12, no. 8, pp. 2833–2860, 2013, doi: 10.1007/s11128-013-0567-z.
  * [11] N. Jiang and L. Wang, “Quantum image scaling using nearest neighbor interpolation,” Quantum Inf. Process., vol. 14, no. 5, pp. 1559–1571, 2015, doi: 10.1007/s11128-014-0841-8.
  * [12] Y. Zhang, K. Lu, K. Xu, Y. Gao, and R. Wilsion, “Local feature point extraction for quantum images,” Quantum Inf. Process., vol. 14, pp. 1573–1588, 2015, doi: 10.1007/s11128-014-0842-7.
  * [13] H. S. Li, X. Chen, H. Y. Xia, Y. Liang, and Z. S. Zhou, “A quantum image representation based on bitplanes,” IEEE Access, vol. 6, pp. 62396–62404, 2018, doi: 10.1109/ACCESS.2018.2871691.
  * [14] P. Q. Le, A. M. Iliyasu, and F. Dong, “Fast geometric transformations on quantum images,” IAENG Int. J. Appl. Math., vol. 40, no. 3, pp. 113–123, 2010. [Online]. Available: http://www.iaeng.org/IJAM/issues_v40/issue_3/IJAM_40_3_02.pdf
  * [15] P. Q. Le, A. M. Iliyasu, and F. Dong, “Strategies for designing geometric transformations on quantum images,” Theor. Comput. Sci., vol. 412, pp. 1406–1418, 2011, doi: 10.1016/j.tcs.2010.11.029.
  * [16] P. Fan, R. G. Zhou, N. Jiang, and H. Li, “Geometric transformations of multidimensional color images based on NASS,” Inf. Sci., vol. 340, pp. 191–208, 2016, doi: 10.1016/j.ins.2015.12.024.
  * [17] N. Jiang, N. Zhao, and L. Wang, “LSB based quantum image steganography algorithm,” Int. J. Theor. Phys., vol. 55, no. 1, pp. 107–123, 2016, doi: 10.1007/s10773-015-2640-0.
  * [18] G. Mogos, “Hiding data in a QImage file,” Comput. Sci., vol. 2174, pp. 448–452, 2009. [Online]. Available: http://iaeng.org/publication/ IMECS2009/IMECS2009_pp448-452.pdf
  * [19] A. M. Iliyasu, P. Q. Le, and F. Dong, “Watermarking and authentication of quantum images based on restricted geometric transformations,” Inf. Sci., vol. 186, pp. 126–149, 2012, doi: 10.1016/j.ins.2011.09.028.
  * [20] W. W. Zhang et al., “A watermark strategy for quantum images based on quantum fourier transform,” Quantum Inf. Process., vol. 12, no. 2, pp. 793–803, 2013, doi: 10.1007/s11128-012-0423-6.
  * [21] S. Miyake and K. Nakamael, “A quantum watermarking scheme using simple and small-scale quantum circuits,” Quantum Inf. Process., vol. 15, pp. 1849–1864, 2016, doi: 10.1007/s11128-016-1260-9.
  * [22] P. Li, X. Liu, and X. Hong, “Quantum image weighted average filtering in spatial domain,” Int. J. Theor. Phys., vol. 56, no. 11, pp. 3690–3716, 2017, doi: 10.1007/s10773-017-3533-1.
  * [23] J. Sang, S. Wang, and X. Niu, “Quantum realization of the nearest-neighbor interpolation method for FRQI and NEQR,” Quantum Inf. Process., vol. 15, pp. 34–64, 2016, doi: 10.1007/s11128-015-1135-5.
  * [24] N. Jiang, K. Y. Dang, and L. Wang, “Quantum image matching,” Quantum Inf. Process., vol. 15, no. 9, pp. 3543–3572, 2016, doi: 10.1007/s11128-016-1364-2.
  * [25] Y. Zhang, K. Lu, and Y. H. Gao, “QSobel: A novel quantum image edge extraction algorithm,” Sci. China Inf. Sci., vol. 58, no. 1, pp. 1–13, 2015, doi: 10.1007/s11432-014-5158-9.
  * [26] P. Fan, R. G. Zhou, W. W. Hu, and N. Jing, “Quantum image edge extraction based on classical Sobel operator for NEQR,” Quantum Inf. Process., vol. 18, no. 1, 2019, Art. no 24, doi: 10.1007/s11128-018-2131-3.
  * [27] R. G. Zhou and D. Q. Liu, “Quantum image edge extraction based on improved Sobel operator,” Int. J. Theor. Phys., vol. 58, no. 9, pp. 2969–2985, 2019, doi: 10.1007/s10773-019-04177-6.
  * [28] R. Chetia, S. Boruah, and P. P. Sahu, “Quantum image edge detection using improved Sobel mask based on NEQR,” Quantum Inf. Process., vol. 20, 2021, Art. no. 21, doi: 10.1007/s11128-020-02944-7.
  * [29] W. J. Liu and L. Wang, “Quantum image edge detection based on eightdirection Sobel operator for NEQR,” Quantum Inf. Process., vol. 21, 2022, Art. no. 190, doi: 10.1007/s11128-022-03527-4.
  * [30] S. Chakraborty, S. H. Shaikh, and A. Chakrabarti, “Quantum image edge extraction based on classical Robinson operator,” Multimedia Tools Appl., vol. 81, pp. 33459–33481, 2022, doi: 10.1007/s11042-022-12627-3.
  * [31] H. S. Li, Z. Qingxin, S. Lan, C.-Y. Shen, R. Zhou, and J. Mo, “Image storage, retrieval, compression and segmentation in a quantum system,” Quantum Inf. Process., vol. 12, no. 6, pp. 2269–2290, 2013, doi: 10.1007/s11128-012-0521-5.
  * [32] S. Caraiman and V. I. Manta, “Histogram-based segmentation of quantum images,” Theor. Comput. Sci., vol. 529, no. 6, pp. 46–60, 2014, doi: 10.1016/j.tcs.2013.08.005.
  * [33] S. Caraiman and V. I. Manta, “Image segmentation on a quantum computer,” Quantum Inf. Process., vol. 14, no. 5, pp. 1693–1715, 2015, doi: 10.1007/s11128-015-0932-1.
  * [34] S. Chakraborty, S. B. Mandal, and S. H. Shaikh, “Design and implementation of a multivalued quantum circuit for threshold based color image segmentation,” Intell. Decis. Technol., vol. 12, no. 2, pp. 251–264, 2018, doi: 10.3233/IDT-180331.
  * [35] H. Xia, H. Li, H. Zhang, Y. Liang, and J. Xin, “Novel multi-bit quantum comparators and their application in image binarization,” Quantum Inf. Process., vol. 18, no. 7, 2019, Art. no. 229, doi: 10.1007/s11128-019-2334-2.
  * [36] S. Yuan, C. Wen, B. Hang, and Y. Gong, “The dual-threshold quantum image segmentation algorithm and its simulation,” Quantum Inf. Process., vol. 19, no. 12, 2020, Art. no. 425, doi: 10.1007/s11128-020-02932-x.
  * [37] S. Z. Yuan et al., “Quantum morphology operations based on quantum representation model,” Quantum Inf. Process., vol. 14, no. 5, pp. 1625–1645, 2015, doi: 10.1007/s11128-014-0862-3.
  * [38] S. Z. Yuan, X. Mao, L. J. Chen, and X. Wang, “Improved quantum dilation and erosion operations,” Int. J. Quantum Inf., vol. 14, no. 7, 2016, Art. no. 1650036, doi: 10.1142/S0219749916500362.
  * [39] P. Fan, R. G. Zhou, and W. W. Hu, “Quantum circuit realization of morphological gradient for quantum grayscale image,” Int. J. Theor. Phys., vol. 58, no. 2, pp. 415–435, 2019, doi: 10.1007/s10773-018-3943-8.
  * [40] P. Li, T. Shi, A. Lu, and B. Wang, “Quantum circuit design for several morphological image processing methods,” Quantum Inf. Process., vol. 18, 2019, Art. no. 364, doi: 10.1007/s11128-019-2479-z.
  * [41] D. S. Oliveira and R. Ramos, “Quantum bit string comparator: Circuits and applications,” Quantum Comput. Comput., vol. 7, no. 1, pp. 17–26, 2007\.
  * [42] A. Iliyasu et al., “A two-tier scheme for greyscale quantum image watermarking and recovery,” Int. J. Innov. Comput. Appl., vol. 5, no. 2, pp. 85–101, 2013, doi: 10.1504/IJICA.2013.053179.
  * [43] M. A. Nielsem and I. L. Chuang, Quantum Computation and Quantum Information. Cambridge, U.K.: Cambridge Univ. Press, 2000, doi: 10.1119/1.1463744.
  * [44] J. Wang, N. Jiang, and L. Wang, “Quantum image translation,” Quantum Inf. Process., vol. 14, pp. 1589–1604, 2015, doi: 10.1007/s11128-014-0843-6.
  * [45] IBM Quantum Lab, “IBM Q.” Accessed: Nov. 30, 2021. [Online]. Available: https://www.research.ibm.com/ibm-q/
  * [46] G. Aleksandrowicz, T. Alexander, P. Barkoutsos, L. Bello, and Y. Ben-Haim, “Qiskit: An open-source framework for quantum computing,” Zenodo, 2019, doi: 10.5281/ZENODO.2562111.