manpagez: man pages & more
info ginac
Home | html | info | man
[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.14.6.3 Minkowski metric tensor

The Minkowski metric tensor is a special metric tensor with a constant matrix representation which is either diag(1, -1, -1, ...) (negative signature, the default) or diag(-1, 1, 1, ...) (positive signature). It is created with the function lorentz_g() (although it is output as ‘eta’):

 
{
    varidx mu(symbol("mu"), 4);

    e = delta_tensor(varidx(0, 4), mu.toggle_variance())
      * lorentz_g(mu, varidx(0, 4));       // negative signature
    cout << e.simplify_indexed() << endl;
     // -> 1

    e = delta_tensor(varidx(0, 4), mu.toggle_variance())
      * lorentz_g(mu, varidx(0, 4), true); // positive signature
    cout << e.simplify_indexed() << endl;
     // -> -1
}

© manpagez.com 2000-2024
Individual documents may contain additional copyright information.