An important question of variation of tensor fields

122 views
Skip to first unread message

Amir Hadi Ziaie

unread,
May 6, 2015, 5:08:11 PM5/6/15
to xa...@googlegroups.com
Dear all

I have attached a math file in which I have explored my problem with variation of tensor fields.

Please let me know for the answer of my questions.

Best wishes

Hadi


An important question on variation.nb

Leo Stein

unread,
May 6, 2015, 5:26:17 PM5/6/15
to Amir Hadi Ziaie, xAct Tensor Computer Algebra
Hi Amir,

1. Regarding which index permutations appear when you perform a variation. Inside the heart of VarD there is an application of the function ImposeSymmetry, followed by the application of ToCanonical. This ensures that the resulting variation will have the index symmetry of the tensor which was varied. Because it uses ToCanonical internally, many of the terms have combined, and you do not get to see the intermediate result that had all of the terms present. If you want to see all of those terms, you can go into the code for VarD and remove the application of ToCanonical. That is, you could change this code:
VarD[tensor_[inds1___], der_][tensor_?xTensorQ[inds2___], rest_] := 
  With[{clist = ChangeIndex /@ IndexList[inds1]},
   ToCanonical[
    ImposeSymmetry[Inner[varddelta, clist, IndexList[inds2], Times], 
      clist, SymmetryGroupOfTensor[tensor[inds1]]] rest, 
    UseMetricOnVBundle -> None]];
to this code:
VarD[tensor_[inds1___], der_][tensor_?xTensorQ[inds2___], rest_] := 
  With[{clist = ChangeIndex /@ IndexList[inds1]},
    ImposeSymmetry[Inner[varddelta, clist, IndexList[inds2], Times], 
      clist, SymmetryGroupOfTensor[tensor[inds1]]] rest];
This is in Sec. 13.1 of xTensor.nb.
 
2. For the expressions that vanish, I believe that you are just seeing a copy-paste typo. Basically you have tried to take the variation of TorsionCD with respect to T1, but these are two functionally independent tensors. This was just a typo of copy-pasting and then only changing one instance of TorsionCD to T1, instead of changing all of them.

Best,
Leo

--
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.
For more options, visit https://groups.google.com/d/optout.

Amir Hadi Ziaie

unread,
May 7, 2015, 9:40:35 AM5/7/15
to xa...@googlegroups.com, ah.z...@gmail.com
Dear Leo

Many thanks for your quick and helpful reply. I agree with your second comment and your are right. 

On your first point, still I have a problem with evaluating the variation VarD[TorsionCD[a, b, c], CD][TorsionCD[e, f, g]]

I have replaced the old code with the new one in xTensor.nb (as you said) and compiled this file. But the result did not change as you see in the attached file.

I want to see all the details coming from variation, so Leo, I would appreciate if you give me a help to overcome this problem.

Best wishes
Hadi


My best regards
Hadi
An important question on variation1.nb

Leo Stein

unread,
May 7, 2015, 9:56:50 AM5/7/15
to Amir Hadi Ziaie, xAct Tensor Computer Algebra
Hi Amir,

Sorry, I don't see what the problem is. I believe the output you see is correct. The expression
(-(delta[-a, e]*delta[-b, g]*delta[-c, f]) + 
  delta[-a, e]*delta[-b, f]*delta[-c, g])/2
is already in canonical form (except for expanding out the division by two).

So, in this example, you are seeing all the details coming from ImposeSymmetry.

Does anybody else agree/disagree? Did I miss something?

Best
Leo

Jose

unread,
May 7, 2015, 11:09:59 AM5/7/15
to xa...@googlegroups.com, leo....@gmail.com, ah.z...@gmail.com
Hi,

Variational derivatives should always differentiate a scalar object. However, in many cases it is possible to extend the concept to deal with a non-scalar object, and this has been requested multiple times in this group. So now VarD starts by checking whether its "numerator" is scalar or not, and if it is not a scalar the message "VarD::nouse: Attempting to apply VarD on a non-scalar expression." is printed and VarD switches to the internal function NonScalarVarD.

What this function NonScalarVarD does is contracting the non-scalar object to differentiate with a temporary tensor of complementary free indices, so that now we have a scalar. Then proceeds with the differentiation and finally removes the temporary tensor. The code is this:

NonScalarVarD[tensor_, der_][expr_] :=
  With[{inds = ChangeIndex /@ FindFreeIndices[expr]}, 
   With[{tmp = Tensor["TMP", SignedVBundleOfIndex /@ inds, DependenciesOf[expr]] @@ inds}, 
    IndexCoefficient[VarD[tensor, der][tmp expr], tmp]
    ]
   ];

For the particular case of a single tensor being differentiated with respect to itself, this is equivalent to the code that Leo posted, and which was being used before. That previous code was probably easier to understand: a product of deltas was constructed and then projected to impose the symmetry of the tensor in both sets of indices (those of the "numerator" and the "denominator" of VarD).

If you want to understand what the new code above does, I recommend you evaluate step by step those instructions. Note it uses the not-yet-public notation Tensor[...], that avoids going through DefTensor and UnDefTensor for temporary tensors.

Cheers,
Jose.


On Thursday, May 7, 2015 at 8:56:50 AM UTC-5, Leo Stein wrote:
Hi Amir,

Sorry, I don't see what the problem is. I believe the output you see is correct. The expression
(-(delta[-a, e]*delta[-b, g]*delta[-c, f]) + 
  delta[-a, e]*delta[-b, f]*delta[-c, g])/2
is already in canonical form (except for expanding out the division by two).

So, in this example, you are seeing all the details coming from ImposeSymmetry.

Does anybody else agree/disagree? Did I miss something?

Best
Leo

Amir Hadi Ziaie

unread,
May 7, 2015, 11:27:27 AM5/7/15
to xa...@googlegroups.com, leo....@gmail.com, ah.z...@gmail.com
Dear Jose
Dear Leo

I appreciate for your comprehensive and extremely useful comments. Now My problem is solved.

My best regards
Hadi
Reply all
Reply to author
Forward
0 new messages