<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Quantum Circuit Based Longest Common Substring</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Domenico Cantone</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Simone Faro</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Arianna Pavone</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Caterina Viola</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Supported by National Centre for HPC, Big Data and Quantum Computing, Project CN00000013, afiliate d to Spoke 10, co-founded by the European Union - NextGenerationEU</institution>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Università di Catania</institution>
          ,
          <addr-line>viale A. Doria n.6, 95125, Catania</addr-line>
          ,
          <country country="IT">Italy</country>
        </aff>
        <aff id="aff2">
          <label>2</label>
          <institution>Università di Palermo</institution>
          ,
          <addr-line>via Archirafi n.34, 90123, Palermo</addr-line>
          ,
          <country country="IT">Italy</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>The Longest Common Substring (LCS) poses classical challenges in computer science, pivotal for string processing. Classically, the problem is tackled with linear time algorithms leveraging sufix trees. Recent breakthroughs in the quantum domain have unveiled sublinear solutions for LCS, demanding ˜(2/3) quantum queries. Yet, these strides are tailored for the quantum query model, which treats input as a black box accessible via an oracle. In contrast, in this paper we delve into these challenges within the circuit model of computation. Here, circuit size gauges structural complexity, while depth identifies execution time on a quantum platform. As the query model complexity sets a baseline, any direct quantum circuit implementation yields a depth and size of at least Ω˜(2/3) for LCS. The main result of this paper is the introduction of a quantum algorithm for LCS in the circuit model, which, despite its ˜(3/2) size, achieves a groundbreaking ˜(√) depth, surpassing prior solutions. Notably, our algorithm is streamlined and readily translatable into quantum protocols. Furthermore, we demonstrate its practicality through a quantum circuit implementation operating in (√ log5()) time-steps.</p>
      </abstract>
      <kwd-group>
        <kwd>eol&gt;Quantum Computing</kwd>
        <kwd>Text Processing</kwd>
        <kwd>Sequence Analysis</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
      <p>Quantum computing is a rapidly developing field within computer science that utilizes the principles
of quantum mechanics to create more powerful computing systems operating in a markedly difer ent
way from classical computers. Unlike classical computers, which rely on bits (either 0 or 1) to process
information, quantum computing leverages qubits, which can exist in multiple states simultaneously.
Additionally, quantum entanglement, a physical phenomenon that allows two or more qubits to
perform operations simultaneously, can be used to combine multiple qubits to perform faster and
more eficient operations than classical bits. These unique features give quantum computers an
advantage over classical ones, particularly in areas such as code-breaking and optimization, allowing
them to perform certain calculations at an exceptional speed.</p>
      <p>
        Quantum computing has had a significant impact on the development of algorithms, with some of
the most notable advancements being Shor’s algorithm [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] for factoring large numbers and Grover’s
algorithm [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ] for unstructured search. These algorithms provide exponential and quadratic speed-ups
over classical algorithms, respectively, serving as impressive demonstrations of the power of quantum
computing and sparking a surge of interest in further research and development in the field. However,
it is the recent demonstration of quantum supremacy that has unleashed a wave of interest in quantum
computing, leading to the integration of these new technologies in various areas of computer science.
      </p>
      <p>
        Only recently, text processing and string problems have become a topic of interest within the realm
of quantum computation (see for instance [
        <xref ref-type="bibr" rid="ref3 ref4 ref5">3, 4, 5</xref>
        ]). This paper focuses on the fundamental Longest
Common Substring (LCS) problem, which holds a crucial position in the field of string processing.
The LCS problem asks for the longest substring that appears in two given input strings  and  of
the same length .
      </p>
      <p>
        In the realm of classical computation, the LCS problem admits a linear time solution [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ]. The
solution to this problem involves the construction of the generalized sufix trees [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ] for the input
strings and the identification of the lowest common ancestors among the tree nodes. 1 It is reasonable to
wonder about harnessing quantum technology to solve LCS more eficiently. In a recent paper [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ], Le
Gall and Seddighin proposed quantum solutions for the LCS problem based on a composition of other
known quantum algorithms, such as Grover’search [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ], string matching [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ], element distinctness [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ],
and amplitude amplification and estimation [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ]. Specifically, for the LCS they proposed a solution
requiring ˜(5/6) queries.
      </p>
      <p>
        More interestingly, in [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ], the authors proved that any quantum algorithm for LCS must take at
least Ω ˜ (2/3) time, even when binary strings are considered. After a while, Akmal and Jin reached in
[
        <xref ref-type="bibr" rid="ref12">12</xref>
        ] the lower bound stated by Le Gall and Seddighin with a quantum algorithm in ˜(2/3) time,
improving the previous result, using the MNRS quantum walk framework [
        <xref ref-type="bibr" rid="ref13">13</xref>
        ], together with a
careful combination of string synchronizing sets [
        <xref ref-type="bibr" rid="ref14">14</xref>
        ] and generalized diference covers [15].
      </p>
      <p>
        The eficiency of previous solutions [
        <xref ref-type="bibr" rid="ref12 ref9">9, 12</xref>
        ] is measured in the query complexity model [
        <xref ref-type="bibr" rid="ref3">3, 16</xref>
        ], also
known as the quantum oracle model (see [17]), where the input is presented as a black box that can
be accessed by an oracle that, given a function  , returns the image of the input (or other variables
depending on it) via  . The query complexity of an algorithm expressed in this model is defined as
the number of queries that the algorithm makes to the oracle(s). However, while the query model
presents an intriguing and abstract framework valuable for purely theoretical exploration, its practical
relevance may be limited in the context of algorithm design for real hardware implementation. This
limitation arises from the challenge of eficiently implementing an oracle, as the methodology for
doing so is frequently unclear. Alternatively, there are diferent models of quantum computation that
easily and almost directly translate to concrete implementations on quantum computers.2
      </p>
      <p>The complexity of a quantum algorithm is de facto best expressed in the computational complexity
model [18], where the input is encoded as a binary string and supplied to the algorithm, which
computes an output string. In such a model, an algorithm is expressed using the quantum Turing
machine model [19] or the quantum circuit model [20]. Perhaps, this latter is one of the most
widespread among such models, considering that there are several programming languages featuring
the circuit formalism, such as IBM’s Qiskit, Microsoft’s Q#, and Google’s Cirq, just to cite a few.
The computational complexity of a quantum circuit can be measured by its size (the number of gates)
or by its depth (the number of layers). We refer to Section 2.1 for details on the computational model
based on quantum circuits and a discussion about the measures used to calculate its complexity.</p>
      <p>
        Thus, given that any quantum oracle comprises at least one gate, and gates are applied sequentially
in an algorithm adhering to the query complexity model, the query complexity of solutions given
1We also mention an algorithm [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ] working in the word RAM model of computation when the size  of the input alphabet
is in 2(√log(+)). Such solution runs in (︀ ( + ) log / √︀log( + ))︀ time using ︀( ( + ) log / log( + ))︀
space.
2We observe that contemporary quantum computers do not have yet the memory capabilities to deal with the large number
of qubits involved in our algorithm.
      </p>
      <sec id="sec-1-1">
        <title>Problem exact LCS exact LCS exact LCS</title>
      </sec>
      <sec id="sec-1-2">
        <title>Paper [9] [12]</title>
      </sec>
      <sec id="sec-1-3">
        <title>This paper</title>
      </sec>
      <sec id="sec-1-4">
        <title>Query Compl. Circuit Size Circuit Depth</title>
        <p>
          ˜(5/6)
˜(2/3)
Ω ˜ (5/6)
Ω ˜ (2/3)
˜(3/2)
Ω ˜ (5/6)
Ω ˜ (2/3)
˜(√)
in [
          <xref ref-type="bibr" rid="ref9">9</xref>
          ] and [
          <xref ref-type="bibr" rid="ref12">12</xref>
          ] establishes a lower bound for both the size and the depth of any quantum circuit
implementing the same algorithms. Consequently, the optimal hypothetical circuit-based solution
would necessitate a depth (and a size) of Ω ˜ (2/3) (see Table 1).
        </p>
        <p>In this paper we present the first quantum algorithm for the LCS problem in the circuit model of
computation, providing an actual implementation of a quantum circuit that works in ˜(√) depth,
despite its ˜(3/2) size. Specifically, our proposed approach leads to the definition of an efective
circuit that requires (√ log4()) depth in the case of binary strings, and (√ log5()) depth in
the general case.</p>
        <p>At first glance, our result might seem contradictory to that of Le Gall and Seddighin; however, in
fact, the comparison of the two results shows how in quantum computation space eficiency can be
traded of for time eficiency. While Le Gall and Seddighin access the input by querying a quantum
oracle, we have direct access to the input, which is encoded on a circuit register. Instead of claiming
the preferability of one model over the other, we aim to draw the reader’s attention to the diferences
between them. The query model allows one to study and analyse quantum algorithms without
worrying about the technicalities around the construction of any specific oracle, and has been the
framework of the first outstanding attempts to design algorithms that exhibit a theoretical advantage
against classical ones.</p>
        <p>
          Another significant diference lies in the ways in which the two algorithms access any input string
. In [
          <xref ref-type="bibr" rid="ref9">9</xref>
          ], the authors assume a QRAM (Quantum Random Access Memory) model [21]. Specifically, it
is assumed that the string  can be accessed directly by a random access oracle that performs, at unit
cost, unitary mappings of the kind |⟩|⟩|⟩ → |⟩| ⊗ []⟩|⟩, where  is a string position such that
0 ⩽  &lt; ,  ∈ Σ is a character,  ∈ {0, 1}* , and ⊗ denotes an appropriate binary operation defined
on Σ . However, we point out that the most eficient QRAM designs [ 22, 23] exhibit a polylogarithmic
time complexity for accessing the memory with respect to its size. In our scenario, the memory size
is (), which implies that QRAM queries will incur an additional multiplicative cost of at least
(log2()). Moreover, we must consider the overhead of initializing the quantum memory, which
requires () operations [24].
        </p>
        <p>
          In contrast, our algorithm does not rely on a random access oracle, but we assume, as in [
          <xref ref-type="bibr" rid="ref4">4, 25</xref>
          ],
that the input registers are already stored in a quantum memory and do not need initialization.
        </p>
        <p>Ultimately, our approach stands apart from the previous results due to its inherent simplicity, which
enables us not only to provide a circuit-level blueprint, but also to assess the quantum resources
required for its implementation.</p>
        <p>The paper is organized as follows. In Section 2, we review some useful preliminaries. Next, in
Section 3, we provide an abstract view of the algorithm for solving the LCS problem. Then, in Section
4, we describe an actual implementation of the same algorithm within the circuit-based model. Finally,
in Section 5, we briefly draw our conclusions.</p>
      </sec>
    </sec>
    <sec id="sec-2">
      <title>2. Preliminaries</title>
      <p>We represent a string  of length  ⩾ 1, over a finite alphabet Σ of size  , as a finite array [0 ..  − 1],
and denote the empty string by . We also denote by [] the ( + 1)-st character of , for 0 ⩽  &lt; ,
and by [ .. ] the substring of  contained between the ( + 1)-st and the ( + 1)-st characters
of , for 0 ⩽  ⩽  &lt; . A -substring of a string  is any substring of  of length . For ease
of notation, the ( + 1)-st character of the string  will also be denoted by the symbol , so that
 = 01 . . . − 1. A substring of  beginning at position 0 is a prefix of . We use the notation :
to indicate the prefix of  of length .</p>
      <p>For any two strings  and  of length , we say that  and  have a common -substring if there
exist two indices 0 ⩽ ,  &lt;  −  such that [ ..  +  − 1] = [ ..  +  − 1]. In particular, when
the indices  and  coincide, we say that  and  share a -substring at position . The expression
 ·  denotes the concatenation of  and . Furthermore, given a string  of length  and a shift
0 ⩽  &lt; , we denote by #»  the cyclic rightward rotation of the characters of  by  positions. More
formally, we have #»  := [ −  ..  − 1] · [0 ..  −  − 1].</p>
      <p>Due to space limitations, we assume the reader is familiar with essential concepts in quantum
computation, including qubits, bra-ket notation, amplitudes, quantum entanglement, and
measurement. Multiple qubits taken together are referred to as quantum registers. Specifically, a quantum
register | ⟩ = |0, 1, . . . , − 1⟩ of  qubits is the tensor product ⨂︀
 =−01 |⟩ of its constituent qubits.</p>
      <p>If  is an integer value that can be represented as a binary string of length , we use the symbol |⟩
to denote the register ⨂︀</p>
      <p>=−01 |⟩ of  qubits, where |⟩ takes the value of the -th most significant
binary digit of . Thus, the quantum register |8⟩ with 4 qubits is given by |8⟩ = |1000⟩.</p>
      <p>Operators in quantum computing are mathematical entities used to represent functional processes
that result in the change of the state of a quantum register. Although there is no problem in realizing
any quantum operator capable of working in constant time on a quantum register of fixed size,
operators of variable size can only be implemented through the composition of elementary gates.</p>
      <p>Given a function  : {0, 1} → {0, 1}, any quantum operator that maps a register containing the
value of a given input  ∈ {0, 1} into a register whose value depends on  () is called a quantum
oracle. A Boolean oracle  maps a register |⟩ ⊗ | 0⟩, of size  + 1, to the register |⟩ ⊗ |  ()⟩. More
formally,  |, 0⟩ = |,  ()⟩. A phase oracle  for a function  : {0, 1} → {0, 1} takes as input
a quantum register |⟩, where  ∈ {0, 1}, and leaves its value unchanged, while applying to it a
negative global phase only when  () = 1, that is, only if  is a solution for the function. More
formally,  |⟩ = (− 1)()|⟩. Intuitively, a Boolean oracle is a black-box function that outputs a
binary result (0 or 1) based on the input. A phase oracle, instead of giving a classical output, alters
the phase of the quantum state if a certain condition is met, flipping its sign. Thus, while the Boolean
oracle returns a bit, the phase oracle encodes the result directly into the quantum state’s phase,
important for algorithms like Grover’s search.</p>
      <sec id="sec-2-1">
        <title>2.1. The Quantum Circuit Model and Its Complexity Measures</title>
        <p>In this paper we adopt the circuit model of computation [18]. David Deutsch was the first to formulate
the idea of the quantum circuit model [26] to encapsulate quantum computations, although, in his
original formalization, Deutsch uses the term quantum network.</p>
        <p>In fact, quantum circuits are networks composed of wires that carry qubit values to gates that
perform elementary operations on qubits. The qubits move through the circuit in a linear fashion,
where the input values are written onto the wires entering the circuit from the left side, while the
output values are read of the wires leaving the circuit on the right side. At every time step, each
wire can enter at most one gate.</p>
        <p>Formally, the quantum circuit model constitutes a broader framework than the classical circuit
model. As in a classical circuit, the size, or number of gates involved in a quantum circuit, is a measure
of its computational complexity, since it represents the number of elementary operations required to
execute a given quantum algorithm: the more gates or operators are applied in a circuit, the more
complex the operation the circuit is performing. This measure becomes even more meaningful within
the quantum framework due to the inherent susceptibility of modern quantum computers to gate
errors. As the number of gates increases, the reliability of the final outcome diminishes, necessitating
the implementation of error correction methods.</p>
        <p>On the other hand, it is imperative to acknowledge that, unlike classical computation, where only
one gate can be executed at a time regardless of circuit structure, a quantum computer enjoys the
remarkable advantage of concurrently executing two (or more) gates, provided they do not involve the
same set of qubits [27, 28]. This characteristic of quantum computation, coupled with superposition
and entanglement, underpins quantum supremacy.3</p>
        <p>Hence, size does not consistently represent the most precise measure of complexity in quantum
computation, often providing only a rough approximation of an algorithm’s intricacy. The
complexity of a quantum algorithm depends on various factors, including the types of gates used, qubit
connectivity within the quantum processor, and especially the circuit depth — defined as the number
of layers required for parallel execution, where a qubit participates in at most one interaction per
layer [29]. It is important to note that the depth of a circuit does not necessarily correspond to its
size, as gates acting on disjoint sets of qubits can often be applied in parallel.</p>
        <p>As quantum gates necessitate implementation time, the depth of a circuit in modern quantum
computers approximately correlates with the duration required for the quantum computer to execute
the circuit. Consequently, circuit depth serves as a crucial metric to assess the feasibility of running a
quantum circuit on a device.4</p>
        <p>In addition, enabling the realization of quantum algorithms in the near future with existing
technology appears contingent upon the development of shallow-depth quantum circuits [29]. Qubits
are susceptible to decoherence, rendering them prone to spontaneous state fluctuations, thereby
limiting the duration of feasible operations. Maximizing the utilization of these delicate qubits
necessitates the circuit depth reduction [27] and, therefore, the parallelization of circuits.5</p>
        <p>In recent years, the complexity of quantum states has emerged as a pivotal quantity of interest
spanning various domains, ranging from quantum computing [30] to black hole theory [31]. Reflecting
this burgeoning interest, Haferkamp et al. [32] recently validated the Brown and Susskind conjecture
[33], asserting that the complexity of quantum circuits typically experiences linear growth with circuit
depth over an exponentially protracted period, ultimately reaching saturation when the number of
applied gates surpasses a threshold that scales exponentially with the number of qubits.</p>
        <p>
          For the reasons stated above, in this paper, our objective is to provide a solution to the LCS problem,
where the measure of complexity is more directed towards circuit depth rather than size.
3We observe that even in the absence of quantum entanglement, simultaneous operations on all qubits remain feasible.
Utilizing  qubits permits  concurrent operations per time step. Nevertheless, in theory, a quantum computer comprising
 qubits could emulate the functionality of a classical computer outfitted with  processors.
4The depth of a circuit is considered the measure of complexity in many quantum languages. See for example https:
//docs.quantum.ibm.com/api/qiskit/0.43/circuit
5It is noteworthy that achieving parallelism within the quantum circuit model mandates the capability to interact with
spatially distant qubits. Various implementations may impose physical constraints on the extent of such interaction.
Nonetheless, recent advancements in quantum computing [
          <xref ref-type="bibr" rid="ref1 ref2 ref3 ref4 ref5 ref6 ref7">1–7</xref>
          ] have demonstrated successful realization of long-range
qubit interactions in several proposed schemes.
        </p>
        <p>Quantum-LCS(, , ):
1. ℓ ← 0;  ← 
2. while ℓ &lt;  do
3.  ← ⌊ (ℓ + )/2⌋
4. if ∃ ,  ∈ {0, . . . ,  − 1} : #» [ ..  +  − 1] = [ ..  +  − 1]
5. then ℓ ← 
6. else  ←  − 1</p>
        <sec id="sec-2-1-1">
          <title>7. return ℓ</title>
          <p>← Quantum test</p>
        </sec>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>3. Quantum Longest Common Substring in the Circuit Model</title>
      <p>In this section, we first describe our quantum algorithm for computing the LCS within an abstract
model, in order to better understand its design, by defining the quantum oracles involved in the
computation, but without giving their actual implementation. Later, we will show that our abstract
algorithm requires ˜(√) queries to oracles.6 Subsequently, we will present an actual implementation
of our algorithm in the circuit-based computational model. Our algorithm, named Quantum-LCS,
comprises a quantum computation-based and a classical computation-based components. Its simple
underlying structure is summarized in the pseudocode shown in Figure 1.</p>
      <p>The classical part of the computation involves a binary search to determine the length  of the
longest common substring of  and  (line 2). During each iteration, the algorithm checks for a
common substring of length  between  and . Let [ℓ .. ] be the interval over which the binary
search is restricted during an iteration of the algorithm, and let  = ⌊(ℓ + )/2⌋ be its median. The
values of ℓ and  are initialized to 0 and , respectively. If the iterative test returns a positive answer,
then the interval is narrowed to [ .. ], otherwise it is narrowed to [ℓ ..  − 1]. The search identifies
the length  of the longest common substring in (log()) steps.</p>
      <p>The quantum part of the algorithm implements the test of line 4. In what follows, we will focus
exclusively on the implementation of such iterative test. Before describing the details of the quantum
procedure for the iterative test, we formalize some assumptions we make along the description.</p>
      <p>Since a quantum register of dimension log() can take on all values between 0 and  − 1, like
any binary sequence of the same dimension, for simplicity we will assume that both input strings
 and  have length  = 2, for some  &gt; 0. We also assume that  and  end with two diferent
special characters, $ and %, respectively, not belonging to the alphabet Σ . These assumptions can be
made without any loss of generality, since it would sufice to take the smallest value  for which we
have  &lt; 2 and concatenate the text with 2 −  copies of the special character. For instance, if
 = abaacbcbbca is a text of length 11, we silently concatenate it with 5 copies of the character $,
i.e., we assume that  = abaacbcbbca$$$$$. This assumption does not afect on the asymptotic
complexity, as the resulting string is at most twice as long as the original.</p>
      <p>Despite any substring of length  can begin at any position  of the text, for 0 ⩽  ⩽  − , in
this paper we also admit values of  between 0 and  − 1, thus assuming that a substring of the text
can be obtained in a circular way. Even such an assumption can be made without loss of generality,
since the last character of  and  are the special character $ and %, respectively, and therefore no
substring obtained circularly can ever be returned as LCS.
6We would like to point out that in counting the number of queries requested by our algorithm, we do not intend to
compute its query complexity, since we work within the circuit-based computational approach that does not conform to
the constraints of the query-based model.</p>
      <p>For the sake of simplicity and due to space constraints, we restrict to circuits algorithms designed
for processing binary strings. This further simplification, however, does not lead to any substantial
change in our results since, assuming that each character can be represented with (at most) log()
bits, it is easy to show that the quantum operators used in the construction of the algorithm would
undergo an increase in their complexity at most equal to a factor of log().</p>
      <sec id="sec-3-1">
        <title>3.1. The Quantum Iterative Test</title>
        <p>Given two strings  and , both of length , and a bound  ⩽ , the quantum test checks for the
presence of a common substring of length  between  and .</p>
        <p>The abstract procedure for the iterative test is outlined in Figure 2. It consists of three phases, each
implemented by a quantum sub-procedure: (1) a search phase, (2) a verification phase, and (3) a final
check. The output of the iterative test is the output of the final check. In this section we describe in
detail the role, structure, and complexity of each of the phases and then discuss the overall complexity
of the iterative test.</p>
        <p>
          The search phase makes use of the Grover’s search algorithm [
          <xref ref-type="bibr" rid="ref2">2</xref>
          ] for finding (with high probability)
a solution (if any) to a black box function, making just (√) queries to the function. Specifically,
the input black box to the algorithm is accessed by a phase oracle  implementing the function
 (,) : {0, . . . ,  − 1} × { 0, . . . ,  − 1} →− { 0, 1}, which depends on the strings  and . Given the
two input parameters  and , with 0 ⩽ ,  &lt; , the phase oracle  tests whether the two strings
#»  and  share a -substring. The function  (,) is defined, for all 0 ⩽ ,  &lt; , as
 (,)(, ) =
︂{ 1 if ∃  ∈ {0, . . . ,  − 1} : #» [ ..  +  − 1] = [ ..  +  − 1]
        </p>
        <p>0 otherwise.</p>
        <p>When the values of  and  are clear from the context, for simplicity we will use the symbol  instead
of  (,). Using this convention, the phase oracle  operates so as to achieve the transformation
 |⟩ = (− 1) ()|⟩, for all  ∈ {0, 1}log(). In Section 4.1, we show how the phase oracle  can
be efectively implemented by means of a circuit having depth (log3()).</p>
        <p>After (√) iterations of Grover’s algorithm, the procedure returns a potential solution  to the
problem, such that #»  and  share a -substring. However, since such a solution may not exist (a case
in which the search would return a random state 0 ⩽  &lt; ), it is necessary to run the subsequent
verification procedures to check whether the returned state is an actual solution of the function.</p>
        <p>Assuming #»  and  share a -substring, the verification phase again makes use of Grover’s search
#»
algorithm in order to identify a position  within the strings such that   [ .. +− 1] = [ .. +− 1].
In this case, the input black box to the algorithm is a phase oracle  implementing the function
 (,) : {0, . . . ,  − 1} × { 0, . . . ,  − 1} × { 0, . . . ,  − 1} →− { 0, 1}, where, for all strings  and ,
and for all 0 ⩽ , ,  &lt; , we have:
 (,)(, , ) =
(2)
Therefore, the oracle  operates so as to achieve the phase transformation  |⟩|⟩|⟩ = (− 1) (,,)|⟩|⟩,
for all , ,  ∈ {0, 1}log(). In Section 4.1, we provide an implementation of the phase oracle  that
operates in (log3()) time.</p>
        <p>Even in this case, after (√) iterations of Grover’s algorithm, the procedure returns a potential
position , such that #»  [ ..  +  − 1] = [ ..  +  − 1].</p>
        <p>Quantum test:
1.  ← get a random  such that #»  and  (possibly) share a -substring
2.  ← get a random  such that #» [ ..  +  − 1] is (possibly) equal to [ ..  +  − 1]
3. check if #» [ ..  +  − 1] is equal to [ ..  +  − 1]</p>
        <p>Ultimately, the quantum test ends by checking whether the two substrings of length  beginning
at position  of the strings #»  and  are indeed equal. Such a final check can be exactly computed
through a single execution of the quantum oracle  implementing the function  defined in (2).</p>
        <p>The whole structure of the quantum test is depicted in Figure 2. The first two phases require both
(√) queries to the oracles  and  , respectively, while the last check requires a single query to
the Boolean oracle  . Therefore, the quantum iterative test requires (√) queries.</p>
        <p>We point out that, when a solution exists, both the search and verification phases may fail with a
probability (1/), due to the internal randomness of Grover’s algorithm. When the search phase
or the verification phase returns a value that is not a solution of the respective function, the final
check fails by returning the value 0. In such a case, we can simply repeat the whole test an arbitrary
constant number of times in order to suppress the probability of failure. The test terminates when a
common substring is found, or when such an attempt fails an arbitrary number of times.</p>
        <p>The overall number of queries needed to solve the problem is (√ log()), since the execution
of the quantum iterative test requires (√) queries and the binary search for the length of the LCS
requires (log()) iterations.</p>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>4. A Circuit-Model Based Implementation</title>
      <p>In this section we provide an actual implementation of the iterative test shown in Figure 2 within the
circuit-based computational model. The purpose of this translation is to provide a direct
implementation of the algorithm in a quantum computer and evaluate the actual resources required.</p>
      <p>The three steps of the iterative test are implemented by the three circuits reported in Figure 5. Only
three operators are used as building-blocks in the three circuits: the circular shift (ROT) operator,
the shared fixed substring checking (SFC) operator, and the fixed prefix matching (FPM) operator
(see Table 2). We observe that the oracles used in the actual circuits of Fig.5 are implemented as
Boolean oracles rather than as phase oracles. These are denoted as  and  instead of  and  ,
respectively. However, we recall that initializing the output register of a Boolean oracle to the value
|−⟩ allows it to behave like a phase oracle.</p>
      <p>For lack of space, in this section we only provide a brief overview of how these operators are
structured, referring the reader to the appropriate references.</p>
      <p>
        A circular shift operator (or rotation operator) ROT applies a rightward shift of  positions to a
register of  qubits for a fixed parameter 0 ⩽  &lt; . Thus, the element at position  is moved to
position ( + ) mod . Such an operator has been efectively used in other quantum text searching
algorithms [
        <xref ref-type="bibr" rid="ref4 ref5">4, 5</xref>
        ]. The details of its construction have been detailed by Pavone and Viola in [34],
where it is shown that the resulting operator can be executed in ( log()) size and (log())
depth.
      </p>
      <p>In our implementation we make use of the controlled version of the circular shift operator, which
applies a circular rotation of a number of positions, depending on an input value  such that 0 ⩽  &lt; .</p>
      <sec id="sec-4-1">
        <title>Operator</title>
      </sec>
      <sec id="sec-4-2">
        <title>Controlled Circular Shift</title>
      </sec>
      <sec id="sec-4-3">
        <title>Shared Fixed Substring Check</title>
      </sec>
      <sec id="sec-4-4">
        <title>Fixed Prefix Matching ROT SFC FPM</title>
        <p>( log())
( log())
( log())</p>
      </sec>
      <sec id="sec-4-5">
        <title>Depth B.S.</title>
        <p>(log2())
(log3())
(log3())</p>
      </sec>
      <sec id="sec-4-6">
        <title>Depth G.C.</title>
        <p>(log2())
(log4())
(log4())
[34]
[35, 25]
[35, 25]</p>
        <p>More formally, for all  ∈ {0, 1} and all  ∈ {0, 1}log(), the controlled circular shift operator
performs the mapping ROT|⟩|⟩ = |⟩| #»  ⟩.</p>
        <p>
          The controlled variant of the circular shift operator can be implemented by means of a well-known
technique [
          <xref ref-type="bibr" rid="ref5">5</xref>
          ] that involves the use of log() ancillae qubits for the application of all parallel operators
controlled by the same qubit, with an overhead of (log()) in both size the depth. Thus, the operator
achieves ( log2()) size and (log2()) depth.
        </p>
        <p>The shared fixed substring checking (SFC) operator addresses the following simple string matching
problem, in which, given two strings  and , both of length , and a bound  ⩾ 0, one wants to check
whether  and  share a common -substring, i.e., if there exists a position , with 0 ⩽  &lt;  − ,
such that [ ..  +  − 1] = [ ..  +  − 1]. In other words, the SFC operator computes the function
 (,)(, ) for the special case where  = 0, that is,  does not undergo any cyclic rotation. More
formally, given a bound  ⩽ , the SFC operator, for all ,  ∈ {0, 1} and  ∈ {0, 1}log(), is defined
by SFC|⟩|⟩|⟩|0⟩ = |⟩|⟩|⟩| (,)(0, )⟩.</p>
        <p>The construction of a quantum circuit implementing the SFC operator has been recently proposed
in [35], where the authors provide a circuit with a (log3()) depth in the case of binary input
strings and a circuit with a (log4()) depth in the general case. The size of the circuit is ( log())
in both cases. We do not provide here further details on the construction of the operator but refer to
[35] for any structural aspects of the corresponding circuit.</p>
        <p>Given two strings  and , both of length , and a bound  ⩽ , the fixed prefix matching (FPM)
operator performs a simple check to determine whether the first  characters of the string  match
their counterparts in the string . Roughly speaking, the FPM operator checks if : = :. More
formally, for all ,  ∈ {0, 1}, and all  ∈ {0, 1}log(), the FPM operator is defined by</p>
        <p>FPM|⟩|⟩|⟩|0⟩ = |⟩|⟩|⟩| (,)(0, 0, )⟩.</p>
        <p>The construction of a quantum circuit implementing the FPM operator has also been recently
proposed in [35], where the authors give a circuit with a depth of (log3()) for the case of binary input
strings and a circuit with a depth of (log4()) for the general case. The size of the corresponding
circuit is ( log()) in both cases.</p>
        <p>We are now ready to describe the quantum circuits that implement the three phases of the quantum
iterative test. All circuits make use of two registers |⟩ and |⟩, both of size , which we assume
to contain the characters of the two input strings  and , respectively. We also assume that these
registers are already stored in a quantum memory and do not need initialization. All circuits involve
the presence of an input register |⟩, of size ⌈log()⌉ ⩽ log(), containing the binary representation
of the bound  ⩽ . The initialization of such input register requires (log()) time. The output of
the computation, for all circuits, is stored in the |⟩ register consisting of a single qubit.
|⟩ |⟩
|⟩ |⟩ |⟩</p>
        <p>|⟩
||⟩⟩ ||||###»»»⟩⟩⟩⟩ ||⟩⟩ ||⟩⟩ ||0⟩( #»,)(0, )⟩ ||00⟩⟩
|⟩ |⟩ |⟩ |0⟩ |0⟩
|⟩ |⟩ |⟩ | ( #»,)(0, )⟩ | ( #»,)(0, )⟩
|⟩ | #» ⟩ |⟩ |⟩ |0⟩ | ( #»,)(0, )⟩
|⟩ |⟩ |⟩ |⟩ |0⟩ | ( #»,)(0, )⟩
← initialization
← application of ROT|⟩|⟩
← application of SFC|⟩|⟩|⟩|⟩
← application of CX|⟩|⟩
← application of SFC†|⟩|⟩|⟩|⟩
← application of ROT†|⟩|⟩
|||||⟩⟩⟩⟩⟩ |||||⟩⟩⟩⟩⟩ ||||||#####»»»»»⟩++++⟩⟩⟩⟩ ||||||###»»»⟩⟩⟩⟩⟩⟩ |||||⟩⟩⟩⟩⟩ |||||0000⟩⟩⟩⟩( #»+, #»)(0, 0, )⟩ |||||00000⟩⟩⟩⟩⟩
|||⟩⟩⟩ |||⟩⟩⟩ || ##»» ++⟩⟩⟩ ||#»⟩⟩ |||⟩⟩⟩ |||00⟩⟩( #»+, #»)(0, 0, )⟩ ||| ((( ###»»»+++,,, ###»»»)))(((000,,, 000,,, )))⟩⟩⟩
|⟩ |⟩ | #» ⟩ |⟩ |⟩ |0⟩ | ( #»+, #»)(0, 0, )⟩
|⟩ |⟩ |⟩ |⟩ |⟩ |0⟩ | ( #»+, #»)(0, 0, )⟩
initialization
application of ROT|⟩|⟩
application of ROT|⟩|⟩
application of ROT|⟩|⟩
application of FPM|⟩|⟩|⟩|⟩
application of CX|⟩|⟩
application of FPM†|⟩|⟩|⟩|⟩
application of ROT†|⟩|⟩
application of ROT†|⟩|⟩
application of ROT†|⟩|⟩</p>
        <sec id="sec-4-6-1">
          <title>4.1. Implementing the Circuits for the Three Phases</title>
          <p>The circuit for the search phase is depicted on the top of Figure 5. It makes use of the additional |⟩
register, of size log(), which holds the rotation values of the string . It is initialized to |+⟩log(), in
order to maintain, at the initial stage, the superposition of all possible rotation values between 0 and
 − 1. The |⟩ register, of a single qubit initialized to |0⟩, stores the output of the SFC operator.</p>
          <p>The core of the quantum procedure involves applying Grover’s search algorithm on the phase
oracle,  , of the  (,) function, as defined in (1). The Boolean oracle  takes the two registers |⟩
and |⟩ as input, and is implemented through the ROT and SFC operators. The output of the SFC
operator is stored in the qubit |⟩, while the output of  is stored on the |⟩ register, which is
initialized to |−⟩ to make  to behave as a phase oracle.</p>
          <p>In Figure 3, we show the evolution of the 6 registers involved in the computation of the Boolean
oracle  , namely |⟩|⟩|⟩|⟩|⟩ and |⟩ (see also Figure 5).</p>
          <p>Specifically, the application on the register |⟩ of the ROT operator, controlled by the register |⟩,
allows |⟩ to be modified so that it contains the superposition of all its possible cyclic rotations. Next,
the application of the SFC operator on the registers |⟩, |⟩, and |⟩ allows the procedure to identify a
possible position  (if any) for which #»  [ ..  +  − 1] = [ ..  +  − 1]. Note that the application of
the SFC operator is done in parallel, for all possible rotations of the register |⟩. The oracle completes
its computation by saving the output of the SFC operator into the |⟩ register and uncomputing
the entire process by applying the inverse operators in their reverse order.</p>
          <p>Regarding the depth of the circuit for the search phase, we can observe that the ROT and the
||⟩⟩ lloogg(())
k ||⟩⟩ 
ec |⟩
h
C |⟩
l
ian |⟩
F
⏞
rot
rot
rot</p>
          <p>SFC operators have a depth equal to (log2()) and (log3()), respectively. The same is true for
their inverse, while the Grover’s difuser is executed in (log(log())) time. Since Grover’s search
requires iterating the phase oracle and difuser a number of times equal to (√), we state that the
depth of circuit implementing the search phase is (√ log3()).</p>
          <p>Once the value  has been returned by the search phase, the circuit for the verification phase again
#»
uses Grover’s search algorithm to identify the position , with 0 ⩽  &lt; , for which   [ ..  + − 1] =
[ ..  +  − 1] holds. The circuit, depicted in the middle of Figure 5, uses the |⟩ register containing
the output of the search phase, and the |⟩ register, holding the position values of the two strings,
initialized to |+⟩log(), in order to maintain, at the initial stage, the superposition of all possible
position values between 0 and  − 1. The qubit |⟩, initialized to |0⟩, stores the output of the operator.</p>
          <p>At the heart of the quantum circuit lies the application of Grover’s search algorithm to the function
 (,,), as outlined in equation (2). The quantum phase oracle,  , for the function  (,,) operates
on the input register |⟩, and is executed using the ROT and the FPM operators. The output from
the FPM operator is stored in the register |⟩, while the output from the oracle  gets stored in the
|⟩ register, a single qubit that is initially set to |−⟩ in order to make  to behave as a phase oracle
rot
rot
rot</p>
          <p>rot
rot
rot</p>
          <p>Diff
within the Grover’s search procedure.</p>
          <p>In Figure 4, we outline the evolution of the seven registers (|⟩, |⟩, |⟩, |⟩, |⟩, |⟩, and |⟩)
involved in the computation of the Boolean oracle  , as depicted in Figure 5.</p>
          <p>Specifically, we apply the ROT operator on the register |⟩, controlled by the register |⟩, allowing
|⟩ to be modified in order to contain the cyclic rotation of  positions. Next, an application of the
rotation operator controlled by register |⟩ to both registers |⟩ and |⟩ allows the two strings to be
rotated by a shift of the same value. Note that, after the application of these operators, the register
|⟩ contains the superposition of all possible rotations of #»  , while |⟩ contains the superposition of
all its possible rotations. Formally, the application of the FP1M], fooprearlaltpoorsosniblteherorteagtiisotnesrso|f#⟩» anadnd|⟩.
allows the procedure to check if #»  [0 ..  − 1] = [0 ..  −
The oracle completes its computation by saving the output into the |⟩ register and uncomputing
the entire process by applying the inverse operators in reverse order.</p>
          <p>Regarding the depth of the circuit for the verification phase, we observe that three ROT operators
have a depth equal to (log2()), as well as their inverse. The FPM operator is executed in (log3())
time-steps, while the Grover’s difuser on the register |⟩ requires (log(log())) time-steps. Since
Grover’s search requires (√) iteration, we can conclude that the depth of the circuit implementing
the verification phase is equal to (√ log3()).</p>
          <p>The circuit for the final check takes as input two registers, |⟩ and |⟩, containing the output of
the search phase and the verification phase, respectively, and checks whether #»  [ ..  +  − 1] =
[ ..  +  − 1]. Such a circuit is obtained by means of the Boolean oracle  . Thus, the resulting
circuit implementing the final check has a depth equal to (log3()).</p>
          <p>Ultimately, the three phases achieve (√ log3()), (√ log3()), and (log3()) time-steps,
respectively. This allows us to state that the quantum iterative test has a (√ log3()) overall depth
and that, therefore, the Quantum-LCS algorithm admits an efective implementation that achieves a
(√ log4()) depth in the case of binary strings. This complexity grows by a logarithmic factor,
reaching (√ log5()) in the general case.</p>
        </sec>
      </sec>
    </sec>
    <sec id="sec-5">
      <title>5. Conclusions</title>
      <p>In this paper we provided a concrete implementation of the first quantum algorithm for the LCS
problem within the circuit model, achieving a significant milestone in the development of practical
quantum algorithms. While previous works in the query model ofer valuable theoretical insights, our
approach emphasizes the importance of circuit-based implementations for real-world applications,
where practical considerations such as quantum resource requirements and hardware constraints
play a crucial role. By directly encoding the input into the circuit register, we achieve a time
complexity of (√ log4()), highlighting the trade-ofs between time and space eficiency in
quantum computation. Our results not only advance the state of quantum algorithms for LCS but also
highlight the broader implications for circuit-based quantum computing, where optimizing resources
is essential. Future work will continue to explore these trade-ofs further and aim to refine quantum
algorithms for practical deployment on quantum hardware.</p>
      <p>We are confident that a similar approach could be used to develop a quantum solution for the
Longest Palindromic Substring (LPS) problem with comparable computational complexity. In future
work, we will focus on this goal, aiming to extend our findings to address the LPS problem with
equivalent eficiency.
[15] S. Burkhardt, J. Kärkkäinen, Fast lightweight sufix array construction and checking, in: R. A.</p>
      <p>Baeza-Yates, E. Chávez, M. Crochemore (Eds.), Combinatorial Pattern Matching, 14th Annual
Symposium, CPM 2003, Morelia, Michocán, Mexico, June 25-27, 2003, Proceedings, volume 2676
of Lecture Notes in Computer Science, Springer, 2003, pp. 55–69. URL: https://doi.org/10.1007/
3-540-44888-8_5. doi:10.1007/3-540-44888-8\_5.
[16] A. Montanaro, Quantum pattern matching fast on average, Algorithmica 77 (2017) 16–39. URL:
https://doi.org/10.1007/s00453-015-0060-4. doi:10.1007/s00453-015-0060-4.
[17] A. S. Arora, A. Coladangelo, M. Coudron, A. Gheorghiu, U. Singh, H. Waldner, Quantum
depth in the random oracle model, in: Proceedings of the 55th Annual ACM Symposium on
Theory of Computing, ACM, 2023. URL: https://doi.org/10.1145%2F3564246.3585153. doi:10.
1145/3564246.3585153.
[18] R. Cleve, An introduction to quantum complexity theory, in: Quantum Computation and
Quantum Information Theory, WORLD SCIENTIFIC, 2001, pp. 103–127. URL: https://doi.org/10.
1142%2F9789810248185_0004. doi:10.1142/9789810248185_0004.
[19] E. Bernstein, U. V. Vazirani, Quantum complexity theory, SIAM J. Comput. 26 (1997) 1411–1473.</p>
      <p>URL: https://doi.org/10.1137/S0097539796300921. doi:10.1137/S0097539796300921.
[20] A. C. Yao, Quantum circuit complexity, in: 34th Annual Symposium on Foundations of Computer
Science, Palo Alto, California, USA, 3-5 November 1993, IEEE Computer Society, 1993, pp. 352–
361. URL: https://doi.org/10.1109/SFCS.1993.366852. doi:10.1109/SFCS.1993.366852.
[21] K. Phalak, A. Chatterjee, S. Ghosh, Quantum random access memory for dummies, 2023.</p>
      <p>arXiv:2305.01178.
[22] V. Giovannetti, S. Lloyd, L. Maccone, Quantum random access memory, Physical
Review Letters 100 (2008). URL: https://doi.org/10.1103%2Fphysrevlett.100.160501. doi:10.1103/
physrevlett.100.160501.
[23] V. Giovannetti, S. Lloyd, L. Maccone, Architectures for a quantum random access memory,
Physical Review A 78 (2008). URL: https://doi.org/10.1103%2Fphysreva.78.052310. doi:10.1103/
physreva.78.052310.
[24] D. K. Park, F. Petruccione, J.-K. K. Rhee, Circuit-based quantum random access memory for
classical data, Scientific Reports 9 (2019). URL: https://doi.org/10.1038%2Fs41598-019-40439-3.
doi:10.1038/s41598-019-40439-3.
[25] D. Cantone, S. Faro, A. Pavone, C. Viola, Quantum circuits for fixed substring matching problems,
in: To appear in Proceedings of the 12th Computing Conference, London, United Kingdom,
11-12 July 2024, 2024. To appear.
[26] D. Deutsch, Quantum computational networks, Proceedings of the Royal Society of London. A.</p>
      <p>Mathematical and Physical Sciences 425 (1989) 73 – 90. URL: https://api.semanticscholar.org/
CorpusID:123073680.
[27] C. Moore, M. Nilsson, Parallel quantum computation and quantum codes, SIAM J.</p>
      <p>Comput. 31 (2001) 799–815. URL: https://doi.org/10.1137/S0097539799355053. doi:10.1137/
S0097539799355053.
[28] F. Green, S. Homer, C. Moore, C. Pollett, Counting, fanout and the complexity of quantum ACC,
Quantum Inf. Comput. 2 (2002) 35–65. URL: https://doi.org/10.26421/QIC2.1-3. doi:10.26421/
QIC2.1-3.
[29] A. Broadbent, E. Kashefi, Parallelizing quantum circuits, Theor. Comput. Sci. 410 (2009) 2489–
2510. URL: https://doi.org/10.1016/j.tcs.2008.12.046. doi:10.1016/J.TCS.2008.12.046.
[30] F. G. Brandão, W. Chemissany, N. Hunter-Jones, R. Kueng, J. Preskill, Models of quantum
complexity growth, PRX Quantum 2 (2021) 030316. URL: https://link.aps.org/doi/10.1103/
PRXQuantum.2.030316. doi:10.1103/PRXQuantum.2.030316.
[31] L. Susskind, Computational Complexity and Black Hole Horizons, Fortsch. Phys. 64 (2016)
24–43. doi:10.1002/prop.201500092. arXiv:1403.5695, [Addendum: Fortsch.Phys. 64,
44–48 (2016)].
[32] J. Haferkamp, P. Faist, N. B. T. Kothakonda, J. Eisert, N. Yunger Halpern, Linear
growth of quantum circuit complexity, Nature Physics 18 (2022) 528–532. doi:10.1038/
s41567-022-01539-6. arXiv:2106.05305.
[33] A. R. Brown, L. Susskind, Second law of quantum complexity, Phys. Rev. D 97 (2018) 086015. URL:
https://link.aps.org/doi/10.1103/PhysRevD.97.086015. doi:10.1103/PhysRevD.97.086015.
[34] A. Pavone, C. Viola, The quantum cyclic rotation gate, in: G. Castiglione, M. Sciortino (Eds.),
Proceedings of the 24th Italian Conference on Theoretical Computer Science, Palermo, Italy,
September 13-15, 2023, volume 3587 of CEUR Workshop Proceedings, CEUR-WS.org, 2023, pp.
206–218. URL: https://ceur-ws.org/Vol-3587/4071.pdf.
[35] D. Cantone, S. Faro, A. Pavone, C. Viola, Quantum circuits for fixed substring matching problems,
2023. arXiv:2308.11758, arXiv: 2308.11758.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>P. W.</given-names>
            <surname>Shor</surname>
          </string-name>
          ,
          <article-title>Polynomial-time algorithms for prime factorization and discrete logarithms on a quantum computer</article-title>
          ,
          <source>SIAM J. Comp</source>
          .
          <volume>26</volume>
          (
          <year>1997</year>
          )
          <fpage>1484</fpage>
          -
          <lpage>1509</lpage>
          . doi:
          <volume>10</volume>
          .1137/s0097539795293172.
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>L. K.</given-names>
            <surname>Grover</surname>
          </string-name>
          ,
          <article-title>A fast quantum mechanical algorithm for database search</article-title>
          ,
          <source>in: Proceedings of the Twenty-Eighth Annual ACM Symposium on Theory of Computing</source>
          , STOC '96,
          <string-name>
            <surname>ACM</surname>
          </string-name>
          , New York, NY, USA,
          <year>1996</year>
          , pp.
          <fpage>212</fpage>
          -
          <lpage>219</lpage>
          . URL: https://doi.org/10.1145/237814.237866. doi:
          <volume>10</volume>
          .1145/237814. 237866.
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>H.</given-names>
            <surname>Ramesh</surname>
          </string-name>
          ,
          <string-name>
            <given-names>V.</given-names>
            <surname>Vinay</surname>
          </string-name>
          , String matching in ˜(√ + √)
          <article-title>quantum time</article-title>
          ,
          <source>Journal of Discrete Algorithms</source>
          <volume>1</volume>
          (
          <year>2003</year>
          )
          <fpage>103</fpage>
          -
          <lpage>110</lpage>
          . URL: https://www.sciencedirect.com/science/article/pii/ S1570866703000108. doi:https://doi.org/10.1016/S1570-
          <volume>8667</volume>
          (
          <issue>03</issue>
          )
          <fpage>00010</fpage>
          -
          <lpage>8</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>P.</given-names>
            <surname>Niroula</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Y.</given-names>
            <surname>Nam</surname>
          </string-name>
          ,
          <article-title>A quantum algorithm for string matching</article-title>
          ,
          <source>npj Quantum Information</source>
          <volume>7</volume>
          (
          <year>2021</year>
          ).
          <source>doi:10.1038/s41534-021-00369-3.</source>
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>D.</given-names>
            <surname>Cantone</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Faro</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Pavone</surname>
          </string-name>
          ,
          <article-title>Quantum string matching unfolded and extended</article-title>
          , in: M.
          <string-name>
            <surname>Kutrib</surname>
          </string-name>
          , U. Meyer (Eds.),
          <source>Reversible Computation - 15th International Conference, RC</source>
          <year>2023</year>
          , Giessen, Germany,
          <source>July 18-19</source>
          ,
          <year>2023</year>
          , Proceedings, volume
          <volume>13960</volume>
          of Lecture Notes in Computer Science, Springer,
          <year>2023</year>
          , pp.
          <fpage>117</fpage>
          -
          <lpage>133</lpage>
          . URL: https://doi.org/10.1007/978-3-
          <fpage>031</fpage>
          -38100-
          <issue>3</issue>
          _9. doi:
          <volume>10</volume>
          .1007/ 978-3-
          <fpage>031</fpage>
          -38100-3\_9.
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>T. H.</given-names>
            <surname>Cormen</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C. E.</given-names>
            <surname>Leiserson</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R. L.</given-names>
            <surname>Rivest</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            <surname>Stein</surname>
          </string-name>
          , Introduction to Algorithms, 2nd ed., The MIT Press,
          <year>2001</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <surname>Bieganski</surname>
          </string-name>
          , Riedl, Cartis, Retzel,
          <article-title>Generalized sufix trees for biological sequence data: applications and implementation</article-title>
          ,
          <source>in: 1994 Proceedings of the Twenty-Seventh Hawaii International Conference on System Sciences</source>
          , volume
          <volume>5</volume>
          ,
          <year>1994</year>
          , pp.
          <fpage>35</fpage>
          -
          <lpage>44</lpage>
          . doi:
          <volume>10</volume>
          .1109/HICSS.
          <year>1994</year>
          .
          <volume>323593</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>P.</given-names>
            <surname>Charalampopoulos</surname>
          </string-name>
          ,
          <string-name>
            <given-names>T.</given-names>
            <surname>Kociumaka</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Pissis</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Radoszewski</surname>
          </string-name>
          ,
          <article-title>Faster algorithms for longest common substring</article-title>
          , in: P. Mutzel,
          <string-name>
            <given-names>R.</given-names>
            <surname>Pagh</surname>
          </string-name>
          , G. Herman (Eds.),
          <source>29th Annual European Symposium on Algorithms (ESA</source>
          <year>2021</year>
          ),
          <source>Leibniz International Proceedings in Informatics (LIPIcs)</source>
          ,
          <article-title>Schloss Dagstuhl-Leibniz-Zentrum fuer Informatik GmbH</article-title>
          , Dagstuhl Publishing,
          <year>2021</year>
          , pp.
          <fpage>1</fpage>
          -
          <lpage>17</lpage>
          . doi:
          <volume>10</volume>
          . 4230/LIPIcs.ESA.
          <year>2021</year>
          .
          <volume>30</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <given-names>F. L.</given-names>
            <surname>Gall</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Seddighin</surname>
          </string-name>
          ,
          <article-title>Quantum meets fine-grained complexity: Sublinear time quantum algorithms for string problems</article-title>
          ,
          <source>Algorithmica</source>
          <volume>85</volume>
          (
          <year>2023</year>
          )
          <fpage>1251</fpage>
          -
          <lpage>1286</lpage>
          . URL: https://doi.org/10.1007/ s00453-022-01066-z. doi:
          <volume>10</volume>
          .1007/s00453-022-01066-z.
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [10]
          <string-name>
            <given-names>A.</given-names>
            <surname>Ambainis</surname>
          </string-name>
          ,
          <article-title>Quantum walk algorithm for element distinctness</article-title>
          ,
          <source>SIAM J. Comput</source>
          .
          <volume>37</volume>
          (
          <year>2007</year>
          )
          <fpage>210</fpage>
          -
          <lpage>239</lpage>
          . URL: https://doi.org/10.1137/S0097539705447311. doi:
          <volume>10</volume>
          .1137/S0097539705447311.
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          [11]
          <string-name>
            <given-names>G.</given-names>
            <surname>Brassard</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Høyer</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Mosca</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Tapp</surname>
          </string-name>
          ,
          <article-title>Quantum amplitude amplification and estimation</article-title>
          , in: S. G. Lo Monaco, H. E. Brandt (Eds.),
          <source>Quantum Computation and Information</source>
          , volume
          <volume>305</volume>
          of Contemporary Mathematics,
          <source>American Mathematical Society</source>
          ,
          <year>2002</year>
          , pp.
          <fpage>53</fpage>
          -
          <lpage>74</lpage>
          . URL: https://doi.org/10.1090%2Fconm%
          <fpage>2F305</fpage>
          %
          <fpage>2F05215</fpage>
          . doi:
          <volume>10</volume>
          .1090/conm/305/05215.
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          [12]
          <string-name>
            <given-names>S.</given-names>
            <surname>Akmal</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            <surname>Jin</surname>
          </string-name>
          ,
          <article-title>Near-optimal quantum algorithms for string problems</article-title>
          ,
          <source>Algorithmica</source>
          <volume>85</volume>
          (
          <year>2023</year>
          )
          <fpage>2260</fpage>
          -
          <lpage>2317</lpage>
          . URL: https://doi.org/10.1007/s00453-022-01092-x. doi:
          <volume>10</volume>
          .1007/ S00453-022-01092-X.
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          [13]
          <string-name>
            <given-names>F.</given-names>
            <surname>Magniez</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Nayak</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Roland</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Santha</surname>
          </string-name>
          , Search via quantum walk,
          <source>SIAM J. Comput</source>
          .
          <volume>40</volume>
          (
          <year>2011</year>
          )
          <fpage>142</fpage>
          -
          <lpage>164</lpage>
          . URL: https://doi.org/10.1137/090745854. doi:
          <volume>10</volume>
          .1137/090745854.
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          [14]
          <string-name>
            <given-names>D.</given-names>
            <surname>Kempa</surname>
          </string-name>
          , T. Kociumaka,
          <article-title>String synchronizing sets: sublinear-time BWT construction and optimal LCE data structure</article-title>
          , in: M.
          <string-name>
            <surname>Charikar</surname>
          </string-name>
          , E. Cohen (Eds.),
          <source>Proceedings of the 51st Annual ACM SIGACT Symposium on Theory of Computing, STOC</source>
          <year>2019</year>
          , Phoenix, AZ, USA, June 23-26,
          <year>2019</year>
          , ACM,
          <year>2019</year>
          , pp.
          <fpage>756</fpage>
          -
          <lpage>767</lpage>
          . URL: https://doi.org/10.1145/3313276.3316368. doi:
          <volume>10</volume>
          .1145/ 3313276.3316368.
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>