We study the problem of computing the Hamming weight of an $n$-bit string modulo $m$, for any positive integer $m \leq n$ whose only prime factors are 2 and 3. We show that the exact quantum query complexity of this problem is $\left\lceil n(1 - 1/m) \right\rceil$. The upper bound is via an iterative query algorithm whose core components are the well-known 1-query quantum algorithm (essentially due to Deutsch) to compute the Hamming weight a 2-bit string mod 2 (i.e., the parity of the input bits), and a new 2-query quantum algorithm to compute the Hamming weight of a 3-bit string mod 3. We show a matching lower bound (in fact for arbitrary moduli $m$) via a variant of the polynomial method [de Wolf, SIAM J. Comput., 32(3), 2003]. This bound is for the weaker task of deciding whether or not a given $n$-bit input has Hamming weight 0 modulo $m$, and it holds even in the stronger non-deterministic quantum query model where an algorithm must have positive acceptance probability iff its input evaluates to 1. For $m>2$ our lower bound exceeds $n/2$, beating the best lower bound provable using the general polynomial method [Theorem 4.3, Beals et al., J. ACM 48(4), 2001].
翻译:我们研究如何计算一个美元-比特调调制调制调制调制调制调制调制调制调制(主要由于Deutsch),以计算任何正整整制的美元=leq n$,其纯质因子为2和3。我们表明,这一问题的确切量子查询复杂度是$left\lcel n(1-1m)\right\rceil n(1-1/m)\right\rceillece$。上界是通过一个迭接调调算法,其核心成分是众所周知的1比特量算制(主要由于Deutsch),以计算调制调制的重量为2比特调制2(即输入比特的等值)和一个新的2比特调制调制调制调制算制,以计算3比特调制调制调制的重量为1美元。我们展示了一个比特调制调制调制调制的比重(事实上Wolf,SIAM J.comput.,32(3),2003)。这一结合是较弱的任务,决定给给给给给给一个给定的1比特的调调制调制调制调制调制调制的重量为4成的重量为4美元,如果调制调制调制调制调制调制调制调制的重量为0.1美元,如果它必须为1比重,则为1比为1,则必须为1比。