The Hamming distance is ubiquitous in computing. Its computation gets expensive when one needs to compare a string against many strings. Quantum computers (QCs) may speed up the comparison. In this paper, we extend an existing algorithm for computing the Hamming distance. The extension can compare strings with symbols drawn from an arbitrary-long alphabet (which the original algorithm could not). We implement our extended algorithm using the QisKit framework to be executed by a programmer without the knowledge of a QC (the code is publicly available). We then provide four pedagogical examples: two from the field of bioinformatics and two from the field of software engineering. We finish by discussing resource requirements and the time horizon of the QCs becoming practical for string comparison.
翻译:Hamming 距离在计算中无处不在。 当需要将字符串与许多字符串进行比较时,其计算成本会很高。 量子计算机( QCs) 可能会加快比较速度 。 在本文中, 我们扩展了计算 Hamming 距离的现有算法 。 扩展可以将字符串与任意长字母( 原始算法无法做到这一点) 的符号作比较 。 我们用QisKit 框架执行扩展算法, 程序员在没有QC 知识的情况下执行( 代码是公开提供的) 。 我们然后提供四个教学示例: 两个来自生物信息学领域, 两个来自软件工程领域。 我们最后讨论资源要求和QC 时间范围, 以便进行字符串比较。