The Polylog and the Polygamma
Two more members of the zeta family, and both of them are the Hurwitz zeta or the Lerch transcendent wearing a different hat:
The polylogarithm is the Lerch transcendent along ; the polygamma is the Hurwitz zeta with its two arguments read the other way round — the order fixes the first slot, and the argument takes the second. So a single Euler–Maclaurin kernel, already written for , computes the entire polygamma family, and the Lerch series computes the polylogarithm.
compute-engine ships both heads natively, so this is an extension rather than an addition. PolyLog is native at integer order (including the continuation past the unit disk); @enumeratio/analytic adds non-integer and complex . PolyGamma is native at real argument; @enumeratio/analytic adds complex , and the GPU kernel neither had.
, , and every negative integer order is a rational function — .
Polygamma as a zeta value
source · editable
At every order is a zeta value: and . At the half-integers the alternating zeta shows up instead — .
Two very different pictures
Colour the complex -plane by hue = argument, brightness = magnitude, and the two functions could hardly look less alike — which is exactly the difference between their kernels. Both are the same <notatio-complex-plot> element, handed a different expression; every constant in them is a slider.
Liₛ(z) is the Lerch series, so it only converges inside : a lit disk, dark outside, with the branch point at sitting on the rim. Raise and the disk fills with spirals, the same winding the Lerch portrait shows; push up and the term dominates, leaving a near-linear ramp of hue.
ψ⁽ᵐ⁾(z) is a Hurwitz zeta, which converges over the whole plane — so the picture fills out, and the poles appear: one at each of , of order , strung along the negative real axis with the full colour wheel turning around each. Step up and the hue wheels round more times per pole — a pole of order winds the argument times.
(f32 on the GPU, so the rim of the disk and the immediate neighbourhood of a pole are approximate — the CPU kernel is the source of truth. The colouring runs on rather than the value, which is what keeps high orders in frame: leaves f32's range past , but its logarithm never does.)
Where the pieces come from
| function | computed as | new here |
|---|---|---|
| , integer | compute-engine's own | — |
| , other | , the Lerch series | |
| , exactly | non-integer | |
| , real | compute-engine's own | — |
| , complex | the whole complex plane |
The one place we stop short: a non-integer order outside the unit disk. The series does not reach there and the continuation is only implemented for integer , so is returned unevaluated rather than guessed at.