1
$\begingroup$

I have a tensor (rank zero) or a scalar $\phi$ which defined as

DefTensor[\[Phi][], M]

on manifold $M$. After defining the metric, how can I use CTensor to rewrite $\phi$? For example, I have tried

\[Phi] = CTensor[\[Phi]0[r[]]];

(where $\phi0$ is already defined as a scalarFunction).

$\endgroup$

1 Answer 1

1
$\begingroup$

You do not really need CTensor for this. You need to replace \[Phi][] by \[Phi]0[r[]]. There are multiple ways to implement that replacement/assignment.

If you want to use CTensor, then you need the object

s = CTensor[\[Phi]0[r[]], {}]

where the empty list indicates that this is a scalar. CTensor does not add this list automatically, because for non-scalars it would not know which vector bases should be used. Then s[] gets converted into \[Phi]0[r[]]. Note that you do not need to define s with DefTensor for the Set assignment above.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.