In this work, we revisit prefix sums through the lens of linear algebra. We describe an identity that decomposes triangular all-ones matrices as a sum of two Kronecker products, and apply it to design recursive prefix sum algorithms and circuits. Notably, the proposed family of circuits is the first one that achieves the following three properties simultaneously: (i) zero-deficiency, (ii) constant fan-out per-level, and (iii) depth that is asymptotically strictly smaller than $2\log(n)$ for input length $n$. As an application, we show how to use these circuits to design quantum adders with $1.893\log(n)+O(1)$ Toffoli depth, $O(n)$ Toffoli gates, and $O(n)$ additional qubits, improving the Toffoli depth and/or Toffoli size of existing constructions.
翻译:本文从线性代数的视角重新审视前缀和问题。我们提出了一种恒等式,将三角全一矩阵分解为两个克罗内克积之和,并应用该恒等式设计递归式前缀和算法与电路。特别值得注意的是,所提出的电路家族是首个同时满足以下三个性质的电路:(i) 零缺陷性,(ii) 每层恒定扇出,以及 (iii) 对于输入长度 $n$,其深度渐近严格小于 $2\log(n)$。作为应用,我们展示了如何利用这些电路设计量子加法器,其托佛利门深度为 $1.893\log(n)+O(1)$,托佛利门数量为 $O(n)$,额外量子比特数为 $O(n)$,从而改进了现有构造的托佛利门深度和/或托佛利门规模。