Polylogarithms
Polylogarithms.Polylogarithms
Polylogarithms.bernoulli
Polylogarithms.bernoulli
Polylogarithms.dirichlet_beta
Polylogarithms.harmonic
Polylogarithms.harmonic
Polylogarithms.harmonic
Polylogarithms.harmonic
Polylogarithms.polylog
Polylogarithms.polylog
Polylogarithms.stieltjes
Polylogarithms.Polylogarithms
— ModulePolylogarithms
Module containing functions to calculate the polylogarithm and associated functions
Polylogarithms.polylog
— Methodpolylog(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)
Polylogarithms.polylog
— Methodpolylog(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
Polylogarithms.bernoulli
— Methodbernoulli(n)
Calculates the first 35 Bernoulli numbers $B_n$ (of the first-kind or NIST type) e.g., see
- http://mathworld.wolfram.com/BernoulliNumber.html
- https://en.wikipedia.org/wiki/Bernoulli_number
- http://dlmf.nist.gov/24
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$ usebernoulli(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
Polylogarithms.bernoulli
— Methodbernoulli(n, x)
Calculates Bernoulli polynomials $B_n(x)$ e.g., see
Arguments
- $n$
::Integer
: the index into the series, $n=0,1,2,3,...$ - $x$
::Real
: the point at which to calculate the polynomial
Examples
julia> bernoulli(6, 1.2)
0.008833523809524735
Polylogarithms.harmonic
— Methodharmonic(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
Polylogarithms.harmonic
— Methodharmonic(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
Polylogarithms.harmonic
— Methodharmonic(n::Integer)
Calculates harmonic numbers, e.g., see http://mathworld.wolfram.com/HarmonicNumber.html
Arguments
- $n$
::Integer
: non-negative index of the Harmonic number to calculate
Examples
julia> harmonic(2)
1.5
Polylogarithms.harmonic
— Methodharmonic(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
Polylogarithms.stieltjes
— Methodstieltjes(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
Polylogarithms.dirichlet_beta
— Methoddirichlet_beta()
Calculates Dirichlet beta function, https://en.wikipedia.org/wiki/Dirichletbetafunction
Arguments
- $s$
::Number
: it should work for any type of number, but mainly tested forComplex{Float64}
Examples
julia> dirichlet_beta(1.5)
0.8645026534612017