9#include <unsupported/Eigen/MatrixFunctions>
130 return acos(
fcos[i][j]);
191 for (
int i = 0; i < 3; i++) {
192 for (
int j = 0; j < 3; j++) {
fUM[i][j] = conj(
fEvec[i][j]); }
208 double kr2GNe =
kK2 * M_SQRT2 *
kGf;
220 for (
int i = 0; i < 3; i++) {
221 for (
int j = i; j < 3; j++) {
244 v[0] = real(A[0][0] + A[1][1] + A[2][2]) / sqrt(6);
245 v[3] = real(A[0][0] - A[1][1]) / 2;
246 v[8] = real(A[0][0] + A[1][1] - 2. * A[2][2]) / sqrt(12);
248 v[1] = real(A[0][1]);
249 v[4] = real(A[0][2]);
250 v[6] = real(A[1][2]);
252 v[2] = -imag(A[0][1]);
253 v[5] = -imag(A[0][2]);
254 v[7] = -imag(A[1][2]);
267 A[0][0] = v[0] * sqrt(2 / 3.) + v[3] + v[8] / sqrt(3);
268 A[1][1] = v[0] * sqrt(2 / 3.) - v[3] + v[8] / sqrt(3);
269 A[2][2] = v[0] * sqrt(2 / 3.) - 2 * v[8] / sqrt(3);
275 for (
int i = 0; i < 3; i++) {
276 for (
int j = 0; j < i; j++) { A[j][i] = conj(A[i][j]); }
290 B[1][2] = real(A[0][0] - A[1][1]);
291 B[1][3] = 2 * imag(A[0][1]);
292 B[1][4] = -imag(A[1][2]);
293 B[1][5] = -real(A[1][2]);
294 B[1][6] = -imag(A[0][2]);
295 B[1][7] = -real(A[0][2]);
297 B[2][3] = 2 * real(A[0][1]);
298 B[2][4] = real(A[1][2]);
299 B[2][5] = -imag(A[1][2]);
300 B[2][6] = -real(A[0][2]);
301 B[2][7] = imag(A[0][2]);
303 B[3][4] = -imag(A[0][2]);
304 B[3][5] = -real(A[0][2]);
305 B[3][6] = imag(A[1][2]);
306 B[3][7] = real(A[1][2]);
308 B[4][5] = real(A[0][0] - A[2][2]);
309 B[4][6] = -imag(A[0][1]);
310 B[4][7] = real(A[0][1]);
311 B[4][8] = sqrt(3) * imag(A[0][2]);
313 B[5][6] = -real(A[0][1]);
314 B[5][7] = -imag(A[0][1]);
315 B[5][8] = sqrt(3) * real(A[0][2]);
317 B[6][7] = real(A[1][1] - A[2][2]);
318 B[6][8] = sqrt(3) * imag(A[1][2]);
320 B[7][8] = sqrt(3) * real(A[1][2]);
322 for (
int i = 1; i <
SU3_DIM; ++i) {
323 for (
int j = i + 1; j <
SU3_DIM; ++j) { B[j][i] = -B[i][j]; }
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];
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;
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;
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;
372 fD[8][8] = (sum45 + sum67) * 3 / 4;
373 fD[3][8] = (sum45 - sum67) * sqrt(3) / 4;
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];
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;
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;
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;
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;
407 for (
int j = 1; j <
SU3_DIM; j++) {
408 for (
int k = j; k <
SU3_DIM; k++) {
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;
493 for (
int i = 1; i <
SU3_DIM; ++i) {
495 for (
int j = 1; j <
SU3_DIM; ++j) {
fRt[i] +=
fM(i - 1, j - 1) *
fR[j]; }
525 vector<vectorD> allstates(nflvi,
vectorD(9));
528 for (
int i = 0; i < nflvi; i++) {
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;
544 for (
int flvi = 0; flvi < nflvi; flvi++) {
545 fR = allstates[flvi];
547 for (
int flvj = 0; flvj < nflvf; flvj++) { probs[flvi][flvj] =
P(flvj); }
void get_GM(const matrixC &A, vectorD &v)
void get_SU3(const vectorD &v, matrixC &A)
void get_GMOP(const matrixC &A, matrixD &B)
virtual void Propagate()
Propagate neutrino through full path.
bool fIsNuBar
Anti-neutrino flag.
int fNumNus
Number of neutrino flavours.
std::vector< NuPath > fNuPaths
Vector of neutrino paths.
double fEnergy
Neutrino energy.
static const double kK2
mol/GeV^2/cm^3 to eV
static const double kKm2eV
km to eV^-1
virtual void SetIsNuBar(bool isNuBar)
Set the anti-neutrino flag.
static const double kGf
G_F in units of GeV^-2.
matrixC fEvec
Eigenvectors of the Hamiltonian.
NuPath fPath
Current neutrino path.
bool fBuiltHms
Tag to avoid rebuilding Hms.
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 BuildHms()
Build the matrix of masses squared.
static const double kGeV2eV
GeV to eV.
Base class for methods based on density matrices.
virtual void ResetToFlavour(int flv)
Reset neutrino state to pure flavour flv.
virtual void RotateState(bool to_basis, matrixC U)
Rotate rho to/from a given basis.
virtual double P(int flv)
Return the probability of final state in flavour flv.
matrixC fRho
The neutrino density matrix state.
virtual void SetVacuumEigensystem()
Set the eigensystem to the analytic solution of the vacuum Hamiltonian.
virtual void SolveHam()
Solve the full Hamiltonian for eigenvectors and eigenvalues.
int fPower
Power-law index (n).
matrixD fHGM
Effective Hamiltonian in GMB (9x9).
vectorD fa
Dissipator parameters |a_i|.
vectorD fR
Initial state of density matrix in Gell-Mann basis.
virtual int GetPower()
Get the currently set power-law index for decoherence parameters.
virtual void SetDecoAngle(int i, int j, double th)
Set mixing angle between two decoherence parameters a_i, a_j.
virtual void SetDecoElement(int i, double val)
Set value of the a_i decoherence element in Gell-Mann basis.
bool fBuiltDissipator
Flag to rebuild dissipator.
virtual matrixD ProbMatrix(int nflvi, int nflvf)
Reimplemented from PMNS_DensityMatrix.
virtual void BuildR()
Build Gell-Mann representation of density matrix.
virtual void BuildM(NuPath p)
Build the matrix M used in evolution equations.
virtual void BuildHVMB(NuPath p)
Build effective Hamiltonian in Vacuum Mass Basis (VMB).
matrixD fD
Off-diagonal, 9x9 dissipator.
matrixC fHVMB
Effective Hamiltonian in VMB (3x3).
static constexpr int SU3_DIM
Dimension of the SU(3) Gell-Mann basis.
vectorD fRt
Time evolution of density matrix in Gell-Mann basis.
virtual void PropagatePath(NuPath p)
Reimplemented from PMNS_Base.
virtual void SetPower(int n)
virtual void SetIsNuBar(bool isNuBar)
Reimplemented from PMNS_Base.
virtual double GetDissipatorElement(int i, int j)
Get dissipator element in Gell-Mann basis.
virtual double GetHGM(int i, int j)
Get element i,j of the dissipator matrix in Gell-Mann basis.
virtual void UpdateRho()
Update density matrix from Gell-Mann representation.
virtual void BuildDissipator()
Build the dissipator in Gell-Mann representation.
virtual void Propagate()
Reimplemented from PMNS_Base.
virtual ~PMNS_OQS()
Destructor.
virtual void BuildHGM(NuPath p)
Build effective Hamiltonian in Gell-Mann representation (GM).
virtual void RotateState(bool to_mass)
Rotate rho to/from mass basis.
virtual void BuildHms()
Reimplemented from PMNS_Base.
matrixD fcos
cosines ai . aj
Eigen::MatrixXd fM
Buffer matrix for exponential.
virtual double GetDecoAngle(int i, int j)
Get mixing angle between two decoherence parameters a_i, a_j.
virtual double GetDecoElement(int i)
Get the value of the a_i decoherence parameter in Gell-Mann basis.
#define THROW_ON_INVALID_ARG(condition,...)
Some useful general definitions.
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 density
The density of the path segment in g/cm^3.
double length
The length of the path segment in km.
double zoa
The effective Z/A value of the path segment.