Skip to content

Commit 8008ced

Browse files
committed
merge gaudel/tests/hadamard_reduction_tests into evaleev/fix/einsum-hadamard-reduction
2 parents f5ef043 + 1ed7567 commit 8008ced

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

tests/einsum.cpp

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -243,18 +243,29 @@ BOOST_AUTO_TEST_CASE(equal_nested_ranks) {
243243
BOOST_REQUIRE(check_manual_eval<ArrayToT>(
244244
"ijk;bc,j;d->kji;dcb", {{0, 1}, {0, 1}, {0, 1}}, {{0, 1}}, {2, 3}, {4}));
245245

246-
// debug
247-
// i_2,i_3,i_1;a_1i_1i_2,a_4i_2i_3
248-
// * i_1,i_3,i_2;a_4i_2i_3,a_2i_1i_2
249-
// = i_1,i_2;a_1i_1i_2,a_2i_1i_2
250-
251246
// H+C;C
252247
BOOST_REQUIRE(check_manual_eval<ArrayToT>(
253248
"jki;ad,ikj;db->ij;ab", //
254249
{{0, 1, 2, 3, 4, 5, 6}, {0, 1, 2, 3}, {0, 1, 2, 3, 4}}, //
255250
{{0, 1, 2, 3, 4}, {0, 1, 2, 3}, {0, 1, 2, 3, 4, 5, 6}}, //
256251
{3, 2}, //
257252
{2, 4}));
253+
254+
// H+C;C
255+
BOOST_REQUIRE(
256+
check_manual_eval<ArrayToT>("ijk;mo,kji;no->ik;nm", //
257+
{{0, 3, 6}, {0, 1, 3}, {0, 2, 4}}, //
258+
{{0, 2, 4}, {0, 1, 3}, {0, 3, 6}}, //
259+
{3, 2}, //
260+
{4, 2}));
261+
262+
// H+C;C
263+
BOOST_REQUIRE(
264+
check_manual_eval<ArrayToT>("ijk;mo,ijk;no->ji;nm", //
265+
{{0, 2, 5}, {0, 1, 3}, {0, 3, 4}}, //
266+
{{0, 2, 5}, {0, 1, 3}, {0, 3, 4}}, //
267+
{4, 2}, //
268+
{3, 2}));
258269
}
259270

260271
BOOST_AUTO_TEST_CASE(different_nested_ranks) {

0 commit comments

Comments
 (0)