Challenges
Datasets
Workspaces
Papers
Discussions
Leaderboard
Log inSign up
Challenges
Datasets
Workspaces
Papers
Discussions
Leaderboard
Blog
Job Board
Q3AS

© 2026 Aqora Quantum S.A.S.

TermsPrivacyLegal Notice

arXiv:quant-ph/0508237

Quantum Pattern Matching

Paulo Mateus, Yasser Omar

Published Aug 31, 2005• 8 citations
arXivHTMLPDF

Abstract

We propose a quantum algorithm for closest pattern matching which allows us to search for as many distinct patterns as we wish in a given string (database), requiring a query function per symbol of the pattern alphabet. This represents a significant practical advantage when compared to Grover's search algorithm as well as to other quantum pattern matching methods, which rely on building specific queries for particular patterns. Our method makes arbitrary searches on long static databases much more realistic and implementable. Our algorithm, inspired by Grover's, returns the position of the closest substring to a given pattern of size $M$ with non-negligible probability in $O(\sqrt{N})$ queries, where $N$ is the size of the string. Furthermore, we give the full recipe to implement our algorithm (together with its total circuit complexity), thus offering an oracle-based quantum algorithm ready to be implemented.

DOI
10.48550/arxiv.quant-ph/0508237

Related papers

Grover search revisited: Application to image pattern matching

Hiroyuki Tezuka, Kouhei Nakaji, Takahiko Satoh +1 more

The landmark Grover algorithm for amplitude amplification serves as an essential subroutine in various types of quantum algorithms, with guaranteed quantum speedup in query complexity. However, there has been no proposal to realize the original motivating application of the algorithm, i.e., the database search or more broadly the pattern matching in a practical setting, mainly due to the technical difficulty in efficiently implementing the data loading and amplitude amplification processes. In this paper, we propose a quantum algorithm that approximately executes the entire Grover database search or pattern matching algorithm. The key idea is to use the recently proposed approximate amplitude encoding method on a shallow quantum circuit, together with the easily implementable inversion-test operation for realizing the projected quantum state having similarity to the query data, followed by the amplitude amplification operation that is independent to the target data index. We provide a thorough demonstration of the algorithm in the problem of image pattern matching.

arXiv:2108.10854•Physical Review A•Mar 24, 2022•35 citations

The deterministic pattern matching based on the parameterized quantum circuit

Lu Liu, Xing-Yu Wu, Chu-Yao Xu +2 more

Abstract Grover quantum algorithm is an unstructured search algorithm that can run on a quantum computer with the complexity of O $\sqrt{N}$ N , and is one of the typical algorithms of quantum computing. Recently, it has served as a routine for pattern-matching tasks. However, the original Grover search algorithm is probabilistic, which is not negligible for problems involving determinism. Besides that, efficient data loading is also a key challenge for the practical applications of the Grover algorithm. Here in this work, we propose a modified pattern-matching scheme with Long’s quantum search algorithm, in which the quantum circuit structure search algorithm requires fewer multi-qubit quantum gates, and can obtain the desired results deterministically. Then, the comparison of the performance of our scheme and the previous algorithms is presented through numerical simulations, indicating our algorithm is feasible with current quantum technologies which is friendly to noisy intermediate-scale quantum (NISQ) devices.

EPJ Quantum Technology•Jan 9, 2024•0 citations

Accelerated quantum search using partial oracles and Grover's algorithm

Bolton, Fintan M.

Grover's algorithm, orginally conceived as a means of searching an unordered database, can also be used to extract solutions from the result sets generated by quantum computations. The Grover algorithm exploits the concept of an oracle function, which abstracts the process of matching a search item (returning 1 for a match and 0 otherwise), where searching for 1 target item in a search space of size $N$ scales as $\mathcal{O}(\sqrt{N})$ oracle queries. In this article, we explore the idea of associating a separate oracle with each bit of the matching condition, obtaining multiple partial oracle functions which can be tested independently. Exploring this idea leads to a multi-stage hybrid search algorithm, whose performance can fall within a wide range, anywhere between $\mathcal{O}(\sqrt{N})$ (same as Grover) or $\mathcal{O}(\log(N))$. The algorithm is validated against the simplest kind of search scenario, where the incoming index bits are scrambled using a permutation operation.

arXiv:2403.13035•Mar 19, 2024•0 citations

Classical Equivalent Quantum Based Pattern Matching Algorithms

Kapil Kumar Soni, Akhtar Rasool

The pattern matching problem is imperative in diversified field of computer science, and it finds occurrences of the pattern string(s) of any arbitrary length “M” in the large text string of length “N”. Since past decades the solutions to a problem have been suggesting through efficient algorithms. Classical benchmark algorithms such as Knuth Morris Pratt and Boyer Moore locates such solution in O(N) time, equivalent quantum algorithms can utilize quantum computations which are inherently parallel and obtains computational speedup by providing the solution in O(√N) time. The quantum pattern matching algorithm uses Grover's search logic that finds an element existence in the large unstructured text data of “N” items in O(√N) time, instead classically it takes O(N) time. The article comprises of introductory pattern matching tactics, quantum basics, Grover's search method, quantum based pattern matching algorithms, their illustration followed by complexity analysis, and finally concludes with the possible algorithmic variations and relevant applications.

International Conference on Computing, Communication and Networking Technologies (ICCCNT)•Jul 1, 2019•0 citations

Quantum string comparison method

Menon, Vikram, Ayan Chattopadhyay

We propose a quantum string comparison method whose main building blocks are a specially designed oracle construction followed by Grover's search algorithm. The purpose of the oracle is to compare all alphabets of the string in parallel. This requires a unique input state preparation, which when combined with some ancillas will result in a deterministic binary success and failure compare outcome.

arXiv:2005.08950•May 16, 2020•1 citation

Solving mathematical problems with quantum search algorithm

Rubens Viana Ramos, Paulo Benicio Melo de Sousa, David Sena Oliveira

Quantum computation has attracted much attention since it was shown by Shor and Grover the possibility to implement quantum algorithms able to realize, respectively, factoring and searching in a faster way than any other known classical algorithm. It is possible to use Grover algorithm, taking profit of its ability to find a specific value in a unordered database, to find, for example, the zero of a logical function; the minimal or maximal value in a database or to recognize if an odd number is prime or not. Here we show quantum algorithms to solve those cited mathematical problems. The solution requires the use of a quantum bit string comparator being used as oracle. This quantum circuit compares two quantum states and identifies if they are equal or, otherwise, which of them is the largest. Moreover, we also show the quantum bit string comparator allow us to implement conditional statements in quantum computation, a fundamental structure for designing of algorithms.

arXiv:quant-ph/0605003•Apr 29, 2006•3 citations
We propose a quantum algorithm for closest pattern matching which allows us to search for as many distinct patterns as we wish in a given string (database), requiring a query function per symbol of the pattern alphabet. This represents a significant practical advantage when compared to Grover's search algorithm as well as to other quantum pattern matching methods, which rely on building specific queries for particular patterns. Our method makes arbitrary searches on long static databases much more realistic and implementable. Our algorithm, inspired by Grover's, returns the position of the closest substring to a given pattern of size MMM with non-negligible probability in O(N)O(\sqrt{N})O(N​) queries, where NNN is the size of the string. Furthermore, we give the full recipe to implement our algorithm (together with its total circuit complexity), thus offering an oracle-based quantum algorithm ready to be implemented.
The landmark Grover algorithm for amplitude amplification serves as an essential subroutine in various types of quantum algorithms, with guaranteed quantum speedup in query complexity. However, there has been no proposal to realize the original motivating application of the algorithm, i.e., the database search or more broadly the pattern matching in a practical setting, mainly due to the technical difficulty in efficiently implementing the data loading and amplitude amplification processes. In this paper, we propose a quantum algorithm that approximately executes the entire Grover database search or pattern matching algorithm. The key idea is to use the recently proposed approximate amplitude encoding method on a shallow quantum circuit, together with the easily implementable inversion-test operation for realizing the projected quantum state having similarity to the query data, followed by the amplitude amplification operation that is independent to the target data index. We provide a thorough demonstration of the algorithm in the problem of image pattern matching.
Abstract Grover quantum algorithm is an unstructured search algorithm that can run on a quantum computer with the complexity of O N\sqrt{N}N​ N , and is one of the typical algorithms of quantum computing. Recently, it has served as a routine for pattern-matching tasks. However, the original Grover search algorithm is probabilistic, which is not negligible for problems involving determinism. Besides that, efficient data loading is also a key challenge for the practical applications of the Grover algorithm. Here in this work, we propose a modified pattern-matching scheme with Long’s quantum search algorithm, in which the quantum circuit structure search algorithm requires fewer multi-qubit quantum gates, and can obtain the desired results deterministically. Then, the comparison of the performance of our scheme and the previous algorithms is presented through numerical simulations, indicating our algorithm is feasible with current quantum technologies which is friendly to noisy intermediate-scale quantum (NISQ) devices.
Grover's algorithm, orginally conceived as a means of searching an unordered database, can also be used to extract solutions from the result sets generated by quantum computations. The Grover algorithm exploits the concept of an oracle function, which abstracts the process of matching a search item (returning 1 for a match and 0 otherwise), where searching for 1 target item in a search space of size NNN scales as O(N)\mathcal{O}(\sqrt{N})O(N​) oracle queries. In this article, we explore the idea of associating a separate oracle with each bit of the matching condition, obtaining multiple partial oracle functions which can be tested independently. Exploring this idea leads to a multi-stage hybrid search algorithm, whose performance can fall within a wide range, anywhere between O(N)\mathcal{O}(\sqrt{N})O(N​) (same as Grover) or O(log⁡(N))\mathcal{O}(\log(N))O(log(N)). The algorithm is validated against the simplest kind of search scenario, where the incoming index bits are scrambled using a permutation operation.
The pattern matching problem is imperative in diversified field of computer science, and it finds occurrences of the pattern string(s) of any arbitrary length “M” in the large text string of length “N”. Since past decades the solutions to a problem have been suggesting through efficient algorithms. Classical benchmark algorithms such as Knuth Morris Pratt and Boyer Moore locates such solution in O(N) time, equivalent quantum algorithms can utilize quantum computations which are inherently parallel and obtains computational speedup by providing the solution in O(√N) time. The quantum pattern matching algorithm uses Grover's search logic that finds an element existence in the large unstructured text data of “N” items in O(√N) time, instead classically it takes O(N) time. The article comprises of introductory pattern matching tactics, quantum basics, Grover's search method, quantum based pattern matching algorithms, their illustration followed by complexity analysis, and finally concludes with the possible algorithmic variations and relevant applications.
Quantum computation has attracted much attention since it was shown by Shor and Grover the possibility to implement quantum algorithms able to realize, respectively, factoring and searching in a faster way than any other known classical algorithm. It is possible to use Grover algorithm, taking profit of its ability to find a specific value in a unordered database, to find, for example, the zero of a logical function; the minimal or maximal value in a database or to recognize if an odd number is prime or not. Here we show quantum algorithms to solve those cited mathematical problems. The solution requires the use of a quantum bit string comparator being used as oracle. This quantum circuit compares two quantum states and identifies if they are equal or, otherwise, which of them is the largest. Moreover, we also show the quantum bit string comparator allow us to implement conditional statements in quantum computation, a fundamental structure for designing of algorithms.