'Return the subgroup generated by `gens` using the
Reidemeister-Schreier algorithm'

def subgroup(self, gens, C=None):

    if (not all([isinstance(g, FreeGroupElement) for g in gens])):
        raise ValueError('Generators    must    be    `FreeGroupElement`s')
    if (not all([(g.group == self.free_group) for g in gens])):
        raise ValueError('Given    generators    are    not    members    of    the    group')
    (g, rels) = reidemeister_presentation(self, gens, C=C)
    g = FpGroup(g[0].group, rels)
    return g
