Propagator

In the example previously, we saw how we can calculate oscillation probabilities for two flavours using tensore β€œby hand”. But the point of nuTens is to perform these calculations for you so that you don’t have to!

This is exactly the job of the Propagator class. In this section we will cover the basics of using this class and provide some examples.

Configurng the Propagator

We instantiate a Propagator, specifying the number of neutrino generations, and a baseline, like so:

#include <nuTens/propagator/propagator.hpp>

Propagator propagator(/*nGenerations=*/3, /*baseline=*/295*units::km);

if we decide later that we want to change the baseline, we can always change it like so:

propagator.setBaseline(600 * units::km);

Warning

It is likely that in the near future the baseline will be changed to a Tensor so that we can calculate gradients with respect to it. This may change the interface here.

Setting a Mixing Matrix

We will also need to specify a mixing matrix

#include <nuTens/tensors/tensor.hpp>

Tensor theta = Tensor::zeros(/*shape=*/{1}, /*dtype=*/NTdtypes::kFloat, /*device=*/NTdtypes::kCPU, /*requiresGrad=*/true);

Calculating Oscillation probabilities

Note

We specify a 1 at the start of the shape. This is to allow for batched calculations (see Batching Oscillation calculations). This extra dummy dimension is essentially the same idea as batch dimensions in machine learning, for those familiar.

Oscillation Spectrum Example

calculate oscillations for a range of energies (specified with a tensor), then plot the spectrum, and the derivative of the spectrum wrt L/E