Hello again,Thank you very much for the previous help. Some of the research I do involves using actions to calculate things like the Euler Lagrange equations. I was wondering if this is possible to do in Sage.
For example, if I had the LagrangianNabla_mu(phi) Nabla^mu (phi)-m^2*phi^2how would I go about constructing one? I tried simply defining it, but I keep getting the attribute 'sage.symbolic.expression.Expression' object has no attribute '_domain' when I try and take the covariant derivative of it.
Thank you for your response. I haven't actually tried the example, as my expression is much more complex. However, let's say I want to take the covariant derivative of the following vector with respect to the Schwarzschild metric: (1-M/r)dt^2.
How would one construct that to take a covariant derivative?
sage: M = Manifold(4, 'M')
sage: X.<t,r,th,ph> = M.chart(r't r:(0,+oo) th:(0,pi):\theta ph:(0,2*pi):\phi')
sage: m = var('m'); assume(m>=0)
sage: g = M.lorentzian_metric('g')
sage: g[0,0], g[1,1] = -(1-2*m/r), 1/(1-2*m/r)
sage: g[2,2], g[3,3] = r^2, (r*sin(th))^2
sage: v = M.vector_field(name='v')
sage: v[0], v[1] = 1, 1-2*m/r
sage: v.display()
v = d/dt + (-2*m/r + 1) d/dr
sage: nabla = g.connection(); nabla
Levi-Civita connection nabla_g associated with the Lorentzian metric g on the 4-dimensional differentiable manifold M
sage: nab_v = nabla(v); nab_v
Tensor field nabla_g(v) of type (1,1) on the 4-dimensional differentiable manifold M
sage: nab_v.display()
nabla_g(v) = m/r^2 d/dt*dt - m/(2*m*r - r^2) d/dt*dr - (2*m^2 - m*r)/r^3 d/dr*dt + m/r^2 d/dr*dr - (2*m - r)/r^2 d/dth*dth - (2*m - r)/r^2 d/dph*dph