Hi,<br>Hope everyone's doing fine !<br><br>Please go through this code :<br><br><br>#include <iostream><br>#include <ginac/ginac.h><br>using namespace std;<br>using namespace GiNaC;<br><br>int main()<br>{<br> symbol i_sym("i"), j_sym("j"), e("e"), a("a"), b("b") ;
<br> idx i(i_sym, 3), j( j_sym, 3) ; //defining indices i and j<br> <br> scalar_products sp;<br> sp.add( indexed(e, i), indexed(e, j), delta_tensor(i,j) ); // e.i * e.j = delta_tensor.i.j<br>
<br> cout << (indexed(e,i)*indexed(e,j)).simplify_indexed(sp) <<endl ;<br><br> return 0;<br>}<br><br>does NOT give delta.j.i instead just gives e.i * e.j - why?<br><br>Basically, i want to define an orthonormal basis vector set {
e.i}.<br>If i have vector_a = indexed(a, i) * indexed(e, i) and vector_b = indexed(b, j) * indexed(e, j) , then i want adotb to reduce to a.i * b.i ( ofcoure after i apply simplify_indexed(sp) to adotb ) <br><br>Thanks a lot for going through this mail.
<br>