PyEllips / pyElli

An open source ellipsometry analysis tool for reproducible and comprehensible building of optical models.
https://pyelli.readthedocs.io
GNU General Public License v3.0
17 stars 6 forks source link

[Issue 168] Vectorized KKR internals #169

Closed IruNikZe closed 4 months ago

IruNikZe commented 4 months ago

This PR leverages NumPy's broadcasting to speed up the computation of the Kramers-Kronig-Relationship by making most of the computations happen at C-level rather than inside the for-loop that handles both odd and even case with an expensive if. Doing so would even allow for a simple Numba-compilation to speed up the computations even further (given it is available at runtime).

It tackles this issue

Fixes #168

IruNikZe commented 4 months ago

A minor refactoring is using x * x rather than x ** 2 because it does not involve the power functions which makes it faster.

IruNikZe commented 4 months ago

Of course! 👍 Thanks for the quick response

domna commented 4 months ago

Of course! 👍 Thanks for the quick response

Sure. I could also do a small release if you need this directly from the package or are you using this through a git install anyways?

IruNikZe commented 4 months ago

I can use it via Git, that's fine by now 👨‍💻 Thanks for the offer 👍

laarisyko commented 2 months ago

It would be super awesome if this feature could be released :D Thank you for your work.

MarJMue commented 2 months ago

Hey @laarisyko, Please excuse, that we didn't release it right away. I am preparing everything right now.