Skip to content

Commit e2b7489

Browse files
author
Kasper Peeters
committed
Fix canonicalise not working correctly on objects with Accents.
1 parent 03d87e5 commit e2b7489

File tree

4 files changed

+19
-2
lines changed

4 files changed

+19
-2
lines changed

core/algorithms/canonicalise.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -395,6 +395,9 @@ Algorithm::result_t canonicalise::apply(iterator& it)
395395
// std::cerr << Ex(facit) << " has tableaubase " << tba << std::endl;
396396
if(tba) {
397397
unsigned int num_ind=number_of_indices(facit);
398+
#ifdef XPERM_DEBUG
399+
std::cerr << "factor " << *facit->name << " has " << num_ind << " indices" << std::endl;
400+
#endif
398401

399402
// Add indices to the base. We used to add everything except the last one, but that
400403
// seems to be the wrong thing to do after the XPERM -> XPERM_EXT upgrade (see Jose's email).

core/properties/AntiSymmetric.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ TableauBase::tab_t AntiSymmetric::get_tab(const Properties& pr, Ex& tr, Ex::iter
2727
}
2828

2929
tab_t tab;
30-
for(unsigned int i=0; i<Ex::number_of_children(it); ++i)
30+
for(unsigned int i=0; i<Algorithm::number_of_indices(pr, it); ++i)
3131
tab.add_box(i,i);
3232
return tab;
3333
}

core/properties/Symmetric.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11

2+
#include "Algorithm.hh"
23
#include "properties/Symmetric.hh"
34

45
using namespace cadabra;
@@ -26,7 +27,7 @@ TableauBase::tab_t Symmetric::get_tab(const Properties& pr, Ex& tr, Ex::iterator
2627
}
2728

2829
tab_t tab;
29-
for(unsigned int i=0; i<tr.number_of_children(it); ++i)
30+
for(unsigned int i=0; i<Algorithm::number_of_indices(pr, it); ++i)
3031
tab.add_box(0,i);
3132
return tab;
3233
}

tests/canonicalise.cdb

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -906,3 +906,16 @@ def test60():
906906
print("Test 60b passed")
907907

908908
test60()
909+
910+
def test61():
911+
{a,b,c,d#}::Indices(position=independent).
912+
\bar{#}::Accent.
913+
\bar{A}_{a b}::Symmetric.
914+
\bar{A}^{a b}::Symmetric.
915+
ex := \bar{A}_{a b} \bar{A}^{b a};
916+
canonicalise (ex);
917+
tst:= \bar{A}_{a b} \bar{A}^{a b} - @(ex);
918+
assert(tst==0)
919+
print("Test 61 passed")
920+
921+
test61()

0 commit comments

Comments
 (0)