NuOscillator
Loading...
Searching...
No Matches

NuOscillator is a wrapper around oscillation calculators, enabling the computation of oscillation probabilities for various configurations, including beam oscillations, atmospheric oscillations, and sterile neutrinos with NSI effects.

The framework has been adapted to integrate seamlessly with oscillation fitters like MaCh3.

Container Image Code - Doxygen Build CI DOI

How to start

mkdir build;
cd build;
cmake ../ -DUseGPU=0 -DUseMultithreading=1 -DUseDoubles=0 -DUseCUDAProb3=1 -DUseCUDAProb3Linear=1 -DUseProb3ppLinear=1 -DUseProbGPULinear=1 -DUseNuFASTLinear=1 -DUseNuFASTEarth=1 -DUseNuSQUIDSLinear=1 -DUseOscProb=1 -DUseGLoBESLinear=1 -DUseCHICLinear=1
make -jN [Where N is number of threads]
make install

don't forget about

source Linux/bin/setup.NuOscillator.sh

then you can check if everything runs correctly by

cd ../
./build/Linux/bin/DragRace 1000 NuOscillatorConfigs/ExampleOscillationParameters.yaml NuOscillatorConfigs/Binned_NuFASTLinear.yaml

How to Integrate in Framework

Recommended way is to use CPM within you CmakeList.txt

CPMAddPackage(
NAME NuOscillator
VERSION v1.2.1
GITHUB_REPOSITORY "dbarrow257/NuOscillator"
GIT_TAG "main"
OPTIONS
"UseGPU 0"
"UseMultithreading 1"
"UseDoubles 1"
"UseCUDAProb3Linear 0"
"UseCUDAProb3 0"
"UseProbGPULinear 0"
"UseProb3ppLinear 0"
"UseNuFASTLinear 1"
"UseNuSQUIDSLinear 0"
"UseOscProb 1"
"UseGLoBESLinear 0"
"UseCHICLinear 0"
)

Implemented Engines

UseCUDAProb3 etc. refers to implemented engines. Engines are loaded via yaml config files. In principle you can compile all of them and select one you want to use via config.

Following neutrino oscillation calculators are available:

Oscillator Hardware Source Model Reference
CUDAProb3Linear CPU/GPU Beam PMNS
CUDAProb3 CPU/GPU Atm PMNS Ref
ProbGPULinear GPU Beam PMNS Ref
Prob3++Linear CPU Beam PMNS
NuFastLinear CPU Beam PMNS Ref
NuFastEarth CPU ATM PMNS Ref
OscProb CPU Beam/Atm
PMNS + extensions

Non-Standard Interactions (NSI), Scalar NSI (SNSI), Sterile Neutrinos (+1, +2, +3), Neutrino Decay, Decoherence, Non-Unitarity (NUNM), Lorentz Invariance Violation (LIV), Open Quantum Systems (OPS)

Ref
NuSQUIDSLinear CPU Beam
PMNS + extensions

Non-Standard Interactions (NSI), Decoherence, Lorentz Invariance Violation (LIV)

Ref
GLoBESLinear CPU Beam PMNS Ref
CHICLinear CPU Beam PMNS Ref
OscLib CPU Beam
PMNS + extensions

Non-Standard Interactions (NSI))

Ref

GPU

Some engines requires gpu like ProbGPULinear other can use both CPU and GPU. To use GPU functionality remember about

cmake ../ -DUseGPU=1

You can also pass CUDA architectures via cmake to ensure consistent architectures in multiple packages:

cmake ../ -DCMAKE_CUDA_ARCHITECTURES="all"

Compiler Flags

NuOscillator natively doesn't include many c++ compiler flags (this include optimalisation flags). Since package is intended to be used withing other (fitting) frameworks we allow to pass compiler flags via cmake.

cmake ../ -DNuOscillator_Compiler_Flags="-O3;-g;-Wextra;-Wall"

This give full freedom to users in how to configure NuOscillator.

How to Use in Fitting Framework

First initialise factory to produce engine defined by config. See exmaples of configs here

auto OscillFactory = std::make_unique<OscillatorFactory>();
std::string NuOscillatorConfigFile = "configs/NuFASTLinear.yaml");
NuOscProbCalcers = OscillFactory->CreateOscillator(NuOscillatorConfigFile);

Now you need specify energy bins for which oscillation are going to be calculated. Energy must be in GeV! It is good practice to sort energy values as NuOscillator expect them in ascending order.

std::vector<double> EnergyArray = {0, 0.6, 1, 10};
std::sort(EnergyArray.begin(),EnergyArray.end());

Then register the oscillation parameter values to be used. A useful function to read this from a yaml file is provided here

Then you need to define the parameter value (for each parameter) via:

for (auto Parameter : OscillationParameters) {
Oscillator->DefineParameter(Parameter.Name, &Parameter.Value);
}

Lastly pass energy vector and finish setup

if (!NuOscProbCalcers->EvalPointsSetInConstructor()) {
NuOscProbCalcers->SetEnergyArrayInCalcer(EnergyArray);
}
NuOscProbCalcers->Setup();

Benchmark

CPU only

Beam

Timing Distribution Beam

Atmospheric Binned

Timing Distribution ATM

Atmospheric Subsampling

Timing Distribution ATM

CPU vs GPU

Unbinned Timing Distribution ATM

Binned

Timing Distribution ATM