Skip to content
/ jitr Public

A fast just-in-time (JIT) compiled calculable R-matrix solver for parametric reaction models, production ready for calibration and uncertainty-quantification.

License

Notifications You must be signed in to change notification settings

beykyle/jitr

Repository files navigation

Python package PyPI publish

drawing

just-in-time R-Matrix (jitR)

A nuclear reaction toolkit, production ready for calibration and uncertainty-quantification, featuring:

  • fast calculable $\mathcal{R}$-matrix solver for parametric reaction models
  • built in uncertainty-quantified optical potentials
  • built in nuclear data
  • plenty of examples demonstrating the propagation of uncertainties into reaction observables and model calibration

Give your nuclear reaction UQ workflow a caffeine-kick with jitR!

quick start

 pip install jitr

The release versions of the package are hosted at pypi.org/project/jitr/.

examples and tutorials

Various example scripts live in examples/. Tutorials live in examples/notebooks/.

In particular, check out:

description

A framework for uncertainty-quantification of nuclear reaction observables using parametric reaction models. Consider a local coordinate-space potential $V(r;\theta)$ that is a function of some parameters $\theta$. Just write it like so:

def V(r,*theta):
  a,b,c,... = theta
  # calculate and return potential at radial coordinate r as a function of parameters a,b,c,...

Then, you can pass it along with many samples of $\theta$ into jitR to calculate many samples of the corresponding cross sections for your system and reaction of interest! The reaction observables jitR can calculate are represented as Workspace instances, and live in src/jitr/xs/.

Under the hood, jitR solves the radial Bloch-Shrödinger equation in the continuum using the calculable $\mathcal{R}$-Matrix method on a Lagrange-Legendre mesh. It is fast because it gives users the tools to precompute everything that they can for a system and reaction of interest, so given a single parameter sample, the minimal amount of compute is required to spit a cross section back out. For this reason, jitR is really suited to calculating an ensemble of observables for many parameter samples. Additionally, jitR relies on vectorized operations from numpy, as well as just-in-time (JIT) compilation from numba for the small subset of performance-critical code.

The theory generally follows:

with the primary difference being that this code uses the energy-scaled version of the Bloch-Shrödinger equation, with dimensionless domain, $s = k_0 r$, where $r$ is the radial coordinate and $k_0$ is the entrance channel wavenumber.

contributing, developing, and testing

To set up the repository for contributing, testing, access to non-release branches, access to the examples and notebooks, etc., clone the repository and install locally:

git clone git@github.com:beykyle/jitr.git
pip install -r ./jitr/requirements.txt
pip install -e ./jitr

then run the tests:

pytest jitr

Feel free to fork and make a pull request if you have things to contribute. There are many open issues, feel free to add more.

BAND

This package is part of the BAND Framework

citation

@software{Beyer_JITR_2024,
author = {Beyer, Kyle},
license = {BSD-3-Clause},
month = oct,
title = {{JITR}},
url = {https://github.com/beykyle/jitr},
version = {1.3.0},
year = {2024}
}

About

A fast just-in-time (JIT) compiled calculable R-matrix solver for parametric reaction models, production ready for calibration and uncertainty-quantification.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages