Expand description

Polylog

The Polylog package provides Rust implementations of real and complex polylogarithms, including the dilogarithm and trilogarithm.

Example:

extern crate num;
extern crate polylog;
use num::complex::Complex;
use polylog::{Li, Li0, Li1, Li2, Li3, Li4, Li5, Li6};

fn main() {
    let x = 1.0;
    let z = Complex::new(1.0, 1.0);
    let n = 10;

    // real polylogarithms for real arguments
    println!("Li0({}) = {}", x, x.li0());      // Re[Li_0(x)]
    println!("Li1({}) = {}", x, x.li1());      // Re[Li_1(x)]
    println!("Li2({}) = {}", x, x.li2());      // Re[Li_2(x)] (dilogarithm)
    println!("Li3({}) = {}", x, x.li3());      // Re[Li_3(x)] (trilogarithm)
    println!("Li4({}) = {}", x, x.li4());      // Re[Li_4(x)]
    println!("Li_{}({}) = {}", n, x, x.li(n)); // Re[Li_n(x)]

    // complex polylogarithms for complex arguments
    println!("Li0({}) = {}", z, z.li0());      // Li_0(z)
    println!("Li1({}) = {}", z, z.li1());      // Li_1(z)
    println!("Li2({}) = {}", z, z.li2());      // Li_2(z) (dilogarithm)
    println!("Li3({}) = {}", z, z.li3());      // Li_3(z) (trilogarithm)
    println!("Li4({}) = {}", z, z.li4());      // Li_4(z)
    println!("Li5({}) = {}", z, z.li5());      // Li_5(z)
    println!("Li6({}) = {}", z, z.li6());      // Li_6(z)
    println!("Li_{}({}) = {}", n, z, z.li(n)); // Li_n(z)
}

Traits

Provides the n-th order polylogarithm function li() of a number of type T.

Provides the 0-th order polylogarithm function li0() of a number of type T.

Provides the 1st order polylogarithm function li1() of a number of type T.

Provides the 2nd order polylogarithm (dilogarithm) function li2() of a number of type T.

Provides the 3rd order polylogarithm (trilogarithm) function li3() of a number of type T.

Provides the 4-th order polylogarithm function li4() of a number of type T.

Provides the 5-th order polylogarithm function li5() of a number of type T.

Provides the 6-th order polylogarithm function li6() of a number of type T.