Skip to content

Commit 6f6efea

Browse files
committed
Fix handling of missing TableauBase properties in young_reduce.
1 parent 39b9125 commit 6f6efea

File tree

2 files changed

+30
-21
lines changed

2 files changed

+30
-21
lines changed

core/algorithms/young_reduce.cc

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -570,16 +570,18 @@ ProjectedForm young_reduce::symmetrize(Ex::iterator it)
570570
pos = 0;
571571
for (auto& it : terms) {
572572
auto tb = kernel.properties.get_composite<TableauBase>(it);
573-
auto tab = tb->get_tab(kernel.properties, tr, it, 0);
574-
for (size_t col = 0; col < tab.row_size(0); ++col) {
575-
if (tab.column_size(col) > 1) {
576-
std::vector<index_t> indices;
577-
for (auto beg = tab.begin_column(col), end = tab.end_column(col); beg != end; ++beg)
578-
indices.push_back(*beg + pos);
579-
std::sort(indices.begin(), indices.end());
580-
sym.apply_young_symmetry(indices, true);
573+
if(tb) {
574+
auto tab = tb->get_tab(kernel.properties, tr, it, 0);
575+
for (size_t col = 0; col < tab.row_size(0); ++col) {
576+
if (tab.column_size(col) > 1) {
577+
std::vector<index_t> indices;
578+
for (auto beg = tab.begin_column(col), end = tab.end_column(col); beg != end; ++beg)
579+
indices.push_back(*beg + pos);
580+
std::sort(indices.begin(), indices.end());
581+
sym.apply_young_symmetry(indices, true);
582+
}
583+
}
581584
}
582-
}
583585
pos += it.number_of_children();
584586
}
585587

@@ -588,19 +590,21 @@ ProjectedForm young_reduce::symmetrize(Ex::iterator it)
588590
for (auto& it : terms) {
589591
// Apply the symmetries
590592
auto tb = kernel.properties.get_composite<TableauBase>(it);
591-
auto tab = tb->get_tab(kernel.properties, tr, it, 0);
592-
for (size_t row = 0; row < tab.number_of_rows(); ++row) {
593-
if (tab.row_size(row) > 1) {
594-
std::vector<index_t> indices;
595-
for (auto beg = tab.begin_row(row), end = tab.end_row(row); beg != end; ++beg)
596-
indices.push_back(*beg + pos);
597-
std::sort(indices.begin(), indices.end());
598-
sym.apply_young_symmetry(indices, false);
593+
if(tb) {
594+
auto tab = tb->get_tab(kernel.properties, tr, it, 0);
595+
for (size_t row = 0; row < tab.number_of_rows(); ++row) {
596+
if (tab.row_size(row) > 1) {
597+
std::vector<index_t> indices;
598+
for (auto beg = tab.begin_row(row), end = tab.end_row(row); beg != end; ++beg)
599+
indices.push_back(*beg + pos);
600+
std::sort(indices.begin(), indices.end());
601+
sym.apply_young_symmetry(indices, false);
602+
}
603+
}
599604
}
600-
}
601605
pos += it.number_of_children();
602-
}
603-
606+
}
607+
604608
sym.multiply(*it->multiplier);
605609

606610
cdebug << pf_to_string(sym, &index_map) << '\n';

tests/youngreduce.cdb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,12 @@ def test13():
140140
young_reduce(ex)
141141
#young_reduce(ex, $R_{a b c d} A^{a b c}$)
142142
assert ex==0
143-
print("Test 13 passed")
143+
print("Test 13a passed")
144+
ex:=R_{a b c d} A_{a b c};
145+
young_reduce(ex)
146+
tst:= R_{a b c d} A_{a b c} - @(ex);
147+
assert(tst==0)
148+
print("Test 13b passed")
144149

145150
test13()
146151

0 commit comments

Comments
 (0)