Skip to content

Commit 814199d

Browse files
committed
Fix subscripts in Derivative conversion.
1 parent 0212671 commit 814199d

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

core/DisplaySympy.cc

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
#include "properties/Accent.hh"
77
#include <regex>
88

9+
//#define DEBUG 1
10+
911
using namespace cadabra;
1012

1113
DisplaySympy::DisplaySympy(const Kernel& kernel, const Ex& e)
@@ -587,14 +589,20 @@ void DisplaySympy::import(Ex& ex)
587589
// 2nd order derivative.
588590

589591
if(*loc->name=="\\comma") {
592+
#ifdef DEBUG
593+
std::cerr << loc << std::endl;
594+
#endif
590595
auto x=ex.begin(loc);
591596
auto n=x; ++n;
592597
if(! n->is_integer())
593598
throw RuntimeException("DisplaySympy::import received un-parseable Derivative expression.");
594599
int nn=to_long(*n->multiplier);
595600
for(int k=0; k<nn; ++k)
596-
ex.insert_subtree(loc, x);
601+
ex.insert_subtree(loc, x)->fl.parent_rel=str_node::p_sub;
597602
ex.erase(loc);
603+
#ifdef DEBUG
604+
std::cerr << it << std::endl;
605+
#endif
598606
}
599607

600608

0 commit comments

Comments
 (0)