'Returns the order of the finitely presented group ``self``. It uses
the coset enumeration with identity group as subgroup, i.e ``H=[]``.
Examples
>>> from sympy.combinatorics.free_groups import free_group
>>> from sympy.combinatorics.fp_groups import FpGroup
>>> F, x, y = free_group("x, y")
>>> f = FpGroup(F, [x, y**2])
>>> f.order(strategy="coset_table_based")
2'

def order(self, strategy='relator_based'):

    from sympy import S, gcd
    if (self._order != None):
        return self._order
    if (self._coset_table != None):
        self._order = len(self._coset_table.table)
    elif (len(self.generators) == 1):
        self._order = gcd([r.array_form[0][1] for r in self.relators])
    elif self._is_infinite():
        self._order = S.Infinity
    else:
        (gens, C) = self._finite_index_subgroup()
        if C:
            ind = len(C.table)
            self._order = (ind * self.subgroup(gens, C=C).order())
        else:
            self._order = self.index([])
    return self._order
