Skip to content

Commit

Permalink
amend fab01d4 to support boost 1.81+
Browse files Browse the repository at this point in the history
  • Loading branch information
evaleev committed Aug 16, 2023
1 parent ab50e61 commit 455eb4f
Showing 1 changed file with 36 additions and 5 deletions.
41 changes: 36 additions & 5 deletions tests/unit/test_mbpt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,10 @@ TEST_CASE("MBPT", "[mbpt]") {

// test biorthogonal transform of some terms in the triples equations
{
std::map<std::wstring, std::tuple<std::function<ExprPtr()>, std::wstring>>
std::map<std::wstring,
std::tuple<std::function<ExprPtr()>,
/* boost <1.81 ref result */ std::wstring,
/* boost >=1.81 ref result */ std::wstring>>
key2expr = {
{L"T3 -> R3",
{[]() { return op::P(3) * op::T_(3); },
Expand All @@ -556,7 +559,14 @@ TEST_CASE("MBPT", "[mbpt]") {
L"{{{\\frac{1}{15}}}{S^{{a_1}{a_2}{a_3}}_{{i_1}{i_2}{i_3}}}{t^{"
L"{i_2}{i_3}{i_1}}_{{a_1}{a_2}{a_3}}}} - "
L"{{{\\frac{1}{10}}}{S^{{a_1}{a_2}{a_3}}_{{i_1}{i_2}{i_3}}}{t^{"
L"{i_2}{i_1}{i_3}}_{{a_1}{a_2}{a_3}}}}\\bigr) }"}},
L"{i_2}{i_1}{i_3}}_{{a_1}{a_2}{a_3}}}}\\bigr) }",
L"{ \\bigl( - "
L"{{{\\frac{1}{10}}}{S^{{a_1}{a_2}{a_3}}_{{i_1}{i_2}{i_3}}}{t^{"
L"{i_2}{i_1}{i_3}}_{{a_1}{a_2}{a_3}}}} + "
L"{{{\\frac{1}{6}}}{S^{{a_1}{a_2}{a_3}}_{{i_1}{i_2}{i_3}}}{t^{{"
L"i_1}{i_2}{i_3}}_{{a_1}{a_2}{a_3}}}} - "
L"{{{\\frac{1}{15}}}{S^{{a_1}{a_2}{a_3}}_{{i_1}{i_2}{i_3}}}{t^{"
L"{i_2}{i_3}{i_1}}_{{a_1}{a_2}{a_3}}}}\\bigr) }"}},
{L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a_2}{a_4}}}} + "
L"{{{\\frac{1}{2}}}{S^{{a_1}{a_2}{a_3}}_{{i_1}{i_2}{i_3}}}{f^{{"
L"a_4}}_{{a_3}}}{t^{{i_1}{i_2}{i_3}}_{{a_1}{a_2}{a_4}}}} - "
L"{{{\\frac{1}{5}}}{S^{{a_1}{a_2}{a_3}}_{{i_1}{i_2}{i_3}}}{f^{{"
L"a_4}}_{{a_2}}}{t^{{i_1}{i_2}{i_3}}_{{a_1}{a_3}{a_4}}}}\\bigr)"
L" }"}},
};

for (auto&& [key, make_expr_and_ref] : key2expr) {
auto&& [make_expr, ref] = make_expr_and_ref;
auto&& [make_expr, ref_pre181, ref_181plus] = make_expr_and_ref;
auto result = op::vac_av(make_expr());

// Biorthogonal transformation
result = biorthogonalize(result);
REQUIRE(ref == to_latex(result));
REQUIRE((hash_version() == hash::Impl::BoostPre181
? ref_pre181
: ref_181plus) == to_latex(result));
}
}

Expand Down

0 comments on commit 455eb4f

Please sign in to comment.