SlowGuess/NeurIPS_2023_OCR huggingface dataset:
$$
\begin{array}{l} - \frac {2}{n} \sum_ {j = 1} ^ {n} \int_ {[ 0, 1 ] ^ {d}} K (\boldsymbol {x}, \boldsymbol {x} _ {j}) \mathrm {d} \boldsymbol {x} (45) \\ = - \frac {2}{n} \sum_ {j = 1} ^ {n} \int_ {[ 0, 1 ] ^ {d}} \sum_ {\boldsymbol {k} \in \mathbb {Z} ^ {d}} \gamma_ {\alpha} (\boldsymbol {k}) \exp \left(2 \pi \mathbf {i} \boldsymbol {k} ^ {\top} (\boldsymbol {x} - \boldsymbol {x} _ {j})\right) d \boldsymbol {x} (46) \\ = - \frac {2}{n} \sum_ {j = 1} ^ {n} \gamma_ {\alpha} (\mathbf {0}) - \frac {2}{n} \sum_ {j = 1} ^ {n} \sum_ {\boldsymbol {k} \in \mathbb {Z} ^ {d}, \boldsymbol {k} \neq \boldsymbol {0}} \gamma_ {\alpha} (\boldsymbol {k}) \int_ {[ 0, 1 ] ^ {d}} \exp \left(2 \pi \mathbf {i} \boldsymbol {k} ^ {\top} (\boldsymbol {x} - \boldsymbol {x} _ {j})\right) d \boldsymbol {x} (47) \\ = - \frac {2}{n} \sum_ {j = 1} ^ {n} \gamma_ {\alpha} (\mathbf {0}) - \frac {2}{n} \sum_ {j = 1} ^ {n} \sum_ {\boldsymbol {k} \in \mathbb {Z} ^ {d}, \boldsymbol {k} \neq \boldsymbol {0}} \gamma_ {\alpha} (\boldsymbol {k}) \cdot 0 (48) \\ = - 2 (49) \\ \end{array}
$$
Moreover, from the definition of rank-1 lattice  $\mathcal{P}$  with prime  $n$  and generating vector  $\pmb{z}$ , we have the third term in Eq.(41) as follows
$$
\begin{array}{l} \frac {1}{n ^ {2}} \sum_ {i, j = 1} ^ {n} K \left(\boldsymbol {x} _ {i}, \boldsymbol {x} _ {j}\right) (50) \\ = \frac {1}{n ^ {2}} \sum_ {i, j = 1} ^ {n} \sum_ {\boldsymbol {k} \in \mathbb {Z} ^ {d}} \gamma_ {\alpha} (\boldsymbol {k}) \exp \left(2 \pi \mathbf {i} \boldsymbol {k} ^ {\top} \left(\boldsymbol {x} _ {i} - \boldsymbol {x} _ {j}\right)\right) (51) \\ = 1 + \frac {1}{n ^ {2}} \sum_ {i, j = 1} ^ {n} \sum_ {\boldsymbol {k} \in \mathbb {Z} ^ {d}, \boldsymbol {k} \neq \boldsymbol {0}} \gamma_ {\alpha} (\boldsymbol {k}) \exp \left(\frac {2 \pi \mathbf {i} (i - j) \boldsymbol {k} ^ {\top} \boldsymbol {z}}{n}\right) (52) \\ = 1 + \sum_ {\boldsymbol {k} \in \mathbb {Z} ^ {d}, \boldsymbol {k} \neq \boldsymbol {0}} \gamma_ {\alpha} (\boldsymbol {k}) \frac {1}{n ^ {2}} \sum_ {i, j = 1} ^ {n} \exp \left(\frac {2 \pi \mathrm {i} (i - j) \boldsymbol {k} ^ {\top} \boldsymbol {z}}{n}\right) (53) \\ = 1 + \sum_ {\boldsymbol {k} \in \mathbb {Z} ^ {d}, \boldsymbol {k} \neq \boldsymbol {0}} \gamma_ {\alpha} (\boldsymbol {k}) \frac {1}{n} \sum_ {j = 1} ^ {n} \exp \left(\frac {2 \pi \mathbf {i} j \boldsymbol {k} ^ {\top} \boldsymbol {z}}{n}\right) (54) \\ \end{array}
$$
Put Eq.(44), Eq.(49) and Eq.(54) together, we know that
$$
e ^ {2} \left(\mathcal {H} _ {k}; \mathcal {P}\right) = \sum_ {\boldsymbol {k} \in \mathbb {Z} ^ {d}, \boldsymbol {k} \neq \boldsymbol {0}} \gamma_ {\alpha} (\boldsymbol {k}) \frac {1}{n} \sum_ {j = 1} ^ {n} \exp \left(\frac {2 \pi \mathrm {i} j \boldsymbol {k} ^ {\top} \boldsymbol {z}}{n}\right) \tag {55}
$$
Note that for a prime number  $n$ , we have
$$
\frac {1}{n} \sum_ {j = 1} ^ {n} \exp \left(\frac {2 \pi \mathbf {i} j \boldsymbol {k} ^ {\top} \boldsymbol {z}}{n}\right) = \left\{ \begin{array}{l l} 1 & \text {i f} \boldsymbol {k} ^ {\top} \boldsymbol {z} \equiv 0 \bmod n \\ 0 & \text {o t h e r w i s e} \end{array} \right. \tag {56}
$$
$$
e ^ {2} \left(\mathcal {H} _ {k}; \mathcal {P}\right) = \sup  _ {f \in \mathcal {H} _ {k}, \| f \| _ {\mathcal {H} _ {k}} \leq 1} \left| \int_ {[ 0, 1 ] ^ {d}} f (\boldsymbol {x}) d \boldsymbol {x} - \frac {1}{n} \sum_ {j = 0} ^ {n - 1} f \left(\boldsymbol {x} _ {j}\right) \right| ^ {2} = \sum_ {\boldsymbol {k} \in L ^ {\perp} \backslash \{\boldsymbol {0} \}} \gamma_ {\alpha} (\boldsymbol {k}), \tag {57}
$$
where  $L^{\perp} \coloneqq \{ \pmb{k} | \pmb{k}^{\top} \pmb{z} \equiv 0 \, (\mathrm{mod} \, n), \pmb{k} \in \mathbb{Z}^{d} \}$  denotes the dual lattice.
Lemma 2. Given a prime  $n$ , construct a rank-1 lattice  $\mathcal{P} = [\pmb{x}_1, \dots, \pmb{x}_n]$  by the generating vector  $z = [z_1, \dots, z_d]$ , then we have that
$$
e ^ {2} \left(\mathcal {H} _ {k}; \mathcal {P}\right) = - 1 + \frac {1}{n} \sum_ {j = 0} ^ {n - 1} \prod_ {i = 1} ^ {d} \left(\sum_ {k _ {i} \in \{1, \dots , n \}} \chi \left(k _ {i}\right) \exp \left(2 \pi \mathbf {i} \frac {k _ {i} j z _ {i}}{n}\right)\right), \tag {58}
$$
where function  $\chi (\cdot)$  on domain  $\{1,\dots ,n\}$  is given as Eq.(59)
$$
\chi \left(k _ {i}\right) = \left\{ \begin{array}{l l} 1 + \frac {2}{n ^ {\alpha}} \zeta (\alpha , 1) & \text {i f} k _ {i} = n \\ \frac {1}{n ^ {\alpha}} \left(\zeta \left(\alpha , \frac {k _ {i}}{n}\right) + \zeta \left(\alpha , \frac {n - k _ {i}}{n}\right)\right) & \text {o t h e r w i s e} \end{array} , \right. \tag {59}
$$
where  $\zeta (\cdot ,\cdot)$  denotes the Hurwitz zeta function.
Proof. From Lemma 1, we know that
$$
\begin{array}{l} e ^ {2} \left(\mathcal {H} _ {k}; \mathcal {P}\right) = \sum_ {\boldsymbol {k} \in \mathbb {Z} ^ {d} \backslash \{\boldsymbol {0} \}} \gamma_ {\alpha} (\boldsymbol {k}) \left(\frac {1}{n} \sum_ {j = 0} ^ {n - 1} \exp \left(2 \pi \mathrm {i} \frac {\boldsymbol {k} ^ {\top} \boldsymbol {x} _ {j}}{n}\right)\right) (60) \\ = - 1 + \frac {1}{n} \sum_ {j = 0} ^ {n - 1} \sum_ {\boldsymbol {k} \in \mathbb {Z} ^ {d}} \gamma_ {\alpha} (\boldsymbol {k}) \exp \left(2 \pi \mathrm {i} \frac {\boldsymbol {k} ^ {\top} \boldsymbol {x} _ {j}}{n}\right) (61) \\ = - 1 + \frac {1}{n} \sum_ {j = 0} ^ {n - 1} \prod_ {i = 1} ^ {d} \left(\sum_ {k _ {i} \in \mathbb {Z}} \gamma_ {\alpha} \left(k _ {i}\right) \exp \left(2 \pi \mathbf {i} \frac {k _ {i} j z _ {i}}{n}\right)\right) (62) \\ = - 1 + \frac {1}{n} \sum_ {j = 0} ^ {n - 1} \prod_ {i = 1} ^ {d} \left(\sum_ {k _ {i} \in \{1, \dots , n \}} \left(\sum_ {q _ {i} \equiv k _ {i} \bmod n} \gamma_ {\alpha} (q _ {i})\right) \exp \left(2 \pi \mathbf {i} \frac {k _ {i} j z _ {i}}{n}\right)\right) (63) \\ \end{array}
$$
Now, we check the term  $\sum_{k_i\in \{1,\dots ,n\}}\left(\sum_{q_i\equiv k_i\bmod n}\gamma_\alpha (q_i)\right)$ . From the definition of the function  $\gamma_{\alpha}(\cdot)$ , for  $\forall k_{i}\in \{1,\dots ,n\}$ , we have that
$$
\chi \left(k _ {i}\right) = \sum_ {q _ {i} \equiv k _ {i} \bmod n} \gamma_ {\alpha} \left(q _ {i}\right) = \left\{ \begin{array}{l l} 1 + 2 \sum_ {m = 1} ^ {\infty} \frac {1}{(m n) ^ {\alpha}} & \text {i f} k _ {i} = n \\ \sum_ {m = 0} ^ {\infty} \frac {1}{\left(k _ {i} + m n\right) ^ {\alpha}} + \sum_ {m = 0} ^ {\infty} \frac {1}{\left(n - k _ {i} + m n\right) ^ {\alpha}} & \text {o t h e r w i s e} \end{array} \right. \tag {64}
$$
Note that series  $\sum_{m=1}^{\infty} \frac{1}{(mn)^{\alpha}}$ ,  $\sum_{m=0}^{\infty} \frac{1}{(k_i + mn)^{\alpha}}$  and  $\sum_{m=0}^{\infty} \frac{1}{(n - k_i + mn)^{\alpha}}$  can be rewritten as
$$
\sum_ {m = 1} ^ {\infty} \frac {1}{(m n) ^ {\alpha}} = \frac {1}{n ^ {\alpha}} \sum_ {m = 1} ^ {\infty} \frac {1}{m ^ {\alpha}} = \frac {1}{n ^ {\alpha}} \zeta (\alpha , 1) \tag {65}
$$
$$
\sum_ {m = 0} ^ {\infty} \frac {1}{\left(k _ {i} + m n\right) ^ {\alpha}} = \frac {1}{n ^ {\alpha}} \sum_ {m = 0} ^ {\infty} \frac {1}{\left(\frac {k _ {i}}{n} + m\right) ^ {\alpha}} = \frac {1}{n ^ {\alpha}} \zeta (\alpha , \frac {k _ {i}}{n}) \tag {66}
$$
$$
\sum_ {m = 0} ^ {\infty} \frac {1}{(n - k _ {i} + m n) ^ {\alpha}} = \frac {1}{n ^ {\alpha}} \sum_ {m = 0} ^ {\infty} \frac {1}{(\frac {n - k _ {i}}{n} + m) ^ {\alpha}} = \frac {1}{n ^ {\alpha}} \zeta (\alpha , \frac {n - k _ {i}}{n}) \tag {67}
$$
Plug them into Eq.(64), we know that
$$
\chi \left(k _ {i}\right) = \sum_ {q _ {i} \equiv k _ {i} \bmod n} \gamma_ {\alpha} \left(q _ {i}\right) = \left\{ \begin{array}{l l} 1 + \frac {2}{n ^ {\alpha}} \zeta (\alpha , 1) & \text {i f} k _ {i} = n \\ \frac {1}{n ^ {\alpha}} \left(\zeta \left(\alpha , \frac {k _ {i}}{n}\right) + \zeta \left(\alpha , \frac {n - k _ {i}}{n}\right)\right) & \text {o t h e r w i s e} \end{array} \right. \tag {68}
$$
Plug Eq.(68) into Eq.(63), we have that
$$
e ^ {2} \left(\mathcal {H} _ {k}; \mathcal {P}\right) = - 1 + \frac {1}{n} \sum_ {j = 0} ^ {n - 1} \prod_ {i = 1} ^ {d} \left(\sum_ {k _ {i} \in \{1, \dots , n \}} \chi \left(k _ {i}\right) \exp \left(2 \pi \mathbf {i} \frac {k _ {i} j z _ {i}}{n}\right)\right) \tag {69}
$$
Lemma 3. Let  $n$  be a prime number. Let  $\gamma = [\gamma_1, \dots, \gamma_n]^\top$  be a vector with  $\gamma_k = \chi(k)$  for  $k \in \{1, \dots, n\}$ , where  $\chi(\cdot)$  is defined in Lemma 2. The square worst-case integral approximation error of rank-1 lattice  $\mathcal{P}$  constructed by generating vector  $z = [z_1, \dots, z_d]$  can be rewritten in a matrix form as Eq.(70)
$$
e ^ {2} \left(\mathcal {H} _ {k}; \mathcal {P}\right) = \frac {1}{n} \mathbf {1} ^ {\top} \left(\boldsymbol {h} ^ {0} \odot \dots \odot \boldsymbol {h} ^ {d - 1} - \mathbf {1}\right) \tag {70}
$$
where  $\odot$  denotes the element-wise product, symbol 1 denotes the vector with elements all ones, and  $h^i = F^i\gamma$  with  $F$  as the discrete Fourier matrix, i.e.,  $F_{jk} = \exp (2\pi \mathrm{i}\frac{jk}{n})$ , and  $F^i$  denotes the matrix after permutation of the rows of  $F$  such that the  $j^{th}$  row of  $F^i$  equals to the  $\widetilde{j}^{th}$  row of  $F$ , where  $\widetilde{j} = jz_{i + 1}$  mod  $n$ .
Proof. Define  $\pmb{h}^i$  as Eq.(71)
$$
\boldsymbol {h} ^ {i} = \boldsymbol {F} ^ {i} \gamma \tag {71}
$$
where  $\pmb{F}$  as the discrete Fourier matrix, i.e.,  $\pmb{F}_{jk} = \exp (2\pi \mathbf{i}\frac{jk}{n})$ , and  $\pmb{F}^i$  denotes the matrix after permutation of the rows of  $\pmb{F}$  such that the  $j^{th}$  row of  $\pmb{F}^i$  equals to the  $\widetilde{j}^{th}$  row of  $\pmb{F}$ , where  $\widetilde{j} = jz_{i + 1} \bmod n$ , and  $g$  denotes the primitive root modulo  $n$ .
From Lemma 2, we know that
$$
e ^ {2} \left(\mathcal {H} _ {k}; \mathcal {P}\right) = - 1 + \frac {1}{n} \sum_ {j = 0} ^ {n - 1} \prod_ {i = 1} ^ {d} \left(\sum_ {k _ {i} \in \{1, \dots , n \}} \chi \left(k _ {i}\right) \exp \left(2 \pi \mathbf {i} \frac {k _ {i} j z _ {i}}{n}\right)\right) \tag {72}
$$
Note that  $\gamma = [\gamma_1, \dots, \gamma_n]^\top$  is a vector with  $\gamma_k = \chi(k)$  for  $k \in \{1, \dots, n\}$ , it follows that
$$
\begin{array}{l} e ^ {2} \left(\mathcal {H} _ {k}; \mathcal {P}\right) = - 1 + \frac {1}{n} \mathbf {1} ^ {\top} \left(\boldsymbol {F} ^ {0} \gamma \odot \dots \odot \boldsymbol {F} ^ {d - 1} \gamma\right) (73) \\ = - 1 + \frac {1}{n} \mathbf {1} ^ {\top} \left(\boldsymbol {h} ^ {0} \odot \dots \odot \boldsymbol {h} ^ {d - 1}\right) (74) \\ = \frac {1}{n} \mathbf {1} ^ {\top} \left(\boldsymbol {h} ^ {0} \odot \dots \odot \boldsymbol {h} ^ {d - 1} - \mathbf {1}\right) (75) \\ \end{array}
$$
Lemma 4. Let  $n$  be a prime number such that  $(2d - 1)(n - 1)$ . Let  $\gamma = [\gamma_1, \dots, \gamma_n]^\top$  be a vector with  $\gamma_k = \chi(k)$  for  $k \in \{1, \dots, n\}$ , where  $\chi(\cdot)$  is defined in Lemma 2. Given a rank-1 lattice  $\mathcal{P}$  constructed by generating vector in Eq.(30), then we have Eq.(76)
$$
\begin{array}{l} \mathbf {1} ^ {\top} \left(\boldsymbol {h} ^ {0} \odot \dots \odot \boldsymbol {h} ^ {d - 1} - \mathbf {1}\right) = \mathbf {1} ^ {\top} \left(\boldsymbol {h} ^ {d} \odot \dots \odot \boldsymbol {h} ^ {2 d - 2} - \mathbf {1}\right) + \left\langle \boldsymbol {h} ^ {d} \odot \dots \odot \boldsymbol {h} ^ {2 d - 2} - \mathbf {1}, \boldsymbol {h} ^ {0} - \mathbf {1} \right\rangle \\ + \mathbf {1} ^ {\top} \left(\mathbf {h} ^ {0} - \mathbf {1}\right) \tag {76} \\ \end{array}
$$
where  $\odot$  denotes the element-wise product, symbol 1 denotes the vector with elements all ones, and  $h^i = F^i\gamma$  with  $F$  as the discrete Fourier matrix, i.e.,  $F_{jk} = \exp (2\pi \mathbf{i}\frac{jk}{n})$ , and  $F^i$  denotes the matrix after permutation of the rows of  $F$  such that the  $j^{th}$  row of  $F^i$  equals to the  $\widetilde{j}^{th}$  row of  $F$ , where  $\widetilde{j} = jg^{\frac{i(n - 1)}{2d - 1}} \bmod n$ , and  $g$  denotes the primitive root modulo  $n$ .
Proof. Note that  $\pmb{h}^i = \pmb{F}^i\pmb{\gamma}$  is a permutation of  $\pmb{h}^0$ . From the definition of permutation  $\pmb{F}^i$ , we know that the  $j^{th}$  row of  $\pmb{F}^i$  equals to the  $\widetilde{j}^{th}$  row of  $\pmb{F}$  with  $\widetilde{j} = jg^{\frac{i(n - 1)}{2d - 1}} \mod n$ . Note that  $(2d - 1) \mid (n - 1)$  and  $n$  is a prime number, we know  $\{1, g^{\frac{1(n - 1)}{2d - 1}}, \dots, g^{\frac{(2d - 2)(n - 1)}{2d - 1}}\}$  modulo  $n$  forms a subgroup of  $\{1, \dots, n - 1\}$  modulo  $n$ . Thus, we know  $\{h^0, h^1, \dots, h^{2d - 2}\}$  forms a group, and  $h^0 = h^{2d - 1}$ . Furthermore, we know that  $\pmb{h}^k$  is a permutation of  $\pmb{h}^i$  such that  $j^{th}$  row of  $\pmb{F}^k$  equals to the  $\bar{j}^{th}$  row of  $\pmb{F}^i$  with  $\bar{j} = jg^{\frac{(k - i)(n - 1)}{2d - 1}} \mod n$ . Thus, we know that
$$
\mathbf {1} ^ {\top} \left(\boldsymbol {h} ^ {0} \odot \dots \odot \boldsymbol {h} ^ {d - 1}\right) = \mathbf {1} ^ {\top} \left(\boldsymbol {h} ^ {d} \odot \dots \odot \boldsymbol {h} ^ {2 d - 1}\right) \tag {77}
$$
Note that  $\pmb{h}^0 = \pmb{h}^{2d - 1}$ . It follows that
$$
\begin{array}{l} \mathbf {1} ^ {\top} \left(\boldsymbol {h} ^ {0} \odot \dots \odot \boldsymbol {h} ^ {d - 1} - \mathbf {1}\right) = \mathbf {1} ^ {\top} \left(\boldsymbol {h} ^ {d} \odot \dots \odot \boldsymbol {h} ^ {2 d - 1} - \mathbf {1}\right) (78) \\ = \mathbf {1} ^ {\top} \left(\boldsymbol {h} ^ {d} \odot \dots \odot \boldsymbol {h} ^ {2 d - 2} \odot \boldsymbol {h} ^ {0} - \mathbf {1}\right) (79) \\ \end{array}
$$
$$
\begin{array}{l} \left\langle \boldsymbol {h} ^ {d} \odot \dots \odot \boldsymbol {h} ^ {2 d - 2} - \mathbf {1}, \boldsymbol {h} ^ {0} - \mathbf {1} \right\rangle (80) \\ = \left\langle \boldsymbol {h} ^ {d} \odot \dots \odot \boldsymbol {h} ^ {2 d - 2}, \boldsymbol {h} ^ {0} \right\rangle - \mathbf {1} ^ {\top} \left(\boldsymbol {h} ^ {d} \odot \dots \odot \boldsymbol {h} ^ {2 d - 2}\right) - \mathbf {1} ^ {\top} \boldsymbol {h} ^ {0} + \mathbf {1} ^ {\top} \mathbf {1} (81) \\ = \mathbf {1} ^ {\top} \left(\boldsymbol {h} ^ {d} \odot \dots \odot \boldsymbol {h} ^ {2 d - 2} \odot \boldsymbol {h} ^ {0}\right) - \mathbf {1} ^ {\top} \left(\boldsymbol {h} ^ {d} \odot \dots \odot \boldsymbol {h} ^ {2 d - 2}\right) - \mathbf {1} ^ {\top} \boldsymbol {h} ^ {0} + \mathbf {1} ^ {\top} \mathbf {1} (82) \\ = \mathbf {1} ^ {\top} \left(\boldsymbol {h} ^ {d} \odot \dots \odot \boldsymbol {h} ^ {2 d - 2} \odot \boldsymbol {h} ^ {0}\right) - \mathbf {1} ^ {\top} \mathbf {1} - \mathbf {1} ^ {\top} \left(\boldsymbol {h} ^ {d} \odot \dots \odot \boldsymbol {h} ^ {2 d - 2}\right) + \mathbf {1} ^ {\top} \mathbf {1} - \mathbf {1} ^ {\top} \boldsymbol {h} ^ {0} + \mathbf {1} ^ {\top} \mathbf {1} (83) \\ = \mathbf {1} ^ {\top} \left(\boldsymbol {h} ^ {d} \odot \dots \odot \boldsymbol {h} ^ {2 d - 2} \odot \boldsymbol {h} ^ {0} - \mathbf {1}\right) - \mathbf {1} ^ {\top} \left(\boldsymbol {h} ^ {d} \odot \dots \odot \boldsymbol {h} ^ {2 d - 2} - \mathbf {1}\right) - \mathbf {1} ^ {\top} \left(\boldsymbol {h} ^ {0} - \mathbf {1}\right) (84) \\ \end{array}
$$
$$
\begin{array}{l} \mathbf {1} ^ {\top} \left(\boldsymbol {h} ^ {d} \odot \dots \odot \boldsymbol {h} ^ {2 d - 2} \odot \boldsymbol {h} ^ {0} - \mathbf {1}\right) = \left\langle \boldsymbol {h} ^ {d} \odot \dots \odot \boldsymbol {h} ^ {2 d - 2} - \mathbf {1}, \boldsymbol {h} ^ {0} - \mathbf {1} \right\rangle + \mathbf {1} ^ {\top} \left(\boldsymbol {h} ^ {d} \odot \dots \odot \boldsymbol {h} ^ {2 d - 2} - \mathbf {1}\right) \\ + \mathbf {1} ^ {\top} \left(\boldsymbol {h} ^ {0} - \mathbf {1}\right) \tag {85} \\ \end{array}
$$
Plug Eq.(85) into Eq.(79), we know that
$$
\begin{array}{l} \mathbf {1} ^ {\top} \left(\boldsymbol {h} ^ {0} \odot \dots \odot \boldsymbol {h} ^ {d - 1} - \mathbf {1}\right) = \left\langle \boldsymbol {h} ^ {d} \odot \dots \odot \boldsymbol {h} ^ {2 d - 2} - \mathbf {1}, \boldsymbol {h} ^ {0} - \mathbf {1} \right\rangle + \mathbf {1} ^ {\top} \left(\boldsymbol {h} ^ {d} \odot \dots \odot \boldsymbol {h} ^ {2 d - 2} - \mathbf {1}\right) \\ + \mathbf {1} ^ {\top} \left(\mathbf {h} ^ {0} - \mathbf {1}\right) \tag {86} \\ \end{array}
$$
Lemma 5. Let  $n$  be a prime number such that  $(2d - 1)|(n - 1)$ . Let  $\gamma = [\gamma_1, \dots, \gamma_n]^\top$  be a vector with  $\gamma_k = \chi(k)$  for  $k \in \{1, \dots, n\}$ , where  $\chi(\cdot)$  is defined in Lemma 2. Given a rank-1 lattice  $\mathcal{P}$  constructed by generating vector in Eq.(30), then we have Eq.(87)
$$
\begin{array}{l} \mathbf {1} ^ {\top} \left(\boldsymbol {h} ^ {0} \odot \dots \odot \boldsymbol {h} ^ {2 d - 2} - \mathbf {1}\right) = \mathbf {1} ^ {\top} \left(\boldsymbol {h} ^ {0} \odot \dots \odot \boldsymbol {h} ^ {d - 1} - \mathbf {1}\right) + \mathbf {1} ^ {\top} \left(\boldsymbol {h} ^ {d} \odot \dots \odot \boldsymbol {h} ^ {2 d - 2} - \mathbf {1}\right) \\ + \left\langle \boldsymbol {h} ^ {0} \odot \dots \odot \boldsymbol {h} ^ {d - 1} - \mathbf {1}, \boldsymbol {h} ^ {d} \odot \dots \odot \boldsymbol {h} ^ {2 d - 2} - \mathbf {1} \right\rangle \tag {87} \\ \end{array}
$$
Proof. Similar to the proof of Lemma 4, we have that
$$
\begin{array}{l} \left\langle \boldsymbol {h} ^ {0} \odot \dots \odot \boldsymbol {h} ^ {d - 1} - \mathbf {1}, \boldsymbol {h} ^ {d} \odot \dots \odot \boldsymbol {h} ^ {2 d - 2} - \mathbf {1} \right\rangle (88) \\ = \left\langle \boldsymbol {h} ^ {0} \odot \dots \odot \boldsymbol {h} ^ {d - 1}, \boldsymbol {h} ^ {d} \odot \dots \odot \boldsymbol {h} ^ {2 d - 2} \right\rangle - \mathbf {1} ^ {\top} \left(\boldsymbol {h} ^ {0} \odot \dots \odot \boldsymbol {h} ^ {d - 1}\right) - \mathbf {1} ^ {\top} \left(\boldsymbol {h} ^ {d} \odot \dots \odot \boldsymbol {h} ^ {2 d - 2}\right) + \mathbf {1} ^ {\top} \mathbf {1} (89) \\ = \mathbf {1} ^ {\top} \left(\boldsymbol {h} ^ {0} \odot \dots \odot \boldsymbol {h} ^ {2 d - 2}\right) - \mathbf {1} ^ {\top} \left(\boldsymbol {h} ^ {0} \odot \dots \odot \boldsymbol {h} ^ {d - 1}\right) - \mathbf {1} ^ {\top} \left(\boldsymbol {h} ^ {d} \odot \dots \odot \boldsymbol {h} ^ {2 d - 2}\right) + \mathbf {1} ^ {\top} \mathbf {1} (90) \\ = \mathbf {1} ^ {\top} \left(\boldsymbol {h} ^ {0} \odot \dots \odot \boldsymbol {h} ^ {2 d - 2}\right) - \mathbf {1} ^ {\top} \mathbf {1} - \mathbf {1} ^ {\top} \left(\boldsymbol {h} ^ {0} \odot \dots \odot \boldsymbol {h} ^ {d - 1}\right) + \mathbf {1} ^ {\top} \mathbf {1} - \mathbf {1} ^ {\top} \left(\boldsymbol {h} ^ {d} \odot \dots \odot \boldsymbol {h} ^ {2 d - 2}\right) + \mathbf {1} ^ {\top} \mathbf {1} (91) \\ = \mathbf {1} ^ {\top} \left(\boldsymbol {h} ^ {0} \odot \dots \odot \boldsymbol {h} ^ {2 d - 2} - \mathbf {1}\right) - \mathbf {1} ^ {\top} \left(\boldsymbol {h} ^ {0} \odot \dots \odot \boldsymbol {h} ^ {d - 1} - \mathbf {1}\right) - \mathbf {1} ^ {\top} \left(\boldsymbol {h} ^ {d} \odot \dots \odot \boldsymbol {h} ^ {2 d - 2} - \mathbf {1}\right) (92) \\ \end{array}
$$
$$
\begin{array}{l} \mathbf {1} ^ {\top} \left(\boldsymbol {h} ^ {0} \odot \dots \odot \boldsymbol {h} ^ {2 d - 2} - \mathbf {1}\right) = \mathbf {1} ^ {\top} \left(\boldsymbol {h} ^ {0} \odot \dots \odot \boldsymbol {h} ^ {d - 1} - \mathbf {1}\right) + \mathbf {1} ^ {\top} \left(\boldsymbol {h} ^ {d} \odot \dots \odot \boldsymbol {h} ^ {2 d - 2} - \mathbf {1}\right) \\ + \left\langle \boldsymbol {h} ^ {0} \odot \dots \odot \boldsymbol {h} ^ {d - 1} - \mathbf {1}, \boldsymbol {h} ^ {d} \odot \dots \odot \boldsymbol {h} ^ {2 d - 2} - \mathbf {1} \right\rangle \tag {93} \\ \end{array}
$$
Lemma 6. Let  $n$  be a prime number such that  $(2d - 1)(n - 1)$ . Let  $\gamma = [\gamma_1, \dots, \gamma_n]^\top$  be a vector with  $\gamma_k = \chi(k)$  for  $k \in \{1, \dots, n\}$ , where  $\chi(\cdot)$  is defined in Lemma 2. Given a rank-1 lattice  $\mathcal{P}$  constructed by generating vector in Eq.(30), then we have Eq.(94)
$$
\begin{array}{l} \mathbf {1} ^ {\top} \left(\mathbf {h} ^ {0} \odot \dots \odot \mathbf {h} ^ {2 d - 2} - \mathbf {1}\right) = \mathbf {1} ^ {\top} \left(\left(\mathbf {h} ^ {1} \odot \dots \odot \mathbf {h} ^ {d - 1} - \mathbf {1}\right) \odot \mathbf {h} ^ {0} \odot \left(\mathbf {h} ^ {- (d - 1)} \odot \dots \odot \mathbf {h} ^ {- 1} - \mathbf {1}\right)\right) \\ + 2 \mathbf {1} ^ {\top} \left(\boldsymbol {h} ^ {0} \odot \dots \odot \boldsymbol {h} ^ {d - 1} - \mathbf {1}\right) - \mathbf {1} ^ {\top} \left(\boldsymbol {h} ^ {0} - \mathbf {1}\right) \tag {94} \\ \end{array}
$$
where  $\odot$  denotes the element-wise product, symbol  $\mathbf{1}$  denotes the vector with elements all ones, and  $\pmb{h}^{i} = \pmb{F}^{i}\gamma$  with  $\pmb{F}$  as the discrete Fourier matrix, i.e.,  $\pmb{F}_{jk} = \exp (2\pi \mathbf{i}\frac{jk}{n})$ , and  $\pmb{F}^{i}$  denotes the matrix after permutation of the rows of  $\pmb{F}$  such that the  $j^{th}$  row of  $\pmb{F}^{i}$  equals to the  $j^{th}$  row of  $\pmb{F}$ , where  $\widetilde{j} = jg^{\frac{i(n - 1)}{2d - 1}}$  mod  $n$ , and  $g$  denotes the primitive root modulo  $n$ .
Proof. Plug Eq.(76) in Lemma 4 into Eq.(87) in Lemma 5, we know that
$$
\begin{array}{l} \mathbf {1} ^ {\top} \left(\boldsymbol {h} ^ {0} \odot \dots \odot \boldsymbol {h} ^ {2 d - 2} - \mathbf {1}\right) = 2 \mathbf {1} ^ {\top} \left(\boldsymbol {h} ^ {0} \odot \dots \odot \boldsymbol {h} ^ {d - 1} - \mathbf {1}\right) - \mathbf {1} ^ {\top} \left(\boldsymbol {h} ^ {0} - \mathbf {1}\right) - \left\langle \boldsymbol {h} ^ {d} \odot \dots \odot \boldsymbol {h} ^ {2 d - 2} - \mathbf {1}, \boldsymbol {h} ^ {0} - \mathbf {1} \right\rangle \\ + \left\langle \boldsymbol {h} ^ {0} \odot \dots \odot \boldsymbol {h} ^ {d - 1} - \mathbf {1}, \boldsymbol {h} ^ {d} \odot \dots \odot \boldsymbol {h} ^ {2 d - 2} - \mathbf {1} \right\rangle \tag {95} \\ \end{array}
$$
Now we check the last two terms in Eq.(95). Note that
$$
\begin{array}{l} \left\langle \boldsymbol {h} ^ {0} \odot \dots \odot \boldsymbol {h} ^ {d - 1} - \mathbf {1}, \boldsymbol {h} ^ {d} \odot \dots \odot \boldsymbol {h} ^ {2 d - 2} - \mathbf {1} \right\rangle - \left\langle \boldsymbol {h} ^ {d} \odot \dots \odot \boldsymbol {h} ^ {2 d - 2} - \mathbf {1}, \boldsymbol {h} ^ {0} - \mathbf {1} \right\rangle (96) \\ = \left\langle \boldsymbol {h} ^ {0} \odot \dots \odot \boldsymbol {h} ^ {d - 1} - \mathbf {1} - \left(\boldsymbol {h} ^ {0} - \mathbf {1}\right), \boldsymbol {h} ^ {d} \odot \dots \odot \boldsymbol {h} ^ {2 d - 2} - \mathbf {1} \right\rangle (97) \\ = \left\langle \boldsymbol {h} ^ {0} \odot \dots \odot \boldsymbol {h} ^ {d - 1} - \boldsymbol {h} ^ {0}, \boldsymbol {h} ^ {d} \odot \dots \odot \boldsymbol {h} ^ {2 d - 2} - \boldsymbol {1} \right\rangle (98) \\ = \left\langle \boldsymbol {h} ^ {0} \odot \left(\boldsymbol {h} ^ {1} \odot \dots \odot \boldsymbol {h} ^ {d - 1} - \mathbf {1}\right), \boldsymbol {h} ^ {d} \odot \dots \odot \boldsymbol {h} ^ {2 d - 2} - \mathbf {1} \right\rangle (99) \\ = \mathbf {1} ^ {\top} \left(\left(h ^ {1} \odot \dots \odot h ^ {d - 1} - \mathbf {1}\right) \odot h ^ {0} \odot \left(h ^ {d} \odot \dots \odot h ^ {2 d - 2} - \mathbf {1}\right)\right) (100) \\ \end{array}
$$
$$
\begin{array}{l} \mathbf {1} ^ {\top} \left(\boldsymbol {h} ^ {0} \odot \dots \odot \boldsymbol {h} ^ {2 d - 2} - \mathbf {1}\right) = 2 \mathbf {1} ^ {\top} \left(\boldsymbol {h} ^ {0} \odot \dots \odot \boldsymbol {h} ^ {d - 1} - \mathbf {1}\right) - \mathbf {1} ^ {\top} \left(\boldsymbol {h} ^ {0} - \mathbf {1}\right) \\ + \mathbf {1} ^ {\top} \left(\left(\mathbf {h} ^ {1} \odot \dots \odot \mathbf {h} ^ {d - 1} - \mathbf {1}\right) \odot \mathbf {h} ^ {0} \odot \left(\mathbf {h} ^ {d} \odot \dots \odot \mathbf {h} ^ {2 d - 2} - \mathbf {1}\right)\right) \tag {101} \\ \end{array}
$$
Because  $\{\pmb{h}^0, \pmb{h}^1, \dots, \pmb{h}^{2d-2}\}$  forms a group, and  $\pmb{h}^0 = \pmb{h}^{2d-1}$  with a modulo period  $2d-1$ , we know that
$$
\boldsymbol {h} ^ {d} \odot \dots \odot \boldsymbol {h} ^ {2 d - 2} = \boldsymbol {h} ^ {- (d - 1)} \odot \dots \odot \boldsymbol {h} ^ {- 1} \tag {102}
$$
Plug Eq.(102) into Eq.(101), we have that