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 Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

nusquids-1.13.1-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.1-cp312-cp312-manylinux_2_28_aarch64.whl (6.1 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ ARM64

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

Uploaded CPython 3.12macOS 14.0+ ARM64

nusquids-1.13.1-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.1-cp311-cp311-manylinux_2_28_aarch64.whl (6.1 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ ARM64

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

Uploaded CPython 3.11macOS 14.0+ ARM64

nusquids-1.13.1-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.1-cp310-cp310-manylinux_2_28_aarch64.whl (6.1 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ ARM64

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

Uploaded CPython 3.10macOS 14.0+ ARM64

nusquids-1.13.1-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.1-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.1-cp312-cp312-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for nusquids-1.13.1-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 a0cacf9cebee3babcc0197b39295d628aa92106a7d0431c9ef09b2586def4204
MD5 5213b6fc604ab2257e1d916a9de37cff
BLAKE2b-256 2a86838fe8373278673cfef48756ef6b2bf5f4fb42671b58142b693687e8f807

See more details on using hashes here.

Provenance

The following attestation bundles were made for nusquids-1.13.1-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.1-cp312-cp312-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for nusquids-1.13.1-cp312-cp312-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 238f13f9112fa519f6adfd82245e6038285c127b41851b68baa81006c1ae86a1
MD5 cd49a3f1a5b8b4210a0a3e98e42ba072
BLAKE2b-256 e48ee24fc11862d8fb4ce3fad000f3cfc2fe8dd86418b612886a0f0e7df3e78c

See more details on using hashes here.

Provenance

The following attestation bundles were made for nusquids-1.13.1-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.1-cp312-cp312-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for nusquids-1.13.1-cp312-cp312-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 1974e051e6ecc25dd0012c3e773d7a570d91cafc6b9c1c928c1b730fabae69bb
MD5 390cd8c22882a982abdf098d8fb29711
BLAKE2b-256 c27d412fdd012d36056c55b35cdec7d14f71884f642563e80656a251911f4f20

See more details on using hashes here.

Provenance

The following attestation bundles were made for nusquids-1.13.1-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.1-cp311-cp311-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for nusquids-1.13.1-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 4a9af387a913e086df4d5fe7027352a7a58e1dea296544aba335c29cee12b1b0
MD5 76ce59b0dc1315baa30650e6d5c76ceb
BLAKE2b-256 bc975ede31bf2e6a652032dd76890ad277c85e1451a95e741e8f56b577a7f120

See more details on using hashes here.

Provenance

The following attestation bundles were made for nusquids-1.13.1-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.1-cp311-cp311-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for nusquids-1.13.1-cp311-cp311-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 356dc71f16a451f3fe18fd1deccff67164c24cbd11b384b37bb241770fa55bc9
MD5 8622c47e79663c46d1ae9af550d40427
BLAKE2b-256 6ccf212d8e8d4a1f85316562c8e914a69213300c2b9c6cb1ea91adcfb16bcba4

See more details on using hashes here.

Provenance

The following attestation bundles were made for nusquids-1.13.1-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.1-cp311-cp311-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for nusquids-1.13.1-cp311-cp311-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 e11bdea0b6539ff86fb34b41735acc5b4ae3e78a99439901d9be02257eb60178
MD5 ca74c053670e74e88e7397f8f62daed1
BLAKE2b-256 a0f2f331811f87c67121ab21a7d6b56286ff1df01c96724d8c1d3475cc9fd95e

See more details on using hashes here.

Provenance

The following attestation bundles were made for nusquids-1.13.1-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.1-cp310-cp310-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for nusquids-1.13.1-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 c7bb58a013d543f2bdc99ffdeea1d6789a4b132f6ab848b4d91c1e7f18d31ae8
MD5 68c5a350fd0691e51c7dec3c44ec9aa1
BLAKE2b-256 89bea0290deaf759d5b258d0c0ffa2ab602cd6d37e84ac8df4570cd7437b7d92

See more details on using hashes here.

Provenance

The following attestation bundles were made for nusquids-1.13.1-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.1-cp310-cp310-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for nusquids-1.13.1-cp310-cp310-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 8a62485ed1bd5db9562320b5772313c4e75bb45be2f0297a0ccddf092abfeb31
MD5 45007a588b278245577bf2d99f578a56
BLAKE2b-256 ed92ff1cabe46a499ae8f5737c61fca2f417bb4085f2013e4a797c18cb7b6ac6

See more details on using hashes here.

Provenance

The following attestation bundles were made for nusquids-1.13.1-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.1-cp310-cp310-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for nusquids-1.13.1-cp310-cp310-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 220efa812ee0dd88c8db0b43ea48326d80323508030f7f2321c16aeb275412f6
MD5 f5129c2bd437d33db3989e44ec84be73
BLAKE2b-256 9f93108f29a452e43c1a25d41d0b00a7766a5ed9602b6e765c9f8ce51f5b76d8

See more details on using hashes here.

Provenance

The following attestation bundles were made for nusquids-1.13.1-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.1-cp39-cp39-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for nusquids-1.13.1-cp39-cp39-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 96d810282f72e15615f490950bb138554531268d7362f75127834cc46b739876
MD5 2894287d251c0ea8aa7b743efa3868b0
BLAKE2b-256 a25dfbb0975bbe62621f6a4a31e178a1ec4bbda64ef58d0285d682756869dc1f

See more details on using hashes here.

Provenance

The following attestation bundles were made for nusquids-1.13.1-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.1-cp39-cp39-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for nusquids-1.13.1-cp39-cp39-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 b4310e02b23f8c3abfefe07c54efeb8cabd3c0b70b809f99354e1929b9e1e9b4
MD5 e5c22636b52b8f45aa2bc48b51ccbfb1
BLAKE2b-256 0b7859d986aa24e6e57df032708332d41bed7e11d3a2a8b1c02b5fa76d2e6e0c

See more details on using hashes here.

Provenance

The following attestation bundles were made for nusquids-1.13.1-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