Skip to content

Commit b045bd4

Browse files
committed
Fix inheritance of Tableau and FilledTableau properties so sums and products of tableau objects display correctly.
1 parent 8061fe9 commit b045bd4

File tree

4 files changed

+18
-2
lines changed

4 files changed

+18
-2
lines changed

core/Props.hh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ namespace cadabra {
200200
/// are more non-index children.
201201

202202
template<class T>
203-
class Inherit {
203+
class Inherit : virtual public property {
204204
public:
205205
virtual ~Inherit() {};
206206
virtual std::string name() const

core/properties/Tableau.hh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@
66

77
namespace cadabra {
88

9+
/// Property representing a Young tableau with unlabelled
10+
/// boxes. Note the difference with TableauBase, which represents
11+
/// a (set of) Young tableaux and the map of the boxes to
12+
/// tensor indices.
13+
914
class Tableau : public ImplicitIndex, virtual public property {
1015
public:
1116
virtual ~Tableau() {};

core/properties/TableauInherit.hh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@
66

77
namespace cadabra {
88

9+
/// Property which makes a node inherit the TableauBase properties of
10+
/// child nodes. The `size` and `get_tab` functions translate the
11+
/// index numbers of the child nodes to index numbers of the
12+
/// wrapping node.
13+
914
class TableauInherit : virtual public TableauBase, virtual public property {
1015
public:
1116
virtual std::string name() const

core/pythoncdb/py_kernel.cc

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
#include "properties/CommutingAsSum.hh"
88
#include "properties/Derivative.hh"
99
#include "properties/Accent.hh"
10+
#include "properties/Tableau.hh"
11+
#include "properties/FilledTableau.hh"
1012

1113
#include "CdbPython.hh"
1214

@@ -72,6 +74,9 @@ namespace cadabra {
7274
k->inject_property(new CommutingAsProduct(), Ex_from_string("\\prod{#}", false, k), 0);
7375
k->inject_property(new DependsInherit(), Ex_from_string("\\prod{#}", false, k), 0);
7476
k->inject_property(new NumericalFlat(), Ex_from_string("\\prod{#}", false, k), 0);
77+
k->inject_property(new Inherit<Tableau>(), Ex_from_string("\\prod{#}", false, k), 0);
78+
k->inject_property(new Inherit<FilledTableau>(), Ex_from_string("\\prod{#}", false, k), 0);
79+
7580
auto wi2 = new WeightInherit();
7681
wi2->combination_type = WeightInherit::multiplicative;
7782
auto wa2 = Ex_from_string("label=all, type=multiplicative", false, k);
@@ -91,7 +96,8 @@ namespace cadabra {
9196
k->inject_property(wi4, Ex_from_string("\\wedge{#}", false, k), wa4);
9297

9398
k->inject_property(new IndexInherit(), Ex_from_string("\\sum{#}", false, k), 0);
94-
k->inject_property(new TableauInherit(), Ex_from_string("\\sum{#}", false, k), 0);
99+
k->inject_property(new Inherit<Tableau>(), Ex_from_string("\\sum{#}", false, k), 0);
100+
k->inject_property(new Inherit<FilledTableau>(), Ex_from_string("\\sum{#}", false, k), 0);
95101
k->inject_property(new CommutingAsSum(), Ex_from_string("\\sum{#}", false, k), 0);
96102
k->inject_property(new DependsInherit(), Ex_from_string("\\sum{#}", false, k), 0);
97103
auto wi = new WeightInherit();

0 commit comments

Comments
 (0)