Skip to content

ewanwm/nuTens

Repository files navigation

nuTens

nuTens

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

CI badge 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

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