15 #include <Eigen/Dense>      23   using Eigen::Matrix4d;
    24   using Eigen::Vector4d;
    25   const auto &log = logger<LogArea::Tmn>();
    43   A <<  
Tmn_[0],  Tmn_[1],  Tmn_[2],  Tmn_[3],
    44        -Tmn_[1], -Tmn_[4], -Tmn_[5], -Tmn_[6],
    45        -Tmn_[2], -Tmn_[5], -Tmn_[7], -Tmn_[8],
    46        -Tmn_[3], -Tmn_[6], -Tmn_[8], -Tmn_[9];
    49   log.debug(
"Looking for Landau frame for T_{mu}^{nu} ", A);
    50   Eigen::EigenSolver<Matrix4d> es(A);
    60   Vector4d eig_im = es.eigenvalues().imag();
    61   Vector4d eig_re = es.eigenvalues().real();
    62   for (
size_t i = 0; i < 4; i++) {
    71   assert(eig_re(0) >= eig_re(1));
    72   assert(eig_re(0) >= eig_re(2));
    73   assert(eig_re(0) >= eig_re(3));
    74   log.debug(
"eigenvalues: ", eig_re);
    77   Vector4d tmp = es.eigenvectors().col(0).real();
    84   const double u_sqr = u.
sqr();
    86     u /= std::sqrt(u_sqr);
    88     log.error(
"Landau frame is not defined.", 
" Eigen vector", u, 
" of ", A,
    89               " is not time-like and",
    90               " cannot be 4-velocity. This may happen if energy-momentum",
    91               " tensor was constructed for a massless particle.");
    98   using Eigen::Matrix4d;
   102   A << 
Tmn_[0], Tmn_[1], Tmn_[2], Tmn_[3],
   103        Tmn_[1], Tmn_[4], Tmn_[5], Tmn_[6],
   104        Tmn_[2], Tmn_[5], Tmn_[7], Tmn_[8],
   105        Tmn_[3], Tmn_[6], Tmn_[8], Tmn_[9];
   110   L << u[0], u[1], u[2], u[3],
   111        u[1], u[1] * tmp.
x1() + 1.0, u[2] * tmp.
x1(), u[3] * tmp.
x1(),
   112        u[2], u[1] * tmp.
x2(), u[2] * tmp.
x2() + 1.0, u[3] * tmp.
x2(),
   113        u[3], u[1] * tmp.
x3(), u[2] * tmp.
x3(), u[3] * tmp.
x3() + 1.0;
   119                                         R(1, 1), R(1, 2), R(1, 3),
   131   Tmn_[4] += mom[1] * tmp.
x1();
   132   Tmn_[5] += mom[1] * tmp.
x2();
   133   Tmn_[6] += mom[1] * tmp.
x3();
   134   Tmn_[7] += mom[2] * tmp.
x2();
   135   Tmn_[8] += mom[2] * tmp.
x3();
   136   Tmn_[9] += mom[3] * tmp.
x3();
   145   for (
size_t mu = 0; mu < 4; mu++) {
   146     for (
size_t nu = 0; nu < 4; nu++) {
   147       out << std::setprecision(3) << std::setw(12) << std::fixed
 The ThreeVector class represents a physical three-vector  with the components . 
constexpr double really_small
Numerical error tolerance. 
static std::int8_t tmn_index(std::int8_t mu, std::int8_t nu)
Access the index of component . 
ThreeVector threevec() const 
EnergyMomentumTensor()
Default constructor (nulls all components) 
Generic numerical functions. 
EnergyMomentumTensor boosted(const FourVector &u) const 
Boost to a given 4-velocity. 
FourVector landau_frame_4velocity() const 
Find the Landau frame 4-velocity from energy-momentum tensor. 
The EnergyMomentumTensor class represents a symmetric positive semi-definite energy-momentum tensor ...
double sqr() const 
calculate the square of the vector (which is a scalar) 
void add_particle(const FourVector &mom)
Given momentum of the particle adds  to the energy momentum tensor. 
tmn_type Tmn_
The internal storage of the components. 
std::ostream & operator<<(std::ostream &out, const ActionPtr &action)
Convenience: dereferences the ActionPtr to Action. 
The FourVector class holds relevant values in Minkowski spacetime with (+, −, −, −) metric signature. 
ParticleData contains the dynamic information of a certain particle. 
const FourVector & momentum() const 
Get the particle's 4-momentum.