class_docstr: References
  ==========
  
  .. [1] Holt, D., Eick, B., O'Brien, E.
         "Handbook of Computational Group Theory"
         Section 8.1.3
class_docstr_tok: ["References","==========","..","[","1","]","Holt",",","D.",",","Eick",",","B.",",","O'Brien",",","E.","``","Handbook","of","Computational","Group","Theory","''","Section","8.1.3"]
docstr: Return the exponent vector of length equal to the
  length of polycyclic generating sequence.
  
  Explanation
  ===========
  
  For a given generator/element ``g`` of the polycyclic group,
  it can be represented as `g = {x_1}^{e_1}, \ldots, {x_n}^{e_n}`,
  where `x_i` represents polycyclic generators and ``n`` is
  the number of generators in the free_group equal to the length
  of pcgs.
  
  Parameters
  ==========
  
  element : Permutation
      Generator of a polycyclic group.
  
  Examples
  ========
  
  >>> from sympy.combinatorics.named_groups import SymmetricGroup
  >>> from sympy.combinatorics.permutations import Permutation
  >>> G = SymmetricGroup(4)
  >>> PcGroup = G.polycyclic_group()
  >>> collector = PcGroup.collector
  >>> pcgs = PcGroup.pcgs
  >>> collector.exponent_vector(G[0])
  [1, 0, 0, 0]
  >>> exp = collector.exponent_vector(G[1])
  >>> g = Permutation()
  >>> for i in range(len(exp)):
  ...     g = g*pcgs[i]**exp[i] if exp[i] else g
  >>> assert g == G[1]
  
  References
  ==========
  
  .. [1] Holt, D., Eick, B., O'Brien, E.
         "Handbook of Computational Group Theory"
         Section 8.1.1, Definition 8.4
docstr_tok: ["Return","the","exponent","vector","of","length","equal","to","the","length","of","polycyclic","generating","sequence",".","Explanation","===========","For","a","given","generator\/element","``","g","``","of","the","polycyclic","group",",","it","can","be","represented","as","`","g","=","{","x_1","}","^","{","e_1","}",",","\\ldots",",","{","x_n","}","^","{","e_n","}","`",",","where","`","x_i","`","represents","polycyclic","generators","and","``","n","``","is","the","number","of","generators","in","the","free_group","equal","to","the","length","of","pcgs",".","Parameters","==========","element",":","Permutation","Generator","of","a","polycyclic","group",".","Examples","========",">",">",">","from","sympy.combinatorics.named_groups","import","SymmetricGroup",">",">",">","from","sympy.combinatorics.permutations","import","Permutation",">",">",">","G","=","SymmetricGroup","(","4",")",">",">",">","PcGroup","=","G.polycyclic_group","(",")",">",">",">","collector","=","PcGroup.collector",">",">",">","pcgs","=","PcGroup.pcgs",">",">",">","collector.exponent_vector","(","G","[","0","]",")","[","1",",","0",",","0",",","0","]",">",">",">","exp","=","collector.exponent_vector","(","G","[","1","]",")",">",">",">","g","=","Permutation","(",")",">",">",">","for","i","in","range","(","len","(","exp",")",")",":","...","g","=","g","*","pcgs","[","i","]","*","*","exp","[","i","]","if","exp","[","i","]","else","g",">",">",">","assert","g","==","G","[","1","]","References","==========","..","[","1","]","Holt",",","D.",",","Eick",",","B.",",","O'Brien",",","E.","``","Handbook","of","Computational","Group","Theory","''","Section","8.1.1",",","Definition","8.4"]
code: def exponent_vector(self, element):
      r"""
      Return the exponent vector of length equal to the
      length of polycyclic generating sequence.
  
      Explanation
      ===========
  
      For a given generator/element ``g`` of the polycyclic group,
      it can be represented as `g = {x_1}^{e_1}, \ldots, {x_n}^{e_n}`,
      where `x_i` represents polycyclic generators and ``n`` is
      the number of generators in the free_group equal to the length
      of pcgs.
  
      Parameters
      ==========
  
      element : Permutation
          Generator of a polycyclic group.
  
      Examples
      ========
  
      >>> from sympy.combinatorics.named_groups import SymmetricGroup
      >>> from sympy.combinatorics.permutations import Permutation
      >>> G = SymmetricGroup(4)
      >>> PcGroup = G.polycyclic_group()
      >>> collector = PcGroup.collector
      >>> pcgs = PcGroup.pcgs
      >>> collector.exponent_vector(G[0])
      [1, 0, 0, 0]
      >>> exp = collector.exponent_vector(G[1])
      >>> g = Permutation()
      >>> for i in range(len(exp)):
      ...     g = g*pcgs[i]**exp[i] if exp[i] else g
      >>> assert g == G[1]
  
      References
      ==========
  
      .. [1] Holt, D., Eick, B., O'Brien, E.
             "Handbook of Computational Group Theory"
             Section 8.1.1, Definition 8.4
  
      """
      free_group = self.free_group
      G = PermutationGroup()
      for g in self.pcgs:
          G = PermutationGroup([g] + G.generators)
      gens = G.generator_product(element, original=True)
      gens.reverse()
  
      perm_to_free = {}
      for sym, g in zip(free_group.generators, self.pcgs):
          perm_to_free[g**-1] = sym**-1
          perm_to_free[g] = sym
      w = free_group.identity
      for g in gens:
          w = w * perm_to_free[g]
  
      word = self.collected_word(w)
  
      index = self.index
      exp_vector = [0] * len(free_group)
      word = word.array_form
      for t in word:
          exp_vector[index[t[0]]] = t[1]
      return exp_vector
  
imports: from sympy.ntheory.primetest import isprime
  from sympy.combinatorics.perm_groups import PermutationGroup
  from sympy.printing.defaults import DefaultPrinting
  from sympy.combinatorics.free_groups import free_group
label_desc: Use image node_id 8 for calling the Collector obj's underlying member method code with example usage: obj.exponent_vector(element) and returns: exp_vector