How to define a scalar field dependent on R?

29 views
Skip to first unread message

Tanush Reddy Vaka

unread,
May 24, 2024, 2:40:15 AMMay 24
to xAct Tensor Computer Algebra
Hello,
I started using Mathematica and Xact a few days ago, so this question might be trivial.

I'm trying to derive the equation for cosmological perturbation in f(R) gravity.
I need both f(R) and derivatives of it f_R(R) and f_{RR}(R) (which are the 1st and 2nd derivatives wrt to R).

ToCannonical keeps giving me the error :
ToCanonical::noident: Unknown expression not canonicalized: (f^\[Prime])[R[Overscript[\[Del], _]]][] .

I do not understand why there's an error when the expression is defined as a scalar.
Any help, either a better implementation of this or making the expression canonical, would be appreciated.

I have attached a basic working example and the full notebook.
Thank you. :)

Tanush

How to define a Scalar Field Dependent on R.nb
full.nb

Thomas Bäckdahl

unread,
May 24, 2024, 3:32:42 AMMay 24
to xa...@googlegroups.com
Hi!

I didn't look into the details of your longer notebook, but I fixed the shorter one.

Your problem was that you defined f as a scalar field, but then you also used it as a scalar function of another scalar field.
You need DefScalarFunction for this.
For convenience it might be useful to also define scalar fields for f and its derivatives with respect to R.
You can give the function and the scalar field the same PrintAs, but they need to have different names because they are different kinds of objects in Mathematica.
If you want the scalar fields and not just the function, you will have to translate back and forth between the two formulations in your calculation.

Regards
Thomas
--
You received this message because you are subscribed to the Google Groups "xAct Tensor Computer Algebra" group.
To unsubscribe from this group and stop receiving emails from it, send an email to xact+uns...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/xact/f7cfff7a-1218-4af8-a3ff-b3f914095e95n%40googlegroups.com.

How to define a Scalar Field Dependent on R.nb
Reply all
Reply to author
Forward
0 new messages