Skip to main content

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

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nada_numpy-0.5.3.tar.gz (46.7 kB view details)

Uploaded Source

Built Distribution

nada_numpy-0.5.3-py3-none-any.whl (48.6 kB view details)

Uploaded Python 3

File details

Details for the file nada_numpy-0.5.3.tar.gz.

File metadata

  • Download URL: nada_numpy-0.5.3.tar.gz
  • Upload date:
  • Size: 46.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.6 Linux/6.8.0-1014-azure

File hashes

Hashes for nada_numpy-0.5.3.tar.gz
Algorithm Hash digest
SHA256 64dc77c33fd5ac6397ebe083d0e3b40b06ddc8b2328fed9de6f180e3bc58a90f
MD5 e47d0ba8ef65fc6bd30e5dae1679e00e
BLAKE2b-256 38b7de99906dbc32c4e17d0ace41b910e35a33d1cd711a919d272fd40f84d10c

See more details on using hashes here.

File details

Details for the file nada_numpy-0.5.3-py3-none-any.whl.

File metadata

  • Download URL: nada_numpy-0.5.3-py3-none-any.whl
  • Upload date:
  • Size: 48.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.6 Linux/6.8.0-1014-azure

File hashes

Hashes for nada_numpy-0.5.3-py3-none-any.whl
Algorithm Hash digest
SHA256 a53d003076f4305ea852714b999f1b2f51672ae6d48e8d2260cd0f0155a4abb4
MD5 b85551e85b7de33182abaa48bded8711
BLAKE2b-256 bd1c6c04d10096009877c7d2528f2029485ab84d84d6fe07aa18586b62ae2e8f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page