Skip to main content

Library to calculate neutrino oscillation probabilities using tensors

Project description

nuTens

nuTens

nuTens is a software library which uses tensors to efficiently calculate neutrino oscillation probabilities.

CI badge pip Code - Doxygen test - coverage cpp - linter

Installation

Requirements

  • CMake - Should work with most modern versions. If you wish to use precompiled headers to speed up build times you will need CMake > 3.16.
  • Compiler with support for c++17 standard - Tested with gcc
  • PyTorch - The recommended way to install is using PyTorch_requirements.txt:
  pip install -r PyTorch_requirements.txt

(or see PyTorch installation instructions for instructions on how to build yourself)

Installation

Assuming PyTorch was built using pip, nuTens can be built using

mkdir build
cd build
cmake -DCMAKE_PREFIX_PATH=`python3 -c 'import torch;print(torch.utils.cmake_prefix_path)'`
make <-j Njobs>

(installation with a non-pip install of PyTorch have not been tested but should be possible)

Verifying Installation

Once nuTens has been built, you can verify your installation by running

make test

Python

nuTens provides a python interface which can be installed using pip by running

pip install .

in the root directory of nuTens

Additionally, the nuTens python module can be installed as a shared library .so object by specifying the CMake option

cmake -DNT_ENABLE_PYTHON=ON <other options> <source dir>

and doing make && make install

Benchmarking

nuTens uses Googles benchmark library to perform benchmarking and tracks the results uing Bencher. Each benchmark consists of calculating neutrino oscillations for 1024 batches of 1024 neutrino energies using the standard PMNS formalism in vacuum and in constant density matter:

Const Density Osc Benchmark for nuTens - Bencher

Vacuum Osc Benchmark for nuTens - Bencher

Feature Wishlist

  • Support PyTorch in tensor library
  • Vacuum oscillation calculations
  • Constant matter density propagation
  • Basic test suite
  • Basic CI
  • Doxygen documentation with automatic deployment
  • Add test coverage checks into CI
  • Integrate linting ( cpp-linter? )
  • Add instrumentation library for benchmarking and profiling
  • Add suite of benchmarking tests
  • Integrate benchmarks into CI ( maybe use hyperfine and bencher for this? )
  • Add proper unit tests
  • Expand CI to include more platforms
  • Add support for modules (see PyTorch doc)
  • Propagation in variable matter density
  • Add support for Tensorflow backend
  • Add python interface

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

nutens-0.1.0.tar.gz (169.8 kB view details)

Uploaded Source

File details

Details for the file nutens-0.1.0.tar.gz.

File metadata

  • Download URL: nutens-0.1.0.tar.gz
  • Upload date:
  • Size: 169.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.6

File hashes

Hashes for nutens-0.1.0.tar.gz
Algorithm Hash digest
SHA256 24a8f677851b458d0320401636def93a57b3c7377c2d115d6181b4128698e200
MD5 0b9c894c83aaf888469f4493f395ba4c
BLAKE2b-256 98f57f4413ce4e2a0285fdce3c681e5949d2aff3a4f39687900d5cb3f757523b

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