Consider the following abelian-subgroup membership-testing **problem**.



> 
> **Inputs:**
> 
> 
> 1. A finite abelian group $G=\mathbb{Z}\_{d\_1}\times\mathbb{Z}\_{d\_1}\ldots\times\mathbb{Z}\_{d\_m}$ with arbitrary-large $d\_i$.
> 2. A generating-set $\lbrace h\_1,\ldots,h\_n\rbrace$ of a subgroup $H\subset G$.
> 3. An element $b\in G$.
> 
> 
> **Output:** 'yes' if $b\in H$ and 'no' elsewhere'.
> 
> 
> 


**Question:** Can this problem be solved *efficiently* in a classical computer? I consider an algorithm efficient if it uses $O(\text{polylog}|G|)$ time and memory resources in the usual sense of classical Turing machines. Notice that we can assume $n= O(\log|G|)$ for any subgroup $H$. The *input-size* of this problem is $\lceil \log|G|\rceil$.


**A bit of motivation**. Intuitively it looks like the problem can be tackled with algorithms to solve linear systems of congruences or linear diophantine equations (read below). However, it seems that there are different notions of computational efficiency used in the context of computations with integers, such as: strongly versus weakly polynomial time, algebraic versus bit complexity. I am not an expert on these definitions and I can not find a reference that clearly settles down this question.




---


Some possible approaches
------------------------


The problem is closely related to solving linear system of congruences and/or linear diophantine equations. I briefly summarise these connection for the sake of completion.


Take $A$ to be the matrix whose columns are the elements of the generating set $\lbrace h\_1, \ldots, h\_n \rbrace$. The following system of equations


$Ax^{T}=
\begin{pmatrix}
h\_1(2) & h\_2(2) & \ldots & h\_n(2)\\\\
\vdots & \vdots & \cdots & \vdots\\\\
h\_1(m) & h\_2(m) & \ldots & h\_n(m)
\end{pmatrix}\begin{pmatrix}
x(1) \\\\
x(2) \\\\
\vdots \\\\
x(n)
\end{pmatrix}=
\begin{pmatrix}
b(1) \\\\
b(2) \\\\
\vdots\\\\
b(m)
\end{pmatrix}
\begin{matrix}
\mod d\_1 \\\\
\mod d\_2 \\\\
\vdots \\\\
\mod d\_m
\end{matrix}$


has a solution if and only if $b\in H$.


If all cyclic factors have the same dimension $d=d\_i$ there is an algorithm based on Smith normal forms that solves the problem in polynomial time. In this case, an efficient algorithm from  [[1]](http://www.cs.uwaterloo.ca/research/tr/1996/03/CS-96-03.pdf)  
finds the Smith normal form of $A$: it returns a diagonal matrix $D$ and two invertible matrices $U$ and $V$ such that $D=UAV$. This reduced the problem to solving the equivalent system system $DY=Ub \mod d$ with $D$ diagonal. We can decide efficiently if the system has a solution using the Euclidean algorithm.


The above example suggest that the problem can be solved efficiently using similar techniques in the general case. We can try to solve the system doing modular operations, or by turning the system into a larger system of linear diophantine equations. Some possible techniques to approach the problem that I can think of are:


1. Computing the Smith normal forms of $A$.
2. Computing the row Echelon form of $A$.
3. Integer Gaussian elimination.



Complexity of Membership-Testing for finite abelian groups
This question **[has been answered](https://cstheory.stackexchange.com/questions/9028/complexity-of-membership-testing-for-finite-abelian-groups)** in CS.Theory Stack Exchange . Here I provide a brief summary of the discussion.


The answer to the problem is "yes".


* First, there is a simple efficient classical algorithm for testing-membership in an abelian subgroup in the prescribed set-up [[2](http://arxiv.org/abs/quant-ph/0411037)]. In short, the algorithm is the following.



> 
> **Algorithm**
> 
> 
> (a) Compute a generating-set of the orthogonal [[1](https://cstheory.stackexchange.com/questions/9028/complexity-of-membership-testing-for-finite-abelian-groups), [2](http://arxiv.org/abs/quant-ph/0411037)] subgroup $H^{\perp}$ of $H$. 
> 
> 
> (b) Check whether or not the element $b$ is orthogonal to $H^{\perp}$. 
> 
> 
> 


The algorithm is correct since, by definition [[1](https://cstheory.stackexchange.com/questions/9028/complexity-of-membership-testing-for-finite-abelian-groups), [2](http://arxiv.org/abs/quant-ph/0411037)], $b$ belongs to $H$ if and only if $\chi\_{b}(g\_i)=1$ for all generators of $H^{\perp}$. 


Moreover, there are efficient clasical algorithms to solve problems (a) and (b). The algorithm for (a) is based on Smith normal forms [[1](https://cstheory.stackexchange.com/questions/9028/complexity-of-membership-testing-for-finite-abelian-groups), [2](http://arxiv.org/abs/quant-ph/0411037)]. (b) can be requires only evaluating the quantities $\chi\_b(g\_i)$ for all generators $g\_i$ of the orthogonal [[2](http://arxiv.org/abs/quant-ph/0411037)]. Since there are a O(polylog($|G|$)) number of them and this can be done efficiently using modular arithmetic we are done .
* In the particular case where all $d\_i$ are of the form $d\_i= N\_i^{e\_i}$ and $N\_i, e\_i$ are "tiny integers" then the problem belongs to $\text{NC}^3\subset \text{P}$ (cf. [[2](http://arxiv.org/abs/quant-ph/0411037)]). Tiny integers are exponentially small with the input size: $O(\log\log|A|)$.


Confer the **[original discusion](https://cstheory.stackexchange.com/questions/9028/complexity-of-membership-testing-for-finite-abelian-groups)** for more details.


