Skip to content

Commit eec645b

Browse files
committed
Add new command to write out index lines (not yet implemented)
1 parent fa286e5 commit eec645b

File tree

2 files changed

+45
-0
lines changed

2 files changed

+45
-0
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
2+
#include "explicit_indices.hh"
3+
4+
#include "properties/ImplicitIndex.hh"
5+
6+
using namespace cadabra;
7+
8+
explicit_indices::explicit_indices(const Kernel& k, Ex& tr)
9+
: Algorithm(k, tr)
10+
{
11+
}
12+
13+
bool explicit_indices::can_apply(iterator st)
14+
{
15+
// Work on equals nodes, or single terms (not terms in a sum) or
16+
// sums, provided the latter are not lhs or rhs of an equals node.
17+
// All this because when we generate free indices, we need to
18+
// ensure that all terms and all sides of an equals node use the
19+
// same index names.
20+
21+
return false;
22+
}
23+
24+
Algorithm::result_t explicit_indices::apply(iterator& prod)
25+
{
26+
27+
28+
return result_t::l_applied;
29+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
2+
#pragma once
3+
4+
#include "Algorithm.hh"
5+
6+
namespace cadabra {
7+
8+
class explicit_indices : public Algorithm {
9+
public:
10+
explicit_indices(const Kernel&, Ex&);
11+
12+
virtual bool can_apply(iterator);
13+
virtual result_t apply(iterator&);
14+
};
15+
16+
}

0 commit comments

Comments
 (0)