class_docstr: Lerch transcendent (Lerch phi function).
  
  Explanation
  ===========
  
  For $\operatorname{Re}(a) > 0$, $|z| < 1$ and $s \in \mathbb{C}$, the
  Lerch transcendent is defined as
  
  .. math :: \Phi(z, s, a) = \sum_{n=0}^\infty \frac{z^n}{(n + a)^s},
  
  where the standard branch of the argument is used for $n + a$,
  and by analytic continuation for other values of the parameters.
  
  A commonly used related function is the Lerch zeta function, defined by
  
  .. math:: L(q, s, a) = \Phi(e^{2\pi i q}, s, a).
  
  **Analytic Continuation and Branching Behavior**
  
  It can be shown that
  
  .. math:: \Phi(z, s, a) = z\Phi(z, s, a+1) + a^{-s}.
  
  This provides the analytic continuation to $\operatorname{Re}(a) \le 0$.
  
  Assume now $\operatorname{Re}(a) > 0$. The integral representation
  
  .. math:: \Phi_0(z, s, a) = \int_0^\infty \frac{t^{s-1} e^{-at}}{1 - ze^{-t}}
                              \frac{\mathrm{d}t}{\Gamma(s)}
  
  provides an analytic continuation to $\mathbb{C} - [1, \infty)$.
  Finally, for $x \in (1, \infty)$ we find
  
  .. math:: \lim_{\epsilon \to 0^+} \Phi_0(x + i\epsilon, s, a)
           -\lim_{\epsilon \to 0^+} \Phi_0(x - i\epsilon, s, a)
           = \frac{2\pi i \log^{s-1}{x}}{x^a \Gamma(s)},
  
  using the standard branch for both $\log{x}$ and
  $\log{\log{x}}$ (a branch of $\log{\log{x}}$ is needed to
  evaluate $\log{x}^{s-1}$).
  This concludes the analytic continuation. The Lerch transcendent is thus
  branched at $z \in \{0, 1, \infty\}$ and
  $a \in \mathbb{Z}_{\le 0}$. For fixed $z, a$ outside these
  branch points, it is an entire function of $s$.
  
  Examples
  ========
  
  The Lerch transcendent is a fairly general function, for this reason it does
  not automatically evaluate to simpler functions. Use ``expand_func()`` to
  achieve this.
  
  If $z=1$, the Lerch transcendent reduces to the Hurwitz zeta function:
  
  >>> from sympy import lerchphi, expand_func
  >>> from sympy.abc import z, s, a
  >>> expand_func(lerchphi(1, s, a))
  zeta(s, a)
  
  More generally, if $z$ is a root of unity, the Lerch transcendent
  reduces to a sum of Hurwitz zeta functions:
  
  >>> expand_func(lerchphi(-1, s, a))
  zeta(s, a/2)/2**s - zeta(s, a/2 + 1/2)/2**s
  
  If $a=1$, the Lerch transcendent reduces to the polylogarithm:
  
  >>> expand_func(lerchphi(z, s, 1))
  polylog(s, z)/z
  
  More generally, if $a$ is rational, the Lerch transcendent reduces
  to a sum of polylogarithms:
  
  >>> from sympy import S
  >>> expand_func(lerchphi(z, s, S(1)/2))
  2**(s - 1)*(polylog(s, sqrt(z))/sqrt(z) -
              polylog(s, sqrt(z)*exp_polar(I*pi))/sqrt(z))
  >>> expand_func(lerchphi(z, s, S(3)/2))
  -2**s/z + 2**(s - 1)*(polylog(s, sqrt(z))/sqrt(z) -
                        polylog(s, sqrt(z)*exp_polar(I*pi))/sqrt(z))/z
  
  The derivatives with respect to $z$ and $a$ can be computed in
  closed form:
  
  >>> lerchphi(z, s, a).diff(z)
  (-a*lerchphi(z, s, a) + lerchphi(z, s - 1, a))/z
  >>> lerchphi(z, s, a).diff(a)
  -s*lerchphi(z, s + 1, a)
  
  See Also
  ========
  
  polylog, zeta
  
  References
  ==========
  
  .. [1] Bateman, H.; Erdelyi, A. (1953), Higher Transcendental Functions,
         Vol. I, New York: McGraw-Hill. Section 1.11.
  .. [2] https://dlmf.nist.gov/25.14
  .. [3] https://en.wikipedia.org/wiki/Lerch_transcendent
class_docstr_tok: ["Lerch","transcendent","(","Lerch","phi","function",")",".","Explanation","===========","For","$","\\operatorname","{","Re","}","(","a",")",">","0","$",",","$","|z|","<","1","$","and","$","s","\\in","\\mathbb","{","C","}","$",",","the","Lerch","transcendent","is","defined","as","..","math",":",":","\\Phi","(","z",",","s",",","a",")","=","\\sum_","{","n=0","}","^\\infty","\\frac","{","z^n","}","{","(","n","+","a",")","^s","}",",","where","the","standard","branch","of","the","argument","is","used","for","$","n","+","a","$",",","and","by","analytic","continuation","for","other","values","of","the","parameters",".","A","commonly","used","related","function","is","the","Lerch","zeta","function",",","defined","by","..","math",":",":","L","(","q",",","s",",","a",")","=","\\Phi","(","e^","{","2\\pi","i","q","}",",","s",",","a",")",".","*","*","Analytic","Continuation","and","Branching","Behavior","*","*","It","can","be","shown","that","..","math",":",":","\\Phi","(","z",",","s",",","a",")","=","z\\Phi","(","z",",","s",",","a+1",")","+","a^","{","-s","}",".","This","provides","the","analytic","continuation","to","$","\\operatorname","{","Re","}","(","a",")","\\le","0","$",".","Assume","now","$","\\operatorname","{","Re","}","(","a",")",">","0","$",".","The","integral","representation","..","math",":",":","\\Phi_0","(","z",",","s",",","a",")","=","\\int_0^\\infty","\\frac","{","t^","{","s-1","}","e^","{","-at","}","}","{","1","-","ze^","{","-t","}","}","\\frac","{","\\mathrm","{","d","}","t","}","{","\\Gamma","(","s",")","}","provides","an","analytic","continuation","to","$","\\mathbb","{","C","}","-","[","1",",","\\infty",")","$",".","Finally",",","for","$","x","\\in","(","1",",","\\infty",")","$","we","find","..","math",":",":","\\lim_","{","\\epsilon","\\to","0^+","}","\\Phi_0","(","x","+","i\\epsilon",",","s",",","a",")","-\\lim_","{","\\epsilon","\\to","0^+","}","\\Phi_0","(","x","-","i\\epsilon",",","s",",","a",")","=","\\frac","{","2\\pi","i","\\log^","{","s-1","}","{","x","}","}","{","x^a","\\Gamma","(","s",")","}",",","using","the","standard","branch","for","both","$","\\log","{","x","}","$","and","$","\\log","{","\\log","{","x","}","}","$","(","a","branch","of","$","\\log","{","\\log","{","x","}","}","$","is","needed","to","evaluate","$","\\log","{","x","}","^","{","s-1","}","$",")",".","This","concludes","the","analytic","continuation",".","The","Lerch","transcendent","is","thus","branched","at","$","z","\\in","\\","{","0",",","1",",","\\infty\\","}","$","and","$","a","\\in","\\mathbb","{","Z","}","_","{","\\le","0","}","$",".","For","fixed","$","z",",","a","$","outside","these","branch","points",",","it","is","an","entire","function","of","$","s","$",".","Examples","========","The","Lerch","transcendent","is","a","fairly","general","function",",","for","this","reason","it","does","not","automatically","evaluate","to","simpler","functions",".","Use","``","expand_func","(",")","``","to","achieve","this",".","If","$","z=1","$",",","the","Lerch","transcendent","reduces","to","the","Hurwitz","zeta","function",":",">",">",">","from","sympy","import","lerchphi",",","expand_func",">",">",">","from","sympy.abc","import","z",",","s",",","a",">",">",">","expand_func","(","lerchphi","(","1",",","s",",","a",")",")","zeta","(","s",",","a",")","More","generally",",","if","$","z","$","is","a","root","of","unity",",","the","Lerch","transcendent","reduces","to","a","sum","of","Hurwitz","zeta","functions",":",">",">",">","expand_func","(","lerchphi","(","-1",",","s",",","a",")",")","zeta","(","s",",","a\/2",")","\/2","*","*","s","-","zeta","(","s",",","a\/2","+","1\/2",")","\/2","*","*","s","If","$","a=1","$",",","the","Lerch","transcendent","reduces","to","the","polylogarithm",":",">",">",">","expand_func","(","lerchphi","(","z",",","s",",","1",")",")","polylog","(","s",",","z",")","\/z","More","generally",",","if","$","a","$","is","rational",",","the","Lerch","transcendent","reduces","to","a","sum","of","polylogarithms",":",">",">",">","from","sympy","import","S",">",">",">","expand_func","(","lerchphi","(","z",",","s",",","S","(","1",")","\/2",")",")","2","*","*","(","s","-","1",")","*","(","polylog","(","s",",","sqrt","(","z",")",")","\/sqrt","(","z",")","-","polylog","(","s",",","sqrt","(","z",")","*","exp_polar","(","I","*","pi",")",")","\/sqrt","(","z",")",")",">",">",">","expand_func","(","lerchphi","(","z",",","s",",","S","(","3",")","\/2",")",")","-2","*","*","s\/z","+","2","*","*","(","s","-","1",")","*","(","polylog","(","s",",","sqrt","(","z",")",")","\/sqrt","(","z",")","-","polylog","(","s",",","sqrt","(","z",")","*","exp_polar","(","I","*","pi",")",")","\/sqrt","(","z",")",")","\/z","The","derivatives","with","respect","to","$","z","$","and","$","a","$","can","be","computed","in","closed","form",":",">",">",">","lerchphi","(","z",",","s",",","a",")",".diff","(","z",")","(","-a","*","lerchphi","(","z",",","s",",","a",")","+","lerchphi","(","z",",","s","-","1",",","a",")",")","\/z",">",">",">","lerchphi","(","z",",","s",",","a",")",".diff","(","a",")","-s","*","lerchphi","(","z",",","s","+","1",",","a",")","See","Also","========","polylog",",","zeta","References","==========","..","[","1","]","Bateman",",","H.",";","Erdelyi",",","A",".","(","1953",")",",","Higher","Transcendental","Functions",",","Vol",".","I",",","New","York",":","McGraw-Hill",".","Section","1.11",".","..","[","2","]","https",":","\/\/dlmf.nist.gov\/25.14","..","[","3","]","https",":","\/\/en.wikipedia.org\/wiki\/Lerch_transcendent"]
code: def _eval_rewrite_helper(self, target):
      res = self._eval_expand_func()
      if res.has(target):
          return res
      else:
          return self
  
imports: from sympy.core.add import Add
  from sympy.core.cache import cacheit
  from sympy.core.function import ArgumentIndexError, expand_mul, Function
  from sympy.core.numbers import pi, I, Integer
  from sympy.core.relational import Eq
  from sympy.core.singleton import S
  from sympy.core.symbol import Dummy
  from sympy.core.sympify import sympify
  from sympy.functions.combinatorial.numbers import bernoulli, factorial, genocchi, harmonic
  from sympy.functions.elementary.complexes import re, unpolarify, Abs, polar_lift
  from sympy.functions.elementary.exponential import log, exp_polar, exp
  from sympy.functions.elementary.integers import ceiling, floor
  from sympy.functions.elementary.miscellaneous import sqrt
  from sympy.functions.elementary.piecewise import Piecewise
  from sympy.polys.polytools import Poly
label_desc: Use image node_id 3 for calling the lerchphi obj's underlying member method code with example usage: obj._eval_rewrite_helper(target) and returns: res, self