bns_nurates
Science Score: 57.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
✓DOI references
Found 20 DOI reference(s) in README -
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (14.9%) to scientific vocabulary
Repository
Basic Info
- Host: GitHub
- Owner: RelNucAs
- License: other
- Language: C++
- Default Branch: main
- Size: 20.7 MB
Statistics
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 0
- Releases: 2
Metadata Files
README.md
BNS_NURATES: A GPU friendly library for neutrino opacities written in c++ with GPU support
BNS_NURATES requires the following dependencies: - A C++ compiler which supports c++17 - The GNU scientific library - Kokkos - OpenMP
Installation
BNS_NURATES is a header-only library, so it can be simply included into your
code, provided the requirements listed above are satisfied. The various headers
are in the include directory.
Stand alone build and testing
Clone the repository recursively to also clone Kokkos which is available as a submodule:
git clone --recursive https://github.com/RelNucAs/bns_nurates.git
cd bns_nurates
Create a build directory:
mkdir build
cd build
By default Kokkos and OpenMP are enabled. To compile for a CPU based system run
cmake ../
and build nurates
cmake --build . --target nurates
If the code is intended for Nvidia GPUs (say, A100 in this case), enable CUDA during compilation
cmake -DKokkos_ENABLE_CUDA=ON -DKokkos_ARCH_AMPERE80=ON ../
Similarly, to disable OpenMP, add the flag -DENABLE_OPENMP=OFF to cmake.
Using bns_nurates as a thorn for the Einsten Toolkit
bns_nurates is also meant for use as a thorn Weakrates2 for Cactus with
THC. To do this, one must export these files:
python utils/export_thc.py /path/to/bns_nurates/ /path/to/destination/
Here /path/to/bns_nurates/ is the full path for the top-level bns_nurates
directory and /path/to/destination/ is the full path to the src
folder insider Weakrates2
Purpose of the library
BNS_NURATES can be exploited to compute both energy-dependent (spectral) and energy-integrated
(gray) emissivities and opacities for the most relevant neutrino-matter interactions in BNS
mergers. The definitions of such quantites can be found in [^fn1], which also discusses in
more details the design of the library.
A self-explanatory minimal working example is provided in the repo (mwe.cpp), which can be
compiled within the build folder as follows
cmake --build . --target MWE
Thermodynamic conditions extracted from a BNS merger simulation (used for the postprocessing
analysis in [^fn1]) are also provided in the inputs/BNS folder.
Python bindings
Bindings can be generated for calling BNSNURATES functions directly from Python.
This is done through SWIG (tested version: 4.0.2). Once SWIG is installed on the system,
enter the bindings/ folder
cd bindings
and run the following command
```
python3 setup.py buildext --inplace
This creates a Python module namedbnsnuratescan that imported as
import bnsnurates as bns
To make the module available to your Python environment either add thebindings/folder
to your PYTHONPATH or install the module.bindings/test_bindings.py``` is a minimal working
example that can be used for testing the bindings.
Included neutrino-matter interactions
BNS_NURATES implements the following neutrino reactions (see also [^fn1]):
Beta processes
Implemented as in [^fn2], [^fn3] under the assumption of zero-momentum transfer and non-relativistic nucleons. We account for the impact from relativistic mean-field effects as in [^fn3], [^fn4], and the correction due to the sum of phase-space, recoil and weak magnetism effects as in [^fn5]. They include:
- Neutrino absorptions on nucleons / $e^\pm$ captures ### $\nue + n \leftrightarrow e^- + p$ ### $\bar{\nu}e + p \leftrightarrow e^+ + n$
- (Inverse) nucleon decay ### $\nue + n \leftrightarrow e^- + p$ ### $\bar{\nu}e + p \leftrightarrow e^+ + n$
Pair processes
- $e^+ e^-$ annihilation (implemented as in [^fn6]) ### $e^+ + e^- \leftrightarrow \nu + \bar{\nu}$
- Nucleon-nucleon bremsstrahlung (implemented as in [^fn7], including the medium modification from [^fn8]) ### $N + N \leftrightarrow N + N + \nu + \bar{\nu}$
Scattering processes
- Isoenergetic scattering off nucleons (implemented as in [^fn2], including phase-space, recoil and weak magnetism effects as in [^fn5]) ### $\nu + N \rightarrow \nu + N$
- Inelastic scattering off $e^\pm$ (implemented as in [^fn2], [^fn9]) ### $\nu + e^\pm \rightarrow \nu + e^\pm$
[^fn1]: L. Chiesa et al., Phys. Rev. D 111, 063053 (2025) [^fn2]: S. W. Bruenn, Astrophys. J. Suppl. Ser. 58, 771 (1985) [^fn3]: M. Oertel, A. Pascal, M. Mancini, and J. Novak, Phys. Rev. C 102, 035802 (2020) [^fn4]: M. Hempel, Phys. Rev. C 91, 055807 (2015) [^fn5]: C. J. Horowitz, Phys. Rev. D 65, 043001 (2002) [^fn6]: J. A. Pons, J. A. Miralles, and J. M. Ibanez, Astron. Astrophys. Suppl. Ser. 129, 343 (1998) [^fn7]: S. Hannestad and G. Raffelt, Astrophys. J. 507, 339 (1998) [^fn8]: T. Fischer, Astron. Astrophys. 593, A103 (2016) [^fn9]: A. Mezzacappa and S. W. Bruenn, Astrophys. J. 410, 740 (1993) [^fn10]:A. Burrows, S. Reddy, and T. A. Thompson, Nucl. Phys. A777, 356 (2006)
Owner
- Name: RelNucAs
- Login: RelNucAs
- Kind: organization
- Location: Italy
- Repositories: 1
- Profile: https://github.com/RelNucAs
Relativistic & Nuclear Astrophysics Group @ UniTn
Citation (CITATION.cff)
cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
- family-names: "Perego"
given-names: "Albino"
orcid: "https://orcid.org/0000-0002-0936-8237"
- family-names: "Radice"
given-names: "David"
orcid: "https://orcid.org/0000-0001-6982-1008"
- family-names: "Guercilena"
given-names: "Federico Maria"
orcid: "https://orcid.org/0000-0003-3824-4433"
- family-names: "Chiesa"
given-names: "Leonardo"
orcid: "https://orcid.org/0000-0002-5112-1975"
- family-names: "Bhattacharyya"
given-names: "Maitraya"
orcid: "https://orcid.org/0000-0003-4618-3159"
title: "BNS_NURATES"
version: 1.1
#doi: https://doi.org/10.48550/arXiv.2412.04570
date-released: 2025-02-17
url: "https://github.com/RelNucAs/bns_nurates"
license: "BSD-3-Clause"
references:
- type: article
authors:
- name: "Chiesa L., Bhattacharyya M., Mazzini F., Guercilena F.M., Perego A., Radice D."
#affiliation: "Author's Institution"
title: "Open-source library for performance-portable neutrino reaction rates: Application to neutron star mergers"
journal: "Phys. Rev. D"
year: "2025"
volume: "111"
issue: "6"
pages: "063053"
doi: "https://doi.org/10.1103/PhysRevD.111.063053" # DOI of the paper
GitHub Events
Total
- Create event: 2
- Release event: 1
- Watch event: 8
- Delete event: 1
- Issue comment event: 1
- Push event: 47
- Public event: 1
- Pull request review event: 1
- Pull request event: 6
- Gollum event: 1
Last Year
- Create event: 2
- Release event: 1
- Watch event: 8
- Delete event: 1
- Issue comment event: 1
- Push event: 47
- Public event: 1
- Pull request review event: 1
- Pull request event: 6
- Gollum event: 1