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 hashes)

Uploaded Source

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