Giter VIP home page Giter VIP logo

polylog.jl's Introduction

PolyLog.jl

test coverage

The PolyLog.jl package provides Julia implementations of real and complex polylogarithms, including the real and complex dilogarithm and trilogarithm.

Example

using PolyLog

# real polylogarithms for real arguments
reli1(1.0)          # Re[Li_1(x)]
reli2(1.0)          # Re[Li_2(x)] (dilogarithm)
reli3(1.0)          # Re[Li_3(x)] (trilogarithm)
reli4(1.0)          # Re[Li_4(x)]
reli(10, 1.0)       # Re[Li_n(x)] for all integers n (here: n = 10)
reli(10, big"1.0")  # Re[Li_n(x)] for all integers n (here: n = 10)
reli(-2, 1.0)       # Re[Li_n(x)] for all integers n (here: n = -2)

# complex polylogarithms for real or complex arguments
li0(1.0 + 1.0im)       # Li_0(z)
li1(1.0 + 1.0im)       # Li_1(z)
li2(1.0 + 1.0im)       # Li_2(z) (dilogarithm)
li3(1.0 + 1.0im)       # Li_3(z) (trilogarithm)
li4(1.0 + 1.0im)       # Li_4(z)
li5(1.0 + 1.0im)       # Li_5(z)
li6(1.0 + 1.0im)       # Li_6(z)
li(10, 1.0 + 1.0im)    # Li_n(z) for all integers n (here: n = 10)
li(10, big"1.0" + 1im) # Li_n(z) for all integers n (here: n = 10)
li(-2, 1.0 + 1.0im)    # Li_n(z) for all integers n (here: n = -2)

Documentation

https://docs.juliahub.com/PolyLog/

Notes

The implementation of the real dilogarithm is an adaptation of [arXiv:2201.01678].

The implementation of the complex dilogarithm has been inspired by the implementation in SPheno and has been translated to Julia.

The implementation of the real trilogarithm is an adaptation of [arXiv:2308.11619].

The implementation of the general n-th order polylogarithm is an adaptation of [arXiv:2010.09860].

Copying

PolyLog.jl is licenced under the MIT License.

Links

Refer to the package Polylogarithms.jl for a Julia implementation of polylogarithms of arbitrary complex order.

polylog.jl's People

Contributors

expander avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

polylog.jl's Issues

Imprecision of complex li2 with Float64 and BigFloat for small real parts

Here is a case where a binary64 and BigFloat (with default precision) evaluation of li2 have a relative difference of about 8 x 10^-8. This relative difference is greater than what I expected.

julia> using PolyLog

julia> x = 4.831285545908206e-6 + 0.004396919500211628im
4.831285545908206e-6 + 0.004396919500211628im

julia> y0 = li2(x)
-1.941665612914504e-9 + 0.004396920676572405im

# convert x to a complex BigFloat, evaluate li2(x), and convert back to a complex binary64
julia> ye = convert(Complex{Float64}, li2(convert(Complex{BigFloat},x)))
-1.941665782029937e-9 + 0.004396920676572405im

julia> abs(real(y0)-real(ye))/abs(real(ye))
8.709811678577144e-8

I found this case by searching about 10 million points in the unit circle.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.