Skip to main content

Neutrino propagation library with pybind11 bindings for reference see

Project description

nuSQuIDS

nuSQuIDS is a neutrino oscillation library that solves the neutrino evolution equations in a variety of environments (vacuum, constant density, Earth, Sun, etc.) and supports non-standard interactions.

Try it Online

No installation required! Run an interactive Jupyter notebook example:

Binder

Installation (Python)

From PyPI (Recommended)

The easiest way to install nuSQuIDS is from PyPI:

pip install nusquids

This installs pre-built wheels with all dependencies bundled - no need to install GSL, HDF5, or SQuIDS separately.

Supported platforms:

  • Linux (x86_64, aarch64) - Python 3.9+
  • macOS (arm64) - Python 3.10+

From Source

To build from source (e.g., for development or unsupported platforms):

pip install .

Prerequisites for source builds: GSL, HDF5, and SQuIDS must be installed on your system (see Prerequisites section below).

After installation:

import nuSQuIDS as nsq
print("nuSQuIDS imported successfully!")

Prerequisites

The following system libraries are required:

For Python bindings, you also need:

Optional (recommended for interactive use):

Documentation

The LaTeX and PDF user manual is included in the doc/ folder. To generate documentation from source: make docs


Installation from Source (C++ Library)

The following instructions are for building the C++ library from source. If you only need the Python interface, pip install . is sufficient.

Configuration

The path for the GSL libraries can be specified by running:

./configure --with-gsl-incdir=GSL_include_path --with-gsl-libdir=GSL_library_path

or, assuming a standard installation into 'include' and 'lib' subdirectories within a common prefix:

./configure --with-gsl=GSL_prefix

The path for the HDF5 libraries can be specified by running:

./configure --with-hdf5-incdir=HDF5_include_path --with-hdf5-libdir=HDF5_library_path

or more simply:

./configure --with-hdf5=HDF5_prefix

Finally, the path for SQuIDS can be specified by:

./configure --with-squids-incdir=SQuIDS_include_path --with-squids-libdir=SQuIDS_library_path

or commonly just:

./configure --with-squids=SQuIDS_prefix

Building

Once configuration is complete, compile the library:

make

Run unit tests to verify correct behavior:

make test

Compile example programs:

make examples

The resulting example executables can be found in the various subdirectories of examples/.

Examples

The examples/ directory contains both C++ and Python versions of example programs:

Directory Description
Single_energy/ Single energy mode oscillations
Multiple_energy/ Multiple energy mode with power-law spectrum
Bodies/ Various body types (Earth, EarthAtm, Vacuum, etc.)
Constant_density_layers/ Multi-layer propagation
Atm_default/ Atmospheric neutrino propagation (nuSQUIDSAtm)
HDF5_Write_Read/ State serialization to HDF5
Astrophysical_neutrino_flavor_ratio/ Astrophysical flavor ratio calculation
NSI/ Non-standard interactions (C++ only)
LV/ Lorentz violation (C++ only)
Xsections/ Custom cross-sections (C++ only)

Run C++ examples after building:

./examples/Single_energy/single_energy

Run Python examples:

python examples/Single_energy/main.py

Benchmarks

nuSQuIDS includes a benchmark suite to measure performance:

make benchmark       # Full benchmark (more iterations)
make benchmark-quick # Quick benchmark

The benchmark tests single energy, multiple energy, and atmospheric modes with various physics configurations (with/without interactions, Glashow resonance, tau regeneration).

Installing

Install the library (default location: /usr/local):

make install

To change the installation prefix:

./configure --prefix=$HOME

This installs:

  • Headers to $PREFIX/include/nuSQuIDS/
  • Libraries to $PREFIX/lib/
  • The nusquids-config script to $PREFIX/bin/
  • Physics data to $PREFIX/share/nuSQuIDS/

Using nusquids-config

After installation, use nusquids-config to get compiler and linker flags for your own programs:

# Get compiler flags
nusquids-config --cflags

# Get linker flags
nusquids-config --libs

# Compile your own program
g++ $(nusquids-config --cflags) -c myprogram.cpp
g++ myprogram.o $(nusquids-config --libs) -o myprogram

# Or in one step
g++ $(nusquids-config --cflags) myprogram.cpp $(nusquids-config --libs) -o myprogram

Available options: --prefix, --incdir, --libdir, --cflags, --libs, --version

Python Bindings (Manual Build)

To build Python bindings manually (instead of using pip install .), pass the --with-python-bindings option to configure:

./configure --with-python-bindings

By default this uses pybind11. To use Boost.Python instead:

./configure --with-boost-python-bindings

Additional options:

# Specify pybind11 headers location
./configure --with-pybind-incdir=location_of_pybind11

# Specify Boost location (for Boost.Python)
./configure --with-boost=boost_prefix

# Specify Python executable
./configure --python-bin=PYTHON_EXECUTABLE

# Specify python-config for compilation flags
./configure --python-config=PYTHON_CONFIG_EXECUTABLE

# Specify installation directory for Python module
./configure --python-module-dir=PYTHON_MODULE_INSTALLATION

Build and install the Python bindings:

make python
make python-install

Alternatively, add the bindings to your PYTHONPATH:

export PYTHONPATH=$(PATH_TO_nuSQUIDS)/resources/python/bindings/:$PYTHONPATH

Citation

If you use nuSQuIDS in your research, please cite our paper:

@article{Arguelles:2021twb,
    author = {Arg{\"u}elles, Carlos A. and Salvado, Jordi and Weaver, Christopher N.},
    title = "{nuSQuIDS: A toolbox for neutrino propagation}",
    eprint = "2112.13804",
    archivePrefix = "arXiv",
    primaryClass = "hep-ph",
    doi = "10.1016/j.cpc.2022.108346",
    journal = "Comput. Phys. Commun.",
    volume = "277",
    pages = "108346",
    year = "2022"
}

nuSQuIDS is built on top of the SQuIDS library. If appropriate, please also consider citing the SQuIDS papers:

@article{Arguelles:2020hss,
    author = {Arg{\"u}elles, Carlos A. and Salvado, Jordi and Weaver, Christopher N.},
    title = "{A Simple Quantum Integro-Differential Solver (SQuIDS)}",
    doi = "10.1016/j.cpc.2020.107405",
    journal = "Comput. Phys. Commun.",
    volume = "255",
    pages = "107405",
    year = "2020"
}

@article{Delgado:2014lyt,
    author = "Arguelles, Carlos and Salvado, Jordi and Weaver, Christopher N.",
    title = "{A Simple Quantum Integro-Differential Solver (SQuIDS)}",
    eprint = "1412.3832",
    archivePrefix = "arXiv",
    primaryClass = "hep-ph",
    doi = "10.1016/j.cpc.2015.06.022",
    journal = "Comput. Phys. Commun.",
    volume = "196",
    pages = "569--591",
    year = "2015"
}

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

nusquids-1.13.3.tar.gz (8.8 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

nusquids-1.13.3-cp312-cp312-manylinux_2_28_x86_64.whl (6.4 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

nusquids-1.13.3-cp312-cp312-manylinux_2_28_aarch64.whl (6.1 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ ARM64

nusquids-1.13.3-cp312-cp312-macosx_14_0_arm64.whl (5.6 MB view details)

Uploaded CPython 3.12macOS 14.0+ ARM64

nusquids-1.13.3-cp311-cp311-manylinux_2_28_x86_64.whl (6.4 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

nusquids-1.13.3-cp311-cp311-manylinux_2_28_aarch64.whl (6.1 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ ARM64

nusquids-1.13.3-cp311-cp311-macosx_14_0_arm64.whl (5.6 MB view details)

Uploaded CPython 3.11macOS 14.0+ ARM64

nusquids-1.13.3-cp310-cp310-manylinux_2_28_x86_64.whl (6.4 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ x86-64

nusquids-1.13.3-cp310-cp310-manylinux_2_28_aarch64.whl (6.1 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ ARM64

nusquids-1.13.3-cp310-cp310-macosx_14_0_arm64.whl (5.6 MB view details)

Uploaded CPython 3.10macOS 14.0+ ARM64

nusquids-1.13.3-cp39-cp39-manylinux_2_28_x86_64.whl (6.4 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.28+ x86-64

nusquids-1.13.3-cp39-cp39-manylinux_2_28_aarch64.whl (6.1 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.28+ ARM64

File details

Details for the file nusquids-1.13.3.tar.gz.

File metadata

  • Download URL: nusquids-1.13.3.tar.gz
  • Upload date:
  • Size: 8.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for nusquids-1.13.3.tar.gz
Algorithm Hash digest
SHA256 8633b154a282d08c97e307eca9eab69d9b42568c4f95e2d5cb6be070a732919d
MD5 909e3132088fd20f581a0714dbdaaf85
BLAKE2b-256 f051cb07a1f148c555793046d866da3d07b8c2a64cbcf1229460cc14ea4ba452

See more details on using hashes here.

Provenance

The following attestation bundles were made for nusquids-1.13.3.tar.gz:

Publisher: build_wheels.yml on arguelles/nuSQuIDS

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nusquids-1.13.3-cp312-cp312-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for nusquids-1.13.3-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 f3a08e5faad2fb201bab8a452d0642d7ba7bea421e1e1e46c291478d00fb6e2d
MD5 0f665daeb3df04ee5a46630d2d6362e9
BLAKE2b-256 0662736e55278d122fe57d1852fb8102fd5f6660b14b7705c9515779e47bbc97

See more details on using hashes here.

Provenance

The following attestation bundles were made for nusquids-1.13.3-cp312-cp312-manylinux_2_28_x86_64.whl:

Publisher: build_wheels.yml on arguelles/nuSQuIDS

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nusquids-1.13.3-cp312-cp312-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for nusquids-1.13.3-cp312-cp312-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 737481c827719a268649fc975291410259a8ab89ef2d71376300ad1d854db933
MD5 003e0c3719a7c1eaf437834122d1802c
BLAKE2b-256 ab78bcda2d6279856aa2ade7512a2cfac1dee998ef0028bca0c6bf1c7ae6ebd5

See more details on using hashes here.

Provenance

The following attestation bundles were made for nusquids-1.13.3-cp312-cp312-manylinux_2_28_aarch64.whl:

Publisher: build_wheels.yml on arguelles/nuSQuIDS

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nusquids-1.13.3-cp312-cp312-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for nusquids-1.13.3-cp312-cp312-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 6002a8f64e386b10a46f8a7b04cd9f0de9646e38a1e828aca04e4dd9eb143662
MD5 2feb489975544a11cec611e671f5fcf0
BLAKE2b-256 3adf2abfa196054fa941c0302125e865b66af38b0075e74924bc0b495847877e

See more details on using hashes here.

Provenance

The following attestation bundles were made for nusquids-1.13.3-cp312-cp312-macosx_14_0_arm64.whl:

Publisher: build_wheels.yml on arguelles/nuSQuIDS

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nusquids-1.13.3-cp311-cp311-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for nusquids-1.13.3-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 5a2e13a4167edacf0f4914eacf6bb3821f91e669abdde68959dfefeaf154b458
MD5 f3a007e47d6a4cdf0815db9a9c4fce73
BLAKE2b-256 d9d4e7fdf6ecd38d5627ccf9eadba2844b44304c6ce8c2adf4ed30b3b0df2e4c

See more details on using hashes here.

Provenance

The following attestation bundles were made for nusquids-1.13.3-cp311-cp311-manylinux_2_28_x86_64.whl:

Publisher: build_wheels.yml on arguelles/nuSQuIDS

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nusquids-1.13.3-cp311-cp311-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for nusquids-1.13.3-cp311-cp311-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 acee07ae98393a3828b8ccd086a819fb5ed273382ba3191065cc86e243f91494
MD5 02504c6103337bf2ab0715522235fd9e
BLAKE2b-256 c5a654966888fff217e070ebe57b9b39d005c2c4d71d265d3745ac88bb40d051

See more details on using hashes here.

Provenance

The following attestation bundles were made for nusquids-1.13.3-cp311-cp311-manylinux_2_28_aarch64.whl:

Publisher: build_wheels.yml on arguelles/nuSQuIDS

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nusquids-1.13.3-cp311-cp311-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for nusquids-1.13.3-cp311-cp311-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 68bac02dc8319d1c69fd319774e42b0d36e40a157635bd826c4c4eba86ecb624
MD5 ad4505f5e803f9d6e843ce613fa6630c
BLAKE2b-256 0270522e65d992d039bd6f1630f14971eb86f82163f0b235563cf7727c843a72

See more details on using hashes here.

Provenance

The following attestation bundles were made for nusquids-1.13.3-cp311-cp311-macosx_14_0_arm64.whl:

Publisher: build_wheels.yml on arguelles/nuSQuIDS

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nusquids-1.13.3-cp310-cp310-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for nusquids-1.13.3-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 06d668ae5a7a9c88442e6c2050fa5c0a5b4516a76e31220962475cab54dc5ff2
MD5 bb1c355fb0aba112a065665f17dae43b
BLAKE2b-256 b2781d2e63e49338500b836057816da3a9991ca4a4535a044b1db3e709c03dc9

See more details on using hashes here.

Provenance

The following attestation bundles were made for nusquids-1.13.3-cp310-cp310-manylinux_2_28_x86_64.whl:

Publisher: build_wheels.yml on arguelles/nuSQuIDS

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nusquids-1.13.3-cp310-cp310-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for nusquids-1.13.3-cp310-cp310-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 bdf474d4a011445d9b0b0191f8a642113c24cc750c6677e6e769f4cf867287a6
MD5 1ed3f2d625f03edfd92210a3b5d75f59
BLAKE2b-256 a89f4bfaac9c1a272c98eaed1e55a084b25a8a781d96d604b3d74cdc2c08745e

See more details on using hashes here.

Provenance

The following attestation bundles were made for nusquids-1.13.3-cp310-cp310-manylinux_2_28_aarch64.whl:

Publisher: build_wheels.yml on arguelles/nuSQuIDS

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nusquids-1.13.3-cp310-cp310-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for nusquids-1.13.3-cp310-cp310-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 b37db6d61f6c4f2c746bdadfe708fcb20858def678a97e43eea9f3333360eda9
MD5 6ca64c3cb0ba7929a3a8cddaa3368e9b
BLAKE2b-256 245d21ceee96ace8f2cec5d6fb96217ad27235ea8f59413808925e24368798ed

See more details on using hashes here.

Provenance

The following attestation bundles were made for nusquids-1.13.3-cp310-cp310-macosx_14_0_arm64.whl:

Publisher: build_wheels.yml on arguelles/nuSQuIDS

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nusquids-1.13.3-cp39-cp39-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for nusquids-1.13.3-cp39-cp39-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 a3804871926cf3afffd275cd6c13792fa1367ef0a46374e156ee68c668aa719d
MD5 aed589f43d015ad8ea789a2e368861ed
BLAKE2b-256 d6c497a90dd379ea90064a6f7cd48b6d03745fbb170a2968bad00510c2cb2eb5

See more details on using hashes here.

Provenance

The following attestation bundles were made for nusquids-1.13.3-cp39-cp39-manylinux_2_28_x86_64.whl:

Publisher: build_wheels.yml on arguelles/nuSQuIDS

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nusquids-1.13.3-cp39-cp39-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for nusquids-1.13.3-cp39-cp39-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 5e17d73e0b28050c2ed3e371c902efe08b14335b9757ef862080323f9b6af7a0
MD5 c02cfb4471a439c416b16bdd55b1e9b3
BLAKE2b-256 4617a151b52b1f935ec1cd37b0eeacd904e70fa8ea3c11c0a5ff3f44d1fdf1d8

See more details on using hashes here.

Provenance

The following attestation bundles were made for nusquids-1.13.3-cp39-cp39-manylinux_2_28_aarch64.whl:

Publisher: build_wheels.yml on arguelles/nuSQuIDS

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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