Abstract tensor manipulation in Sage Manifold

120 views
Skip to first unread message

Zach Elgood

unread,
May 25, 2016, 12:40:57 PM5/25/16
to sage-support
I recently started using Sage Manifolds, and was wondering if it was possible to define tensor expression independent of basis. For example, I am working with some quantum field theory, and am trying to define the following tensor

U_mu=partial_mu (psi)/(sqrt(partial_nu(psi) nabla^nu (psi))

where psi is a scalar field. I want this to be valid independent of the choice of basis.

Eric Gourgoulhon

unread,
May 26, 2016, 8:58:05 AM5/26/16
to sage-support
Hi,

With SageManifolds, all tensor expressions are independent of basis, although internally computations are made in one or more bases.
For instance, your example could be written as (assuming that (M,g) is a Lorentzian manifold):

psi = M.scalar_field(...)
dpsi = psi.differential()
U = dpsi / sqrt( g.inverse()(dpsi, dpsi) )

There is no mention of any basis in the definition of U.

Best wishes,

Eric.

Zach Elgood

unread,
May 26, 2016, 3:03:23 PM5/26/16
to sage-support
Thank you very much for the reply. What I was looking for was a tensor which I could manipulate and then choose the basis at a later time. With your example, which is similar to what I started with, I am unable to do things like take the covariant derivative with respect to an arbitrary metric. Or if I wished to check relationships with an arbitrary tensor 

Eric Gourgoulhon

unread,
May 27, 2016, 2:14:10 AM5/27/16
to sage-support

Le jeudi 26 mai 2016 21:03:23 UTC+2, Zach Elgood a écrit :
Thank you very much for the reply. What I was looking for was a tensor which I could manipulate and then choose the basis at a later time.

OK I see. Unfortunately this is not possible in the current setting: you have to define a basis (for instance by defining a coordinate chart) prior to any computation. Of course, at a later time, you may introduce another basis and ask for any tensor components w.r.t. it. You may even decide that the new basis is the default one, via the function set_default_frame.

 
With your example, which is similar to what I started with, I am unable to do things like take the covariant derivative with respect to an arbitrary metric. Or if I wished to check relationships with an arbitrary tensor 

None of these is possible because SageManifolds is not doing *abstract* tensor calculus (like xAct/xTensor for instance), but *component* tensor calculus, according to the terminology introduced in the classification at http://www.xact.es/links.html

Best wishes,

Eric.

Reply all
Reply to author
Forward
0 new messages