Skip to content

Commit 85393e6

Browse files
author
Kasper Peeters
committed
In meld, disable logic to detect overlapping index sets of length>1 in symmetry sets; it is incorrect and leads to spurious zeroes.
1 parent 1037323 commit 85393e6

File tree

2 files changed

+24
-11
lines changed

2 files changed

+24
-11
lines changed

core/algorithms/meld.cc

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#include "properties/SelfNonCommuting.hh"
2424
#include "properties/NonCommuting.hh"
2525

26-
#define DEBUG 1
26+
// #define DEBUG 1
2727

2828
using namespace cadabra;
2929

@@ -1010,6 +1010,9 @@ void meld::symmetrize_as_product(ProjectedTerm& projterm, const std::vector<symm
10101010
symmetrizers[i].independent &&
10111011
std::all_of(symmetrizers[i].indices.begin(), symmetrizers[i].indices.end(),
10121012
[seed](size_t i) { return seed[i] < 0; });
1013+
#ifdef DEBUG
1014+
std::cerr << "meld::symmetrize_as_product: symmetriser " << i << " independent " << independent << std::endl;
1015+
#endif
10131016
if (independent) {
10141017
Adjform indices;
10151018
for (const auto& index : symmetrizers[i].indices)
@@ -1034,7 +1037,7 @@ void meld::symmetrize_as_product(ProjectedTerm& projterm, const std::vector<symm
10341037

10351038
// Shared-dummy optimization: see if the symmetrizer at the front has cancellations (a la
10361039
// logic in symmetrize_as_product) taking into account dummy positions. We can only do this
1037-
// with the front of the symmetriers as after this the dummies will be mixed up. We rewrite
1040+
// with the front of the symmetrisers as after this the dummies will be mixed up. We rewrite
10381041
// the symmetrizers replacing index positions with their dummy equivalents if this points to
10391042
// a lower slot and then look for cancellations.
10401043

@@ -1078,7 +1081,13 @@ void meld::symmetrize_as_product(ProjectedTerm& projterm, const std::vector<symm
10781081
// One is symmetric and the other antisymmetric: if they overlap by more than one index
10791082
// then the whole projection is identically zero
10801083
if (inter.size() > 1) {
1081-
return;
1084+
#ifdef DEBUG
1085+
for(const auto& aa: inter)
1086+
std::cerr << aa << std::endl;
1087+
std::cerr << "meld::symmetrize_as_product: overlapping symmetric/anti-symmetric symmetriser" << std::endl;
1088+
#endif
1089+
// FIXME: the logic here is incorrect.
1090+
// return;
10821091
}
10831092
}
10841093
}

tests/meld.cdb

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -607,18 +607,22 @@ def traceless01():
607607
ex := dR_{m n p q r r};
608608
meld(_)
609609
assert ex == $0$, ex
610-
print('Test traceless01 passed')
610+
print("Test traceless01 passed")
611611

612612
traceless01()
613613

614+
def tab33():
615+
__cdbkernel__=create_scope()
616+
{a,b,c,d}::Indices;
617+
X_{a b c}::TableauSymmetry(shape=(2,1), indices=(0,2,1)).
618+
ex:=X_{a d d};
619+
meld(ex)
620+
tst:= X_{a d d} - @(ex);
621+
assert(tst==0)
622+
print("Test tab33 passed")
623+
624+
tab33()
614625

615-
{a,b,c,d}::Indices;
616-
X_{a b c}::TableauSymmetry(shape=(2,1), indices=(0,2,1)).
617-
ex:=X_{a d d};
618-
meld(ex);
619-
tst:= X_{a b c} - @(ex);
620-
assert(tst==0)
621-
print("tab33 passed")
622626

623627
# {a,b,c,i,j,k}::Indices;
624628
# {a,b,c,i,j,k}::Integer(1..3);

0 commit comments

Comments
 (0)