See the following example code snippet, which is based on the method here:
In[19]:= gMatrix =
SparseArray[{{1, 3} -> 1, {2, 1} -> 1, {3, 2} ->
1, {4, 4} -> -(1/2), {4, 5} -> -(1/2), {4, 6} -> -(1/2), {4,
7} -> -(1/2), {5, 4} -> 1/2, {5, 5} -> -(1/2), {5, 6} ->
1/2, {5, 7} -> -(1/2), {6, 4} ->
1/2, {6, 5} -> -(1/2), {6, 6} -> -(1/2), {6, 7} -> 1/2, {7, 4} ->
1/2, {7, 5} ->
1/2, {7, 6} -> -(1/2), {7, 7} -> -(1/2), {_, _} -> 0}, 7];
hMatrix =
SparseArray[{{1, 5} ->
1, {2, 2} -> -(1/2), {2, 3} -> -(1/2), {2, 6} -> 1/2, {2, 7} ->
1/2, {3, 2} -> 1/2, {3, 3} -> -(1/2), {3, 6} -> -(1/2), {3, 7} ->
1/2, {4, 1} -> 1, {5, 4} -> 1, {6, 2} -> -(1/2), {6, 3} ->
1/2, {6, 6} -> -(1/2), {6, 7} ->
1/2, {7, 2} -> -(1/2), {7, 3} -> -(1/2), {7, 6} -> -(1/2), {7,
7} -> -(1/2), {_, _} -> 0}, 7];
kMatrix =
SparseArray[{{1, 4} -> -1, {2, 2} -> -(1/2), {2, 3} -> -(1/2), {2,
6} -> -(1/2), {2, 7} -> 1/2, {3, 2} ->
1/2, {3, 3} -> -(1/2), {3, 6} -> -(1/2), {3, 7} -> -(1/2), {4,
5} -> -1, {5, 1} -> 1, {6, 2} -> 1/2, {6, 3} ->
1/2, {6, 6} -> -(1/2), {6, 7} -> 1/2, {7, 2} -> -(1/2), {7, 3} ->
1/2, {7, 6} -> -(1/2), {7, 7} -> -(1/2), {_, _} -> 0}, 7];
gen= {gMatrix, hMatrix, kMatrix};
count = 0; (matrices = NestWhile[(Print[count++];
Union[#~Join~Flatten[Outer[Dot, gen, #, 1], 1]]) &,
{IdentityMatrix[7]}, Length[#2] != Length[#1] &, 2, 99]) // Length // Timing
During evaluation of In[19]:= 0
During evaluation of In[19]:= 1
During evaluation of In[19]:= 2
During evaluation of In[19]:= 3
During evaluation of In[19]:= 4
During evaluation of In[19]:= 5
During evaluation of In[19]:= 6
During evaluation of In[19]:= 7
During evaluation of In[19]:= 8
During evaluation of In[19]:= 9
During evaluation of In[19]:= 10
During evaluation of In[19]:= 11
During evaluation of In[19]:= 12
During evaluation of In[19]:= 13
Out[23]= {2.27465, 6048}