Simplifying expressions with tensor defined by IndexSet

656 views
Skip to first unread message

kold...@gmail.com

unread,
Sep 13, 2021, 1:26:29 AM9/13/21
to xAct Tensor Computer Algebra
Hi All, 

I am calculating some variations of a generalisation of the Cotton tensor on a 3D manifold; To this end, I have defined two tensors through (please also see the attached MWE):

DefTensor[Cotton[a, b], M3];
IndexSet[Cotton[a_, b_], epsilon[metricg][a, c, d] CD[-c][ RicciCD[-d, b] - 1/4 RicciScalarCD[] metricg[-d, b] // ToCanonical]];

and then getting the equations of motion of Cotton^2 using VarL. I am left with a long expression in terms of the Ricci tensor. 

Is there any way to use the IndexSet definition of Cotton to express the output of VarL in terms of the Cotton tensor and its derivatives? I have tried defining rules using MakeRule, but it does not seem to work. 

Also, does 'epsilon[metricg]' define the weight -2 tensor density that is the levicivita tensor, or should I be multiplying this by Sqrt[Detmetricg]? The documentation is not clear on this. 

Thanks in advance!


Cotton_variation.nb

Jose

unread,
Sep 13, 2021, 7:44:40 AM9/13/21
to xAct Tensor Computer Algebra
Hi,

You have two questions:

1) No, there is no automatic way  to reconstruct a large expression replacing B in terms of A after having set A = B. I always do this sort of thing manually, guessing which terms could be present in the final expression in terms of A. You can add coefficients (as constant variables) to the terms you think could be there, and then try to solve a system of linear equations for them.

2) In xTensor, epsilon[metricg] is a true tensor (weight 0), not a tensor density. I recommend to read section 1.5 of xCobaDoc.nb. Very briefly: Given a basis B of vectors (let's say in 3D) you can antisymmetrize the product of all vectors and you get the etaUpB[a, b, c] tensor density (of weight +1 in that basis), or you can antisymmetrize the product of all covectors and you get the etaDownB[-a, -b, -c] tensor density (of weight -1 in that basis). The determinant DetgB[] of the matrix of components of the metric g in the basis B has weight +2 in that basis. Hence we have (beware of signs from the metric signature and basis orientation):

    epsilong[a, b, c] == Sqrt[DetgB[]] etaDownB[a, b, c] == Sqrt[1 / DetgB[]] etaUpB[a, b, c]

where those are equalities among tensors and all indices are raised/lowered with g. See the mentioned docs for full details and examples.

Cheers,
Jose.

kold...@gmail.com

unread,
Sep 13, 2021, 8:15:20 PM9/13/21
to xAct Tensor Computer Algebra
Hi Jose, thanks a lot for your answers!

I looked into the LeviCivita a bit with xCoba, and it seems that when I call epsilon[g][i,j,k] (in 3D), and write out the components (with CTensor, for example) there is a 1/Sqrt[DetB[]] present in that representation. I think that tracks with your explanation and the docs. Did I understand this right?

Cheers, 
Albin

On Monday, 13 September 2021 at 20:44:40 UTC+9 Jose wrote:
Hi,

You have two questions:

1) No, there is no automatic way  to reconstruct a large expression replacing B in terms of A after having set A = B. I always do this sort of thing manually, guessing which terms could be present in the final expression in terms of A. You can add coefficients (as constant variables) to the terms you think could be there, and then try to solve a system of linear equations for them.

2) In xTensor, epsilon[metricg] is a true tensor (weight 0), not a tensor density. I recommend to read section 1.5 of xCobaDoc.nb. Very briefly: Given a basis B of vectors (let's say in 3D) you can antisymmetrize the product of all vectors and you get the etaUpB[a, b, c] tensor density (of weight +1 in that basis), or you can antisymmetrize the product of all covectors and you get the etaDownB[-a, -b, -c] tensor density (of weight -1 in that basis). The determinant DetgB[] of the matrix of components of the metric g in the basis B has weight +2 in that basis. Hence we have (beware of signs from the metric signature and basis orientation):

    epsilong[a, b, c] == Sqrt[DetgB[]] etaDownB[a, b, c] == Sqrt[1 / DetgB[]] etaUpB[a, b, c]

where those are equalities among tensors and all indices are raised/lowered with g. See the mentioned docs for full details and examples.

Cheers,
Jose.

On Monday, September 13, 2021 at 12:26:29 AM UT
Hi All, 

Jose

unread,
Sep 13, 2021, 8:25:23 PM9/13/21
to xAct Tensor Computer Algebra
That's correct.

epsilon[g][i, j, k] has weight 0 and etaUpB[i, j, k] has weight +1 in the basis B. We know they are proportional and therefore the relation is (modulo signs)

   epsilon[g][i, j, k] = etaUpB[i, j, k] / Sqrt[DetgB[]]

because the weight of DetgB[] is +2 in the basis B. The components of etaUpB[i, j, k] are 0, +1 or -1 in the basis B and therefore the components of epsilong in the basis B are 0, +- 1/Sqrt[DetgB[]].

Jose.

kold...@gmail.com

unread,
Sep 14, 2021, 7:02:28 AM9/14/21
to xAct Tensor Computer Algebra
Hi Jose, 

thanks! This is clear now. 

I am dealing with almost exactly the same problem: my scalar function in the ADM lapse, and I have complicated equations of motion which I am trying to evaluate with CTensor constructs. All is well, until I need to choose the lapse function. You end your answer above by hinting that it's possible to do that so that covariant derivatives etc understand. How would you do that in that case?

Many thanks. 
Albin

kold...@gmail.com

unread,
Sep 14, 2021, 7:02:59 AM9/14/21
to xAct Tensor Computer Algebra
As an update to my question: I have tried to define the lapse as

lapse = CTensor[1/r[], {}]

and some contractions work fine, for example cd[a][cd[a][lapse[]]], but things like cd[-b][cd[-a][lapse[]]] are still throwing basis vectors (e_a^b), and I am not sure how to define it correctly. The shift vector was much easier for some reason; shift = CTensor[{r[], 0, 0}, {CC}, 0], seems to have worked fine?

Best, 
Albin

On Tuesday, 14 September 2021 at 09:25:23 UTC+9 Jose wrote:

kold...@gmail.com

unread,
Sep 16, 2021, 1:31:27 AM9/16/21
to xAct Tensor Computer Algebra
I hope it's okay to carry on in the same thread and that people see this. 

I have found an ugly workaround to my problem with defining a scalar function properly. 

Recap: I have field equations which look like this (small snippet)

Fulleqs=(-(1/2) \[Sigma] lapse[] g[-i, -j] - 
  1/2 \[Alpha]2 lapse[] g[-i, -j] Ricci[cd][-a, -b] Ricci[cd][a, 
    b] + \[Xi] lapse[] Ricci[cd][-i, -j] + 
  2 \[Alpha]2 lapse[] Ricci[cd][-i, -a] Ricci[cd][-j, a]

everything except the lapse[] is known, and I have been struggling to define it in such a way that xCoba doesn't express everything in terms of e^i_a, which I guess is a basis connection. This is a partial workaround:

DefScalarFunction[lapse, PrintAs -> "N"]

and then extract the different components of Fulleqs, without making use of a certain basis, and defining the lapse[] function at the same time

Fulleqs[[1]][[1]][[1]] /. lapse[] -> 1/r[]^2 // Simplify

It works, but it's not pretty, and not very xCoba-esque. 

Also, when I define the shift and Extrinsic curvature:

DefTensor[shift[i], M3, PrintAs -> "N"]
DefTensor[ExK[-i, -j], M3, Symmetric[{-i, -j}]]
shift = CTensor[{r[], 0, 0}, {CC}, 0];
IndexSetDelayed[ExK[-i_, -j_], 
  1/(2*lapse[]) (ParamD[t][g[-i, -j]] - cd[-i][shift[-j]] - 
     cd[-j][shift[-i]])];

The following does NOT work: ExK[i, -j], but ExK[-i, -j]*g[i,k] works just fine. Is there a reason for this?


Many thanks to all

Jose

unread,
Sep 16, 2021, 6:36:41 PM9/16/21
to xAct Tensor Computer Algebra
Hi,

Again, sending partial code does not fully characterize the problem. Please send a small notebook or a small complete collection of inputs that produce a result that looks incorrect or surprising to you. We can then discuss what's the best way to achieve some computation.

The e^i_a objects you mention are Basis[i, {-a, -basis}] objects, i.e. basis vectors. If you want to convert between this notation and CTensor notation use the commands BasisExpand and FromBasisExpand. See for example the end of the subsubsection 3.1.2 of xCobaDoc.nb, in the Basic Ideas subsection of the CTensor section. You may need to trace dummy indices in advance.

If you have an IndexSetDelayed definition using patterns ExK[-i_, -j_], with explicit minus signs (i.e. covariant indices), then it will only work for covariant indices. See subsection 5.2 (IndexSet and IndexSetDelayed) and subsection 5.3 (Index patterns) of xTensorDoc.nb on how to defined all sorts of assignments and index patterns.

Cheers,
Jose.

kold...@gmail.com

unread,
Sep 16, 2021, 11:22:50 PM9/16/21
to xAct Tensor Computer Algebra
Hi Jose, 

thanks for your input. I forgot to attach my MWE, sorry about that. Please find it attached now. In the meantime, I will read the documentation you suggested. 

Thanks in advance, 
Albin
CTensor_MWE.nb

Jose

unread,
Sep 17, 2021, 4:28:08 PM9/17/21
to xAct Tensor Computer Algebra
Hi Albin,

This notebook was very useful to understand what is going on. I attach it again showing how I'd do this computation.

The main point to notice is that you should never use Clear or assignments (Set, SetDelayed, etc.) on an object that has been declared with DefTensor or other DefXXX command. That can deeply confuse xTensor. To particularize abstract equations to explicit CTensor objects use rules. In this way you can try many different replacements on the same abstract situation.

Cheers,
Jose.

CTensor_MWE.nb
Reply all
Reply to author
Forward
0 new messages