26 const Eigen::Matrix2cd
Unit_Matrix(Eigen::Matrix2cd::Identity());
31 const Eigen::Matrix2cd
Pauli_X((Eigen::Matrix2cd() << 0, 1, 1, 0).finished());
32 const Eigen::Matrix2cd
Pauli_Y((Eigen::Matrix2cd() << 0, -
I,
I, 0).finished());
33 const Eigen::Matrix2cd
Pauli_Z((Eigen::Matrix2cd() << 1, 0, 0, -1).finished());
38 double magnetic_factor,
41 Eigen::Matrix2cd result =
50 double magnetic_factor,
53 double magnetic_factor,
58 return n * n - n_ref * n_ref * k.
sin2Theta();
64 Eigen::Matrix2cd result;
73 bool isDefault =
true;
74 for (
const Material* mat : materials) {
76 result = mat->typeID();
77 isDefault = mat->isDefaultMaterial();
80 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)
Forked from CLHEP/Geometry by E.
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.
const Eigen::Matrix2cd Pauli_X((Eigen::Matrix2cd()<< 0, 1, 1, 0).finished())
const Eigen::Matrix2cd Pauli_Z((Eigen::Matrix2cd()<< 1, 0, 0, -1).finished())
const Eigen::Matrix2cd Pauli_Y((Eigen::Matrix2cd()<< 0, -I, I, 0).finished())