We present a method of representing an element of $\mathbb{F}_3^n$ as an element of $\mathbb{F}_n^2 \times \mathbb{F}_n^2$ which in practice will be a pair of unsigned integers. We show how to do addition, subtraction and pointwise multiplication and division of such vectors quickly using primitive binary operations (and, or, xor). We use this machinery to develop a fast algorithm for computing the permanent of a matrix in $\mathbb{F}_3^{n\times n}$. We present Julia code for a natural implementation of the permanent and show that our improved implementation gives, roughly, a factor of 80 speedup for problems of practical size. Using this improved code, we perform Monte Carlo simulations that suggest that the distribution of $\mbox{perm}(A)$ tends to the uniform distribution as $n \to \infty$.
翻译:我们提出了一种将 $\mathbb{F}_3^n$ 中的元素表示为 $\mathbb{F}_n^2 \times \mathbb{F}_n^2$ 中元素的方法,在实际中这将是一对无符号整数。我们展示了如何利用基本的二元运算(与、或、异或)快速对此类向量进行加法、减法以及逐点乘法和除法运算。我们利用这一机制开发了一种快速算法,用于计算 $\mathbb{F}_3^{n\times n}$ 中矩阵的积和式。我们给出了 Julia 代码来实现积和式的一种自然计算方式,并展示了我们改进的实现对于实际规模的问题能带来大约 80 倍的加速。利用这一改进的代码,我们进行了蒙特卡洛模拟,结果表明当 $n \to \infty$ 时,$\mbox{perm}(A)$ 的分布趋于均匀分布。