Polylogarithms

Polylogarithms.polylogMethod
polylog(s, z, Diagnostics())

Calculates the Polylogarithm function ${Li}_s(z)$ defined by

${Li}_s = \sum_{n=1}^{\infty} \frac{z^n}{n^s}$

Uses double precision complex numbers (not arbitrary precision). It's goal is an relative error bound 10^{-12}.

Input Arguments

  • $s::$ Complex: the 'fractional' parameter
  • $z$ ::Complex: the point at which to calculate it
  • ::Diagnostics: use this to indicate that the output should include extra information

It should also accept input arguments as Real or Rational or Integer but these aren't completely tested.

There are additional keywords, but these are currently intended for testing not use.

Output Arguments

  • $Li_s(z)$: The result
  • $n$: The number of elements used in each series
  • series: The series used to compute results (4 = reciprocal)

Examples

julia> polylog(0.35, 0.2, Diagnostics() )
(0.23803890574407033, 17, 1)
source
Polylogarithms.polylogMethod
polylog(s, z)

Calculates the Polylogarithm function ${Li}_s(z)$ defined by

${Li}_s = \sum_{n=1}^{\infty} \frac{z^n}{n^s}$

Uses double precision complex numbers (not arbitrary precision). It's goal is an relative error bound 10^{-12}.

Input Arguments

  • $s$ ::Complex: the 'fractional' parameter
  • $z$ ::Complex: the point at which to calculate it

It should also accept input arguments as Real or Rational or Integer but these aren't completely tested.

There are additional keywords, but these are currently intended for testing not use.

Output Arguments

  • $Li_s(z)$: The result

Examples

julia> polylog(0.35, 0.2)
0.23803890574407033
source
Polylogarithms.bernoulliMethod
bernoulli(n)

Calculates the first 35 Bernoulli numbers $B_n$ (of the first-kind or NIST type) e.g., see

N.B. Bernoulli numbers of second kind only seem to differ in that $B_1 = + 1/2$ (instead of -1/2)

Arguments

  • $n$ ::Integer: the index into the series, $n=0,1,2,3,...,35$ (for larger $n$ use bernoulli(n,0.0) )

We only provide the 1st 36 values as beyond this, we can't return Int64 rationals, so best to compute the real approximation using bernoulli(n,0.0).

Odd values for $n>1$ are all zero.

Examples

julia> bernoulli(6)
1//42
source
Polylogarithms.harmonicMethod
harmonic(n::Integer,r::Integer)

Calculates generalized harmonic numbers e.g., see http://mathworld.wolfram.com/HarmonicNumber.html using a better approach which works when both inputs are integers https://carma.newcastle.edu.au/resources/jon/Preprints/Papers/Published-InPress/Oscillatory%20(Tapas%20II)/Papers/coffey-zeta.pdf, p.341

Arguments

  • $n$ ::Integer: non-negative index 1 of the Harmonic number to calculate
  • $r$ ::Integer: index 2 of the Harmonic number to calculate

Examples

julia> harmonic(2,1)
1.5000000000000002
source
Polylogarithms.harmonicMethod
harmonic(n::Integer,r::Real)

Calculates generalized harmonic numbers, e.g., see http://mathworld.wolfram.com/HarmonicNumber.html

Arguments

  • $n$ ::Integer: non-negative index 1 of the Harmonic number to calculate
  • $r$ ::Real: index 2 of the Harmonic number to calculate

It should be possible to extend this to complex r, but that requires more testing.

Examples

julia> harmonic(2,1.5)
1.3535533905932737
source
Polylogarithms.harmonicMethod
harmonic(x::ComplexOrReal{Float64})

Calculates harmonic numbers extended to non-integer arguments using the digamma form.

Arguments

  • $x$ ::ComplexOrReal{Float64}: index of the Harmonic number to calculate

Examples

julia> harmonic(2.0)
1.5000000000000016
source
Polylogarithms.stieltjesMethod
stieltjes(n)

Provides the first 10 Stieltjes (generalized Euler-Mascheroni) constants (see Abramowitz and Stegunm, 23.2.5) or https://en.wikipedia.org/wiki/Stieltjes_constants.

There is a table at "The Generalized Euler-Mascheroni Constants", O.R. Ainsworth and L.W.Howell NASA Technical Paper 2264, Jan 1984 https://ntrs.nasa.gov/archive/nasa/casi.ntrs.nasa.gov/19840007812.pdf but the OEIS has more accurate values, which will be useful when I get around to bit float versions of the code.

Note that stieltjes(0) = γ, the Euler–Mascheroni constant, also called just Euler's constant. https://en.wikipedia.org/wiki/Euler-Mascheroni_constant

Arguments

  • n::Integer: the number of elements to compute.

Examples

julia> stieltjes(0)
0.5772156649015329
source