26 const Eigen::Matrix2cd
Unit_Matrix(Eigen::Matrix2cd::Identity());
30 const Eigen::Matrix2cd Pauli_X((Eigen::Matrix2cd() << 0, 1, 1, 0).finished());
31 const Eigen::Matrix2cd Pauli_Y((Eigen::Matrix2cd() << 0, -
I,
I, 0).finished());
32 const Eigen::Matrix2cd Pauli_Z((Eigen::Matrix2cd() << 1, 0, 0, -1).finished());
37 double magnetic_factor,
40 Eigen::Matrix2cd result =
43 * (Pauli_X * polarization[0] + Pauli_Y * polarization[1] + Pauli_Z * polarization[2]);
49 double magnetic_factor,
52 double magnetic_factor,
57 return n * n - n_ref * n_ref * k.
sin2Theta();
63 Eigen::Matrix2cd result;
72 bool isDefault =
true;
73 for (
const Material* mat : materials) {
75 result = mat->typeID();
76 isDefault = mat->isDefaultMaterial();
79 if (mat->typeID() != result && !mat->isDefaultMaterial())
std::complex< double > complex_t
const Eigen::Matrix2cd Unit_Matrix(Eigen::Matrix2cd::Identity())
constexpr double magnetic_prefactor
Declares functions in namespace MaterialUtils.
Defines the values of physical constants (SI)
Three-dimensional vector template, for use with integer, double, or complex components.
double mag2() const
Returns magnitude squared of the vector.
double sin2Theta() const
Returns squared sine of polar angle.
A wrapper for underlying material implementation.
MATERIAL_TYPES checkMaterialTypes(const std::vector< const Material * > &materials)
Checks if all non-default materials in materials are of the same type and returns this type.
complex_t ScalarReducedPotential(complex_t n, kvector_t k, double n_ref)
Function for calculating the reduced potential, used for obtaining the Fresnel coefficients (non-pola...
Eigen::Matrix2cd PolarizedReducedPotential(complex_t n, kvector_t b_field, kvector_t k, double n_ref)
Function for calculating the reduced potential, used for obtaining the Fresnel coefficients (polarize...
Eigen::Matrix2cd MagnetizationCorrection(complex_t unit_factor, double magnetic_factor, BasicVector3D< T > polarization)
constexpr double g_factor_n
neutron g-factor
constexpr double h_bar
Reduced Plank constant, J s.
constexpr double m_n
Neutron mass, kg.
constexpr double mu_N
Nuclear magneton ( ), J/T.