Let $G$ be a group and let $S$ be a nonempty subset of a group $G$. The subgroup of $G$ generated by $S$, which is denoted by $\langle S\rangle$, is equal to the set of all elements of $G$ that can be written as products $s_1s_2\ldots s_k$, for some integer $k\geq1$, where each $s_i$ is in $S\cup S^{-1}$. Equivalently, a subgroup generated by $S$ is the intersection of all subgroups which contain $S$.
Clearly, if $S$ consists of one element $S=\{s\}$, then $\langle S\rangle=\langle s\rangle=\{s^k\mid k\in\mathbb{Z}\}$. But what about if $|S|>1$.
Is there any rule for computing the subgroup $H$ generated by $S$ when $S$ is a finite set?
For example,
it seems a bit difficult to determine which subgroup of
$GL_2(\mathbb{C})$ is
$$
\left< \begin{pmatrix} e^{\frac{\pi i}{2^{n-2}}} & 0 \\ 0 & e^{-\frac{\pi i}{2^{n-2}}} \end{pmatrix} ,
\begin{pmatrix}
0 & -1 \\1 & 0
\end{pmatrix},
\begin{pmatrix}
0 & 1 \\1 & 0
\end{pmatrix}\right>.
$$
Is there any algorithm or something else that could help?
If you are interested in what elements this subgroup is made up of, it looks like it would be something like this: $$ \left< \begin{pmatrix} e^{\frac{\pi i}{2^{n-2}}} & 0 \\ 0 & e^{-\frac{\pi i}{2^{n-2}}} \end{pmatrix} , \begin{pmatrix} 0 & -1 \\1 & 0 \end{pmatrix}, \begin{pmatrix} 0 & 1 \\1 & 0 \end{pmatrix}\right> $$ $$= \left\{ \begin{pmatrix} 0 & \pm\alpha^k \\ \pm\bar\alpha^k & 0 \end{pmatrix}, \begin{pmatrix} \pm\alpha^k & 0\\ 0 &\pm\bar\alpha^k \end{pmatrix}\mid k\in\mathbb{Z} \right\}, $$ where $\alpha=e^{\frac{\pi i}{2^{n-2}}}$.
Supplement.
Answer to the question: How did I come to this conclusion?
It is checked directly that $$ H=\left<\ \begin{pmatrix} 0 & -1 \\1 & 0 \end{pmatrix}, \begin{pmatrix} 0 & 1 \\1 & 0 \end{pmatrix}\right>= \left\{ \begin{pmatrix} 0 & \pm1 \\ \pm1 & 0 \end{pmatrix}, \begin{pmatrix} \pm1 & 0\\ 0 &\pm1 \end{pmatrix} \right\}. $$
Let $$ F=\left<\ \begin{pmatrix} \alpha & 0 \\0 & \bar\alpha \end{pmatrix} \right>= \left\{ \begin{pmatrix} \alpha^k & 0 \\0 & \bar\alpha^k \end{pmatrix}\mid k\in\mathbb{Z} \right\}. $$