Given a large dataset of many tuples, it is hard for users to pick out their preferred tuples. Thus, the preference query problem, which is to find the most preferred tuples from a dataset, is widely discussed in the database area. In this problem, a utility function is given by the user to evaluate to what extent the user prefers a tuple. However, considering a dataset consisting of N tuples, the existing algorithms need O(N) time to answer a query, or need O(N) time for a cold start to answer a query. The reason is that in a classical computer, a linear time is needed to evaluate the utilities by the utility function for N tuples. In this paper, we discuss the Quantum Preference Query (QPQ) problem, where the dataset is given in a quantum memory, and we use a quantum computer to return the answers. Due to quantum parallelism, the quantum algorithm can theoretically perform better than their classical competitors. We discuss this problem in different kinds of input and output. In the QPQ problem, the input can be a number k or a threshold theta. Given k, the problem is to return k tuples with the highest utilities. Given theta, the problem is to return all the tuples with utilities higher than theta. Also, in QPQ problem, the output can be classical (i.e., a list of tuples) or quantum (i.e., a superposition in quantum bits). We proposed four quantum algorithms to solve the problems in the above four scenarios. We analyze the number of memory accesses needed for each quantum algorithm, which shows that the proposed quantum algorithms are at least quadratically faster than their classical competitors. In our experiments, we show that to answer a QPQ problem, the quantum algorithms achieve up to 1000x improvement in number of memory accesses than their classical competitors, which proved that QPQ problem could be a future direction of the study of preference query problems.
翻译:给定一个包含大量元组的大型数据集,用户很难从中挑选出偏好的元组。因此,偏好查询问题——即从数据集中找出最受偏好的元组——在数据库领域被广泛讨论。在此问题中,用户通过一个效用函数来评估其对某个元组的偏好程度。然而,对于一个包含 N 个元组的数据集,现有算法需要 O(N) 的时间来响应一次查询,或在冷启动时需要 O(N) 的时间来响应查询。原因在于,在经典计算机中,对 N 个元组通过效用函数计算效用值需要线性时间。本文探讨量子偏好查询问题,其中数据集存储在量子存储器中,我们使用量子计算机来返回答案。得益于量子并行性,量子算法在理论上可以表现得比经典算法更好。我们在不同类型的输入和输出下讨论此问题。在 QPQ 问题中,输入可以是一个数字 k 或一个阈值 θ。给定 k,问题在于返回效用最高的 k 个元组。给定 θ,问题在于返回所有效用高于 θ 的元组。同时,在 QPQ 问题中,输出可以是经典的(即一个元组列表)或量子的(即量子比特中的叠加态)。我们提出了四种量子算法来解决上述四种场景中的问题。我们分析了每种量子算法所需的内存访问次数,结果表明所提出的量子算法至少比经典算法快二次方。在我们的实验中,我们展示了在回答 QPQ 问题时,量子算法在内存访问次数上相比经典算法实现了高达 1000 倍的改进,这证明 QPQ 问题可能成为未来偏好查询问题研究的一个方向。