Skip to content

Commit fa480cf

Browse files
committed
Cleanup patch, make tests work again.
1 parent 3686df6 commit fa480cf

File tree

4 files changed

+12
-10
lines changed

4 files changed

+12
-10
lines changed

core/algorithms/canonicalise.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,9 @@ bool canonicalise::remove_traceless_traces(iterator& it)
5959
bool incremented_now=false;
6060
auto ind=kernel.properties.get<Indices>(indit, true);
6161
if(ind) {
62-
if(ind->set_name==trl->index_set_name) {
62+
// The indexs need to be in the set for which the object is
63+
// traceless (if specified, otherwise accept all).
64+
if(ind->set_name==trl->index_set_name || trl->index_set_name=="") {
6365
incremented_now=true;
6466
++ihits;
6567
}

core/properties/Traceless.hh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace cadabra {
88
class Traceless : virtual public property {
99
public:
1010
virtual ~Traceless() {};
11-
virtual std::string name() const;
11+
virtual std::string name() const override;
1212
virtual bool parse(Kernel&, keyval_t&) override;
1313

1414
std::string index_set_name; // refers to Indices::set_name

core/properties/WeylTensor.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ std::string WeylTensor::name() const
2323
}
2424

2525
// Traceless and TableauSymetry args are overwritten elsewhere
26-
bool WeylTensor::parse(Kernel&, keyval_t& keyvals)
26+
bool WeylTensor::parse(Kernel&, keyval_t& )
2727
{
2828
return true;
2929
}

tests/implicit.cdb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def test04():
5151
A::Traceless(indices=spinor);
5252
B::Traceless(indices=vector);
5353
ex:=Tr( A ) + Tr( B );
54-
canonicalise(_);
54+
canonicalise(_)
5555
tst:= Tr( B ) - @(ex);
5656
assert(tst==0)
5757
print("Test 04 passed")
@@ -98,7 +98,7 @@ def test08():
9898
{A,B}::AntiCommuting;
9999
ex:=(A)_{a b} (B)_{b a};
100100
combine(_)
101-
tst:= (-B A)_{b b} - @(ex);
101+
tst:= \indexbracket{-B A}_{b b} - @(ex);
102102
assert(tst==0)
103103
print("Test 08 passed")
104104

@@ -133,7 +133,7 @@ def test11():
133133
__cdbkernel__=create_scope()
134134
{a,b,c}::Indices(vector);
135135
ex:=(B)_{b c} (A)_{a b};
136-
combine(_);
136+
combine(_)
137137
tst:= (A B)_{a c} - @(ex);
138138
assert(tst==0)
139139
print("Test 11 passed")
@@ -148,8 +148,8 @@ def test12():
148148
B::ImplicitIndex(B_{a b});
149149
{A_{a b}, B_{a b}, C, D}::AntiCommuting;
150150
ex:=Tr( A C B D );
151-
untrace(_);
152-
sort_product(_);
151+
untrace(_)
152+
sort_product(_)
153153
tst:= -C D Tr( A B ) - @(ex);
154154
assert(tst==0)
155155
print("Test 12 passed")
@@ -164,7 +164,7 @@ def test13():
164164
B::ImplicitIndex(B_{a b});
165165
{A_{a b}, B_{a b}}::AntiCommuting;
166166
ex:=Tr( B A );
167-
sort_product(_);
167+
sort_product(_)
168168
tst:= Tr( -A B ) - @(ex);
169169
assert(tst==0)
170170
print("Test 13 passed")
@@ -175,7 +175,7 @@ def test14():
175175
__cdbkernel__=create_scope()
176176
{A,B,C}::ImplicitIndex;
177177
ex:=(B A C)_{a a};
178-
sort_product(_);
178+
sort_product(_)
179179
tst:= (A C B)_{a a} - @(ex);
180180
assert(tst==0)
181181
print("Test 14 passed")

0 commit comments

Comments
 (0)