27PMNS_DensityMatrix::PMNS_DensityMatrix()
49 for (
int i = 0; i <
fNumNus; i++) {
50 for (
int j = 0; j <
fNumNus; j++) {
52 for (
int k = 0; k <
fNumNus; k++) {
63 for (
int i = 0; i <
fNumNus; i++) {
64 for (
int j = i; j <
fNumNus; j++) {
66 for (
int k = 0; k <
fNumNus; k++) {
72 if (j > i)
fRho[j][i] = conj(
fRho[i][j]);
90 assert(flv >= 0 && flv <
fNumNus);
94 for (
int i = 0; i <
fNumNus; ++i) {
95 for (
int j = 0; j <
fNumNus; ++j) {
96 if (i == flv && i == j)
119 assert(flv >= 0 && flv <
fNumNus);
120 return abs(
fRho[flv][flv]);
131 assert(nu_in.size() ==
fNumNus);
133 for (
int i = 0; i <
fNumNus; i++) {
134 for (
int j = 0; j <
fNumNus; j++) {
135 fRho[i][j] = conj(nu_in[i]) * nu_in[j];
153 assert(rho_in.size() ==
fNumNus);
154 assert(rho_in[0].size() ==
fNumNus);
160 for (
int i = 0; i <
fNumNus; i++) {
161 trace += abs(rho_in[i][i]);
162 for (
int j = i; j <
fNumNus; j++) {
164 assert(abs(rho_in[i][j] - conj(rho_in[j][i])) < eps);
165 rho_array[i][j] = rho_in[i][j];
170 assert(abs(trace - 1) < eps);
172 double fEvalGLoBES[3];
176 zheevh3(rho_array, fEvecGLoBES, fEvalGLoBES);
179 for (
int i = 0; i <
fNumNus; i++) assert(fEvalGLoBES[i] >= -eps);
212 for (
int i = 0; i < nflvi; i++) {
218 for (
int i = 0; i < int(
fNuPaths.size()); i++) {
219 for (
int flvi = 0; flvi < nflvi; flvi++) {
220 fRho = allstates[flvi];
222 allstates[flvi] =
fRho;
227 for (
int flvi = 0; flvi < nflvi; flvi++) {
228 for (
int flvj = 0; flvj < nflvf; flvj++) {
229 probs[flvi][flvj] = abs(allstates[flvi][flvj][flvj]);
static const complexD zero
zero in complex
int fNumNus
Number of neutrino flavours.
std::vector< NuPath > fNuPaths
Vector of neutrino paths.
static const complexD one
one in complex
virtual void ResetToFlavour(int flv)
Reset neutrino state to pure flavour flv.
virtual void SetPureState(vectorC nu_in)
Set the density matrix from a pure state.
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 ~PMNS_DensityMatrix()
Destructor.
virtual matrixD ProbMatrix(int nflvi, int nflvf)
matrixC fMBuffer
Some memory buffer for matrix operations.
virtual double P(int flv)
Return the probability of final state in flavour flv.
virtual void PropagatePath(NuPath p)=0
Propagate neutrino through a single path.
virtual void SetIsOscProbAvg(bool isOscProbAvg)
Deactivate Maltoni.
virtual void SetInitialRho(matrixC rho_in)
Set the density matrix from an arbitrary state.
matrixC fRho
The neutrino density matrix state.
Implementation of oscillations of neutrinos in matter in a three-neutrino framework.
#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
int zheevh3(std::complex< double > A[3][3], std::complex< double > Q[3][3], double w[3])