54 cerr <<
"WARNING: Gamma_" << j << 1 <<
" not valid for " <<
fNumNus
55 <<
" neutrinos. Doing nothing." << endl;
60 cerr <<
"WARNING: Gamma_" << j << 1 <<
" must be positive. "
61 <<
"Setting it to absolute value of input: " << -val << endl;
87 cerr <<
"WARNING: Gamma_32 must be positive. "
88 <<
"Setting it to absolute value of input: " << -val << endl;
92 double min32 = 0.25 *
fGamma[1];
95 min32 *= 1 - pow(
fGamma[0], 2);
97 min32 *= 1 + 3 * pow(
fGamma[0], 2);
109 cerr <<
"WARNING: Impossible to have Gamma32 = " << val
110 <<
" with current Gamma21 and theta parameters." << endl
111 <<
" Changing the value of cos(theta) to " <<
fGamma[0]
122 cerr <<
"WARNING: Imaginary Gamma31 found. Changing the value of "
131 if (fabs(val -
GetGamma(3, 2)) > 1e-6) {
132 cerr <<
"ERROR: Failed sanity check: GetGamma(3,2) = " <<
GetGamma(3, 2)
133 <<
" != " << val << endl;
188 cerr <<
"WARNING: First argument should be larger than second argument"
190 <<
"Setting reverse order (Gamma_" << j << i <<
"). " << endl;
195 if (i < 1 || i > 3 || i <= j || j < 1) {
196 cerr <<
"WARNING: Gamma_" << i << j <<
" not valid for " <<
fNumNus
197 <<
" neutrinos. Returning 0." << endl;
201 if (j == 1) {
return fGamma[i - 1]; }
223 for (
int i = 0; i <
fNumNus; i++) {
224 for (
int j = 0; j <
fNumNus; j++) {
226 for (
int k = 0; k <
fNumNus; k++) {
237 for (
int i = 0; i <
fNumNus; i++) {
238 for (
int j = i; j <
fNumNus; j++) {
240 for (
int k = 0; k <
fNumNus; k++) {
246 if (j > i)
fRho[j][i] = conj(
fRho[i][j]);
260 if (x[0] < x[1] && x[0] < x[2]) {
273 else if (x[1] < x[2]) {
276 if (x[0] < x[2]) out[2] = 2;
285 if (x[0] < x[1]) out[2] = 1;
316 for (
int i = 0; i <
fNumNus; i++) idx[ev_idx[i]] = dm_idx[i];
325 for (
int j = 0; j <
fNumNus; j++) {
326 for (
int i = 0; i < j; i++) {
329 GetGamma(max(idx[i], idx[j]) + 1, min(idx[i], idx[j]) + 1) *
332 gamma_ij *=
kGeV2eV * lengthIneV;
334 double arg = (
fEval[i] -
fEval[j]) * lengthIneV;
336 fRho[i][j] *= exp(-gamma_ij) *
complexD(cos(arg), -sin(arg));
360 assert(flv >= 0 && flv <
fNumNus);
361 for (
int i = 0; i <
fNumNus; ++i) {
362 for (
int j = 0; j <
fNumNus; ++j) {
363 if (i == flv && i == j)
386 assert(flv >= 0 && flv <
fNumNus);
387 return abs(
fRho[flv][flv]);
398 assert(nu_in.size() ==
fNumNus);
400 for (
int i = 0; i <
fNumNus; i++) {
401 for (
int j = 0; j <
fNumNus; j++) {
402 fRho[i][j] = conj(nu_in[i]) * nu_in[j];
423 assert(nflvi <= fNumNus && nflvi >= 0);
424 assert(nflvf <= fNumNus && nflvf >= 0);
433 for (
int i = 0; i < nflvi; i++) {
439 for (
int i = 0; i < int(
fNuPaths.size()); i++) {
440 for (
int flvi = 0; flvi < nflvi; flvi++) {
441 fRho = allstates[flvi];
443 allstates[flvi] =
fRho;
448 for (
int flvi = 0; flvi < nflvi; flvi++) {
449 for (
int flvj = 0; flvj < nflvf; flvj++) {
450 probs[flvi][flvj] = abs(allstates[flvi][flvj][flvj]);
vectorI sort3(const vectorD &x)
static const complexD zero
zero in complex
int fNumNus
Number of neutrino flavours.
std::vector< NuPath > fNuPaths
Vector of neutrino paths.
double fEnergy
Neutrino energy.
static const double kKm2eV
km to eV^-1
static const complexD one
one in complex
matrixC fEvec
Eigenvectors of the Hamiltonian.
vectorD fEval
Eigenvalues of the Hamiltonian.
virtual void SetCurPath(NuPath p)
Set the path currently in use by the class.
vectorD fDm
m^2_i - m^2_1 in vacuum
virtual void ResetToFlavour(int flv)
Reset neutrino state to pure flavour flv.
static const double kGeV2eV
GeV to eV.
virtual void SetStdPath()
Set standard neutrino path.
virtual void PropagatePath(NuPath p)
Propagate neutrino through a single path.
double fPower
Stores the power index parameter.
virtual void SetGamma32(double val)
Set the parameter.
matrixC fMBuffer
Some memory buffer for matrix operations.
virtual void SetDecoAngle(double th)
Set the decoherence angle.
virtual void ResetToFlavour(int flv)
Reset neutrino state to pure flavour flv.
virtual ~PMNS_Deco()
Destructor.
virtual double GetDecoAngle()
Get the decoherence angle.
virtual double GetGamma(int i, int j)
Get any given decoherence parameter.
virtual matrixD ProbMatrix(int nflvi, int nflvf)
virtual void SetPureState(vectorC nu_in)
Set the density matrix from a pure state.
virtual double GetPower()
Get the power index.
virtual double P(int flv)
Return the probability of final state in flavour flv.
virtual void RotateState(bool to_mass)
Rotate rho to/from mass basis.
matrixC fRho
The neutrino density matrix state.
virtual void SetGamma(int j, double val)
Set any given decoherence parameter.
double fGamma[3]
Stores each decoherence parameter.
virtual void SetPower(double n)
Set the power index.
Implementation of oscillations of neutrinos in matter in a three-neutrino framework.
virtual void SolveHam()
Solve the full Hamiltonian for eigenvectors and eigenvalues.
Some useful general definitions.
std::vector< int > vectorI
std::complex< double > complexD
std::vector< complexD > vectorC
std::vector< double > vectorD
std::vector< vectorD > matrixD
std::vector< vectorC > matrixC
A struct representing a neutrino path segment.
double length
The length of the path segment in km.