munozariasjm / efficient-fibonacci

Repository from Github https://github.communozariasjm/efficient-fibonacciRepository from Github https://github.communozariasjm/efficient-fibonacci

Fast Fibonacci

This is a simple (yet hopefully) fast implementation of the Fibonacci sequence in Python using Jax with matrix exponentiation.

The justification (explanation) and analysis of the method in the notebook /notebooks/explanation.ipynb

Also we show how the Jax implementation is faster than alternative implementations in the notebook /notebooks/efficient_implementation.ipynb.

Finally the clean implementation is in the file (/src/matrix_exponentiation.py).

Installation

To run the code you need to install Jax. You can do this by running the following command:

pip install jax[cpu]

Authors

About


Languages

Language:Jupyter Notebook 94.2%Language:Python 5.8%