Ask Your Question

# Alternating symbols with SageManifolds

I would like to utilize the alternating symbol $\epsilon_{abcd}$ in SageManifolds. I've worked out that you can define the volume form like

epsilon = g.volume_form()
print(epsilon) ; epsilon.display()

4-form eps_g on the 4-dimensional differentiable manifold M
eps_g = r^2*sqrt(-f(t))*abs(a(t))^3*sin(th) dt/\dr/\dth/\dph


And I can turn this into "the alternating 1-form" by dividing by the determinant of the metric. However, if I try to find the totally upper symbol $\epsilon^{abcd}$, which should just have components +1 and -1, I get

epsilon_up=epsilon.up(g)*det*det
print(epsilon_up);epsilon_up.display()

Tensor field of type (4,0) on the 4-dimensional differentiable manifold
M
abs(a(t))^6/a(t)^6 d/dt*d/dr*d/dth*d/dph - abs(a(t))^6/a(t)^6
d/dt*d/dr*d/dph*d/dth - abs(a(t))^6/a(t)^6 d/dt*d/dth*d/dr*d/dph +
abs(a(t))^6/a(t)^6 d/dt*d/dth*d/dph*d/dr + abs(a(t))^6/a(t)^6
d/dt*d/dph*d/dr*d/dth - abs(a(t))^6/a(t)^6 d/dt*d/dph*d/dth*d/dr -
abs(a(t))^6/a(t)^6 d/dr*d/dt*d/dth*d/dph + abs(a(t))^6/a(t)^6
d/dr*d/dt*d/dph*d/dth + abs(a(t))^6/a(t)^6 d/dr*d/dth*d/dt*d/dph -
abs(a(t))^6/a(t)^6 d/dr*d/dth*d/dph*d/dt - abs(a(t))^6/a(t)^6
d/dr*d/dph*d/dt*d/dth + abs(a(t))^6/a(t)^6 d/dr*d/dph*d/dth*d/dt +
abs(a(t))^6/a(t)^6 d/dth*d/dt*d/dr*d/dph - abs(a(t))^6/a(t)^6
d/dth*d/dt*d/dph*d/dr - abs(a(t))^6/a(t)^6 d/dth*d/dr*d/dt*d/dph +
abs(a(t))^6/a(t)^6 d/dth*d/dr*d/dph*d/dt + abs(a(t))^6/a(t)^6
d/dth*d/dph*d/dt*d/dr - abs(a(t))^6/a(t)^6 d/dth*d/dph*d/dr*d/dt -
abs(a(t))^6/a(t)^6 d/dph*d/dt*d/dr*d/dth + abs(a(t))^6/a(t)^6
d/dph*d/dt*d/dth*d/dr + abs(a(t))^6/a(t)^6 d/dph*d/dr*d/dt*d/dth -
abs(a(t))^6/a(t)^6 d/dph*d/dr*d/dth*d/dt - abs(a(t))^6/a(t)^6
d/dph*d/dth*d/dt*d/dr + abs(a(t))^6/a(t)^6 d/dph*d/dth*d/dr*d/dt


Which is just happening because at some point Sage has figured it out needs to keep track of the sign of a. Is there a direct way to define $\epsilon_{abcd}$ without accessing to the volume form at all? Essentially, I want to directly calculate things like the Euler Characteristic (and signature), which look like

$$R_{abcd}R_{efgh}\epsilon^{abef}\epsilon^{cdgh}$$

edit retag close merge delete

## 1 Answer

Sort by » oldest newest most voted

First of all, I would recommend using volume_form(contra=4) to get the volume form with all the indices raised up (see the documentation of volume_form). Guessing the form of your metric from the determinant you have given, the code could be

M = Manifold(4, 'M')
X.<t,r,th,ph> = M.chart(r't r:(0,+oo) th:(0,pi):\theta ph:\phi')
g = M.lorentzian_metric('g')
ff = function('f')(t)
aa = function('a')(t)
g[0,0] = ff
g[1,1] = aa^2
g[2,2] = aa^2*r^2
g[3,3] = aa^2*r^2*sin(th)^2
g.display()


output:

g = f(t) dt*dt + a(t)^2 dr*dr + r^2*a(t)^2 dth*dth + r^2*a(t)^2*sin(th)^2 dph*dph


g.volume_form(4) returns a 4-vector, i.e. a fully antisymmetric type-(4,0) tensor, with the advantage of a compact display, using wedge products instead of tensor products:

print(g.volume_form(contra=4))
g.volume_form(contra=4).display()


output:

4-vector field on the 4-dimensional differentiable manifold M
sqrt(-f(t))*abs(a(t))^3/(r^2*a(t)^6*f(t)*sin(th)) d/dt/\d/dr/\d/dth/\d/dph


The totally upper symbol is then

epsilon_up = - g.volume_form(contra=4)*g.sqrt_abs_det()
print(epsilon_up)
epsilon_up.display()


output:

4-vector field on the 4-dimensional differentiable manifold M
abs(a(t))^6/a(t)^6 d/dt/\d/dr/\d/dth/\d/dph


As you pointed out, $|a(t)|$ is not simplified to $a(t)$. Unfortunately, assume(a(t)>0) is of no help here (this is a known weakness of Sage: assumptions involving symbolic functions do not work). If you know that $a(t)>0$, the solution is to ask Sage to substitute $a(t)$ for $|a(t)|$:

epsilon_up[0,1,2,3] = epsilon_up[0,1,2,3].expr().substitute({abs(a(t)): a(t)})
epsilon_up.display()


output:

d/dt/\d/dr/\d/dth/\d/dph

more

## Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

## Stats

Asked: 2018-05-07 22:03:28 +0200

Seen: 185 times

Last updated: May 08 '18