20 const auto eps = std::numeric_limits<double>::epsilon() * 10.;
22 complex_t GetImExponential(complex_t exponent)
24 if (exponent.imag() > -std::log(std::numeric_limits<double>::min()))
26 return std::exp(I * exponent);
33 : m_lambda(std::move(eigenvalues))
38 , m_magnetic_SLD(magnetic_SLD)
40 ASSERT(std::abs(
m_b.mag() - 1) < eps || (
m_b.mag() < eps && magnetic_SLD < eps));
47 if (std::abs(
m_b.mag() - 1.) < eps) {
48 const double factor1 = 2. * (1. +
m_b.z());
50 return Q * exp2 * Q.
adjoint() / factor1;
55 throw std::runtime_error(
"Broken magnetic field vector");
137 if (std::abs(alpha * alpha -
beta *
beta) == 0.)
141 result *= 2. / (alpha * alpha -
beta *
beta);
151 if (std::abs(
m_b.mag() - 1.) < eps) {
154 const double factor1 = 2. * (1. +
m_b.z());
158 return Q * exp2 * Q.
adjoint() / factor1;
163 throw std::runtime_error(
"Broken magnetic field vector");
Defines the macro ASSERT.
#define ASSERT(condition)
Defines class MatrixFlux.
SpinMatrix computeP() const
Spinor T1min() const override
Spinor R1plus() const override
Spinor T1plus() const override
The following functions return the transmitted and reflected amplitudes for different incoming beam p...
Spinor T2min() const override
Spinor m_lambda
eigenvalues for wave propagation
SpinMatrix TransformationMatrix(const Spinor &selection) const
SpinMatrix T1Matrix() const
Spinor T2plus() const override
SpinMatrix pMatrixHelper(double sign) const
SpinMatrix T2Matrix() const
SpinMatrix computeInverseP() const
Spinor getKz() const override
Returns z-part of the two wavevector eigenmodes.
Spinor R2min() const override
R3 m_b
unit magnetic field vector
MatrixFlux(double kz_sign, const Spinor &eigenvalues, const R3 &b, double magnetic_SLD)
Spinor R2plus() const override
Spinor R1min() const override
SpinMatrix computeDeltaMatrix(double thickness)
SpinMatrix adjoint() const
double beta(double z, double w)