7#include <doctest/doctest.h>
12 constexpr double PI = 3.141592653589793238462643383279502884;
13 constexpr double numerical_precision = 100 * std::numeric_limits<double>::epsilon();
15 auto wigner_real_entry =
16 wigner::wigner_uppercase_d_matrix<double>(0.5, 0.5, -0.5, 4 * PI, PI / 3, 2 * PI);
17 auto wigner_real_entry_reference = -0.5;
18 DOCTEST_CHECK((wigner_real_entry - wigner_real_entry_reference) <= numerical_precision);
20 std::string error_msg =
21 "The scalar type must be complex if m_initial*alpha is not a multiple of pi";
22 DOCTEST_CHECK_THROWS_WITH_AS(
23 wigner::wigner_uppercase_d_matrix<double>(0.5, 0.5, -0.5, 0.1 * PI, 0, 0);
24 , error_msg.c_str(), std::invalid_argument);
26 error_msg =
"The scalar type must be complex if m_final*gamma is not a multiple of pi";
27 DOCTEST_CHECK_THROWS_WITH_AS(
28 wigner::wigner_uppercase_d_matrix<double>(0.5, 0.5, -0.5, 0, 0, 0.1 * PI);
29 , error_msg.c_str(), std::invalid_argument);
31 auto wigner_complex_entry = wigner::wigner_uppercase_d_matrix<std::complex<double>>(
32 0.5, 0.5, -0.5, 0.5 * PI, PI, -0.5 * PI);
33 auto wigner_complex_entry_reference = std::complex<double>(0, 1);
34 DOCTEST_CHECK(std::abs(wigner_complex_entry - wigner_complex_entry_reference) <=
DOCTEST_TEST_CASE("create a basis for strontium 88")