pykk
Python library for calculating Kramers-Kronig transform written in Rust.
Requirements
Install
You can install with pip command.
$ pip install pykk
Or build from the source.
build
Use maturin for building. If you use poetry, you can build by the following commands.
$ poetry install
$ poetry run maturin build --release
You can find .whl
file in $PROJECT_ROOT/target/wheels
. Install it by pip command.
How to use
This library has two functions for calculating Kramers-Kronig transform, the transformation from real to imaginary part and vice versa.
import pykk
energy = [1, 2, 3, 4]
real = [1, 2, 3, 4]
imag = pykk.real2imag(energy, real)
real_kk = pykk.imag2real(energy, imag)
Performance
Compare the performance with the code implemented by Python. The length of the data is ~ 1000 data points.
License
This application contains artifacts distributed under the license of the Apache License, Version 2.0.