xTensor: how to define one tensor in terms of another

290 views
Skip to first unread message

Shubham Kumar Sinha

unread,
Jun 25, 2022, 4:45:27 AM6/25/22
to xAct Tensor Computer Algebra
Hi,

I have to define another tensor in terms of already defined tensors.

DefManifold[M, 2, Complement[IndexRange[i, t], {n}]]

DefTensor[\[Phi][i], M]

DefTensor[\[Lambda][-i, -j, -k], M, Symmetric[{-i, -j, -k}]]

V = 1/6 \[Lambda][-i, -j, -k] \[Phi][i] \[Phi][j] \[Phi][k]

Now I have to define tensor v_{i} which takes the derivative of V with respect to \phi^{i} , so I defined it like this:

DefTensor[v[-i], M]

IndexSet[v[-i_], VarD[\[Phi][i]][V] // ToCanonical];

So it defines v[-i] in terms of another tensor but it does not define its dual v[i] in terms of another. I am new to both  Mathematica and xACT as well. It will be really helpful to point out where I  am doing wrong.

Best,
Shubham

conv.nb

Thomas Bäckdahl

unread,
Jun 25, 2022, 5:35:24 AM6/25/22
to xa...@googlegroups.com
Hi!

There are two problems with your code.
1)
First of all, you need to define a metric to be able to raise or lower indices. For instance you can add
DefMetric[-1, met[-i, -j], CD, {";", "\[Del]"}, PrintAs -> "g"]

2)
IndexSet does not know how to handle metrics, so one should be careful.
I usually like to work with equations instead and MakeRule, ToRule or something similar to make equations into rules that can be applied.
For instance:
vDef = v[-i] == VarD[\[Phi][i]][V]
vRule = ToRule[vDef, MetricOn -> All, ContractMetrics -> True]

It can then be used as
v[-i] /. vRule
v[i] /. vRule

If you want to automatically applied you can do
AutomaticRules[v, vRule]

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/e27a9f22-27bc-468c-aaf1-dfa71113f276n%40googlegroups.com.

Shubham Kumar Sinha

unread,
Jun 25, 2022, 4:35:22 PM6/25/22
to xAct Tensor Computer Algebra

Thanks a lot for pointing out the error. I still got one error in solving the equation. One more doubt that how to define that metric you defined to set to equal to delta [I,j]. I have the following equation to solve to get the two rank tensor (\gamma_{ij}):
\gamma_{ij}\phi^{i}\phi^{j} = 1/12 V_{ij} v^{ij}.  which suppose to give \gamma_{ij} = 1/12 \lambda_{abi}\lambda^{ab}_j , where v_{ij} = \lambda_{ijk}\phi^{k}.

DefTensor[w[-i, -j], M]
wDef = w[-i, -j] == VarD[\[Phi][i]][v[-j]]
wRule = ToRule[wDef, MetricOn -> All, ContractMetrics -> True]
AutomaticRules[w, wRule]
Solve[\[Gamma]1[-i, -j] \[Phi][i] \[Phi][j] == 1/12 w[i, j] w[-i, -j], \[Gamma]1[-i, -j]]

which gives result \[Gamma]1[-i, -j] -> (\[Lambda][-i, -l, -j]   \[Lambda][ i, -k, j]   \[Phi][k]   \[Phi][l])/(12  \[Phi][i]   \[Phi][j])

But I expected to get \[Gamma]1[-i, -j] -> (\[Lambda][-i, -l, -m]   \[Lambda][ -j, l, m] )/12

Is there any efficient way  to solve tensor equation in xACT.

Thomas Bäckdahl

unread,
Jun 27, 2022, 3:15:07 AM6/27/22
to xa...@googlegroups.com
Hi!

By default the indices in xAct are abstract indices. For abstract indices delta[-i,-j] makes no sense at all. Hence, if you really want to set your metric to
delta, you have to use a coordinate or frame basis. Only in that basis the metric can be delta. See the documentation for xCoba on how to handle this.

Regarding the tensorial equation, I don't see how you can draw the conclusion. Solving tensor equations is in general difficult. For some simple cases you might be able to extract useful information with the function IndexCoefficient. However, be aware that it is easy to draw the wrong conclusions unless you think about symmetries, traces etc. When you have figured out how it works with pen and paper, you can usually guide xAct to do something similar.

Regards
Thomas
Reply all
Reply to author
Forward
0 new messages