21 const double pi2_15 = std::pow(M_PI_2, 1.5);
26 double sigma,
bool inverse)
const
28 if (sigma < 10 * std::numeric_limits<double>::epsilon())
29 return Eigen::Matrix2cd{Eigen::Matrix2cd::Identity()};
31 const double sigeff = pi2_15 * sigma;
32 const auto b = coeff.m_b;
34 if (std::abs(b.mag() - 1.) < std::numeric_limits<double>::epsilon() * 10.) {
36 const double factor1 = 2. * (1. + b.z());
37 Q << (1. + b.z()), (I * b.y() - b.x()), (b.x() + I * b.y()), (b.z() + 1.);
47 const Eigen::Matrix2cd lambda = Eigen::DiagonalMatrix<complex_t, 2>({l1, l2});
49 return Q * lambda * Q.adjoint() / factor1;
51 }
else if (b.mag() < 10 * std::numeric_limits<double>::epsilon()) {
56 const Eigen::Matrix2cd lambda = Eigen::DiagonalMatrix<complex_t, 2>({alpha, alpha});
61 throw std::runtime_error(
"Broken magnetic field vector");
64 std::pair<Eigen::Matrix2cd, Eigen::Matrix2cd>
65 SpecularMagneticNewTanhStrategy::computeBackwardsSubmatrices(
69 Eigen::Matrix2cd R{Eigen::Matrix2cd::Identity()};
70 Eigen::Matrix2cd RInv{Eigen::Matrix2cd::Identity()};
73 R = computeRoughnessMatrix(coeff_i1, sigma,
false)
74 * computeRoughnessMatrix(coeff_i, sigma,
true);
76 RInv = computeRoughnessMatrix(coeff_i, sigma,
false)
77 * computeRoughnessMatrix(coeff_i1, sigma,
true);
80 const Eigen::Matrix2cd mproduct = coeff_i.computeInverseP() * coeff_i1.computeP();
81 const Eigen::Matrix2cd mp = 0.5 * (RInv + mproduct * R);
82 const Eigen::Matrix2cd mm = 0.5 * (RInv - mproduct * R);
Defines M_PI and some more mathematical constants.
Defines namespace MathFunctions.
Defines class SpecularMagneticNewTanhStrategy.
Specular reflection and transmission coefficients in a layer in case of magnetic interactions between...
complex_t tanhc(const complex_t z)
Complex tanhc function: .