[GiNaC-list] Problem with scalar_products : Scalar product of two vectors in index notation

aravind b baravi2005 at gmail.com
Thu Nov 9 03:08:08 CET 2006


Hi,
Hope everyone's doing fine !

Please go through this code :


#include <iostream>
#include <ginac/ginac.h>
using namespace std;
using namespace GiNaC;

int main()
{
    symbol i_sym("i"), j_sym("j"), e("e"), a("a"), b("b") ;
    idx i(i_sym, 3), j( j_sym, 3) ;          //defining indices i and j

    scalar_products sp;
    sp.add( indexed(e, i), indexed(e, j), delta_tensor(i,j) );       // e.i*
e.j = delta_tensor.i.j

    cout << (indexed(e,i)*indexed(e,j)).simplify_indexed(sp) <<endl ;

    return 0;
}

does NOT give delta.j.i instead just gives e.i * e.j - why?

Basically, i want to define an orthonormal basis vector set {e.i}.
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 )

Thanks a lot for going through this mail.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.cebix.net/pipermail/ginac-list/attachments/20061109/b47dc4d8/attachment.html


More information about the GiNaC-list mailing list