OscProb
PMNS_Decay.cxx
Go to the documentation of this file.
1
9
10#include <iostream>
11
12#include <unsupported/Eigen/MatrixFunctions>
13
14#include "PMNS_Decay.h"
15#include "complexsolver.h"
16
17using namespace OscProb;
18using namespace std;
19
20//.............................................................................
26PMNS_Decay::PMNS_Decay() : PMNS_Base()
27{
29 fHam = Eigen::Matrix3cd(fNumNus, fNumNus);
31}
32
33//.............................................................................
38
39//.............................................................................
48void PMNS_Decay::SetMix(double th12, double th23, double th13, double deltacp)
49{
50 SetAngle(1, 2, th12);
51 SetAngle(1, 3, th13);
52 SetAngle(2, 3, th23);
53 SetDelta(1, 3, deltacp);
54}
55
56//.............................................................................
62void PMNS_Decay::SetAlpha3(double alpha3)
63{
64 if (alpha3 < 0) {
65 cerr << "WARNING: Alpha3 must be positive. Doing nothing." << endl;
66 return;
67 }
68
69 fBuiltHms *= (fAlpha[2] == alpha3);
70 fAlpha[2] = alpha3;
71}
72
73//.............................................................................
79void PMNS_Decay::SetAlpha2(double alpha2)
80{
81 if (alpha2 < 0) {
82 cerr << "WARNING: Alpha2 must be positive. Doing nothing." << endl;
83 return;
84 }
85
86 fBuiltHms *= (fAlpha[1] == alpha2);
87 fAlpha[1] = alpha2;
88}
89
90//.............................................................................
96void PMNS_Decay::SetIsNuBar(bool isNuBar)
97{
98 // Check if value is actually changing
99 fGotES *= (fIsNuBar == isNuBar);
100 fBuiltHms *= (fIsNuBar == isNuBar);
101 fIsNuBar = isNuBar;
102}
103
104//.............................................................................
114void PMNS_Decay::SetDeltaMsqrs(double dm21, double dm32)
115{
116 SetDm(2, dm21);
117 SetDm(3, dm32 + dm21);
118}
119
120//.............................................................................
126double PMNS_Decay::GetAlpha3() { return fAlpha[2]; }
127
128//.............................................................................
134double PMNS_Decay::GetAlpha2() { return fAlpha[1]; }
135
136//.............................................................................
141{
142 // Check if anything changed
143 if (fBuiltHms) return;
144
145 // Tag to recompute eigensystem
146 fGotES = false;
147
148 for (int j = 0; j < fNumNus; j++) {
149 // Set mass splitting
150 fHms[j][j] = fDm[j];
151 fHd[j][j] = fAlpha[j];
152 // Reset off-diagonal elements
153 for (int i = 0; i < j; i++) {
154 fHms[i][j] = 0;
155 fHd[i][j] = 0;
156 }
157 // Rotate j neutrinos
158 for (int i = 0; i < j; i++) {
159 RotateH(i, j, fHms);
160 RotateH(i, j, fHd);
161 }
162 }
163
164 // Taking care of antineutrinos delta-> -delta and filling the upper triangle
165 // because final hamiltonian will be non-hermitian.
166 for (int i = 0; i < fNumNus; i++) {
167 for (int j = i + 1; j < fNumNus; j++) {
168 if (fIsNuBar) {
169 fHms[i][j] = conj(fHms[i][j]);
170 fHd[i][j] = conj(fHd[i][j]);
171 }
172 fHms[j][i] = conj(fHms[i][j]);
173 fHd[j][i] = conj(fHd[i][j]);
174 }
175 }
176
177 const complexD numi(0.0, 1.0);
179 for (int j = 0; j < fNumNus; j++) {
180 for (int i = 0; i < fNumNus; i++) {
181 fHms[i][j] = fHms[i][j] - numi * fHd[i][j];
182 }
183 }
184
185 // Clear eigensystem cache
186 // ClearCache();
187
188 // Tag as built
189 fBuiltHms = true;
190}
191
192//.............................................................................
201{
202 double lv = 2 * kGeV2eV * fEnergy; // 2E in eV
203
204 double kr2GNe = kK2 * M_SQRT2 * kGf;
205 kr2GNe *= fPath.density * fPath.zoa; // Matter potential in eV
206
207 // Finish building Hamiltonian in matter with dimension of eV
208 for (int i = 0; i < fNumNus; i++) {
209 for (int j = 0; j < fNumNus; j++) { fHam(i, j) = fHms[i][j] / lv; }
210 }
211
212 if (!fIsNuBar)
213 fHam(0, 0) += kr2GNe;
214 else
215 fHam(0, 0) -= kr2GNe;
216}
217
218//.............................................................................
228{
229 // Build Hamiltonian
230 BuildHms();
231
232 // Check if anything changed
233 if (fGotES) return;
234
235 // Try caching if activated
236 // if(TryCache()) return;
237
238 UpdateHam();
239
240 // Solve Hamiltonian for eigenvalues using the Eigen library method
242
243 fGotES = true;
244
245 // Fill cache if activated
246 // FillCache();
247}
248
249//.............................................................................
256{
257 // Set the neutrino path
258 SetCurPath(p);
259
260 // Build Hamiltonian
261 BuildHms();
262 UpdateHam();
263
264 double LengthIneV = kKm2eV * p.length;
265
266 // Compute evolution operator exp(-I*H*L)
267 Eigen::Matrix3cd H = fHam;
268 H *= complexD(0, -LengthIneV);
269 H = H.exp();
270
271 // Propagate using evolution operator
272 for (int i = 0; i < fNumNus; i++) {
273 fBuffer[i] = 0;
274 for (int j = 0; j < fNumNus; j++) { fBuffer[i] += H(i, j) * fNuState[j]; }
275 }
276
277 // Update neutrino state
278 for (int i = 0; i < fNumNus; i++) { fNuState[i] = fBuffer[i]; }
279}
280
Base class implementing general functions for computing neutrino oscillations.
Definition: PMNS_Base.h:26
static const complexD zero
zero in complex
Definition: PMNS_Base.h:211
bool fIsNuBar
Anti-neutrino flag.
Definition: PMNS_Base.h:293
vectorC fNuState
The neutrino current state.
Definition: PMNS_Base.h:283
int fNumNus
Number of neutrino flavours.
Definition: PMNS_Base.h:277
double fEnergy
Neutrino energy.
Definition: PMNS_Base.h:292
virtual void RotateH(int i, int j, matrixC &Ham)
Rotate the Hamiltonian by theta_ij and delta_ij.
Definition: PMNS_Base.cxx:822
static const double kK2
mol/GeV^2/cm^3 to eV
Definition: PMNS_Base.h:216
static const double kKm2eV
km to eV^-1
Definition: PMNS_Base.h:215
virtual void SetDm(int j, double dm)
Set the mass-splitting dm_j1 in eV^2.
Definition: PMNS_Base.cxx:674
virtual void SetDelta(int i, int j, double delta)
Set the CP phase delta_ij.
Definition: PMNS_Base.cxx:602
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
bool fGotES
Tag to avoid recalculating eigensystem.
Definition: PMNS_Base.h:299
static const double kGf
G_F in units of GeV^-2.
Definition: PMNS_Base.h:220
NuPath fPath
Current neutrino path.
Definition: PMNS_Base.h:296
vectorD fEval
Eigenvalues of the Hamiltonian.
Definition: PMNS_Base.h:289
bool fBuiltHms
Tag to avoid rebuilding Hms.
Definition: PMNS_Base.h:298
virtual void SetCurPath(NuPath p)
Set the path currently in use by the class.
Definition: PMNS_Base.cxx:274
vectorD fDm
m^2_i - m^2_1 in vacuum
Definition: PMNS_Base.h:279
virtual void SetAngle(int i, int j, double th)
Set the mixing angle theta_ij.
Definition: PMNS_Base.cxx:539
static const double kGeV2eV
GeV to eV.
Definition: PMNS_Base.h:217
vectorD fAlpha
alpha parameters
Definition: PMNS_Decay.h:64
virtual double GetAlpha2()
Definition: PMNS_Decay.cxx:134
virtual void PropagatePath(NuPath p)
Propagation with Decay.
Definition: PMNS_Decay.cxx:255
virtual void SetAlpha2(double alpha2)
Definition: PMNS_Decay.cxx:79
virtual void UpdateHam()
Build the full Hamiltonian.
Definition: PMNS_Decay.cxx:200
virtual double GetAlpha3()
Definition: PMNS_Decay.cxx:126
virtual void SetIsNuBar(bool isNuBar)
Definition: PMNS_Decay.cxx:96
Eigen::Matrix3cd fHam
Final hamiltonian.
Definition: PMNS_Decay.h:62
virtual void SetAlpha3(double alpha3)
Definition: PMNS_Decay.cxx:62
virtual void SetDeltaMsqrs(double dm21, double dm32)
Set both mass-splittings at once.
Definition: PMNS_Decay.cxx:114
matrixC fHd
Decay hamiltonian.
Definition: PMNS_Decay.h:61
virtual void BuildHms()
Build the Hms Hamiltonian.
Definition: PMNS_Decay.cxx:140
virtual void SolveHam()
Solve the full Hamiltonian for eigenvalues.
Definition: PMNS_Decay.cxx:227
virtual void SetMix(double th12, double th23, double th13, double deltacp)
Set the all mixing parameters at once.
Definition: PMNS_Decay.cxx:48
virtual ~PMNS_Decay()
Destructor.
Definition: PMNS_Decay.cxx:37
void complexsolver(const Eigen::Matrix3cd &A, OscProb::vectorD &w)
Some useful general definitions.
Definition: Absorption.h:6
std::complex< double > complexD
Definition: Definitions.h:21
std::vector< complexD > vectorC
Definition: Definitions.h:22
std::vector< double > vectorD
Definition: Definitions.h:18
std::vector< vectorC > matrixC
Definition: Definitions.h:23
Definition: EigenPoint.h:44
A struct representing a neutrino path segment.
Definition: NuPath.h:34
double density
The density of the path segment in g/cm^3.
Definition: NuPath.h:79
double length
The length of the path segment in km.
Definition: NuPath.h:78
double zoa
The effective Z/A value of the path segment.
Definition: NuPath.h:80