Setting A Combination Of Terms To 0

71 views
Skip to first unread message

Benedict

unread,
Nov 9, 2020, 3:30:04 PM11/9/20
to xAct Tensor Computer Algebra
Is there a way to set a certain combination of terms to 0?

For example, I derived that
0 == -(m[sf[]]^2*sf[]) + cd[-\[Sigma]$10886][cd[\[Sigma]$10886][sf[]]] - m[sf[]]*sf[]^2*Derivative[1][m][sf[]] -   Derivative[1][V][sf[]]

Now, I'd like to use this relation in other expressions. Is there a way to have mathematica / xAct doing it for me? Can it factor out such a combination of terms, even though they might be multiplied by an additional factor, e.g. -x(m[sf[]]^2*sf[]) + cd[-\[Sigma]$10886][cd[\[Sigma]$10886][sf[]]] - m[sf[]]*sf[]^2*Derivative[1][m][sf[]] -   Derivative[1][V][sf[]]=-x*0=0, and also if the summed over indices are others (dummy indices)?

Thank you very much in advance!

Thomas Bäckdahl

unread,
Nov 9, 2020, 3:52:26 PM11/9/20
to xa...@googlegroups.com
Hi!

In principle one could make a rule like
myRule1 = -(m[sf[]]^2*sf[]) + cd[-\[Sigma]_][cd[\[Sigma]_][sf[]]] - m[sf[]]*sf[]^2*Derivative[1][m][sf[]] -   Derivative[1][V][sf[]] :> 0
together with other rules with this multiplied by -1 etc. This could then be applied to expressions where you have collected the right expressions.

However, any rules based on replacement rules with several terms in the left hand side is a fundamentally bad idea. It is always difficult to combine the terms in the right way and find all possible cases.

It is much better to make a replacement rule with one term on the left hand side. For instance

myRule2 = cd[-\[Sigma]_][cd[\[Sigma]_][sf[]]]  :> aaa + (m[sf[]]^2*sf[]) + m[sf[]]*sf[]^2*Derivative[1][m][sf[]] + Derivative[1][V][sf[]]

Now myRule1 would correspond to myRule2 followed by aaa->0. What you probably would do is to apply myRule2 first, collect and simplify in some way. Then you have to decide which aaa terms should be turned back into the long expression, and which terms should be set to zero.
Exactly how this should be done depends a lot on the actual situation.
The general idea though is always to find a way to write the expression in a canonical form only using rules with one term in the left hand side. Trying to do anything else is going to cause more problems than solutions.

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/098f6985-a1a7-460c-a3c9-14eb825f0fe2n%40googlegroups.com.

Benedict

unread,
Nov 10, 2020, 9:43:42 AM11/10/20
to xAct Tensor Computer Algebra
Thank you very much for your answer. It helps a lot! One thing seems not to be working properly though: I get terms like

... + pertsf[LI[1]] - Scalar[pertsf[LI[1]]] + ...

Why is this happening? Sure, I can make an additional rule, ensuring pertsf[LI[1]]=Scalar[pertsf[LI[1]]], which works fine.

Also, terms like

pert[LI[1], \[Alpha], -\[Alpha]] -  Scalar[metric[\[Alpha], \[Beta]]*pert[LI[1], -\[Alpha], -\[Beta]]]

are not cancelled. 

What I do is the following: I have an expression L, which depends on a metric and a scalar field. I want the perturbation:
varL2 = ToCanonical[ContractMetric[ExpandPerturbation[Perturbation[L, 2]]]]

vartf2 = 2 (-VarD[pert[LI[1], \[Alpha], \[Beta]], cd][varL2] / Sqrt[-Detmetric[]] 
          /. {delta[-LI[1], LI[1]] -> 1, 
          delta[-LI[2], LI[1]] -> 0,
          delta[-LI[1], LI[2]] -> 0}
          //SeparateMetric[metric] //RicciToEinstein) //Expand //ContractMetric //ToCanonical

eterm2 = IndexCollect[cd[\[Alpha]]@vartf2 //ToCanonical, CD[-\[Beta]][sf[]]] //Simplification

result = eterm2 /. myRule /. myRule2 /. myRule3 // Simplification

If you spot any error in this approach, please let me know! Thank you very much in advance! :)

Thomas Bäckdahl

unread,
Nov 10, 2020, 1:59:54 PM11/10/20
to xa...@googlegroups.com
Hi!

NoScalar or PutScalar can help. See older posts for why they appear and how to handle them.

Regards
Thomas
Reply all
Reply to author
Forward
0 new messages