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

Uploaded CPython 3.12manylinux: glibc 2.28+ ARM64

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

Uploaded CPython 3.12macOS 14.0+ ARM64

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

Uploaded CPython 3.11manylinux: glibc 2.28+ ARM64

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

Uploaded CPython 3.11macOS 14.0+ ARM64

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

Uploaded CPython 3.10manylinux: glibc 2.28+ ARM64

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

Uploaded CPython 3.10macOS 14.0+ ARM64

nusquids-1.13.2-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.2-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.2.tar.gz.

File metadata

  • Download URL: nusquids-1.13.2.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.2.tar.gz
Algorithm Hash digest
SHA256 7e38dd0dc673d8ea35aa16221c5f9b2b6d03bc5c50341d8ce757058a94c3c24d
MD5 70b7eb36408a39e54b215845842f5f65
BLAKE2b-256 fc352a6844d00e2601e29f5c4a496ad2cf37ce00873f96485abca668c4184ac7

See more details on using hashes here.

Provenance

The following attestation bundles were made for nusquids-1.13.2.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.2-cp312-cp312-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for nusquids-1.13.2-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 267da4c9afa5d823a347e45d624e5f2e35cf6ac3810bb815dc13937d9fe28332
MD5 fb033f71b8f5c130dec31aabca241b35
BLAKE2b-256 80fda48d3035042d7685c0ffb99e988a9f3ec164334fd5c7dade435f9c3b0147

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for nusquids-1.13.2-cp312-cp312-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 914cad69bd50c99c75b0543dab3d8746c5a9c34b74eed1789ecd784ac04c129b
MD5 f0e2d82401bbcfb56f98e9253e58d040
BLAKE2b-256 bf98168137da0e74bc1dbff5b36149f2c754d41931b082898be1ce955d66feae

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for nusquids-1.13.2-cp312-cp312-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 3dcc055b2c78356f355999fc6260bb8cfd115bf886ae579ab644f9e7b50552f7
MD5 2d3afdd1060b912d352452ccb54f7131
BLAKE2b-256 947e29be29244a57832f7426b4e25d0c5229da4d718e84c4e84c647309309dd1

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for nusquids-1.13.2-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 977c1f85d09b0312ebc1988dff57cebd3c817a5a66d6c9b6a5b8bdca218d7204
MD5 12c187a16bb128d25f36fa915dc51f27
BLAKE2b-256 26d2733dd74d363d2b206de811da680e95ec9bcdaec262fa9a1bb23f382f1743

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for nusquids-1.13.2-cp311-cp311-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 afd6eeaace5ec05d21b42cb51b8838fcd94f6c48bead88236e4a3b7538fc203f
MD5 c7ecf56fe28158508dce82ddbe400744
BLAKE2b-256 b8211c70c949270433aacf3582890884f4b6cd847b3c354440934f2f0e95a705

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for nusquids-1.13.2-cp311-cp311-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 6fa18cd8b47b2cdf696e50c42600181da3d621c863e7809a7166804b0548b83c
MD5 85ec1708c6241db410ff12dc85880af1
BLAKE2b-256 24f98a11a64d865b0f61308f6455555e254c67815e883a243d8f6e900e8e9633

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for nusquids-1.13.2-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 b03d3467a99841e491aa83a0ddd36a62e4bcd0be0166962cd7af5b718c004ae3
MD5 1ef04186834faca1885f31871308d2f1
BLAKE2b-256 8b1fa92fec17d1f8de290799e34f4876005301ef000281cc8d8dcb9108befed2

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for nusquids-1.13.2-cp310-cp310-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 82052194fa7d4de2938d79bf76db914eb863fe4d477c4e9556fbb53991bf5e54
MD5 4900c6c77a8e69486ab3d3f21290f0ac
BLAKE2b-256 07a2a5447ab39cc9dee81c2dbddbb725a947768611311f0a32acf6214ab46e6b

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for nusquids-1.13.2-cp310-cp310-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 7f5409f91ea3ed6170a01f34e9cbc5b5da6684442b828d00150156b23756555a
MD5 db16f65fde974fe235669edf86aa9c91
BLAKE2b-256 a989c1ee86784888de61c10cfbc80f12d219634e0c207856467eedc7490416f8

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for nusquids-1.13.2-cp39-cp39-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 fa3a7b3a55176ab37d1dab9faab517fc29876315548815f12fc10cec2e9ffce9
MD5 71de5a371d6e81ddea019df2e032dbc2
BLAKE2b-256 0ba87e8caa69fa10630b6ba83f0e402173d183fb8a6c285acd134c04907f0175

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for nusquids-1.13.2-cp39-cp39-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 3238db0ca0a83c9853f7b87486d11e79c2f7b404abf6bc8eee3e9ab3b67b8bd6
MD5 55181f8f8026eacd958f5cb0132dee06
BLAKE2b-256 29a1a21e3b633cd9afee2b2ee0cc6605c462c41cecacedba2ffa66c4225f8645

See more details on using hashes here.

Provenance

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