OscProb
OscProb::PMNS_OQS Class Reference

Implements neutrino oscillations using an open quantum system approach. More...

#include <PMNS_OQS.h>

Inheritance diagram for OscProb::PMNS_OQS:
OscProb::PMNS_DensityMatrix OscProb::PMNS_Fast OscProb::PMNS_Base

Public Member Functions

 PMNS_OQS ()
 Constructor. More...
 
virtual ~PMNS_OQS ()
 Destructor. More...
 
virtual void SetPower (int n)
 
virtual void SetDecoElement (int i, double val)
 Set value of the a_i decoherence element in Gell-Mann basis. More...
 
virtual void SetDecoAngle (int i, int j, double th)
 Set mixing angle between two decoherence parameters a_i, a_j. More...
 
virtual int GetPower ()
 Get the currently set power-law index for decoherence parameters. More...
 
virtual double GetDecoElement (int i)
 Get the value of the a_i decoherence parameter in Gell-Mann basis. More...
 
virtual double GetDecoAngle (int i, int j)
 Get mixing angle between two decoherence parameters a_i, a_j. More...
 
virtual double GetHGM (int i, int j)
 Get element i,j of the dissipator matrix in Gell-Mann basis. More...
 
virtual double GetDissipatorElement (int i, int j)
 Get dissipator element in Gell-Mann basis. More...
 
virtual void SetIsNuBar (bool isNuBar)
 Reimplemented from PMNS_Base. More...
 
virtual matrixD ProbMatrix (int nflvi, int nflvf)
 Reimplemented from PMNS_DensityMatrix. More...
 
virtual matrixD ProbMatrix (int nflvi, int nflvf, double E)
 Compute the probability matrix. More...
 
virtual matrixD ProbMatrix (int nflvi, int nflvf, double E, double L)
 Compute the probability matrix. More...
 
virtual void SetMix (double th12, double th23, double th13, double deltacp)
 Set the all mixing parameters at once. More...
 
virtual void SetDeltaMsqrs (double dm21, double dm32)
 Set both mass-splittings at once. More...
 
virtual double Prob (vectorC nu_in, int flvf)
 Compute the probability of nu_in going to flvf. More...
 
virtual double Prob (vectorC nu_in, int flvf, double E)
 
virtual double Prob (vectorC nu_in, int flvf, double E, double L)
 
virtual double Prob (int flvi, int flvf)
 Compute the probability of flvi going to flvf. More...
 
virtual double Prob (int flvi, int flvf, double E)
 
virtual double Prob (int flvi, int flvf, double E, double L)
 
virtual vectorD ProbVector (vectorC nu_in)
 
virtual vectorD ProbVector (vectorC nu_in, double E)
 flavours for energy E More...
 
virtual vectorD ProbVector (vectorC nu_in, double E, double L)
 
virtual vectorD ProbVector (int flvi)
 
virtual vectorD ProbVector (int flvi, double E)
 
virtual vectorD ProbVector (int flvi, double E, double L)
 
virtual double AvgProb (vectorC nu_in, int flvf, double E, double dE=0)
 Compute the average probability over a bin of energy. More...
 
virtual double AvgProb (int flvi, int flvf, double E, double dE=0)
 Compute the average probability over a bin of energy. More...
 
virtual double AvgProbLoE (vectorC nu_in, int flvf, double LoE, double dLoE=0)
 Compute the average probability over a bin of L/E. More...
 
virtual double AvgProbLoE (int flvi, int flvf, double LoE, double dLoE=0)
 Compute the average probability over a bin of L/E. More...
 
virtual vectorD AvgProbVector (vectorC nu_in, double E, double dE=0)
 
virtual vectorD AvgProbVector (int flvi, double E, double dE=0)
 
virtual vectorD AvgProbVectorLoE (vectorC nu_in, double LoE, double dLoE=0)
 Compute the average probability vector over a bin of L/E. More...
 
virtual vectorD AvgProbVectorLoE (int flvi, double LoE, double dLoE=0)
 Compute the average probability vector over a bin of L/E. More...
 
virtual matrixD AvgProbMatrix (int nflvi, int nflvf, double E, double dE=0)
 
virtual matrixD AvgProbMatrixLoE (int nflvi, int nflvf, double LoE, double dLoE=0)
 Compute the average probability matrix over a bin of L/E. More...
 
virtual vectorC GetMassEigenstate (int mi)
 Get a neutrino mass eigenstate. More...
 
virtual void SetAngle (int i, int j, double th)
 Set the mixing angle theta_ij. More...
 
virtual void SetDelta (int i, int j, double delta)
 Set the CP phase delta_ij. More...
 
virtual void SetDm (int j, double dm)
 Set the mass-splitting dm_j1 in eV^2. More...
 
virtual double GetAngle (int i, int j)
 Get the mixing angle theta_ij. More...
 
virtual double GetDelta (int i, int j)
 Get the CP phase delta_ij. More...
 
virtual double GetDm (int j)
 Get the mass-splitting dm_j1 in eV^2. More...
 
virtual double GetDmEff (int j)
 Get the effective mass-splitting dm_j1 in eV^2. More...
 
virtual void SetStdPars ()
 Set PDG 3-flavor parameters. More...
 
virtual void SetEnergy (double E)
 Set the neutrino energy in GeV. More...
 
virtual double GetEnergy ()
 Get the neutrino energy in GeV. More...
 
virtual bool GetIsNuBar ()
 Get the anti-neutrino flag. More...
 
virtual void SetPath (NuPath p)
 Set a single path. More...
 
virtual void SetPath (double length, double density, double zoa=0.5, int layer=0)
 Set a single path. More...
 
virtual void SetPath (std::vector< NuPath > paths)
 Set a path sequence. More...
 
virtual void AddPath (NuPath p)
 Add a path to the sequence. More...
 
virtual void AddPath (double length, double density, double zoa=0.5, int layer=0)
 Add a path to the sequence. More...
 
virtual void ClearPath ()
 Clear the path vector. More...
 
virtual void SetLength (double L)
 Set a single path lentgh in km. More...
 
virtual void SetLength (vectorD L)
 Set multiple path lengths. More...
 
virtual void SetDensity (double rho)
 Set single path density in g/cm^3. More...
 
virtual void SetDensity (vectorD rho)
 Set multiple path densities. More...
 
virtual void SetZoA (double zoa)
 Set Z/A value for single path. More...
 
virtual void SetZoA (vectorD zoa)
 Set multiple path Z/A values. More...
 
virtual void SetLayers (std::vector< int > lay)
 Set multiple path layer indices. More...
 
virtual void SetStdPath ()
 Set standard neutrino path. More...
 
virtual std::vector< NuPathGetPath ()
 Get the neutrino path sequence. More...
 
virtual vectorD GetSamplePoints (double LoE, double dLoE)
 Compute the sample points for a bin of L/E with width dLoE. More...
 
virtual void SetUseCache (bool u=true)
 Set caching on/off. More...
 
virtual void ClearCache ()
 Clear the cache. More...
 
virtual void SetMaxCache (int mc=1e6)
 Set max cache size. More...
 
virtual void SetAvgProbPrec (double prec)
 Set the AvgProb precision. More...
 

Static Public Attributes

static constexpr int SU3_DIM = 9
 Dimension of the SU(3) Gell-Mann basis. More...
 

Protected Member Functions

virtual void BuildHms ()
 Reimplemented from PMNS_Base. More...
 
virtual void BuildHVMB (NuPath p)
 Build effective Hamiltonian in Vacuum Mass Basis (VMB). More...
 
virtual void BuildHGM (NuPath p)
 Build effective Hamiltonian in Gell-Mann representation (GM). More...
 
virtual void BuildDissipator ()
 Build the dissipator in Gell-Mann representation. More...
 
virtual void BuildM (NuPath p)
 Build the matrix M used in evolution equations. More...
 
virtual void RotateState (bool to_mass)
 Rotate rho to/from mass basis. More...
 
virtual void BuildR ()
 Build Gell-Mann representation of density matrix. More...
 
virtual void UpdateRho ()
 Update density matrix from Gell-Mann representation. More...
 
virtual void Propagate ()
 Reimplemented from PMNS_Base. More...
 
virtual void PropagatePath (NuPath p)
 Reimplemented from PMNS_Base. More...
 
virtual void ResetToFlavour (int flv)
 Reset neutrino state to pure flavour flv. More...
 
virtual void SetPureState (vectorC nu_in)
 Set the density matrix from a pure state. More...
 
virtual void SetInitialRho (matrixC rho_in)
 Set the density matrix from an arbitrary state. More...
 
virtual double P (int flv)
 Return the probability of final state in flavour flv. More...
 
virtual void RotateState (bool to_basis, matrixC U)
 Rotate rho to/from a given basis. More...
 
virtual void RotateState (int i, int j)
 Rotate the neutrino state by theta_ij and delta_ij. More...
 
virtual void UpdateHam ()
 Build the full Hamiltonian. More...
 
virtual void SolveHam ()
 Solve the full Hamiltonian for eigenvectors and eigenvalues. More...
 
virtual void SolveHamMatter ()
 Solve the full Hamiltonian in matter. More...
 
virtual void SetVacuumEigensystem ()
 Set the eigensystem to the analytic solution of the vacuum Hamiltonian. More...
 
virtual void InitializeVectors ()
 
virtual bool TryCache ()
 Try to find a cached eigensystem. More...
 
virtual void FillCache ()
 Cache the current eigensystem. More...
 
virtual void SetCurPath (NuPath p)
 Set the path currently in use by the class. More...
 
virtual void SetAtt (double att, int idx)
 Set one of the path attributes. More...
 
virtual void SetAtt (vectorD att, int idx)
 Set all values of a path attribute. More...
 
virtual void RotateH (int i, int j, matrixC &Ham)
 Rotate the Hamiltonian by theta_ij and delta_ij. More...
 
virtual vectorD GetProbVector ()
 
virtual std::vector< int > GetSortedIndices (const vectorD x)
 Get indices that sort a vector. More...
 
virtual vectorD ConvertEtoLoE (double E, double dE)
 

Protected Attributes

int fPower
 Power-law index (n). More...
 
vectorD fa
 Dissipator parameters |a_i|. More...
 
matrixD fcos
 cosines ai . aj More...
 
vectorD fR
 Initial state of density matrix in Gell-Mann basis. More...
 
vectorD fRt
 Time evolution of density matrix in Gell-Mann basis. More...
 
matrixC fUM
 PMNS Matrix. More...
 
matrixC fHVMB
 Effective Hamiltonian in VMB (3x3). More...
 
matrixD fHGM
 Effective Hamiltonian in GMB (9x9). More...
 
matrixD fD
 Off-diagonal, 9x9 dissipator. More...
 
Eigen::MatrixXd fM
 Buffer matrix for exponential. More...
 
bool fBuiltDissipator
 Flag to rebuild dissipator. More...
 
matrixC fRho
 The neutrino density matrix state. More...
 
matrixC fMBuffer
 Some memory buffer for matrix operations. More...
 
complexD fHam [3][3]
 The full hamiltonian. More...
 
int fNumNus
 Number of neutrino flavours. More...
 
vectorD fDm
 m^2_i - m^2_1 in vacuum More...
 
matrixD fTheta
 theta[i][j] mixing angle More...
 
matrixD fDelta
 delta[i][j] CP violating phase More...
 
vectorC fNuState
 The neutrino current state. More...
 
matrixC fHms
 matrix H*2E in eV^2 More...
 
vectorC fPhases
 Buffer for oscillation phases. More...
 
vectorC fBuffer
 Buffer for neutrino state tranformations. More...
 
vectorD fEval
 Eigenvalues of the Hamiltonian. More...
 
matrixC fEvec
 Eigenvectors of the Hamiltonian. More...
 
double fEnergy
 Neutrino energy. More...
 
bool fIsNuBar
 Anti-neutrino flag. More...
 
std::vector< NuPathfNuPaths
 Vector of neutrino paths. More...
 
NuPath fPath
 Current neutrino path. More...
 
bool fBuiltHms
 Tag to avoid rebuilding Hms. More...
 
bool fGotES
 Tag to avoid recalculating eigensystem. More...
 
bool fUseCache
 Flag for whether to use caching. More...
 
double fCachePrec
 Precision of cache matching. More...
 
int fMaxCache
 Maximum cache size. More...
 
double fAvgProbPrec
 AvgProb precision. More...
 
std::unordered_set< EigenPointfMixCache
 Caching set of eigensystems. More...
 
EigenPoint fProbe
 EigenpPoint to try. More...
 

Static Protected Attributes

static const complexD zero
 zero in complex More...
 
static const complexD one
 one in complex More...
 
static const double kKm2eV = 1.0 / 1.973269788e-10
 km to eV^-1 More...
 
static const double kK2
 mol/GeV^2/cm^3 to eV More...
 
static const double kGeV2eV = 1.0e+09
 GeV to eV. More...
 
static const double kNA = 6.022140857e23
 Avogadro constant. More...
 
static const double kGf = 1.1663787e-05
 G_F in units of GeV^-2. More...
 

Detailed Description

Implementation of three-flavor neutrino oscillations in vacuum and matter, incorporating quantum dissipation effects. Based on the formalism described in: https://doi.org/10.48550/arXiv.hep-ph/0208166.

This developement is part of the QGRANT project (ID: 101068013), founded by the HORIZON-MSCA-2021-PF-01-01 programme.

Author
Alba Domi - alba.domi@fau.de
Joao Coelho - jcoelho@apc.in2p3.fr

Definition at line 28 of file PMNS_OQS.h.

Constructor & Destructor Documentation

◆ PMNS_OQS()

PMNS_OQS::PMNS_OQS ( )

Constructor.

See also
PMNS_Base::PMNS_Base

This class is restricted to 3 neutrino flavours.

Definition at line 27 of file PMNS_OQS.cxx.

28 : PMNS_DensityMatrix(), fUM(3, vectorC(3, 0)), fHVMB(3, vectorC(3, 0)),
31 fRt(SU3_DIM), fM(8, 8)
32{
33 SetPower(0);
34 fBuiltDissipator = false;
35}
matrixD fHGM
Effective Hamiltonian in GMB (9x9).
Definition: PMNS_OQS.h:94
vectorD fa
Dissipator parameters |a_i|.
Definition: PMNS_OQS.h:87
vectorD fR
Initial state of density matrix in Gell-Mann basis.
Definition: PMNS_OQS.h:90
bool fBuiltDissipator
Flag to rebuild dissipator.
Definition: PMNS_OQS.h:99
matrixD fD
Off-diagonal, 9x9 dissipator.
Definition: PMNS_OQS.h:95
matrixC fHVMB
Effective Hamiltonian in VMB (3x3).
Definition: PMNS_OQS.h:93
static constexpr int SU3_DIM
Dimension of the SU(3) Gell-Mann basis.
Definition: PMNS_OQS.h:34
vectorD fRt
Time evolution of density matrix in Gell-Mann basis.
Definition: PMNS_OQS.h:91
virtual void SetPower(int n)
Definition: PMNS_OQS.cxx:49
matrixD fcos
cosines ai . aj
Definition: PMNS_OQS.h:88
Eigen::MatrixXd fM
Buffer matrix for exponential.
Definition: PMNS_OQS.h:97
matrixC fUM
PMNS Matrix.
Definition: PMNS_OQS.h:92
std::vector< complexD > vectorC
Definition: Definitions.h:22
std::vector< double > vectorD
Definition: Definitions.h:18

References fBuiltDissipator, and SetPower().

◆ ~PMNS_OQS()

PMNS_OQS::~PMNS_OQS ( )
virtual

Nothing to clean.

Definition at line 41 of file PMNS_OQS.cxx.

41{}

Member Function Documentation

◆ AddPath() [1/2]

void PMNS_Base::AddPath ( double  length,
double  density,
double  zoa = 0.5,
int  layer = 0 
)
virtualinherited

Add a path to the sequence defining attributes directly.

Parameters
length- The length of the path segment in km
density- The density of the path segment in g/cm^3
zoa- The effective Z/A of the path segment
layer- An index to identify the layer type (e.g. earth inner core)

Definition at line 317 of file PMNS_Base.cxx.

318{
319 AddPath(NuPath(length, density, zoa, layer));
320}
virtual void AddPath(NuPath p)
Add a path to the sequence.
Definition: PMNS_Base.cxx:307
A struct representing a neutrino path segment.
Definition: NuPath.h:34

References OscProb::PMNS_Base::AddPath().

◆ AddPath() [2/2]

void PMNS_Base::AddPath ( NuPath  p)
virtualinherited

Add a path to the sequence.

Parameters
p- A neutrino path segment

Definition at line 307 of file PMNS_Base.cxx.

307{ fNuPaths.push_back(p); }
std::vector< NuPath > fNuPaths
Vector of neutrino paths.
Definition: PMNS_Base.h:295

References OscProb::PMNS_Base::fNuPaths.

Referenced by OscProb::PMNS_Base::AddPath(), OscProb::PMNS_Base::SetAtt(), OscProb::PMNS_Base::SetPath(), and SetTestPath().

◆ AvgProb() [1/2]

double PMNS_Base::AvgProb ( int  flvi,
int  flvf,
double  E,
double  dE = 0 
)
virtualinherited

Compute the average probability of flvi going to flvf over a bin of energy E with width dE.

This gets transformed into L/E, since the oscillation terms have arguments linear in L/E and not E.

This function works best for single paths. In multiple paths the accuracy may be somewhat worse. If needed, average over smaller energy ranges.

Flavours are:

  0 = nue, 1 = numu, 2 = nutau
  3 = sterile_1, 4 = sterile_2, etc.
Parameters
flvi- The neutrino starting flavour.
flvf- The neutrino final flavour.
E- The neutrino energy in the bin center in GeV
dE- The energy bin width in GeV
Returns
Average neutrino oscillation probability

Definition at line 1500 of file PMNS_Base.cxx.

1501{
1502 ResetToFlavour(flvi);
1503
1504 return AvgProb(fNuState, flvf, E, dE);
1505}
vectorC fNuState
The neutrino current state.
Definition: PMNS_Base.h:283
virtual double AvgProb(vectorC nu_in, int flvf, double E, double dE=0)
Compute the average probability over a bin of energy.
Definition: PMNS_Base.cxx:1568
virtual void ResetToFlavour(int flv)
Reset neutrino state to pure flavour flv.
Definition: PMNS_Base.cxx:1034

References OscProb::PMNS_Base::AvgProb(), OscProb::PMNS_Base::fNuState, and OscProb::PMNS_Base::ResetToFlavour().

◆ AvgProb() [2/2]

double PMNS_Base::AvgProb ( vectorC  nu_in,
int  flvf,
double  E,
double  dE = 0 
)
virtualinherited

Compute the average probability of nu_in going to flvf over a bin of energy E with width dE.

This gets transformed into L/E, since the oscillation terms have arguments linear in L/E and not E.

This function works best for single paths. In multiple paths the accuracy may be somewhat worse. If needed, average over smaller energy ranges.

Flavours are:

  0 = nue, 1 = numu, 2 = nutau
  3 = sterile_1, 4 = sterile_2, etc.
Parameters
nu_in- The neutrino initial state in flavour.
flvf- The neutrino final flavour.
E- The neutrino energy in the bin center in GeV
dE- The energy bin width in GeV
Returns
Average neutrino oscillation probability

Definition at line 1568 of file PMNS_Base.cxx.

1569{
1570 // Do nothing if energy is not positive
1571 if (E <= 0) return 0;
1572
1573 if (fNuPaths.empty()) return 0;
1574
1575 // Don't average zero width
1576 if (dE <= 0) return Prob(nu_in, flvf, E);
1577
1578 vectorD LoEbin = ConvertEtoLoE(E, dE);
1579
1580 // Compute average in LoE
1581 return AvgProbLoE(nu_in, flvf, LoEbin[0], LoEbin[1]);
1582}
virtual vectorD ConvertEtoLoE(double E, double dE)
Definition: PMNS_Base.cxx:1516
virtual double AvgProbLoE(vectorC nu_in, int flvf, double LoE, double dLoE=0)
Compute the average probability over a bin of L/E.
Definition: PMNS_Base.cxx:1643
virtual double Prob(vectorC nu_in, int flvf)
Compute the probability of nu_in going to flvf.
Definition: PMNS_Base.cxx:1114

References OscProb::PMNS_Base::AvgProbLoE(), OscProb::PMNS_Base::ConvertEtoLoE(), OscProb::PMNS_Base::fNuPaths, and OscProb::PMNS_Base::Prob().

Referenced by OscProb::PMNS_Base::AvgProb(), CheckProb(), and SaveTestFile().

◆ AvgProbLoE() [1/2]

double PMNS_Base::AvgProbLoE ( int  flvi,
int  flvf,
double  LoE,
double  dLoE = 0 
)
virtualinherited

Compute the average probability of flvi going to flvf over a bin of L/E with width dLoE.

The probabilities are weighted by (L/E)^-2 so that event density is flat in energy. This avoids giving too much weight to low energies. Better approximations would be achieved if we used an interpolated event density.

This function works best for single paths. In multiple paths the accuracy may be somewhat worse. If needed, average over smaller L/E ranges.

Flavours are:

  0 = nue, 1 = numu, 2 = nutau
  3 = sterile_1, 4 = sterile_2, etc.
Parameters
flvi- The neutrino starting flavour.
flvf- The neutrino final flavour.
LoE- The neutrino L/E value in the bin center in km/GeV
dLoE- The L/E bin width in km/GeV
Returns
Average neutrino oscillation probability

Definition at line 1610 of file PMNS_Base.cxx.

1611{
1612 ResetToFlavour(flvi);
1613
1614 return AvgProbLoE(fNuState, flvf, LoE, dLoE);
1615}

References OscProb::PMNS_Base::AvgProbLoE(), OscProb::PMNS_Base::fNuState, and OscProb::PMNS_Base::ResetToFlavour().

◆ AvgProbLoE() [2/2]

double PMNS_Base::AvgProbLoE ( vectorC  nu_in,
int  flvf,
double  LoE,
double  dLoE = 0 
)
virtualinherited

Compute the average probability of nu_in going to flvf over a bin of L/E with width dLoE.

The probabilities are weighted by (L/E)^-2 so that event density is flat in energy. This avoids giving too much weight to low energies. Better approximations would be achieved if we used an interpolated event density.

This function works best for single paths. In multiple paths the accuracy may be somewhat worse. If needed, average over smaller L/E ranges.

Flavours are:

  0 = nue, 1 = numu, 2 = nutau
  3 = sterile_1, 4 = sterile_2, etc.
Parameters
nu_in- The neutrino intial state in flavour basis.
flvf- The neutrino final flavour.
LoE- The neutrino L/E value in the bin center in km/GeV
dLoE- The L/E bin width in km/GeV
Returns
Average neutrino oscillation probability

Definition at line 1643 of file PMNS_Base.cxx.

1644{
1645 // Do nothing if L/E is not positive
1646 if (LoE <= 0) return 0;
1647
1648 if (fNuPaths.empty()) return 0;
1649
1650 // Make sure fPath is set
1651 // Use average if multiple paths
1653
1654 // Set the energy at bin center
1655 SetEnergy(fPath.length / LoE);
1656
1657 // Don't average zero width
1658 if (dLoE <= 0) return Prob(nu_in, flvf);
1659
1660 // Get sample points for this bin
1661 vectorD samples = GetSamplePoints(LoE, dLoE);
1662
1663 // Variables to fill sample
1664 // probabilities and weights
1665 double sumw = 0;
1666 double prob = 0;
1667 double length = fPath.length;
1668
1669 // Loop over all sample points
1670 for (int j = 0; j < int(samples.size()); j++) {
1671 // Set (L/E)^-2 weights
1672 double w = 1. / pow(samples[j], 2);
1673
1674 // Add weighted probability
1675 prob += w * Prob(nu_in, flvf, length / samples[j]);
1676
1677 // Increment sum of weights
1678 sumw += w;
1679 }
1680
1681 // Return weighted average of probabilities
1682 return prob / sumw;
1683}
NuPath fPath
Current neutrino path.
Definition: PMNS_Base.h:296
virtual void SetEnergy(double E)
Set the neutrino energy in GeV.
Definition: PMNS_Base.cxx:226
virtual void SetCurPath(NuPath p)
Set the path currently in use by the class.
Definition: PMNS_Base.cxx:274
virtual vectorD GetSamplePoints(double LoE, double dLoE)
Compute the sample points for a bin of L/E with width dLoE.
Definition: PMNS_Base.cxx:1985
NuPath AvgPath(NuPath &p1, NuPath &p2)
Get the average of two paths.
Definition: NuPath.cxx:27
double length
The length of the path segment in km.
Definition: NuPath.h:78

References OscProb::AvgPath(), OscProb::PMNS_Base::fNuPaths, OscProb::PMNS_Base::fPath, OscProb::PMNS_Base::GetSamplePoints(), OscProb::NuPath::length, OscProb::PMNS_Base::Prob(), OscProb::PMNS_Base::SetCurPath(), and OscProb::PMNS_Base::SetEnergy().

Referenced by OscProb::PMNS_Base::AvgProb(), and OscProb::PMNS_Base::AvgProbLoE().

◆ AvgProbMatrix()

matrixD PMNS_Base::AvgProbMatrix ( int  nflvi,
int  nflvf,
double  E,
double  dE = 0 
)
virtualinherited

Compute the average probability matrix over a bin of energy

Compute the average probability matrix for nflvi and nflvf over a bin of energy E with width dE.

This gets transformed into L/E, since the oscillation terms have arguments linear in L/E and not E.

This function works best for single paths. In multiple paths the accuracy may be somewhat worse. If needed, average over smaller energy ranges.

Parameters
nflvi- The number of initial flavours in the matrix.
nflvf- The number of final flavours in the matrix.
E- The neutrino energy in the bin center in GeV
dE- The energy bin width in GeV
Returns
Average neutrino oscillation probabilities

Definition at line 1861 of file PMNS_Base.cxx.

1862{
1863 matrixD probs(nflvi, vectorD(nflvf, 0));
1864
1865 // Do nothing if energy is not positive
1866 if (E <= 0) return probs;
1867
1868 if (fNuPaths.empty()) return probs;
1869
1870 // Don't average zero width
1871 if (dE <= 0) return ProbMatrix(nflvi, nflvf, E);
1872
1873 vectorD LoEbin = ConvertEtoLoE(E, dE);
1874
1875 // Compute average in LoE
1876 return AvgProbMatrixLoE(nflvi, nflvf, LoEbin[0], LoEbin[1]);
1877}
virtual matrixD AvgProbMatrixLoE(int nflvi, int nflvf, double LoE, double dLoE=0)
Compute the average probability matrix over a bin of L/E.
Definition: PMNS_Base.cxx:1900
virtual matrixD ProbMatrix(int nflvi, int nflvf)
Compute the probability matrix.
Definition: PMNS_Base.cxx:1387
std::vector< vectorD > matrixD
Definition: Definitions.h:19

References OscProb::PMNS_Base::AvgProbMatrixLoE(), OscProb::PMNS_Base::ConvertEtoLoE(), OscProb::PMNS_Base::fNuPaths, and OscProb::PMNS_Base::ProbMatrix().

◆ AvgProbMatrixLoE()

matrixD PMNS_Base::AvgProbMatrixLoE ( int  nflvi,
int  nflvf,
double  LoE,
double  dLoE = 0 
)
virtualinherited

Compute the average probability matrix for nflvi and nflvf over a bin of L/E with width dLoE.

The probabilities are weighted by (L/E)^-2 so that event density is flat in energy. This avoids giving too much weight to low energies. Better approximations would be achieved if we used an interpolated event density.

This function works best for single paths. In multiple paths the accuracy may be somewhat worse. If needed, average over smaller L/E ranges.

Parameters
nflvi- The number of initial flavours in the matrix.
nflvf- The number of final flavours in the matrix.
LoE- The neutrino L/E value in the bin center in km/GeV
dLoE- The L/E bin width in km/GeV
Returns
Average neutrino oscillation probabilities

Definition at line 1900 of file PMNS_Base.cxx.

1902{
1903 matrixD probs(nflvi, vectorD(nflvf, 0));
1904
1905 // Do nothing if L/E is not positive
1906 if (LoE <= 0) return probs;
1907
1908 if (fNuPaths.empty()) return probs;
1909
1910 // Make sure fPath is set
1911 // Use average if multiple paths
1913
1914 // Set the energy at bin center
1915 SetEnergy(fPath.length / LoE);
1916
1917 // Don't average zero width
1918 if (dLoE <= 0) return ProbMatrix(nflvi, nflvf);
1919
1920 // Get sample points for this bin
1921 vectorD samples = GetSamplePoints(LoE, dLoE);
1922
1923 // Variables to fill sample
1924 // probabilities and weights
1925 double sumw = 0;
1926 double length = fPath.length;
1927
1928 // Loop over all sample points
1929 for (int j = 0; j < int(samples.size()); j++) {
1930 // Set (L/E)^-2 weights
1931 double w = 1. / pow(samples[j], 2);
1932
1933 matrixD sample_probs = ProbMatrix(nflvi, nflvf, length / samples[j]);
1934
1935 for (int flvi = 0; flvi < nflvi; flvi++) {
1936 for (int flvf = 0; flvf < nflvf; flvf++) {
1937 // Add weighted probability
1938 probs[flvi][flvf] += w * sample_probs[flvi][flvf];
1939 }
1940 }
1941 // Increment sum of weights
1942 sumw += w;
1943 }
1944
1945 for (int flvi = 0; flvi < nflvi; flvi++) {
1946 for (int flvf = 0; flvf < nflvf; flvf++) {
1947 // Divide by total sampling weight
1948 probs[flvi][flvf] /= sumw;
1949 }
1950 }
1951
1952 // Return weighted average of probabilities
1953 return probs;
1954}

References OscProb::AvgPath(), OscProb::PMNS_Base::fNuPaths, OscProb::PMNS_Base::fPath, OscProb::PMNS_Base::GetSamplePoints(), OscProb::NuPath::length, OscProb::PMNS_Base::ProbMatrix(), OscProb::PMNS_Base::SetCurPath(), and OscProb::PMNS_Base::SetEnergy().

Referenced by OscProb::PMNS_Base::AvgProbMatrix().

◆ AvgProbVector() [1/2]

vectorD PMNS_Base::AvgProbVector ( int  flvi,
double  E,
double  dE = 0 
)
virtualinherited

Compute the average probability vector over a bin of energy

Compute the average probability of nu_in going to all flavours over a bin of energy E with width dE.

This gets transformed into L/E, since the oscillation terms have arguments linear in L/E and not E.

This function works best for single paths. In multiple paths the accuracy may be somewhat worse. If needed, average over smaller energy ranges.

Parameters
flvi- The neutrino starting flavour.
E- The neutrino energy in the bin center in GeV
dE- The energy bin width in GeV
Returns
Average neutrino oscillation probabilities

Definition at line 1729 of file PMNS_Base.cxx.

1730{
1731 ResetToFlavour(flvi);
1732 return AvgProbVector(fNuState, E, dE);
1733}
virtual vectorD AvgProbVector(vectorC nu_in, double E, double dE=0)
Definition: PMNS_Base.cxx:1753

References OscProb::PMNS_Base::AvgProbVector(), OscProb::PMNS_Base::fNuState, and OscProb::PMNS_Base::ResetToFlavour().

◆ AvgProbVector() [2/2]

vectorD PMNS_Base::AvgProbVector ( vectorC  nu_in,
double  E,
double  dE = 0 
)
virtualinherited

Compute the average probability vector over a bin of energy

Compute the average probability of nu_in going to all flavours over a bin of energy E with width dE.

This gets transformed into L/E, since the oscillation terms have arguments linear in L/E and not E.

This function works best for single paths. In multiple paths the accuracy may be somewhat worse. If needed, average over smaller energy ranges.

Parameters
nu_in- The neutrino initial state in flavour.
E- The neutrino energy in the bin center in GeV
dE- The energy bin width in GeV
Returns
Average neutrino oscillation probabilities

Definition at line 1753 of file PMNS_Base.cxx.

1754{
1755 vectorD probs(fNumNus, 0);
1756
1757 // Do nothing if energy is not positive
1758 if (E <= 0) return probs;
1759
1760 if (fNuPaths.empty()) return probs;
1761
1762 // Don't average zero width
1763 if (dE <= 0) return ProbVector(nu_in, E);
1764
1765 vectorD LoEbin = ConvertEtoLoE(E, dE);
1766
1767 // Compute average in LoE
1768 return AvgProbVectorLoE(nu_in, LoEbin[0], LoEbin[1]);
1769}
virtual vectorD AvgProbVectorLoE(vectorC nu_in, double LoE, double dLoE=0)
Compute the average probability vector over a bin of L/E.
Definition: PMNS_Base.cxx:1791
int fNumNus
Number of neutrino flavours.
Definition: PMNS_Base.h:277
virtual vectorD ProbVector(vectorC nu_in)
Definition: PMNS_Base.cxx:1250

References OscProb::PMNS_Base::AvgProbVectorLoE(), OscProb::PMNS_Base::ConvertEtoLoE(), OscProb::PMNS_Base::fNumNus, OscProb::PMNS_Base::fNuPaths, and OscProb::PMNS_Base::ProbVector().

Referenced by OscProb::PMNS_Base::AvgProbVector().

◆ AvgProbVectorLoE() [1/2]

vectorD PMNS_Base::AvgProbVectorLoE ( int  flvi,
double  LoE,
double  dLoE = 0 
)
virtualinherited

Compute the average probability of flvi going to all flavours over a bin of L/E with width dLoE.

The probabilities are weighted by (L/E)^-2 so that event density is flat in energy. This avoids giving too much weight to low energies. Better approximations would be achieved if we used an interpolated event density.

This function works best for single paths. In multiple paths the accuracy may be somewhat worse. If needed, average over smaller L/E ranges.

Parameters
flvi- The neutrino starting flavour.
LoE- The neutrino L/E value in the bin center in km/GeV
dLoE- The L/E bin width in km/GeV
Returns
Average neutrino oscillation probabilities

Definition at line 1705 of file PMNS_Base.cxx.

1706{
1707 ResetToFlavour(flvi);
1708 return AvgProbVectorLoE(fNuState, LoE, dLoE);
1709}

References OscProb::PMNS_Base::AvgProbVectorLoE(), OscProb::PMNS_Base::fNuState, and OscProb::PMNS_Base::ResetToFlavour().

◆ AvgProbVectorLoE() [2/2]

vectorD PMNS_Base::AvgProbVectorLoE ( vectorC  nu_in,
double  LoE,
double  dLoE = 0 
)
virtualinherited

Compute the average probability of nu_in going to all flavours over a bin of L/E with width dLoE.

The probabilities are weighted by (L/E)^-2 so that event density is flat in energy. This avoids giving too much weight to low energies. Better approximations would be achieved if we used an interpolated event density.

This function works best for single paths. In multiple paths the accuracy may be somewhat worse. If needed, average over smaller L/E ranges.

Parameters
nu_in- The neutrino intial state in flavour basis.
LoE- The neutrino L/E value in the bin center in km/GeV
dLoE- The L/E bin width in km/GeV
Returns
Average neutrino oscillation probabilities

Definition at line 1791 of file PMNS_Base.cxx.

1792{
1793 vectorD probs(fNumNus, 0);
1794
1795 // Do nothing if L/E is not positive
1796 if (LoE <= 0) return probs;
1797
1798 if (fNuPaths.empty()) return probs;
1799
1800 // Make sure fPath is set
1801 // Use average if multiple paths
1803
1804 // Set the energy at bin center
1805 SetEnergy(fPath.length / LoE);
1806
1807 // Don't average zero width
1808 if (dLoE <= 0) return ProbVector(nu_in);
1809
1810 // Get sample points for this bin
1811 vectorD samples = GetSamplePoints(LoE, dLoE);
1812
1813 // Variables to fill sample
1814 // probabilities and weights
1815 double sumw = 0;
1816 double length = fPath.length;
1817
1818 // Loop over all sample points
1819 for (int j = 0; j < int(samples.size()); j++) {
1820 // Set (L/E)^-2 weights
1821 double w = 1. / pow(samples[j], 2);
1822
1823 vectorD sample_probs = ProbVector(nu_in, length / samples[j]);
1824
1825 for (int i = 0; i < fNumNus; i++) {
1826 // Add weighted probability
1827 probs[i] += w * sample_probs[i];
1828 }
1829 // Increment sum of weights
1830 sumw += w;
1831 }
1832
1833 for (int i = 0; i < fNumNus; i++) {
1834 // Divide by total sampling weight
1835 probs[i] /= sumw;
1836 }
1837
1838 // Return weighted average of probabilities
1839 return probs;
1840}

References OscProb::AvgPath(), OscProb::PMNS_Base::fNumNus, OscProb::PMNS_Base::fNuPaths, OscProb::PMNS_Base::fPath, OscProb::PMNS_Base::GetSamplePoints(), OscProb::NuPath::length, OscProb::PMNS_Base::ProbVector(), OscProb::PMNS_Base::SetCurPath(), and OscProb::PMNS_Base::SetEnergy().

Referenced by OscProb::PMNS_Base::AvgProbVector(), and OscProb::PMNS_Base::AvgProbVectorLoE().

◆ BuildDissipator()

void PMNS_OQS::BuildDissipator ( )
protectedvirtual

Build dissipator in Gell-Mann representation.

Definition at line 343 of file PMNS_OQS.cxx.

344{
345 if (fBuiltDissipator) return;
346
347 double aa[SU3_DIM][SU3_DIM];
348 for (int i = 1; i < SU3_DIM; i++) {
349 for (int j = i; j < SU3_DIM; j++) {
350 aa[i][j] = fa[i] * fa[j];
351 if (i == 8) aa[i][j] *= sqrt(3);
352 if (j == 8) aa[i][j] *= sqrt(3);
353 if (i < j) aa[i][j] *= fcos[i][j];
354 }
355 }
356 double sum12 = aa[1][1] + aa[2][2];
357 double sum45 = aa[4][4] + aa[5][5];
358 double sum67 = aa[6][6] + aa[7][7];
359 double gamma21 = aa[3][3];
360 double gamma31 = (aa[3][3] + aa[8][8] + 2 * aa[3][8]) / 4;
361 double gamma32 = (aa[3][3] + aa[8][8] - 2 * aa[3][8]) / 4;
362
363 fD[1][1] = gamma21 + aa[2][2] + (sum45 + sum67) / 4;
364 fD[2][2] = gamma21 + aa[1][1] + (sum45 + sum67) / 4;
365 fD[3][3] = sum12 + (sum45 + sum67) / 4;
366
367 fD[4][4] = gamma31 + aa[5][5] + (sum12 + sum67) / 4;
368 fD[5][5] = gamma31 + aa[4][4] + (sum12 + sum67) / 4;
369 fD[6][6] = gamma32 + aa[7][7] + (sum12 + sum45) / 4;
370 fD[7][7] = gamma32 + aa[6][6] + (sum12 + sum45) / 4;
371
372 fD[8][8] = (sum45 + sum67) * 3 / 4;
373 fD[3][8] = (sum45 - sum67) * sqrt(3) / 4;
374
375 fD[1][2] = -aa[1][2];
376 fD[1][3] = -aa[1][3];
377 fD[2][3] = -aa[2][3];
378 fD[4][5] = -aa[4][5];
379 fD[6][7] = -aa[6][7];
380
381 fD[1][8] = (aa[4][6] + aa[5][7]) * sqrt(3) / 2;
382 fD[2][8] = (aa[5][6] - aa[4][7]) * sqrt(3) / 2;
383
384 fD[4][6] = -(aa[4][6] - 2 * aa[1][8] - 3 * aa[5][7]) / 4;
385 fD[4][7] = -(aa[4][7] + 2 * aa[2][8] + 3 * aa[5][6]) / 4;
386 fD[5][6] = -(aa[5][6] - 2 * aa[2][8] + 3 * aa[4][7]) / 4;
387 fD[5][7] = -(aa[5][7] - 2 * aa[1][8] - 3 * aa[4][6]) / 4;
388
389 fD[1][4] = -(aa[1][4] - 3 * (aa[2][5] - aa[3][6]) + aa[6][8]) / 4;
390 fD[1][5] = -(aa[1][5] + 3 * (aa[2][4] + aa[3][7]) + aa[7][8]) / 4;
391 fD[1][6] = -(aa[1][6] + 3 * (aa[2][7] - aa[3][4]) + aa[4][8]) / 4;
392 fD[1][7] = -(aa[1][7] - 3 * (aa[2][6] + aa[3][5]) + aa[5][8]) / 4;
393 fD[2][4] = -(aa[2][4] + 3 * (aa[1][5] - aa[3][7]) - aa[7][8]) / 4;
394 fD[2][5] = -(aa[2][5] - 3 * (aa[1][4] - aa[3][6]) + aa[6][8]) / 4;
395 fD[2][6] = -(aa[2][6] - 3 * (aa[1][7] + aa[3][5]) + aa[5][8]) / 4;
396 fD[2][7] = -(aa[2][7] + 3 * (aa[1][6] + aa[3][4]) - aa[4][8]) / 4;
397 fD[3][4] = -(aa[3][4] - 3 * (aa[1][6] - aa[2][7]) + aa[4][8]) / 4;
398 fD[3][5] = -(aa[3][5] - 3 * (aa[1][7] + aa[2][6]) + aa[5][8]) / 4;
399 fD[3][6] = -(aa[3][6] + 3 * (aa[1][4] + aa[2][5]) - aa[6][8]) / 4;
400 fD[3][7] = -(aa[3][7] + 3 * (aa[1][5] - aa[2][4]) - aa[7][8]) / 4;
401
402 fD[4][8] = -(aa[1][6] - aa[2][7] + aa[3][4] + aa[4][8]) * sqrt(3) / 4;
403 fD[5][8] = -(aa[1][7] + aa[2][6] + aa[3][5] + aa[5][8]) * sqrt(3) / 4;
404 fD[6][8] = -(aa[1][4] + aa[2][5] - aa[3][6] + aa[6][8]) * sqrt(3) / 4;
405 fD[7][8] = -(aa[1][5] - aa[2][4] - aa[3][7] + aa[7][8]) * sqrt(3) / 4;
406
407 for (int j = 1; j < SU3_DIM; j++) {
408 for (int k = j; k < SU3_DIM; k++) {
409 fD[j][k] = -fD[j][k] * kGeV2eV;
410 fD[k][j] = fD[j][k];
411 }
412 }
413
414 fBuiltDissipator = true;
415}
static const double kGeV2eV
GeV to eV.
Definition: PMNS_Base.h:217

References fa, fBuiltDissipator, fcos, fD, OscProb::PMNS_Base::kGeV2eV, and SU3_DIM.

Referenced by BuildM().

◆ BuildHGM()

void PMNS_OQS::BuildHGM ( NuPath  p)
protectedvirtual

Build the effective Hamiltonian in Gell-Mann representation.

Parameters
p- Neutrino path segment.

Definition at line 333 of file PMNS_OQS.cxx.

334{
335 BuildHVMB(p);
337}
void get_GMOP(const matrixC &A, matrixD &B)
Definition: PMNS_OQS.cxx:288
virtual void BuildHVMB(NuPath p)
Build effective Hamiltonian in Vacuum Mass Basis (VMB).
Definition: PMNS_OQS.cxx:203

References BuildHVMB(), fHGM, fHVMB, and get_GMOP().

Referenced by BuildM().

◆ BuildHms()

void PMNS_OQS::BuildHms ( )
protectedvirtual

Reimplement from PMNS_Base and save the PMNS matrix for later use.

Reimplemented from OscProb::PMNS_Base.

Definition at line 187 of file PMNS_OQS.cxx.

188{
189 if (fBuiltHms) return;
191 for (int i = 0; i < 3; i++) {
192 for (int j = 0; j < 3; j++) { fUM[i][j] = conj(fEvec[i][j]); }
193 }
195}
matrixC fEvec
Eigenvectors of the Hamiltonian.
Definition: PMNS_Base.h:290
bool fBuiltHms
Tag to avoid rebuilding Hms.
Definition: PMNS_Base.h:298
virtual void BuildHms()
Build the matrix of masses squared.
Definition: PMNS_Base.cxx:955
virtual void SetVacuumEigensystem()
Set the eigensystem to the analytic solution of the vacuum Hamiltonian.
Definition: PMNS_Fast.cxx:154

References OscProb::PMNS_Base::BuildHms(), OscProb::PMNS_Base::fBuiltHms, OscProb::PMNS_Base::fEvec, fUM, and OscProb::PMNS_Fast::SetVacuumEigensystem().

Referenced by BuildHVMB(), and RotateState().

◆ BuildHVMB()

void PMNS_OQS::BuildHVMB ( NuPath  p)
protectedvirtual

Build the effective Hamiltonian in VMB for a given propagation path.

Parameters
p- Neutrino path segment.

Definition at line 203 of file PMNS_OQS.cxx.

204{
205 // Set the neutrino path
206 SetCurPath(p);
207
208 double kr2GNe = kK2 * M_SQRT2 * kGf;
209 kr2GNe *= fPath.density * fPath.zoa; // Matter potential in eV
210
211 double Ve = 0;
212
213 if (!fIsNuBar)
214 Ve = kr2GNe;
215 else
216 Ve = -kr2GNe;
217
218 BuildHms();
219
220 for (int i = 0; i < 3; i++) {
221 for (int j = i; j < 3; j++) {
222 fHVMB[i][j] = conj(fUM[0][i]) * Ve * fUM[0][j];
223 if (i > j) fHVMB[j][i] = conj(fHVMB[i][j]);
224 }
225 }
226
227 double lv = 2 * kGeV2eV * fEnergy; // 2E in eV
228
229 // add mass terms
230 fHVMB[1][1] += fDm[1] / lv;
231 fHVMB[2][2] += fDm[2] / lv;
232}
bool fIsNuBar
Anti-neutrino flag.
Definition: PMNS_Base.h:293
double fEnergy
Neutrino energy.
Definition: PMNS_Base.h:292
static const double kK2
mol/GeV^2/cm^3 to eV
Definition: PMNS_Base.h:216
static const double kGf
G_F in units of GeV^-2.
Definition: PMNS_Base.h:220
vectorD fDm
m^2_i - m^2_1 in vacuum
Definition: PMNS_Base.h:279
virtual void BuildHms()
Reimplemented from PMNS_Base.
Definition: PMNS_OQS.cxx:187
double density
The density of the path segment in g/cm^3.
Definition: NuPath.h:79
double zoa
The effective Z/A value of the path segment.
Definition: NuPath.h:80

References BuildHms(), OscProb::NuPath::density, OscProb::PMNS_Base::fDm, OscProb::PMNS_Base::fEnergy, fHVMB, OscProb::PMNS_Base::fIsNuBar, OscProb::PMNS_Base::fPath, fUM, OscProb::PMNS_Base::kGeV2eV, OscProb::PMNS_Base::kGf, OscProb::PMNS_Base::kK2, OscProb::PMNS_Base::SetCurPath(), and OscProb::NuPath::zoa.

Referenced by BuildHGM().

◆ BuildM()

void PMNS_OQS::BuildM ( NuPath  p)
protectedvirtual

Build the matrix M used in evolution equations.

Parameters
p- Neutrino path segment.

Definition at line 423 of file PMNS_OQS.cxx.

424{
425 BuildHGM(p);
427 double energyCorr = pow(fEnergy, fPower);
428 for (int k = 1; k < SU3_DIM; ++k) {
429 for (int j = 1; j < SU3_DIM; ++j) {
430 fM(k - 1, j - 1) = fHGM[k][j] + fD[k][j] * energyCorr;
431 }
432 }
433}
int fPower
Power-law index (n).
Definition: PMNS_OQS.h:86
virtual void BuildDissipator()
Build the dissipator in Gell-Mann representation.
Definition: PMNS_OQS.cxx:343
virtual void BuildHGM(NuPath p)
Build effective Hamiltonian in Gell-Mann representation (GM).
Definition: PMNS_OQS.cxx:333

References BuildDissipator(), BuildHGM(), fD, OscProb::PMNS_Base::fEnergy, fHGM, fM, fPower, and SU3_DIM.

Referenced by PropagatePath().

◆ BuildR()

void PMNS_OQS::BuildR ( )
protectedvirtual

Build Gell-Mann representation of density matrix.

Definition at line 439 of file PMNS_OQS.cxx.

439{ get_GM(fRho, fR); }
void get_GM(const matrixC &A, vectorD &v)
Definition: PMNS_OQS.cxx:242
matrixC fRho
The neutrino density matrix state.

References fR, OscProb::PMNS_DensityMatrix::fRho, and get_GM().

Referenced by RotateState().

◆ ClearCache()

void PMNS_Base::ClearCache ( )
virtualinherited

Clear the cache

Definition at line 111 of file PMNS_Base.cxx.

112{
113 fMixCache.clear();
114
115 // Set some better hash table parameters
116 fMixCache.max_load_factor(0.25);
117 fMixCache.reserve(512);
118}
std::unordered_set< EigenPoint > fMixCache
Caching set of eigensystems.
Definition: PMNS_Base.h:307

References OscProb::PMNS_Base::fMixCache.

Referenced by OscProb::PMNS_Base::BuildHms(), OscProb::PMNS_Base::PMNS_Base(), OscProb::PMNS_NUNM::SetAlpha(), OscProb::PMNS_LIV::SetaT(), OscProb::PMNS_NSI::SetCoupByIndex(), OscProb::PMNS_LIV::SetcT(), OscProb::PMNS_NSI::SetEps(), and OscProb::PMNS_NUNM::SetFracVnc().

◆ ClearPath()

void PMNS_Base::ClearPath ( )
virtualinherited

Clear the path vector.

Definition at line 287 of file PMNS_Base.cxx.

287{ fNuPaths.clear(); }

References OscProb::PMNS_Base::fNuPaths.

Referenced by OscProb::PMNS_Base::SetAtt(), and OscProb::PMNS_Base::SetPath().

◆ ConvertEtoLoE()

vectorD PMNS_Base::ConvertEtoLoE ( double  E,
double  dE 
)
protectedvirtualinherited

Convert a bin of energy into a bin of L/E

Parameters
E- energy bin center in GeV
dE- energy bin width in GeV
Returns
The L/E bin center and width in km/GeV

Definition at line 1516 of file PMNS_Base.cxx.

1517{
1518 // Make sure fPath is set
1519 // Use average if multiple paths
1521
1522 // Define L/E variables
1523 vectorD LoEbin(2);
1524
1525 // Set a minimum energy
1526 double minE = 0.1 * E;
1527
1528 // Transform range to L/E
1529 // Full range if low edge > minE
1530 if (E - dE / 2 > minE) {
1531 LoEbin[0] =
1532 0.5 * (fPath.length / (E - dE / 2) + fPath.length / (E + dE / 2));
1533 LoEbin[1] = fPath.length / (E - dE / 2) - fPath.length / (E + dE / 2);
1534 }
1535 // Else start at minE
1536 else {
1537 LoEbin[0] = 0.5 * (fPath.length / minE + fPath.length / (E + dE / 2));
1538 LoEbin[1] = fPath.length / minE - fPath.length / (E + dE / 2);
1539 }
1540
1541 return LoEbin;
1542}

References OscProb::AvgPath(), OscProb::PMNS_Base::fNuPaths, OscProb::PMNS_Base::fPath, OscProb::NuPath::length, and OscProb::PMNS_Base::SetCurPath().

Referenced by OscProb::PMNS_Base::AvgProb(), OscProb::PMNS_Base::AvgProbMatrix(), and OscProb::PMNS_Base::AvgProbVector().

◆ FillCache()

void PMNS_Base::FillCache ( )
protectedvirtualinherited

If using caching, save the eigensystem in memory

Reimplemented in OscProb::PMNS_LIV, and OscProb::PMNS_SNSI.

Definition at line 157 of file PMNS_Base.cxx.

158{
159 if (fUseCache) {
160 if (fMixCache.size() > fMaxCache) { fMixCache.erase(fMixCache.begin()); }
162 for (int i = 0; i < fNumNus; i++) {
163 fProbe.fEval[i] = fEval[i];
164 for (int j = 0; j < fNumNus; j++) { fProbe.fEvec[i][j] = fEvec[i][j]; }
165 }
166 fMixCache.insert(fProbe);
167 }
168}
int fMaxCache
Maximum cache size.
Definition: PMNS_Base.h:303
vectorD fEval
Eigenvalues of the Hamiltonian.
Definition: PMNS_Base.h:289
EigenPoint fProbe
EigenpPoint to try.
Definition: PMNS_Base.h:308
bool fUseCache
Flag for whether to use caching.
Definition: PMNS_Base.h:301
vectorD fEval
Eigenvalues to be cached.
Definition: EigenPoint.h:38
void SetVars(double e=0, NuPath p=NuPath(0, 0), bool n=false)
Set eigensystem parameters.
Definition: EigenPoint.cxx:39
matrixC fEvec
Eigenvectors to be cached.
Definition: EigenPoint.h:39

References OscProb::PMNS_Base::fEnergy, OscProb::EigenPoint::fEval, OscProb::PMNS_Base::fEval, OscProb::EigenPoint::fEvec, OscProb::PMNS_Base::fEvec, OscProb::PMNS_Base::fIsNuBar, OscProb::PMNS_Base::fMaxCache, OscProb::PMNS_Base::fMixCache, OscProb::PMNS_Base::fNumNus, OscProb::PMNS_Base::fPath, OscProb::PMNS_Base::fProbe, OscProb::PMNS_Base::fUseCache, and OscProb::EigenPoint::SetVars().

Referenced by OscProb::PMNS_Sterile::SolveHam(), and OscProb::PMNS_Fast::SolveHamMatter().

◆ GetAngle()

double PMNS_Base::GetAngle ( int  i,
int  j 
)
virtualinherited

Get the mixing angle theta_ij in radians.

Requires that i<j. Will notify you if input is wrong. If i>j, will assume reverse order and swap i and j.

Parameters
i,j- the indices of theta_ij

Definition at line 570 of file PMNS_Base.cxx.

571{
572 if (i > j) {
573 cerr << "WARNING: First argument should be smaller than second argument"
574 << endl
575 << " Setting reverse order (Theta" << j << i << "). " << endl;
576 int temp = i;
577 i = j;
578 j = temp;
579 }
580 if (i < 1 || i > fNumNus - 1 || j < 2 || j > fNumNus) {
581 cerr << "ERROR: Theta" << i << j << " not valid for " << fNumNus
582 << " neutrinos. Returning zero." << endl;
583 return 0;
584 }
585
586 return fTheta[i - 1][j - 1];
587}
matrixD fTheta
theta[i][j] mixing angle
Definition: PMNS_Base.h:280

References OscProb::PMNS_Base::fNumNus, and OscProb::PMNS_Base::fTheta.

◆ GetDecoAngle()

double PMNS_OQS::GetDecoAngle ( int  i,
int  j 
)
virtual

Get mixing angle between two decoherence vectors a_i and a_j.

Parameters
i- First index in GM representation in range [1, 8].
j- Second index in GM representation in range [2, 8].
Returns
Decoherence angle between a_i and a_j.

Definition at line 122 of file PMNS_OQS.cxx.

123{
124 THROW_ON_INVALID_ARG(i > 0, i);
126 THROW_ON_INVALID_ARG(j > 0, i);
128 THROW_ON_INVALID_ARG(i != j, i, j);
129
130 return acos(fcos[i][j]);
131}
#define THROW_ON_INVALID_ARG(condition,...)
Definition: exceptions.h:85

References fcos, SU3_DIM, and THROW_ON_INVALID_ARG.

◆ GetDecoElement()

double PMNS_OQS::GetDecoElement ( int  i)
virtual

Get the value of a_i decoherence parameter in GM representation.

Parameters
i- Index of the parameter in range [1, 8].
Returns
Decoherence parameter a_i.

Definition at line 105 of file PMNS_OQS.cxx.

106{
107 THROW_ON_INVALID_ARG(i > 0, i);
109
110 return fa[i];
111}

References fa, SU3_DIM, and THROW_ON_INVALID_ARG.

◆ GetDelta()

double PMNS_Base::GetDelta ( int  i,
int  j 
)
virtualinherited

Get the CP phase delta_ij in radians.

Requires that i+1<j. Will notify you if input is wrong. If i>j, will assume reverse order and swap i and j.

Parameters
i,j- the indices of delta_ij

Definition at line 638 of file PMNS_Base.cxx.

639{
640 if (i > j) {
641 cerr << "WARNING: First argument should be smaller than second argument"
642 << endl
643 << " Setting reverse order (Delta" << j << i << "). " << endl;
644 int temp = i;
645 i = j;
646 j = temp;
647 }
648 if (i < 1 || i > fNumNus - 1 || j < 2 || j > fNumNus) {
649 cerr << "ERROR: Delta" << i << j << " not valid for " << fNumNus
650 << " neutrinos. Returning zero." << endl;
651 return 0;
652 }
653 if (i + 1 == j) {
654 cerr << "WARNING: Rotation " << i << j << " is real. Returning zero."
655 << endl;
656 return 0;
657 }
658
659 return fDelta[i - 1][j - 1];
660}
matrixD fDelta
delta[i][j] CP violating phase
Definition: PMNS_Base.h:281

References OscProb::PMNS_Base::fDelta, and OscProb::PMNS_Base::fNumNus.

◆ GetDissipatorElement()

double PMNS_OQS::GetDissipatorElement ( int  i,
int  j 
)
virtual

Get specific element of the dissipator matrix in the GM representation.

Parameters
iRow index in range [0, 8].
jColumn index in range [0, 8].
Returns
Dissipator element i,j.

Definition at line 161 of file PMNS_OQS.cxx.

162{
163 THROW_ON_INVALID_ARG(i >= 0, i);
165 THROW_ON_INVALID_ARG(j >= 0, i);
167
168 return fD[i][j];
169}

References fD, SU3_DIM, and THROW_ON_INVALID_ARG.

◆ GetDm()

double PMNS_Base::GetDm ( int  j)
virtualinherited

Get the mass-splitting dm_j1 = (m_j^2 - m_1^2) in eV^2

Requires that j>1. Will notify you if input is wrong.

Parameters
j- the index of dm_j1

Definition at line 696 of file PMNS_Base.cxx.

697{
698 if (j < 2 || j > fNumNus) {
699 cerr << "ERROR: Dm" << j << "1 not valid for " << fNumNus
700 << " neutrinos. Returning zero." << endl;
701 return 0;
702 }
703
704 return fDm[j - 1];
705}

References OscProb::PMNS_Base::fDm, and OscProb::PMNS_Base::fNumNus.

◆ GetDmEff()

double PMNS_Base::GetDmEff ( int  j)
virtualinherited

Get the effective mass-splitting dm_j1 in matter in eV^2

Requires that j>1. Will notify you if input is wrong.

Parameters
j- the index of dm_j1

Definition at line 732 of file PMNS_Base.cxx.

733{
734 if (j < 2 || j > fNumNus) {
735 cerr << "ERROR: Dm_" << j << "1 not valid for " << fNumNus
736 << " neutrinos. Returning zero." << endl;
737 return 0;
738 }
739
740 // Solve the Hamiltonian to update eigenvalues
741 SolveHam();
742
743 // Sort eigenvalues in same order as vacuum Dm^2
744 vectorI dm_idx = GetSortedIndices(fDm);
745 vectorD dm_idx_double(dm_idx.begin(), dm_idx.end());
746 dm_idx = GetSortedIndices(dm_idx_double);
748
749 // Return difference in eigenvalues * 2E
750 return (fEval[ev_idx[dm_idx[j - 1]]] - fEval[ev_idx[dm_idx[0]]]) * 2 *
752}
virtual void SolveHam()=0
virtual std::vector< int > GetSortedIndices(const vectorD x)
Get indices that sort a vector.
Definition: PMNS_Base.cxx:715
std::vector< int > vectorI
Definition: Definitions.h:16

References OscProb::PMNS_Base::fDm, OscProb::PMNS_Base::fEnergy, OscProb::PMNS_Base::fEval, OscProb::PMNS_Base::fNumNus, OscProb::PMNS_Base::GetSortedIndices(), OscProb::PMNS_Base::kGeV2eV, and OscProb::PMNS_Base::SolveHam().

◆ GetEnergy()

double PMNS_Base::GetEnergy ( )
virtualinherited

Get the neutrino energy in GeV.

Definition at line 255 of file PMNS_Base.cxx.

255{ return fEnergy; }

References OscProb::PMNS_Base::fEnergy.

◆ GetHGM()

double PMNS_OQS::GetHGM ( int  i,
int  j 
)
virtual

Get element of the Hamiltonian in GM representation.

Parameters
i- Row index in range [0, 8].
j- Column index in range [0, 8].
Returns
Hamiltonian element i,j in GM representation.

Definition at line 142 of file PMNS_OQS.cxx.

143{
144 THROW_ON_INVALID_ARG(i >= 0, i);
146 THROW_ON_INVALID_ARG(j >= 0, i);
148
149 return fHGM[i][j];
150}

References fHGM, SU3_DIM, and THROW_ON_INVALID_ARG.

◆ GetIsNuBar()

bool PMNS_Base::GetIsNuBar ( )
virtualinherited

Get the anti-neutrino flag.

Definition at line 261 of file PMNS_Base.cxx.

261{ return fIsNuBar; }

References OscProb::PMNS_Base::fIsNuBar.

◆ GetMassEigenstate()

vectorC PMNS_Base::GetMassEigenstate ( int  mi)
virtualinherited

Get the neutrino mass eigenstate in vacuum

States are:

  0 = m_1, 1 = m_2, 2 = m_3, etc.
Parameters
mi- the mass eigenstate index
Returns
The mass eigenstate

Definition at line 795 of file PMNS_Base.cxx.

796{
797 vectorC oldState = fNuState;
798
799 ResetToFlavour(mi);
800
801 for (int j = 0; j < fNumNus; j++) {
802 for (int i = 0; i < j; i++) { RotateState(i, j); }
803 }
804
805 vectorC newState = fNuState;
806 fNuState = oldState;
807
808 return newState;
809}
virtual void RotateState(int i, int j)
Rotate the neutrino state by theta_ij and delta_ij.
Definition: PMNS_Base.cxx:760

References OscProb::PMNS_Base::fNumNus, OscProb::PMNS_Base::fNuState, OscProb::PMNS_Base::ResetToFlavour(), and OscProb::PMNS_Base::RotateState().

◆ GetPath()

vector< NuPath > PMNS_Base::GetPath ( )
virtualinherited

Get the vector of neutrino paths.

Definition at line 300 of file PMNS_Base.cxx.

300{ return fNuPaths; }

References OscProb::PMNS_Base::fNuPaths.

◆ GetPower()

int PMNS_OQS::GetPower ( )
virtual

Get the currently set power-law index for decoherence parameters.

Returns
Power-law index.

Definition at line 95 of file PMNS_OQS.cxx.

95{ return fPower; }

References fPower.

◆ GetProbVector()

vectorD PMNS_Base::GetProbVector ( )
protectedvirtualinherited

Return vector of probabilities from final state

Get the vector of probabilities for current state

Returns
Neutrino oscillation probabilities

Definition at line 1233 of file PMNS_Base.cxx.

1234{
1235 vectorD probs(fNumNus);
1236
1237 for (int i = 0; i < probs.size(); i++) { probs[i] = P(i); }
1238
1239 return probs;
1240}
virtual double P(int flv)
Return the probability of final state in flavour flv.
Definition: PMNS_Base.cxx:1058

References OscProb::PMNS_Base::fNumNus, and OscProb::PMNS_Base::P().

Referenced by OscProb::PMNS_Base::ProbVector().

◆ GetSamplePoints()

vectorD PMNS_Base::GetSamplePoints ( double  LoE,
double  dLoE 
)
virtualinherited

Compute the sample points for a bin of L/E with width dLoE

This is used for averaging the probability over a bin of L/E. It should be a private function, but I'm keeping it public for now for debugging purposes. The number of sample points seems too high for most purposes. The number of subdivisions needs to be optimized.

Parameters
LoE- The neutrino L/E value in the bin center in km/GeV
dLoE- The L/E bin width in km/GeV

Definition at line 1985 of file PMNS_Base.cxx.

1986{
1987 // Solve Hamiltonian to get eigenvalues
1988 SolveHam();
1989
1990 // Define conversion factor [km/GeV -> 1/(4 eV^2)]
1991 const double k1267 = kKm2eV / (4 * kGeV2eV);
1992
1993 // Get list of all effective Dm^2
1994 vectorD effDm;
1995
1996 for (int i = 0; i < fNumNus - 1; i++) {
1997 for (int j = i + 1; j < fNumNus; j++) {
1998 effDm.push_back(2 * kGeV2eV * fEnergy * fabs(fEval[j] - fEval[i]));
1999 }
2000 }
2001
2002 int numDm = effDm.size();
2003
2004 // Sort the effective Dm^2 list
2005 sort(effDm.begin(), effDm.end());
2006
2007 // Set a number of sub-divisions to achieve "good" accuracy
2008 // This needs to be studied better
2009 int n_div = ceil(200 * pow(dLoE / LoE, 0.8) / sqrt(fAvgProbPrec / 1e-4));
2010 // int n_div = 1;
2011
2012 // A vector to store sample points
2013 vectorD allSamples;
2014
2015 // Loop over sub-divisions
2016 for (int k = 0; k < n_div; k++) {
2017 // Define sub-division center and width
2018 double bctr = LoE - dLoE / 2 + (k + 0.5) * dLoE / n_div;
2019 double bwdt = dLoE / n_div;
2020
2021 // Make a vector of L/E sample values
2022 // Initialized in the sub-division center
2023 vectorD samples;
2024 samples.push_back(bctr);
2025
2026 // Loop over all Dm^2 to average each frequency
2027 // This will recursively sample points in smaller
2028 // bins so that all relevant frequencies are used
2029 for (int i = 0; i < numDm; i++) {
2030 // Copy the list of sample L/E values
2031 vectorD prev = samples;
2032
2033 // Redefine bin width to lie within full sub-division
2034 double Width =
2035 2 * min(prev[0] - (bctr - bwdt / 2), (bctr + bwdt / 2) - prev[0]);
2036
2037 // Compute oscillation argument sorted from lowest to highest
2038 const double arg = k1267 * effDm[i] * Width;
2039
2040 // Skip small oscillation values.
2041 // If it's the last one, lower the tolerance
2042 if (i < numDm - 1) {
2043 if (arg < 0.9) continue;
2044 }
2045 else {
2046 if (arg < 0.1) continue;
2047 }
2048
2049 // Reset samples to redefine them
2050 samples.clear();
2051
2052 // Loop over previous samples
2053 for (int j = 0; j < int(prev.size()); j++) {
2054 // Compute new sample points around old samples
2055 // This is based on a oscillatory quadrature rule
2056 double sample = (1 / sqrt(3)) * (Width / 2);
2057 if (arg != 0) sample = acos(sin(arg) / arg) / arg * (Width / 2);
2058
2059 // Add samples above and below center
2060 samples.push_back(prev[j] - sample);
2061 samples.push_back(prev[j] + sample);
2062 }
2063
2064 } // End of loop over Dm^2
2065
2066 // Add sub-division samples to the end of allSamples vector
2067 allSamples.insert(allSamples.end(), samples.begin(), samples.end());
2068
2069 } // End of loop over sub-divisions
2070
2071 // Return all sample points
2072 return allSamples;
2073}
static const double kKm2eV
km to eV^-1
Definition: PMNS_Base.h:215
double fAvgProbPrec
AvgProb precision.
Definition: PMNS_Base.h:305

References OscProb::PMNS_Base::fAvgProbPrec, OscProb::PMNS_Base::fEnergy, OscProb::PMNS_Base::fEval, OscProb::PMNS_Base::fNumNus, OscProb::PMNS_Base::kGeV2eV, OscProb::PMNS_Base::kKm2eV, and OscProb::PMNS_Base::SolveHam().

Referenced by OscProb::PMNS_Base::AvgProbLoE(), OscProb::PMNS_Base::AvgProbMatrixLoE(), and OscProb::PMNS_Base::AvgProbVectorLoE().

◆ GetSortedIndices()

vectorI PMNS_Base::GetSortedIndices ( const vectorD  x)
protectedvirtualinherited

Get the indices of the sorted x vector

Parameters
x- input vector
Returns
The vector of sorted indices

Definition at line 715 of file PMNS_Base.cxx.

716{
717 vectorI idx(x.size(), 0);
718 for (int i = 0; i < x.size(); i++) idx[i] = i;
719 sort(idx.begin(), idx.end(), IdxCompare(x));
720
721 return idx;
722}
An index sorting comparator.
Definition: PMNS_Base.h:312

Referenced by OscProb::PMNS_Base::GetDmEff().

◆ InitializeVectors()

void PMNS_Base::InitializeVectors ( )
protectedvirtualinherited

Initialize all member vectors with zeros

Set vector sizes and initialize elements to zero.

Definition at line 79 of file PMNS_Base.cxx.

80{
81 fDm = vectorD(fNumNus, 0);
84
87
90
91 fEval = vectorD(fNumNus, 0);
93}
static const complexD zero
zero in complex
Definition: PMNS_Base.h:211
matrixC fHms
matrix H*2E in eV^2
Definition: PMNS_Base.h:284
vectorC fBuffer
Buffer for neutrino state tranformations.
Definition: PMNS_Base.h:287
vectorC fPhases
Buffer for oscillation phases.
Definition: PMNS_Base.h:286
std::vector< vectorC > matrixC
Definition: Definitions.h:23

Referenced by OscProb::PMNS_Base::PMNS_Base().

◆ P()

double PMNS_DensityMatrix::P ( int  flv)
protectedvirtualinherited

Compute oscillation probability of flavour flv from current state

Flavours are:

  0 = nue, 1 = numu, 2 = nutau
  3 = sterile_1, 4 = sterile_2, etc.
Parameters
flv- The neutrino final flavour.
Returns
Neutrino oscillation probability

Reimplemented from OscProb::PMNS_Base.

Definition at line 116 of file PMNS_DensityMatrix.cxx.

117{
118 assert(flv >= 0 && flv < fNumNus);
119 return abs(fRho[flv][flv]);
120}

References OscProb::PMNS_Base::fNumNus, and OscProb::PMNS_DensityMatrix::fRho.

Referenced by ProbMatrix().

◆ Prob() [1/6]

double PMNS_Base::Prob ( int  flvi,
int  flvf 
)
virtualinherited

Compute the probability of flvi going to flvf.

Flavours are:

  0 = nue, 1 = numu, 2 = nutau
  3 = sterile_1, 4 = sterile_2, etc.
Parameters
flvi- The neutrino starting flavour.
flvf- The neutrino final flavour.
Returns
Neutrino oscillation probability

Definition at line 1091 of file PMNS_Base.cxx.

1092{
1093 ResetToFlavour(flvi);
1094
1095 Propagate();
1096
1097 return P(flvf);
1098}
virtual void Propagate()
Propagate neutrino through full path.
Definition: PMNS_Base.cxx:1018

References OscProb::PMNS_Base::P(), OscProb::PMNS_Base::Propagate(), and OscProb::PMNS_Base::ResetToFlavour().

◆ Prob() [2/6]

double PMNS_Base::Prob ( int  flvi,
int  flvf,
double  E 
)
virtualinherited

Compute the probability of flvi going to flvf for energy E

Compute the probability of flvi going to flvf for a given energy in GeV.

Flavours are:

  0 = nue, 1 = numu, 2 = nutau
  3 = sterile_1, 4 = sterile_2, etc.
Parameters
flvi- The neutrino starting flavour.
flvf- The neutrino final flavour.
E- The neutrino energy in GeV
Returns
Neutrino oscillation probability

Definition at line 1160 of file PMNS_Base.cxx.

1161{
1162 SetEnergy(E);
1163
1164 return Prob(flvi, flvf);
1165}

References OscProb::PMNS_Base::Prob(), and OscProb::PMNS_Base::SetEnergy().

◆ Prob() [3/6]

double PMNS_Base::Prob ( int  flvi,
int  flvf,
double  E,
double  L 
)
virtualinherited

Compute the probability of flvi going to flvf for energy E and distance L

Compute the probability of flvi going to flvf for a given energy in GeV and distance in km in a single path.

If the path sequence is not a single path, a new single path will be created and the previous sequence will be lost.

Don't use this if you want to propagate over multiple path segments.

Flavours are:

  0 = nue, 1 = numu, 2 = nutau
  3 = sterile_1, 4 = sterile_2, etc.
Parameters
flvi- The neutrino starting flavour.
flvf- The neutrino final flavour.
E- The neutrino energy in GeV
L- The neutrino path length in km
Returns
Neutrino oscillation probability

Definition at line 1219 of file PMNS_Base.cxx.

1220{
1221 SetEnergy(E);
1222 SetLength(L);
1223
1224 return Prob(flvi, flvf);
1225}
virtual void SetLength(double L)
Set a single path lentgh in km.
Definition: PMNS_Base.cxx:391

References OscProb::PMNS_Base::Prob(), OscProb::PMNS_Base::SetEnergy(), and OscProb::PMNS_Base::SetLength().

◆ Prob() [4/6]

double PMNS_Base::Prob ( vectorC  nu_in,
int  flvf 
)
virtualinherited

Compute the probability of nu_in going to flvf.

Flavours are:

  0 = nue, 1 = numu, 2 = nutau
  3 = sterile_1, 4 = sterile_2, etc.
Parameters
nu_in- The neutrino initial state in flavour basis.
flvf- The neutrino final flavour.
Returns
Neutrino oscillation probability

Definition at line 1114 of file PMNS_Base.cxx.

1115{
1116 SetPureState(nu_in);
1117
1118 Propagate();
1119
1120 return P(flvf);
1121}
virtual void SetPureState(vectorC nu_in)
Set the initial state from a pure state.
Definition: PMNS_Base.cxx:1070

References OscProb::PMNS_Base::P(), OscProb::PMNS_Base::Propagate(), and OscProb::PMNS_Base::SetPureState().

Referenced by OscProb::PMNS_Base::AvgProb(), OscProb::PMNS_Base::AvgProbLoE(), and OscProb::PMNS_Base::Prob().

◆ Prob() [5/6]

double PMNS_Base::Prob ( vectorC  nu_in,
int  flvf,
double  E 
)
virtualinherited

Compute the probability of nu_in going to flvf for energy E

Compute the probability of nu_in going to flvf for a given energy in GeV.

Flavours are:

  0 = nue, 1 = numu, 2 = nutau
  3 = sterile_1, 4 = sterile_2, etc.
Parameters
nu_in- The neutrino initial state in flavour basis.
flvf- The neutrino final flavour.
E- The neutrino energy in GeV
Returns
Neutrino oscillation probability

Definition at line 1138 of file PMNS_Base.cxx.

1139{
1140 SetEnergy(E);
1141
1142 return Prob(nu_in, flvf);
1143}

References OscProb::PMNS_Base::Prob(), and OscProb::PMNS_Base::SetEnergy().

◆ Prob() [6/6]

double PMNS_Base::Prob ( vectorC  nu_in,
int  flvf,
double  E,
double  L 
)
virtualinherited

Compute the probability of nu_in going to flvf for energy E and distance L

Compute the probability of nu_in going to flvf for a given energy in GeV and distance in km in a single path.

If the path sequence is not a single path, a new single path will be created and the previous sequence will be lost.

Don't use this if you want to propagate over multiple path segments.

Flavours are:

  0 = nue, 1 = numu, 2 = nutau
  3 = sterile_1, 4 = sterile_2, etc.
Parameters
nu_in- The neutrino initial state in flavour basis.
flvf- The neutrino final flavour.
E- The neutrino energy in GeV
L- The neutrino path length in km
Returns
Neutrino oscillation probability

Definition at line 1189 of file PMNS_Base.cxx.

1190{
1191 SetEnergy(E);
1192 SetLength(L);
1193
1194 return Prob(nu_in, flvf);
1195}

References OscProb::PMNS_Base::Prob(), OscProb::PMNS_Base::SetEnergy(), and OscProb::PMNS_Base::SetLength().

◆ ProbMatrix() [1/3]

matrixD PMNS_OQS::ProbMatrix ( int  nflvi,
int  nflvf 
)
virtual

Compute the probability matrix for the first nflvi and nflvf states.

Flavours are:

  0 = nue, 1 = numu, 2 = nutau
  3 = sterile_1, 4 = sterile_2, etc.
Parameters
nflvi- The number of initial flavours in the matrix.
nflvf- The number of final flavours in the matrix.
Returns
Neutrino oscillation probabilities.

Reimplemented from OscProb::PMNS_DensityMatrix.

Definition at line 514 of file PMNS_OQS.cxx.

515{
516 THROW_ON_INVALID_ARG(nflvi >= 0, nflvi);
517 THROW_ON_INVALID_ARG(nflvi <= fNumNus, nflvi, fNumNus);
518 THROW_ON_INVALID_ARG(nflvf >= 0, nflvf);
519 THROW_ON_INVALID_ARG(nflvf <= fNumNus, nflvf, fNumNus);
520
521 // Output probabilities
522 matrixD probs(nflvi, vectorD(nflvf));
523
524 // List of states
525 vector<vectorD> allstates(nflvi, vectorD(9));
526
527 // Reset all initial states
528 for (int i = 0; i < nflvi; i++) {
530 RotateState(true);
531 allstates[i] = fR;
532 }
533
534 // Propagate all states in parallel
535 for (int i = 0; i < int(fNuPaths.size()); i++) {
536 for (int flvi = 0; flvi < nflvi; flvi++) {
537 fR = allstates[flvi];
539 allstates[flvi] = fR;
540 }
541 }
542
543 // Get all probabilities
544 for (int flvi = 0; flvi < nflvi; flvi++) {
545 fR = allstates[flvi];
546 RotateState(false);
547 for (int flvj = 0; flvj < nflvf; flvj++) { probs[flvi][flvj] = P(flvj); }
548 }
549
550 return probs;
551}
virtual void ResetToFlavour(int flv)
Reset neutrino state to pure flavour flv.
virtual double P(int flv)
Return the probability of final state in flavour flv.
virtual void PropagatePath(NuPath p)
Reimplemented from PMNS_Base.
Definition: PMNS_OQS.cxx:478
virtual void RotateState(bool to_mass)
Rotate rho to/from mass basis.
Definition: PMNS_OQS.cxx:453

References OscProb::PMNS_Base::fNumNus, OscProb::PMNS_Base::fNuPaths, fR, OscProb::PMNS_DensityMatrix::P(), PropagatePath(), OscProb::PMNS_DensityMatrix::ResetToFlavour(), RotateState(), and THROW_ON_INVALID_ARG.

◆ ProbMatrix() [2/3]

matrixD PMNS_Base::ProbMatrix ( int  nflvi,
int  nflvf,
double  E 
)
virtualinherited

Reimplemented from OscProb::PMNS_Base.

Definition at line 80 of file PMNS_Base.cxx.

1440{
1441 SetEnergy(E);
1442
1443 return ProbMatrix(nflvi, nflvf);
1444}
virtual matrixD ProbMatrix(int nflvi, int nflvf)

References OscProb::PMNS_Base::fDm, OscProb::PMNS_Base::fNumNus, and OscProb::PMNS_Base::fTheta.

◆ ProbMatrix() [3/3]

matrixD PMNS_Base::ProbMatrix ( int  nflvi,
int  nflvf,
double  E,
double  L 
)
virtualinherited

Reimplemented from OscProb::PMNS_Base.

Definition at line 83 of file PMNS_Base.cxx.

1469{
1470 SetEnergy(E);
1471 SetLength(L);
1472
1473 return ProbMatrix(nflvi, nflvf);
1474}

◆ ProbVector() [1/6]

vectorD PMNS_Base::ProbVector ( int  flvi)
virtualinherited

Compute the probabilities of flvi going to all flavours

Compute the probability of flvi going to all flavours.

Flavours are:

  0 = nue, 1 = numu, 2 = nutau
  3 = sterile_1, 4 = sterile_2, etc.
Parameters
flvi- The neutrino starting flavour.
Returns
Neutrino oscillation probabilities

Definition at line 1272 of file PMNS_Base.cxx.

1273{
1274 ResetToFlavour(flvi);
1275
1276 Propagate();
1277
1278 return GetProbVector();
1279}
virtual vectorD GetProbVector()
Definition: PMNS_Base.cxx:1233

References OscProb::PMNS_Base::GetProbVector(), OscProb::PMNS_Base::Propagate(), and OscProb::PMNS_Base::ResetToFlavour().

◆ ProbVector() [2/6]

vectorD PMNS_Base::ProbVector ( int  flvi,
double  E 
)
virtualinherited

Compute the probabilities of flvi going to all flavours for energy E

Compute the probability of flvi going to all flavours for a given energy in GeV.

Flavours are:

  0 = nue, 1 = numu, 2 = nutau
  3 = sterile_1, 4 = sterile_2, etc.
Parameters
flvi- The neutrino starting flavour.
E- The neutrino energy in GeV
Returns
Neutrino oscillation probability

Definition at line 1313 of file PMNS_Base.cxx.

1314{
1315 SetEnergy(E);
1316
1317 return ProbVector(flvi);
1318}

References OscProb::PMNS_Base::ProbVector(), and OscProb::PMNS_Base::SetEnergy().

◆ ProbVector() [3/6]

vectorD PMNS_Base::ProbVector ( int  flvi,
double  E,
double  L 
)
virtualinherited

Compute the probabilities of flvi going to all flavours for energy E and distance L

Compute the probability of flvi going to all flavours for a given energy in GeV and distance in km in a single path.

If the path sequence is not a single path, a new single path will be created and the previous sequence will be lost.

Don't use this if you want to propagate over multiple path segments.

Flavours are:

  0 = nue, 1 = numu, 2 = nutau
  3 = sterile_1, 4 = sterile_2, etc.
Parameters
flvi- The neutrino starting flavour.
E- The neutrino energy in GeV
L- The neutrino path length in km
Returns
Neutrino oscillation probability

Definition at line 1365 of file PMNS_Base.cxx.

1366{
1367 SetEnergy(E);
1368 SetLength(L);
1369
1370 return ProbVector(flvi);
1371}

References OscProb::PMNS_Base::ProbVector(), OscProb::PMNS_Base::SetEnergy(), and OscProb::PMNS_Base::SetLength().

◆ ProbVector() [4/6]

vectorD PMNS_Base::ProbVector ( vectorC  nu_in)
virtualinherited

Compute the probabilities of nu_in going to all flavours

Compute the probability of nu_in going to all flavours.

Parameters
nu_in- The neutrino initial state in flavour basis.
Returns
Neutrino oscillation probabilities

Definition at line 1250 of file PMNS_Base.cxx.

1251{
1252 SetPureState(nu_in);
1253
1254 Propagate();
1255
1256 return GetProbVector();
1257}

References OscProb::PMNS_Base::GetProbVector(), OscProb::PMNS_Base::Propagate(), and OscProb::PMNS_Base::SetPureState().

Referenced by OscProb::PMNS_Base::AvgProbVector(), OscProb::PMNS_Base::AvgProbVectorLoE(), and OscProb::PMNS_Base::ProbVector().

◆ ProbVector() [5/6]

vectorD PMNS_Base::ProbVector ( vectorC  nu_in,
double  E 
)
virtualinherited

Compute the probabilities of nu_in going to all

Compute the probability of nu_in going to all flavours for a given energy in GeV.

Parameters
nu_in- The neutrino initial state in flavour basis.
E- The neutrino energy in GeV
Returns
Neutrino oscillation probabilities

Definition at line 1291 of file PMNS_Base.cxx.

1292{
1293 SetEnergy(E);
1294
1295 return ProbVector(nu_in);
1296}

References OscProb::PMNS_Base::ProbVector(), and OscProb::PMNS_Base::SetEnergy().

◆ ProbVector() [6/6]

vectorD PMNS_Base::ProbVector ( vectorC  nu_in,
double  E,
double  L 
)
virtualinherited

Compute the probabilities of nu_in going to all flavours for energy E and distance L

Compute the probability of nu_in going to all flavours for a given energy in GeV and distance in km in a single path.

If the path sequence is not a single path, a new single path will be created and the previous sequence will be lost.

Don't use this if you want to propagate over multiple path segments.

Parameters
nu_in- The neutrino initial state in flavour basis.
E- The neutrino energy in GeV
L- The neutrino path length in km
Returns
Neutrino oscillation probabilities

Definition at line 1336 of file PMNS_Base.cxx.

1337{
1338 SetEnergy(E);
1339 SetLength(L);
1340
1341 return ProbVector(nu_in);
1342}

References OscProb::PMNS_Base::ProbVector(), OscProb::PMNS_Base::SetEnergy(), and OscProb::PMNS_Base::SetLength().

◆ Propagate()

void PMNS_OQS::Propagate ( )
protectedvirtual

Reimplemented from PMNS_Base to rotate to mass basis before propagation.

Reimplemented from OscProb::PMNS_Base.

Definition at line 465 of file PMNS_OQS.cxx.

466{
467 RotateState(true);
469 RotateState(false);
470}

References OscProb::PMNS_Base::Propagate(), and RotateState().

◆ PropagatePath()

void PMNS_OQS::PropagatePath ( NuPath  p)
protectedvirtual

Propagate the current neutrino state through a given path.

Parameters
p- A neutrino path segment.

Implements OscProb::PMNS_DensityMatrix.

Definition at line 478 of file PMNS_OQS.cxx.

479{
480 BuildM(p);
481
482 // Solve for eigensystem
483 SolveHam();
484
485 // Convert path length to eV
486 double lengthIneV = kKm2eV * p.length;
487
488 fM *= lengthIneV;
489 fM = fM.exp();
490
491 fRt[0] = fR[0];
492
493 for (int i = 1; i < SU3_DIM; ++i) {
494 fRt[i] = 0;
495 for (int j = 1; j < SU3_DIM; ++j) { fRt[i] += fM(i - 1, j - 1) * fR[j]; }
496 }
497 fR = fRt;
498}
virtual void SolveHam()
Solve the full Hamiltonian for eigenvectors and eigenvalues.
Definition: PMNS_Fast.cxx:98
virtual void BuildM(NuPath p)
Build the matrix M used in evolution equations.
Definition: PMNS_OQS.cxx:423

References BuildM(), fM, fR, fRt, OscProb::PMNS_Base::kKm2eV, OscProb::NuPath::length, OscProb::PMNS_Fast::SolveHam(), and SU3_DIM.

Referenced by ProbMatrix().

◆ ResetToFlavour()

void PMNS_DensityMatrix::ResetToFlavour ( int  flv)
protectedvirtualinherited

Reset the neutrino state back to a pure flavour where it starts

Flavours are:

  0 = nue, 1 = numu, 2 = nutau
  3 = sterile_1, 4 = sterile_2, etc.
Parameters
flv- The neutrino starting flavour.

Reimplemented from OscProb::PMNS_Base.

Definition at line 87 of file PMNS_DensityMatrix.cxx.

88{
89 assert(flv >= 0 && flv < fNumNus);
90
92
93 for (int i = 0; i < fNumNus; ++i) {
94 for (int j = 0; j < fNumNus; ++j) {
95 if (i == flv && i == j)
96 fRho[i][j] = one;
97 else
98 fRho[i][j] = zero;
99 }
100 }
101}
static const complexD one
one in complex
Definition: PMNS_Base.h:212

References OscProb::PMNS_Base::fNumNus, OscProb::PMNS_DensityMatrix::fRho, OscProb::PMNS_Base::one, OscProb::PMNS_Base::ResetToFlavour(), and OscProb::PMNS_Base::zero.

Referenced by OscProb::PMNS_DensityMatrix::ProbMatrix(), and ProbMatrix().

◆ RotateH()

void PMNS_Base::RotateH ( int  i,
int  j,
matrixC Ham 
)
protectedvirtualinherited

Rotate the Hamiltonian by the angle theta_ij and phase delta_ij.

The rotations assume all off-diagonal elements with i > j are zero. This is correct if the order of rotations is chosen appropriately and it speeds up computation by skipping null terms

Parameters
i,j- the indices of the rotation ij
Ham- the Hamiltonian to be rotated

Definition at line 822 of file PMNS_Base.cxx.

823{
824 // Do nothing if angle is zero
825 if (fTheta[i][j] == 0) return;
826
827 double fSinBuffer = sin(fTheta[i][j]);
828 double fCosBuffer = cos(fTheta[i][j]);
829
830 double fHmsBufferD;
831 complexD fHmsBufferC;
832
833 // With Delta
834 if (i + 1 < j) {
835 complexD fExpBuffer = complexD(cos(fDelta[i][j]), -sin(fDelta[i][j]));
836
837 // General case
838 if (i > 0) {
839 // Top columns
840 for (int k = 0; k < i; k++) {
841 fHmsBufferC = Ham[k][i];
842
843 Ham[k][i] *= fCosBuffer;
844 Ham[k][i] += Ham[k][j] * fSinBuffer * conj(fExpBuffer);
845
846 Ham[k][j] *= fCosBuffer;
847 Ham[k][j] -= fHmsBufferC * fSinBuffer * fExpBuffer;
848 }
849
850 // Middle row and column
851 for (int k = i + 1; k < j; k++) {
852 fHmsBufferC = Ham[k][j];
853
854 Ham[k][j] *= fCosBuffer;
855 Ham[k][j] -= conj(Ham[i][k]) * fSinBuffer * fExpBuffer;
856
857 Ham[i][k] *= fCosBuffer;
858 Ham[i][k] += fSinBuffer * fExpBuffer * conj(fHmsBufferC);
859 }
860
861 // Nodes ij
862 fHmsBufferC = Ham[i][i];
863 fHmsBufferD = real(Ham[j][j]);
864
865 Ham[i][i] *= fCosBuffer * fCosBuffer;
866 Ham[i][i] +=
867 2 * fSinBuffer * fCosBuffer * real(Ham[i][j] * conj(fExpBuffer));
868 Ham[i][i] += fSinBuffer * Ham[j][j] * fSinBuffer;
869
870 Ham[j][j] *= fCosBuffer * fCosBuffer;
871 Ham[j][j] += fSinBuffer * fHmsBufferC * fSinBuffer;
872 Ham[j][j] -=
873 2 * fSinBuffer * fCosBuffer * real(Ham[i][j] * conj(fExpBuffer));
874
875 Ham[i][j] -= 2 * fSinBuffer * real(Ham[i][j] * conj(fExpBuffer)) *
876 fSinBuffer * fExpBuffer;
877 Ham[i][j] +=
878 fSinBuffer * fCosBuffer * (fHmsBufferD - fHmsBufferC) * fExpBuffer;
879 }
880 // First rotation on j (No top columns)
881 else {
882 // Middle rows and columns
883 for (int k = i + 1; k < j; k++) {
884 Ham[k][j] = -conj(Ham[i][k]) * fSinBuffer * fExpBuffer;
885
886 Ham[i][k] *= fCosBuffer;
887 }
888
889 // Nodes ij
890 fHmsBufferD = real(Ham[i][i]);
891
892 Ham[i][j] =
893 fSinBuffer * fCosBuffer * (Ham[j][j] - fHmsBufferD) * fExpBuffer;
894
895 Ham[i][i] *= fCosBuffer * fCosBuffer;
896 Ham[i][i] += fSinBuffer * Ham[j][j] * fSinBuffer;
897
898 Ham[j][j] *= fCosBuffer * fCosBuffer;
899 Ham[j][j] += fSinBuffer * fHmsBufferD * fSinBuffer;
900 }
901 }
902 // Without Delta (No middle rows or columns: j = i+1)
903 else {
904 // General case
905 if (i > 0) {
906 // Top columns
907 for (int k = 0; k < i; k++) {
908 fHmsBufferC = Ham[k][i];
909
910 Ham[k][i] *= fCosBuffer;
911 Ham[k][i] += Ham[k][j] * fSinBuffer;
912
913 Ham[k][j] *= fCosBuffer;
914 Ham[k][j] -= fHmsBufferC * fSinBuffer;
915 }
916
917 // Nodes ij
918 fHmsBufferC = Ham[i][i];
919 fHmsBufferD = real(Ham[j][j]);
920
921 Ham[i][i] *= fCosBuffer * fCosBuffer;
922 Ham[i][i] += 2 * fSinBuffer * fCosBuffer * real(Ham[i][j]);
923 Ham[i][i] += fSinBuffer * Ham[j][j] * fSinBuffer;
924
925 Ham[j][j] *= fCosBuffer * fCosBuffer;
926 Ham[j][j] += fSinBuffer * fHmsBufferC * fSinBuffer;
927 Ham[j][j] -= 2 * fSinBuffer * fCosBuffer * real(Ham[i][j]);
928
929 Ham[i][j] -= 2 * fSinBuffer * real(Ham[i][j]) * fSinBuffer;
930 Ham[i][j] += fSinBuffer * fCosBuffer * (fHmsBufferD - fHmsBufferC);
931 }
932 // First rotation (theta12)
933 else {
934 Ham[i][j] = fSinBuffer * fCosBuffer * Ham[j][j];
935
936 Ham[i][i] = fSinBuffer * Ham[j][j] * fSinBuffer;
937
938 Ham[j][j] *= fCosBuffer * fCosBuffer;
939 }
940 }
941}
std::complex< double > complexD
Definition: Definitions.h:21

References OscProb::PMNS_Base::fDelta, and OscProb::PMNS_Base::fTheta.

Referenced by OscProb::PMNS_Base::BuildHms(), OscProb::PMNS_Decay::BuildHms(), and OscProb::PMNS_SNSI::BuildHms().

◆ RotateState() [1/3]

void PMNS_DensityMatrix::RotateState ( bool  to_basis,
matrixC  U 
)
protectedvirtualinherited

Rotate the density matrix to or from a basis given by U

Parameters
to_basis- true if to the given basis
U- the rotation matrix to the given basis

Definition at line 45 of file PMNS_DensityMatrix.cxx.

46{
47 // buffer = rho . U
48 for (int i = 0; i < fNumNus; i++) {
49 for (int j = 0; j < fNumNus; j++) {
50 fMBuffer[i][j] = 0;
51 for (int k = 0; k < fNumNus; k++) {
52 if (to_basis)
53 fMBuffer[i][j] += fRho[i][k] * U[k][j];
54 else
55 fMBuffer[i][j] += fRho[i][k] * conj(U[j][k]);
56 }
57 }
58 }
59
60 // rho = U^\dagger . buffer = U^\dagger . rho . U
61 // Final matrix is Hermitian, so copy upper to lower triangle
62 for (int i = 0; i < fNumNus; i++) {
63 for (int j = i; j < fNumNus; j++) {
64 fRho[i][j] = 0;
65 for (int k = 0; k < fNumNus; k++) {
66 if (to_basis)
67 fRho[i][j] += conj(U[k][i]) * fMBuffer[k][j];
68 else
69 fRho[i][j] += U[i][k] * fMBuffer[k][j];
70 }
71 if (j > i) fRho[j][i] = conj(fRho[i][j]);
72 }
73 }
74}
matrixC fMBuffer
Some memory buffer for matrix operations.

References OscProb::PMNS_DensityMatrix::fMBuffer, OscProb::PMNS_Base::fNumNus, and OscProb::PMNS_DensityMatrix::fRho.

Referenced by OscProb::PMNS_Deco::PropagatePath(), and RotateState().

◆ RotateState() [2/3]

void PMNS_OQS::RotateState ( bool  to_mass)
protectedvirtual

Rotate the density matrix to or from the mass basis.

Parameters
to_mass- true if to mass basis.

Definition at line 453 of file PMNS_OQS.cxx.

454{
455 BuildHms();
456 if (!to_mass) UpdateRho();
458 if (to_mass) BuildR();
459}
virtual void RotateState(bool to_basis, matrixC U)
Rotate rho to/from a given basis.
virtual void BuildR()
Build Gell-Mann representation of density matrix.
Definition: PMNS_OQS.cxx:439
virtual void UpdateRho()
Update density matrix from Gell-Mann representation.
Definition: PMNS_OQS.cxx:445

References BuildHms(), BuildR(), fUM, OscProb::PMNS_DensityMatrix::RotateState(), and UpdateRho().

Referenced by ProbMatrix(), and Propagate().

◆ RotateState() [3/3]

void PMNS_Base::RotateState ( int  i,
int  j 
)
protectedvirtualinherited

Rotate the neutrino state by the angle theta_ij and phase delta_ij.

Parameters
i,j- the indices of the rotation ij

Definition at line 760 of file PMNS_Base.cxx.

761{
762 // Do nothing if angle is zero
763 if (fTheta[i][j] == 0) return;
764
765 double sij = sin(fTheta[i][j]);
766 double cij = cos(fTheta[i][j]);
767
768 complexD buffer;
769
770 if (i + 1 == j || fDelta[i][j] == 0) {
771 buffer = cij * fNuState[i] + sij * fNuState[j];
772 fNuState[j] = cij * fNuState[j] - sij * fNuState[i];
773 }
774 else {
775 complexD eij = complexD(cos(fDelta[i][j]), -sin(fDelta[i][j]));
776 buffer = cij * fNuState[i] + sij * eij * fNuState[j];
777 fNuState[j] = cij * fNuState[j] - sij * conj(eij) * fNuState[i];
778 }
779
780 fNuState[i] = buffer;
781}

References OscProb::PMNS_Base::fDelta, OscProb::PMNS_Base::fNuState, and OscProb::PMNS_Base::fTheta.

Referenced by OscProb::PMNS_Base::GetMassEigenstate().

◆ SetAngle()

void PMNS_Base::SetAngle ( int  i,
int  j,
double  th 
)
virtualinherited

Set the mixing angle theta_ij in radians.

Requires that i<j. Will notify you if input is wrong. If i>j, will assume reverse order and swap i and j.

This will check if value is changing to keep track of whether the hamiltonian needs to be rebuilt.

Parameters
i,j- the indices of theta_ij
th- the value of theta_ij

Definition at line 539 of file PMNS_Base.cxx.

540{
541 if (i > j) {
542 cerr << "WARNING: First argument should be smaller than second argument"
543 << endl
544 << " Setting reverse order (Theta" << j << i << "). " << endl;
545 int temp = i;
546 i = j;
547 j = temp;
548 }
549 if (i < 1 || i > fNumNus - 1 || j < 2 || j > fNumNus) {
550 cerr << "ERROR: Theta" << i << j << " not valid for " << fNumNus
551 << " neutrinos. Doing nothing." << endl;
552 return;
553 }
554
555 // Check if value is actually changing
556 fBuiltHms *= (fTheta[i - 1][j - 1] == th);
557
558 fTheta[i - 1][j - 1] = th;
559}

References OscProb::PMNS_Base::fBuiltHms, OscProb::PMNS_Base::fNumNus, and OscProb::PMNS_Base::fTheta.

Referenced by GetSterile(), OscProb::PMNS_Decay::SetMix(), OscProb::PMNS_Fast::SetMix(), SetNominalPars(), and OscProb::PMNS_Base::SetStdPars().

◆ SetAtt() [1/2]

void PMNS_Base::SetAtt ( double  att,
int  idx 
)
protectedvirtualinherited

Set some single path attribute.

An auxiliary function to set individual attributes in a single path.

If the path sequence is not a single path, a new single path will be created and the previous sequence will be lost. Use with care.

Parameters
att- The value of the attribute
idx- The index of the attribute (0,1,2,3) = (L, Rho, Z/A, Layer)

Definition at line 364 of file PMNS_Base.cxx.

365{
366 if (fNuPaths.size() != 1) {
367 cerr << "WARNING: Clearing path vector and starting new single path."
368 << endl
369 << "To avoid possible issues, use the SetPath function." << endl;
370
371 SetStdPath();
372 }
373
374 switch (idx) {
375 case 0: fNuPaths[0].length = att; break;
376 case 1: fNuPaths[0].density = att; break;
377 case 2: fNuPaths[0].zoa = att; break;
378 case 3: fNuPaths[0].layer = att; break;
379 }
380}
virtual void SetStdPath()
Set standard neutrino path.
Definition: PMNS_Base.cxx:205

References OscProb::PMNS_Base::fNuPaths, and OscProb::PMNS_Base::SetStdPath().

Referenced by OscProb::PMNS_Base::SetDensity(), OscProb::PMNS_Base::SetLayers(), OscProb::PMNS_Base::SetLength(), and OscProb::PMNS_Base::SetZoA().

◆ SetAtt() [2/2]

void PMNS_Base::SetAtt ( vectorD  att,
int  idx 
)
protectedvirtualinherited

Set all values of a path attribute.

An auxiliary function to set individual attributes in a path sequence.

If the path sequence is of a different size, a new path sequence will be created and the previous sequence will be lost. Use with care.

Parameters
att- The values of the attribute
idx- The index of the attribute (0,1,2,3) = (L, Rho, Z/A, Layer)

Definition at line 427 of file PMNS_Base.cxx.

428{
429 // Get the sizes of the attribute and
430 // path sequence vectors
431 int nA = att.size();
432 int nP = fNuPaths.size();
433
434 // If the vector sizes are equal, update this attribute
435 if (nA == nP) {
436 for (int i = 0; i < nP; i++) {
437 switch (idx) {
438 case 0: fNuPaths[i].length = att[i]; break;
439 case 1: fNuPaths[i].density = att[i]; break;
440 case 2: fNuPaths[i].zoa = att[i]; break;
441 case 3: fNuPaths[i].layer = att[i]; break;
442 }
443 }
444 }
445 // If the vector sizes differ, create a new path sequence
446 // and set value for this attribute. Other attributes will
447 // be taken from default single path.
448 else {
449 cerr << "WARNING: New vector size. Starting new path vector." << endl
450 << "To avoid possible issues, use the SetPath function." << endl;
451
452 // Start a new standard path just
453 // to set default values
454 SetStdPath();
455
456 // Create a path segment with default values
457 NuPath p = fNuPaths[0];
458
459 // Clear the path sequence
460 ClearPath();
461
462 // Set this particular attribute's value
463 // and add the path segment to the sequence
464 for (int i = 0; i < nA; i++) {
465 switch (idx) {
466 case 0: p.length = att[i]; break;
467 case 1: p.density = att[i]; break;
468 case 2: p.zoa = att[i]; break;
469 case 3: p.layer = att[i]; break;
470 }
471
472 AddPath(p);
473 }
474 }
475}
virtual void ClearPath()
Clear the path vector.
Definition: PMNS_Base.cxx:287
int layer
An index to identify the matter type.
Definition: NuPath.h:81

References OscProb::PMNS_Base::AddPath(), OscProb::PMNS_Base::ClearPath(), OscProb::NuPath::density, OscProb::PMNS_Base::fNuPaths, OscProb::NuPath::layer, OscProb::NuPath::length, OscProb::PMNS_Base::SetStdPath(), and OscProb::NuPath::zoa.

◆ SetAvgProbPrec()

void PMNS_Base::SetAvgProbPrec ( double  prec)
virtualinherited

Set the precision for the AvgProb method

Parameters
prec- AvgProb precision

Definition at line 1962 of file PMNS_Base.cxx.

1963{
1964 if (prec < 1e-8) {
1965 cerr << "WARNING: Cannot set AvgProb precision lower that 1e-8."
1966 << "Setting to 1e-8." << endl;
1967 prec = 1e-8;
1968 }
1969 fAvgProbPrec = prec;
1970}

References OscProb::PMNS_Base::fAvgProbPrec.

Referenced by OscProb::PMNS_Base::PMNS_Base().

◆ SetCurPath()

void PMNS_Base::SetCurPath ( NuPath  p)
protectedvirtualinherited

Set the path currentlyin use by the class.

This will be used to know what path to propagate through next.

It will also check if values are changing to keep track of whether the eigensystem needs to be recomputed.

Parameters
p- A neutrino path segment

Definition at line 274 of file PMNS_Base.cxx.

275{
276 // Check if relevant value are actually changing
277 fGotES *= (fPath.density == p.density);
278 fGotES *= (fPath.zoa == p.zoa);
279
280 fPath = p;
281}
bool fGotES
Tag to avoid recalculating eigensystem.
Definition: PMNS_Base.h:299

References OscProb::NuPath::density, OscProb::PMNS_Base::fGotES, OscProb::PMNS_Base::fPath, and OscProb::NuPath::zoa.

Referenced by OscProb::PMNS_Base::AvgProbLoE(), OscProb::PMNS_Base::AvgProbMatrixLoE(), OscProb::PMNS_Base::AvgProbVectorLoE(), BuildHVMB(), OscProb::PMNS_Base::ConvertEtoLoE(), OscProb::PMNS_Base::PropagatePath(), OscProb::PMNS_Decay::PropagatePath(), and OscProb::PMNS_Deco::PropagatePath().

◆ SetDecoAngle()

void PMNS_OQS::SetDecoAngle ( int  i,
int  j,
double  th 
)
virtual

Set angle between two decoherence vectors a_i and a_j.

Parameters
i- First index in GM representation in range [1, 8].
j- Second index in GM representation in range [2, 8].
th- Angle in radians.

Definition at line 75 of file PMNS_OQS.cxx.

76{
77 THROW_ON_INVALID_ARG(i > 0, i);
79 THROW_ON_INVALID_ARG(j > 0, i);
81 THROW_ON_INVALID_ARG(i != j, i, j);
82
83 double val = cos(th);
84 fBuiltDissipator *= (fcos[i][j] == val);
85 fcos[i][j] = val;
86 fcos[j][i] = val;
87}

References fBuiltDissipator, fcos, SU3_DIM, and THROW_ON_INVALID_ARG.

Referenced by GetOQS().

◆ SetDecoElement()

void PMNS_OQS::SetDecoElement ( int  i,
double  val 
)
virtual

Set the value of decoherence parameter |a_i| in Gell-Mann representation.

Parameters
i- Index of the parameter in range [1, 8].
val- Value to assign.

Definition at line 58 of file PMNS_OQS.cxx.

59{
60 THROW_ON_INVALID_ARG(i > 0, i);
62
63 fBuiltDissipator *= (fa[i] == abs(val));
64 fa[i] = abs(val);
65}

References fa, fBuiltDissipator, SU3_DIM, and THROW_ON_INVALID_ARG.

Referenced by GetOQS().

◆ SetDelta()

void PMNS_Base::SetDelta ( int  i,
int  j,
double  delta 
)
virtualinherited

Set the CP phase delta_ij in radians.

Requires that i+1<j. Will notify you if input is wrong. If i>j, will assume reverse order and swap i and j.

This will check if value is changing to keep track of whether the hamiltonian needs to be rebuilt.

Parameters
i,j- the indices of delta_ij
delta- the value of delta_ij

Definition at line 602 of file PMNS_Base.cxx.

603{
604 if (i > j) {
605 cerr << "WARNING: First argument should be smaller than second argument"
606 << endl
607 << " Setting reverse order (Delta" << j << i << "). " << endl;
608 int temp = i;
609 i = j;
610 j = temp;
611 }
612 if (i < 1 || i > fNumNus - 1 || j < 2 || j > fNumNus) {
613 cerr << "ERROR: Delta" << i << j << " not valid for " << fNumNus
614 << " neutrinos. Doing nothing." << endl;
615 return;
616 }
617 if (i + 1 == j) {
618 cerr << "WARNING: Rotation " << i << j << " is real. Doing nothing."
619 << endl;
620 return;
621 }
622
623 // Check if value is actually changing
624 fBuiltHms *= (fDelta[i - 1][j - 1] == delta);
625
626 fDelta[i - 1][j - 1] = delta;
627}

References OscProb::PMNS_Base::fBuiltHms, OscProb::PMNS_Base::fDelta, and OscProb::PMNS_Base::fNumNus.

Referenced by OscProb::PMNS_Decay::SetMix(), OscProb::PMNS_Fast::SetMix(), and SetNominalPars().

◆ SetDeltaMsqrs()

void PMNS_Fast::SetDeltaMsqrs ( double  dm21,
double  dm32 
)
virtualinherited

Set both mass-splittings at once.

These are Dm_21 and Dm_32 in eV^2.
The corresponding Dm_31 is set in the class attributes.

Parameters
dm21- The solar mass-splitting Dm_21
dm32- The atmospheric mass-splitting Dm_32

Definition at line 55 of file PMNS_Fast.cxx.

56{
57 SetDm(2, dm21);
58 SetDm(3, dm32 + dm21);
59}
virtual void SetDm(int j, double dm)
Set the mass-splitting dm_j1 in eV^2.
Definition: PMNS_Base.cxx:674

References OscProb::PMNS_Base::SetDm().

◆ SetDensity() [1/2]

void PMNS_Base::SetDensity ( double  rho)
virtualinherited

Set single path density.

If the path sequence is not a single path, a new single path will be created and the previous sequence will be lost. Use with care.

Parameters
rho- The density of the path segment in g/cm^3

Definition at line 402 of file PMNS_Base.cxx.

402{ SetAtt(rho, 1); }
virtual void SetAtt(double att, int idx)
Set one of the path attributes.
Definition: PMNS_Base.cxx:364

References OscProb::PMNS_Base::SetAtt().

◆ SetDensity() [2/2]

void PMNS_Base::SetDensity ( vectorD  rho)
virtualinherited

Set multiple path densities.

If the path sequence is of a different size, a new path sequence will be created and the previous sequence will be lost. Use with care.

Parameters
rho- The densities of the path segments in g/cm^3

Definition at line 497 of file PMNS_Base.cxx.

497{ SetAtt(rho, 1); }

References OscProb::PMNS_Base::SetAtt().

◆ SetDm()

void PMNS_Base::SetDm ( int  j,
double  dm 
)
virtualinherited

Set the mass-splitting dm_j1 = (m_j^2 - m_1^2) in eV^2

Requires that j>1. Will notify you if input is wrong.

This will check if value is changing to keep track of whether the hamiltonian needs to be rebuilt.

Parameters
j- the index of dm_j1
dm- the value of dm_j1

Definition at line 674 of file PMNS_Base.cxx.

675{
676 if (j < 2 || j > fNumNus) {
677 cerr << "ERROR: Dm" << j << "1 not valid for " << fNumNus
678 << " neutrinos. Doing nothing." << endl;
679 return;
680 }
681
682 // Check if value is actually changing
683 fBuiltHms *= (fDm[j - 1] == dm);
684
685 fDm[j - 1] = dm;
686}

References OscProb::PMNS_Base::fBuiltHms, OscProb::PMNS_Base::fDm, and OscProb::PMNS_Base::fNumNus.

Referenced by GetSterile(), OscProb::PMNS_Decay::SetDeltaMsqrs(), OscProb::PMNS_Fast::SetDeltaMsqrs(), SetNominalPars(), and OscProb::PMNS_Base::SetStdPars().

◆ SetEnergy()

void PMNS_Base::SetEnergy ( double  E)
virtualinherited

Set neutrino energy in GeV.

This will check if value is changing to keep track of whether the eigensystem needs to be recomputed.

Parameters
E- The neutrino energy in GeV

Definition at line 226 of file PMNS_Base.cxx.

227{
228 // Check if value is actually changing
229 fGotES *= (fEnergy == E);
230
231 fEnergy = E;
232}

References OscProb::PMNS_Base::fEnergy, and OscProb::PMNS_Base::fGotES.

Referenced by OscProb::PMNS_Base::AvgProbLoE(), OscProb::PMNS_Base::AvgProbMatrixLoE(), OscProb::PMNS_Base::AvgProbVectorLoE(), OscProb::PMNS_Base::PMNS_Base(), OscProb::PMNS_Base::Prob(), OscProb::PMNS_Base::ProbMatrix(), and OscProb::PMNS_Base::ProbVector().

◆ SetInitialRho()

void PMNS_DensityMatrix::SetInitialRho ( matrixC  rho_in)
protectedvirtualinherited

Set the density matrix from an arbitrary initial matrix

The initial matrix needs to satisfy the basic conditions:

  • Hermitian matrix
  • Trace = 1
  • Positive semidefinite
Parameters
rho_in- The initial density matrix in flavour basis.

Definition at line 150 of file PMNS_DensityMatrix.cxx.

151{
152 assert(rho_in.size() == fNumNus);
153 assert(rho_in[0].size() == fNumNus);
154
155 double eps = 1e-12;
156
157 double trace = 0;
158 complexD rho_array[3][3];
159 for (int i = 0; i < fNumNus; i++) {
160 trace += abs(rho_in[i][i]);
161 for (int j = i; j < fNumNus; j++) {
162 // Ensure rho_in is hermitian
163 assert(abs(rho_in[i][j] - conj(rho_in[j][i])) < eps);
164 rho_array[i][j] = rho_in[i][j];
165 }
166 }
167
168 // Ensure rho_in has trace 1
169 assert(abs(trace - 1) < eps);
170
171 double fEvalGLoBES[3];
172 complexD fEvecGLoBES[3][3];
173
174 // Find the eigenvalues of rho_in
175 zheevh3(rho_array, fEvecGLoBES, fEvalGLoBES);
176
177 // Ensure rho_in is positive definite
178 for (int i = 0; i < fNumNus; i++) assert(fEvalGLoBES[i] >= -eps);
179
180 fRho = rho_in;
181}
int zheevh3(std::complex< double > A[3][3], std::complex< double > Q[3][3], double w[3])
Definition: zheevh3.cxx:31

References OscProb::PMNS_Base::fNumNus, OscProb::PMNS_DensityMatrix::fRho, and zheevh3().

◆ SetIsNuBar()

void PMNS_OQS::SetIsNuBar ( bool  isNuBar)
virtual

Reimplement from PMNS_Base flagging to rebuild Hamiltonian.

Parameters
isNuBar- Flag for anti-neutrinos.

Reimplemented from OscProb::PMNS_Base.

Definition at line 177 of file PMNS_OQS.cxx.

178{
179 fBuiltHms *= (fIsNuBar == isNuBar);
180 PMNS_Base::SetIsNuBar(isNuBar);
181}
virtual void SetIsNuBar(bool isNuBar)
Set the anti-neutrino flag.
Definition: PMNS_Base.cxx:243

References OscProb::PMNS_Base::fBuiltHms, OscProb::PMNS_Base::fIsNuBar, and OscProb::PMNS_Base::SetIsNuBar().

◆ SetLayers()

void PMNS_Base::SetLayers ( std::vector< int >  lay)
virtualinherited

Set multiple path layer indices.

If the path sequence is of a different size, a new path sequence will be created and the previous sequence will be lost. Use with care.

Parameters
lay- Indices to identify the layer types (e.g. earth inner core)

Definition at line 519 of file PMNS_Base.cxx.

520{
521 vectorD lay_double(lay.begin(), lay.end());
522
523 SetAtt(lay_double, 3);
524}

References OscProb::PMNS_Base::SetAtt().

◆ SetLength() [1/2]

void PMNS_Base::SetLength ( double  L)
virtualinherited

Set the length for a single path.

If the path sequence is not a single path, a new single path will be created and the previous sequence will be lost. Use with care.

Parameters
L- The length of the path segment in km

Definition at line 391 of file PMNS_Base.cxx.

391{ SetAtt(L, 0); }

References OscProb::PMNS_Base::SetAtt().

Referenced by OscProb::PMNS_Base::Prob(), OscProb::PMNS_Base::ProbMatrix(), and OscProb::PMNS_Base::ProbVector().

◆ SetLength() [2/2]

void PMNS_Base::SetLength ( vectorD  L)
virtualinherited

Set multiple path lengths.

If the path sequence is of a different size, a new path sequence will be created and the previous sequence will be lost. Use with care.

Parameters
L- The lengths of the path segments in km

Definition at line 486 of file PMNS_Base.cxx.

486{ SetAtt(L, 0); }

References OscProb::PMNS_Base::SetAtt().

◆ SetMaxCache()

void PMNS_Base::SetMaxCache ( int  mc = 1e6)
virtualinherited

Set maximum number of cached eigensystems. Finding eigensystems can become slow and take up memory. This protects the cache from becoming too large.

Parameters
mc- Max cache size (default: 1e6)

Definition at line 128 of file PMNS_Base.cxx.

128{ fMaxCache = mc; }

References OscProb::PMNS_Base::fMaxCache.

◆ SetMix()

void PMNS_Fast::SetMix ( double  th12,
double  th23,
double  th13,
double  deltacp 
)
virtualinherited

Set all mixing parameters at once.

Parameters
th12- The value of the mixing angle theta_12
th23- The value of the mixing angle theta_23
th13- The value of the mixing angle theta_13
deltacp- The value of the CP phase delta_13

Definition at line 37 of file PMNS_Fast.cxx.

38{
39 SetAngle(1, 2, th12);
40 SetAngle(1, 3, th13);
41 SetAngle(2, 3, th23);
42 SetDelta(1, 3, deltacp);
43}
virtual void SetDelta(int i, int j, double delta)
Set the CP phase delta_ij.
Definition: PMNS_Base.cxx:602
virtual void SetAngle(int i, int j, double th)
Set the mixing angle theta_ij.
Definition: PMNS_Base.cxx:539

References OscProb::PMNS_Base::SetAngle(), and OscProb::PMNS_Base::SetDelta().

◆ SetPath() [1/3]

void PMNS_Base::SetPath ( double  length,
double  density,
double  zoa = 0.5,
int  layer = 0 
)
virtualinherited

Set a single path defining attributes directly.

This destroys the current path sequence and creates a new first path.

Parameters
length- The length of the path segment in km
density- The density of the path segment in g/cm^3
zoa- The effective Z/A of the path segment
layer- An index to identify the layer type (e.g. earth inner core)

Definition at line 347 of file PMNS_Base.cxx.

348{
349 SetPath(NuPath(length, density, zoa, layer));
350}
virtual void SetPath(NuPath p)
Set a single path.
Definition: PMNS_Base.cxx:330

References OscProb::PMNS_Base::SetPath().

◆ SetPath() [2/3]

void PMNS_Base::SetPath ( NuPath  p)
virtualinherited

Set a single path.

This destroys the current path sequence and creates a new first path.

Parameters
p- A neutrino path segment

Definition at line 330 of file PMNS_Base.cxx.

331{
332 ClearPath();
333 AddPath(p);
334}

References OscProb::PMNS_Base::AddPath(), and OscProb::PMNS_Base::ClearPath().

Referenced by OscProb::PMNS_Base::SetPath(), OscProb::PMNS_Base::SetStdPath(), and SetTestPath().

◆ SetPath() [3/3]

void PMNS_Base::SetPath ( std::vector< NuPath paths)
virtualinherited

Set vector of neutrino paths.

Parameters
paths- A sequence of neutrino paths

Definition at line 294 of file PMNS_Base.cxx.

294{ fNuPaths = paths; }

References OscProb::PMNS_Base::fNuPaths.

◆ SetPower()

void PMNS_OQS::SetPower ( int  n)
virtual

Set power-law index for the energy dependence of decoherence parameters.

Set the power-law index for the energy dependence of decoherence parameters.

Parameters
n- Power-law index.

Definition at line 49 of file PMNS_OQS.cxx.

49{ fPower = n; }

References fPower.

Referenced by PMNS_OQS().

◆ SetPureState()

void PMNS_DensityMatrix::SetPureState ( vectorC  nu_in)
protectedvirtualinherited

Set the density matrix from a pure state

Parameters
nu_in- The neutrino initial state in flavour basis.

Reimplemented from OscProb::PMNS_Base.

Definition at line 128 of file PMNS_DensityMatrix.cxx.

129{
130 assert(nu_in.size() == fNumNus);
131
132 for (int i = 0; i < fNumNus; i++) {
133 for (int j = 0; j < fNumNus; j++) {
134 fRho[i][j] = conj(nu_in[i]) * nu_in[j];
135 }
136 }
137}

References OscProb::PMNS_Base::fNumNus, and OscProb::PMNS_DensityMatrix::fRho.

◆ SetStdPars()

void PMNS_Base::SetStdPars ( )
virtualinherited

Set standard oscillation parameters from PDG 2015.

For two neutrinos, Dm is set to the muon disappearance effective mass-splitting and mixing angle.

Definition at line 177 of file PMNS_Base.cxx.

178{
179 if (fNumNus > 2) {
180 // PDG values for 3 neutrinos
181 // Also applicable for 3+N neutrinos
182 SetAngle(1, 2, asin(sqrt(0.304)));
183 SetAngle(1, 3, asin(sqrt(0.0219)));
184 SetAngle(2, 3, asin(sqrt(0.514)));
185 SetDm(2, 7.53e-5);
186 SetDm(3, 2.52e-3);
187 }
188 else if (fNumNus == 2) {
189 // Effective muon disappearance values
190 // for two-flavour approximation
191 SetAngle(1, 2, 0.788);
192 SetDm(2, 2.47e-3);
193 }
194}

References OscProb::PMNS_Base::fNumNus, OscProb::PMNS_Base::SetAngle(), and OscProb::PMNS_Base::SetDm().

Referenced by OscProb::PMNS_Base::PMNS_Base().

◆ SetStdPath()

void PMNS_Base::SetStdPath ( )
virtualinherited

Set standard single path.

Length is 1000 km, so ~2 GeV peak energy.

Density is approximate from CRUST2.0 (~2.8 g/cm^3). Z/A is set to a round 0.5.

Definition at line 205 of file PMNS_Base.cxx.

206{
207 NuPath p;
208
209 p.length = 1000; // 1000 km default
210 p.density = 2.8; // Crust density
211 p.zoa = 0.5; // Crust Z/A
212 p.layer = 0; // Single layer
213
214 SetPath(p);
215}

References OscProb::NuPath::density, OscProb::NuPath::layer, OscProb::NuPath::length, OscProb::PMNS_Base::SetPath(), and OscProb::NuPath::zoa.

Referenced by OscProb::PMNS_Base::PMNS_Base(), OscProb::PMNS_LIV::PMNS_LIV(), OscProb::PMNS_NSI::PMNS_NSI(), OscProb::PMNS_NUNM::PMNS_NUNM(), and OscProb::PMNS_Base::SetAtt().

◆ SetUseCache()

void PMNS_Base::SetUseCache ( bool  u = true)
virtualinherited

Turn on/off caching of eigensystems. This can save a lot of CPU time by avoiding recomputing eigensystems if we've already seen them recently. Especially useful when running over multiple earth layers and even more if multiple baselines will be computed, e.g. for atmospheric neutrinos.

Parameters
u- flag to set caching on (default: true)

Definition at line 105 of file PMNS_Base.cxx.

105{ fUseCache = u; }

References OscProb::PMNS_Base::fUseCache.

Referenced by OscProb::PMNS_Base::PMNS_Base().

◆ SetVacuumEigensystem()

void PMNS_Fast::SetVacuumEigensystem ( )
protectedvirtualinherited

Set the eigensystem to the analytic solution in vacuum.

We know the vacuum eigensystem, so just write it explicitly

Definition at line 154 of file PMNS_Fast.cxx.

155{
156 double s12, s23, s13, c12, c23, c13;
157 complexD idelta(0.0, fDelta[0][2]);
158 if (fIsNuBar) idelta = conj(idelta);
159
160 s12 = sin(fTheta[0][1]);
161 s23 = sin(fTheta[1][2]);
162 s13 = sin(fTheta[0][2]);
163 c12 = cos(fTheta[0][1]);
164 c23 = cos(fTheta[1][2]);
165 c13 = cos(fTheta[0][2]);
166
167 fEvec[0][0] = c12 * c13;
168 fEvec[0][1] = s12 * c13;
169 fEvec[0][2] = s13 * exp(-idelta);
170
171 fEvec[1][0] = -s12 * c23 - c12 * s23 * s13 * exp(idelta);
172 fEvec[1][1] = c12 * c23 - s12 * s23 * s13 * exp(idelta);
173 fEvec[1][2] = s23 * c13;
174
175 fEvec[2][0] = s12 * s23 - c12 * c23 * s13 * exp(idelta);
176 fEvec[2][1] = -c12 * s23 - s12 * c23 * s13 * exp(idelta);
177 fEvec[2][2] = c23 * c13;
178
179 fEval[0] = 0;
180 fEval[1] = fDm[1] / (2 * kGeV2eV * fEnergy);
181 fEval[2] = fDm[2] / (2 * kGeV2eV * fEnergy);
182}

References OscProb::PMNS_Base::fDelta, OscProb::PMNS_Base::fDm, OscProb::PMNS_Base::fEnergy, OscProb::PMNS_Base::fEval, OscProb::PMNS_Base::fEvec, OscProb::PMNS_Base::fIsNuBar, OscProb::PMNS_Base::fTheta, and OscProb::PMNS_Base::kGeV2eV.

Referenced by BuildHms(), OscProb::PMNS_Fast::SolveHam(), and OscProb::PMNS_Iter::SolveHam().

◆ SetZoA() [1/2]

void PMNS_Base::SetZoA ( double  zoa)
virtualinherited

Set single path Z/A.

If the path sequence is not a single path, a new single path will be created and the previous sequence will be lost. Use with care.

Parameters
zoa- The effective Z/A of the path segment

Definition at line 413 of file PMNS_Base.cxx.

413{ SetAtt(zoa, 2); }

References OscProb::PMNS_Base::SetAtt().

◆ SetZoA() [2/2]

void PMNS_Base::SetZoA ( vectorD  zoa)
virtualinherited

Set multiple path Z/A values.

If the path sequence is of a different size, a new path sequence will be created and the previous sequence will be lost. Use with care.

Parameters
zoa- The effective Z/A of the path segments

Definition at line 508 of file PMNS_Base.cxx.

508{ SetAtt(zoa, 2); }

References OscProb::PMNS_Base::SetAtt().

◆ SolveHam()

void PMNS_Fast::SolveHam ( )
protectedvirtualinherited

Solve the full Hamiltonian for eigenvectors and eigenvalues.

If vacuum, just use the PMNS matrix, otherwise solve in Matter using GLoBES.

Implements OscProb::PMNS_Base.

Reimplemented in OscProb::PMNS_Iter, and OscProb::PMNS_LIV.

Definition at line 98 of file PMNS_Fast.cxx.

99{
100 // Do vacuum oscillation in low density
101 if (fPath.density < 1.0e-6) {
103 return;
104 }
105
107}
virtual void SolveHamMatter()
Solve the full Hamiltonian in matter.
Definition: PMNS_Fast.cxx:117

References OscProb::NuPath::density, OscProb::PMNS_Base::fPath, OscProb::PMNS_Fast::SetVacuumEigensystem(), and OscProb::PMNS_Fast::SolveHamMatter().

Referenced by OscProb::PMNS_Deco::PropagatePath(), and PropagatePath().

◆ SolveHamMatter()

void PMNS_Fast::SolveHamMatter ( )
protectedvirtualinherited

Solve the full Hamiltonian for eigenvectors and eigenvalues.

This is using a method from the GLoBES software available at http://www.mpi-hd.mpg.de/personalhomes/globes/3x3/
We should cite them accordingly

Definition at line 117 of file PMNS_Fast.cxx.

118{
119 // Build Hamiltonian
120 BuildHms();
121
122 // Check if anything changed
123 if (fGotES) return;
124
125 // Try caching if activated
126 if (TryCache()) return;
127
128 UpdateHam();
129
130 double fEvalGLoBES[3];
131 complexD fEvecGLoBES[3][3];
132
133 // Solve Hamiltonian for eigensystem using the GLoBES method
134 zheevh3(fHam, fEvecGLoBES, fEvalGLoBES);
135
136 // Fill fEval and fEvec vectors from GLoBES arrays
137 for (int i = 0; i < fNumNus; i++) {
138 fEval[i] = fEvalGLoBES[i];
139 for (int j = 0; j < fNumNus; j++) { fEvec[i][j] = fEvecGLoBES[i][j]; }
140 }
141
142 fGotES = true;
143
144 // Fill cache if activated
145 FillCache();
146}
virtual void FillCache()
Cache the current eigensystem.
Definition: PMNS_Base.cxx:157
virtual bool TryCache()
Try to find a cached eigensystem.
Definition: PMNS_Base.cxx:134
virtual void UpdateHam()
Build the full Hamiltonian.
Definition: PMNS_Fast.cxx:69
complexD fHam[3][3]
The full hamiltonian.
Definition: PMNS_Fast.h:64

References OscProb::PMNS_Base::BuildHms(), OscProb::PMNS_Base::fEval, OscProb::PMNS_Base::fEvec, OscProb::PMNS_Base::fGotES, OscProb::PMNS_Fast::fHam, OscProb::PMNS_Base::FillCache(), OscProb::PMNS_Base::fNumNus, OscProb::PMNS_Base::TryCache(), OscProb::PMNS_Fast::UpdateHam(), and zheevh3().

Referenced by OscProb::PMNS_Fast::SolveHam(), and OscProb::PMNS_LIV::SolveHam().

◆ TryCache()

bool PMNS_Base::TryCache ( )
protectedvirtualinherited

Try to find a cached version of this eigensystem.

Definition at line 134 of file PMNS_Base.cxx.

135{
136 if (fUseCache && !fMixCache.empty()) {
138
139 unordered_set<EigenPoint>::iterator it = fMixCache.find(fProbe);
140
141 if (it != fMixCache.end()) {
142 for (int i = 0; i < fNumNus; i++) {
143 fEval[i] = (*it).fEval[i] * (*it).fEnergy / fEnergy;
144 for (int j = 0; j < fNumNus; j++) { fEvec[i][j] = (*it).fEvec[i][j]; }
145 }
146 return true;
147 }
148 }
149
150 return false;
151}

References OscProb::PMNS_Base::fEnergy, OscProb::PMNS_Base::fEval, OscProb::PMNS_Base::fEvec, OscProb::PMNS_Base::fIsNuBar, OscProb::PMNS_Base::fMixCache, OscProb::PMNS_Base::fNumNus, OscProb::PMNS_Base::fPath, OscProb::PMNS_Base::fProbe, OscProb::PMNS_Base::fUseCache, and OscProb::EigenPoint::SetVars().

Referenced by OscProb::PMNS_Sterile::SolveHam(), and OscProb::PMNS_Fast::SolveHamMatter().

◆ UpdateHam()

void PMNS_Fast::UpdateHam ( )
protectedvirtualinherited

Build the full Hamiltonian in matter.

Here we divide the mass squared matrix Hms by the 2E to obtain the vacuum Hamiltonian in eV. Then, the matter potential is added to the electron component.

Reimplemented in OscProb::PMNS_LIV, OscProb::PMNS_NSI, OscProb::PMNS_NUNM, and OscProb::PMNS_SNSI.

Definition at line 69 of file PMNS_Fast.cxx.

70{
71 double lv = 2 * kGeV2eV * fEnergy; // 2E in eV
72
73 double kr2GNe = kK2 * M_SQRT2 * kGf;
74 kr2GNe *= fPath.density * fPath.zoa; // Matter potential in eV
75
76 // Finish building Hamiltonian in matter with dimension of eV
77 for (int i = 0; i < fNumNus; i++) {
78 fHam[i][i] = fHms[i][i] / lv;
79 for (int j = i + 1; j < fNumNus; j++) {
80 if (!fIsNuBar)
81 fHam[i][j] = fHms[i][j] / lv;
82 else
83 fHam[i][j] = conj(fHms[i][j]) / lv;
84 }
85 }
86 if (!fIsNuBar)
87 fHam[0][0] += kr2GNe;
88 else
89 fHam[0][0] -= kr2GNe;
90}

References OscProb::NuPath::density, OscProb::PMNS_Base::fEnergy, OscProb::PMNS_Fast::fHam, OscProb::PMNS_Base::fHms, OscProb::PMNS_Base::fIsNuBar, OscProb::PMNS_Base::fNumNus, OscProb::PMNS_Base::fPath, OscProb::PMNS_Base::kGeV2eV, OscProb::PMNS_Base::kGf, OscProb::PMNS_Base::kK2, and OscProb::NuPath::zoa.

Referenced by OscProb::PMNS_Fast::SolveHamMatter().

◆ UpdateRho()

void PMNS_OQS::UpdateRho ( )
protectedvirtual

Update density matrix from Gell-Mann representation.

Definition at line 445 of file PMNS_OQS.cxx.

445{ get_SU3(fR, fRho); }
void get_SU3(const vectorD &v, matrixC &A)
Definition: PMNS_OQS.cxx:265

References fR, OscProb::PMNS_DensityMatrix::fRho, and get_SU3().

Referenced by RotateState().

Member Data Documentation

◆ fa

vectorD OscProb::PMNS_OQS::fa
protected

Definition at line 87 of file PMNS_OQS.h.

Referenced by BuildDissipator(), GetDecoElement(), and SetDecoElement().

◆ fAvgProbPrec

double OscProb::PMNS_Base::fAvgProbPrec
protectedinherited

◆ fBuffer

vectorC OscProb::PMNS_Base::fBuffer
protectedinherited

◆ fBuiltDissipator

bool OscProb::PMNS_OQS::fBuiltDissipator
protected

Definition at line 99 of file PMNS_OQS.h.

Referenced by BuildDissipator(), PMNS_OQS(), SetDecoAngle(), and SetDecoElement().

◆ fBuiltHms

◆ fCachePrec

double OscProb::PMNS_Base::fCachePrec
protectedinherited

Definition at line 302 of file PMNS_Base.h.

◆ fcos

matrixD OscProb::PMNS_OQS::fcos
protected

Definition at line 88 of file PMNS_OQS.h.

Referenced by BuildDissipator(), GetDecoAngle(), and SetDecoAngle().

◆ fD

matrixD OscProb::PMNS_OQS::fD
protected

Definition at line 95 of file PMNS_OQS.h.

Referenced by BuildDissipator(), BuildM(), and GetDissipatorElement().

◆ fDelta

◆ fDm

◆ fEnergy

◆ fEval

◆ fEvec

◆ fGotES

◆ fHam

◆ fHGM

matrixD OscProb::PMNS_OQS::fHGM
protected

Definition at line 94 of file PMNS_OQS.h.

Referenced by BuildHGM(), BuildM(), and GetHGM().

◆ fHms

◆ fHVMB

matrixC OscProb::PMNS_OQS::fHVMB
protected

Definition at line 93 of file PMNS_OQS.h.

Referenced by BuildHGM(), and BuildHVMB().

◆ fIsNuBar

◆ fM

Eigen::MatrixXd OscProb::PMNS_OQS::fM
protected

Definition at line 97 of file PMNS_OQS.h.

Referenced by BuildM(), and PropagatePath().

◆ fMaxCache

int OscProb::PMNS_Base::fMaxCache
protectedinherited

Definition at line 303 of file PMNS_Base.h.

Referenced by OscProb::PMNS_Base::FillCache(), and OscProb::PMNS_Base::SetMaxCache().

◆ fMBuffer

matrixC OscProb::PMNS_DensityMatrix::fMBuffer
protectedinherited

Definition at line 49 of file PMNS_DensityMatrix.h.

Referenced by OscProb::PMNS_DensityMatrix::RotateState().

◆ fMixCache

std::unordered_set<EigenPoint> OscProb::PMNS_Base::fMixCache
protectedinherited

◆ fNumNus

int OscProb::PMNS_Base::fNumNus
protectedinherited

Definition at line 277 of file PMNS_Base.h.

Referenced by OscProb::PMNS_NUNM::ApplyAlphaDagger(), OscProb::PMNS_Base::AvgProbVector(), OscProb::PMNS_Base::AvgProbVectorLoE(), OscProb::PMNS_Base::BuildHms(), OscProb::PMNS_Decay::BuildHms(), OscProb::PMNS_SNSI::BuildHms(), OscProb::PMNS_Base::FillCache(), OscProb::PMNS_NUNM::GetAlpha(), OscProb::PMNS_Base::GetAngle(), OscProb::PMNS_LIV::GetaT(), OscProb::PMNS_LIV::GetcT(), OscProb::PMNS_Base::GetDelta(), OscProb::PMNS_Base::GetDm(), OscProb::PMNS_Base::GetDmEff(), OscProb::PMNS_NSI::GetEps(), OscProb::PMNS_Base::GetMassEigenstate(), OscProb::PMNS_Base::GetProbVector(), OscProb::PMNS_Base::GetSamplePoints(), OscProb::PMNS_Base::P(), OscProb::PMNS_DensityMatrix::P(), OscProb::PMNS_Base::PMNS_Base(), OscProb::PMNS_Decay::PMNS_Decay(), OscProb::PMNS_Base::ProbMatrix(), OscProb::PMNS_NUNM::ProbMatrix(), ProbMatrix(), OscProb::PMNS_DensityMatrix::ProbMatrix(), OscProb::PMNS_Base::PropagatePath(), OscProb::PMNS_Decay::PropagatePath(), OscProb::PMNS_Deco::PropagatePath(), OscProb::PMNS_Iter::PropagatePath(), OscProb::PMNS_Base::ResetToFlavour(), OscProb::PMNS_DensityMatrix::ResetToFlavour(), OscProb::PMNS_DensityMatrix::RotateState(), OscProb::PMNS_NUNM::SetAlpha(), OscProb::PMNS_Base::SetAngle(), OscProb::PMNS_LIV::SetaT(), OscProb::PMNS_LIV::SetcT(), OscProb::PMNS_Base::SetDelta(), OscProb::PMNS_Base::SetDm(), OscProb::PMNS_NSI::SetEps(), OscProb::PMNS_DensityMatrix::SetInitialRho(), OscProb::PMNS_Base::SetPureState(), OscProb::PMNS_DensityMatrix::SetPureState(), OscProb::PMNS_Base::SetStdPars(), OscProb::PMNS_Sterile::SolveEigenSystem(), OscProb::PMNS_Iter::SolveHam(), OscProb::PMNS_Sterile::SolveHam(), OscProb::PMNS_Fast::SolveHamMatter(), OscProb::PMNS_Base::TryCache(), OscProb::PMNS_Decay::UpdateHam(), OscProb::PMNS_Fast::UpdateHam(), OscProb::PMNS_LIV::UpdateHam(), OscProb::PMNS_NSI::UpdateHam(), OscProb::PMNS_NUNM::UpdateHam(), OscProb::PMNS_SNSI::UpdateHam(), and OscProb::PMNS_Sterile::UpdateHam().

◆ fNuPaths

◆ fNuState

◆ fPath

◆ fPhases

vectorC OscProb::PMNS_Base::fPhases
protectedinherited

Definition at line 286 of file PMNS_Base.h.

Referenced by OscProb::PMNS_Base::PropagatePath().

◆ fPower

int OscProb::PMNS_OQS::fPower
protected

Definition at line 86 of file PMNS_OQS.h.

Referenced by BuildM(), GetPower(), and SetPower().

◆ fProbe

EigenPoint OscProb::PMNS_Base::fProbe
protectedinherited

Definition at line 308 of file PMNS_Base.h.

Referenced by OscProb::PMNS_Base::FillCache(), and OscProb::PMNS_Base::TryCache().

◆ fR

vectorD OscProb::PMNS_OQS::fR
protected

Definition at line 90 of file PMNS_OQS.h.

Referenced by BuildR(), ProbMatrix(), PropagatePath(), and UpdateRho().

◆ fRho

◆ fRt

vectorD OscProb::PMNS_OQS::fRt
protected

Definition at line 91 of file PMNS_OQS.h.

Referenced by PropagatePath().

◆ fTheta

◆ fUM

matrixC OscProb::PMNS_OQS::fUM
protected

Definition at line 92 of file PMNS_OQS.h.

Referenced by BuildHms(), BuildHVMB(), and RotateState().

◆ fUseCache

bool OscProb::PMNS_Base::fUseCache
protectedinherited

◆ kGeV2eV

◆ kGf

◆ kK2

◆ kKm2eV

◆ kNA

const double PMNS_Base::kNA = 6.022140857e23
staticprotectedinherited

Definition at line 218 of file PMNS_Base.h.

◆ one

const complexD PMNS_Base::one
staticprotectedinherited

◆ SU3_DIM

constexpr int OscProb::PMNS_OQS::SU3_DIM = 9
staticconstexpr

◆ zero


The documentation for this class was generated from the following files: