class_docstr: A class representing group homomorphisms. Instantiate using `homomorphism()`.
  
  References
  ==========
  
  .. [1] Holt, D., Eick, B. and O'Brien, E. (2005). Handbook of computational group theory.
docstr: Return the restriction of the homomorphism to the subgroup `H`
  of the domain.
docstr_tok: ["Return","the","restriction","of","the","homomorphism","to","the","subgroup","`","H","`","of","the","domain","."]
code: def restrict_to(self, H):
      """
      Return the restriction of the homomorphism to the subgroup `H`
      of the domain.
  
      """
      if not isinstance(H, PermutationGroup) or not H.is_subgroup(
          self.domain
      ):
          raise ValueError("Given H is not a subgroup of the domain")
      domain = H
      images = {g: self(g) for g in H.generators}
      return GroupHomomorphism(domain, self.codomain, images)
  
imports: import itertools
  from sympy.combinatorics.fp_groups import FpGroup, FpSubgroup, simplify_presentation
  from sympy.combinatorics.free_groups import FreeGroup
  from sympy.combinatorics.perm_groups import PermutationGroup
  from sympy.core.intfunc import igcd
  from sympy.ntheory.factor_ import totient
  from sympy.core.singleton import S
label_desc: Use image node_id 14 for calling the GroupHomomorphism obj's underlying member method code with example usage: obj.restrict_to(H) and returns: GroupHomomorphism