6 #include "OscLib/func/OscCalculatorGeneral.h" 8 #include <boost/numeric/ublas/vector.hpp> 9 #include <boost/numeric/ublas/matrix.hpp> 20 namespace ublas = boost::numeric::ublas;
21 typedef std::complex<double>
val_t;
22 typedef ublas::bounded_array<val_t, kNumFlavours>
alloc_t;
24 typedef ublas::bounded_matrix<val_t, kNumFlavours, kNumFlavours>
ComplexMat;
26 typedef ublas::unit_vector<val_t, alloc_t>
UnitVec;
27 const ublas::zero_matrix<val_t, alloc_t>
kZeroMat(kNumFlavours, kNumFlavours);
28 const ublas::identity_matrix<val_t, alloc_t>
kIdentity(kNumFlavours);
68 d->
atmos(1, 2) = sin(th23);
89 d->
solar(0, 1) = sin(th12);
98 d->
phase = std::polar(1.0, -delta);
109 ublas::noalias(d->
pmns) = ublas::prod(d->
atmos, ublas::prod<ComplexMat>(d->
react, d->
solar));
133 H(
a,
b) += U(
a,
i)*mSq[
i]/(2*
E)*std::conj(U(
b,
i));
151 const double GF = 1.368e-4;
155 H(0, 0) = sqrt(2)*GF*Ne;
158 H(1, 2) = H(2, 1) = emutau*sqrt(2)*GF*Ne;
174 ComplexMat
m = m2/65536;
180 for(
int n = 0;
n < 16; ++
n) ret = ublas::prod(ret, ret);
188 const std::complex<double>
i = std::complex<double>(0, 1);
190 return ublas::prod(
MatrixExp(-H*L*i), A);
197 m(
i, j) = std::conj(
m(
i, j));
202 const int af =
abs(from);
203 const int at =
abs(to);
204 assert(af == 12 || af == 14 || af == 16);
205 assert(at == 12 || at == 14 || at == 16);
208 if(af*at < 0)
return 0;
214 ComplexVec initState =
UnitVec(kNumFlavours, 1);
215 if(af == 12) initState =
UnitVec(kNumFlavours, 0);
216 if(af == 16) initState =
UnitVec(kNumFlavours, 2);
218 std::vector<double> mSq;
228 if(from < 0) H += -1*Hm;
else H += Hm;
232 if(at == 12)
return std::norm(finalState(0));
233 if(at == 14)
return std::norm(finalState(1));
234 if(at == 16)
return std::norm(finalState(2));
236 assert(0 &&
"Not reached");
ComplexMat MatrixExp(const ComplexMat &m2)
virtual ~OscCalculatorGeneral()
void conjugate_elements(ComplexMat &m)
std::complex< double > phase
ublas::unit_vector< val_t, alloc_t > UnitVec
virtual void SetTh13(double th13)
virtual double P(int from, int to, double E)
ComplexVec EvolveState(ComplexVec A, const ComplexMat &H, double L)
ComplexMat GetPMNS(OscCalculatorGeneral::Priv *d)
virtual void SetTh23(double th23)
virtual void SetdCP(double dCP)
ublas::bounded_matrix< val_t, kNumFlavours, kNumFlavours > ComplexMat
ComplexMat VacuumHamiltonian(const ComplexMat &U, std::vector< double > mSq, double E)
auto norm(Vector const &v)
Return norm of the specified vector.
const ublas::zero_matrix< val_t, alloc_t > kZeroMat(kNumFlavours, kNumFlavours)
const unsigned int kNumFlavours
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
std::complex< double > val_t
ComplexMat MatterHamiltonianComponent(double Ne, double emutau)
ublas::c_vector< val_t, kNumFlavours > ComplexVec
const ublas::identity_matrix< val_t, alloc_t > kIdentity(kNumFlavours)
ublas::bounded_array< val_t, kNumFlavours > alloc_t
virtual void SetTh12(double th12)