A quantum algorithm for string matching
Open Access
- 16 February 2021
- journal article
- research article
- Published by Springer Nature in npj Quantum Information
- Vol. 7 (1) , 1-5
Abstract
Algorithms that search for a pattern within a larger data-set appear ubiquitously in text and image processing. Here, we present an explicit, circuit-level implementation of a quantum pattern-matching algorithm that matches a search string (pattern) of length M inside a longer text of length N. Our algorithm has a time complexity of $$\tilde{O}(\sqrt{N})$$ , while the space complexity remains modest at O(N + M). We report the quantum gate counts relevant for both pre-fault-tolerant and fault-tolerant regimes.
Keywords
Funding Information
- U.S. Department of Energy (DESC0019040, DE-SC0020312)
This publication has 19 references indexed in Scilit:
- Quantum Random Access MemoryPhysical Review Letters, 2008
- A Subexponential-Time Quantum Algorithm for the Dihedral Hidden Subgroup ProblemSIAM Journal on Computing, 2005
- String matching in O(n+m) quantum timeJournal of Discrete Algorithms, 2003
- Quantum amplitude amplification and estimation2002
- Quantum template matchingPhysical Review A, 2001
- Matched filtering of gravitational waves from inspiraling compact binaries: Computational cost and template placementPhysical Review D, 1999
- Pattern matching in a digitized imageAlgorithmica, 1994
- Sublinear approximate string matching and biological applicationsAlgorithmica, 1994
- Applications of approximate string matching to 2D shape recognitionPattern Recognition, 1993
- Fast Pattern Matching in StringsSIAM Journal on Computing, 1977