Given a finite set $S=\{s_0,s_1,s_2,...,s_{N-1}\}$, we aim to verify that a map $f$ from $S$ to $\mathbb{R}$ is nonnegative, i.e. $f(s)\geq 0$ for each $s \in S$. We propose the following method:
(1) Choose a finite abelian group $G=\{g,g_1,g_2,...,g_{N}\}$, define a bijection $\phi:G \mapsto S$, such that $g_i=\phi(s_i)$ for $ 1\leq i \leq N$;
(2) We verify that $f\circ \phi$ is a nonnegative function on $G$ via computing its sparse sum-of-squares representation on abelian group $G$.