Skip to content

Nada-Numpy is a Python library designed for algebraic operations on NumPy-like array objects on top of Nada DSL and Nillion Network.

License

Notifications You must be signed in to change notification settings

NillionNetwork/nada-numpy

Repository files navigation

Nada-Numpy

GitHub License GitHub Actions Workflow Status GitHub Release

Features

Use Numpy Array Features

  • Dot Product: Compute the dot product between two NadaArray objects.
  • Element-wise Operations: Perform element-wise addition, subtraction, multiplication, and division with broadcasting support.
  • Stacking: Horizontally and vertically stack arrays.

Use additional Array helpers

  • Shuffling: Our implementation shuffles a 1D array using the Benes network, which rearranges elements in a deterministic yet seemingly random order. The Benes network is commonly used in sorting and switching circuits and requires the input array length to be a power of two (e.g., 2, 4, 8, 16). The shuffled array contains the same elements as the input, just in a different order.

Use Decimal Numbers in Nada

  • Rational Number Support: Our implementation of Rational and SecretRational allows the use of simplified implementations of decimal numbers on top of Nillion.

Installation

Using pip

pip install nada-numpy

From Sources

You can install the nada-numpy library using Poetry:

git clone https://github.com/NillionNetwork/nada-numpy.git
pip3 install ./nada-numpy

Testing

To test that the version installed works as expected, you can use poetry as follows:

poetry install
poetry run pytest

Join Nillion community and contribute

Please join the Nillion community on Discord.

See the CONTRIBUTING file for how to contribute to nada-numpy.

License

This project is licensed under the Apache2 License. See the LICENSE file for details.

About

Nada-Numpy is a Python library designed for algebraic operations on NumPy-like array objects on top of Nada DSL and Nillion Network.

Resources

License

Stars

Watchers

Forks

Packages

No packages published