Rule for equation

42 views
Skip to first unread message

Sergio González

unread,
Dec 15, 2016, 5:31:45 PM12/15/16
to xAct Tensor Computer Algebra
Hi there,

I am struggling trying to implement a rule for a equation, hope that someone can help me.

I want to evaluate an expression on-shell (maybe there's already a defined function to do so and all of this is useless). The problem is that my equations of motions are somehow complicated (with four diferent terms) so trying MakeRule[{eom,0}] does not work as there are several terms on the lhs. Any idea of how to implement this?

Thomas Bäckdahl

unread,
Dec 15, 2016, 6:19:35 PM12/15/16
to xa...@googlegroups.com
Hi!

I  use the following:
EqToRule[expr_Equal] := MakeRule[Evaluate[List @@ expr], MetricOn -> All, ContractMetrics -> True]
and
EqToRuleN[expr_Equal] :=  MakeRule[Evaluate[List @@ expr], MetricOn -> None, ContractMetrics -> False]

This way you can turn an equation into a rule.

If you have many indices in your left hand side you might also try
EqToCompareRule[expr_Equal] := MakeCompareRule[Evaluate[List @@ expr]]

However, you always have to have only one term on the left hand side. If you have an equation like a+b+c==0 you can often use a==-b-c, but sometimes you have to be a bit more clever. Everything depends on the structure of your problem. Picking out symmetric parts, or even better irreducible parts is often a good idea. I often solve this kind of problem in spinors by substituting the expressions with their irreducible decompositions, and then I can compute substitution rules for each irreducible piece. If I do it like that I always get one term in the left hand side and still get maximal simplification.

I hope this gave you some ideas. If you want more detailed help, you might want to give more details about the structure of your problem.

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

Mario Herrero Valea

unread,
Dec 16, 2016, 8:12:35 AM12/16/16
to xa...@googlegroups.com
However, you always have to have only one term on the left hand side. If you have an equation like a+b+c==0 you can often use a==-b-c, but sometimes you have to be a bit more clever. Everything depends on the structure of your problem. Picking out symmetric parts, or even better irreducible parts is often a good idea. I often solve this kind of problem in spinors by substituting the expressions with their irreducible decompositions, and then I can compute substitution rules for each irreducible piece. If I do it like that I always get one term in the left hand side and still get maximal simplification


This is probably the most efficient way to do it. The problem here is that pattern matching is in general very complicated. You cannot just say to the computer “take into account Einstein equations” expecting that it works.

If you try to impose a substitution rule like 

RicciCD[m,n]-1/2 RicciScalarCD[]g[m,n]->T[m,n]

the computer will only substitute those terms which are exactly identical to that combination. For instance, it wont substitute things like

RicciCD[m,n]-6 RicciScalarCD[]g[m,n]

although this should be simplified when taking the former into account.

Thomas´s suggestion is the best procedure. Try to reduce your system of equations to basic constituents and then reduce the expressions by using those. Following the previous simple example, choose the rule to be

RicciCD[m,n]->1/2 RicciScalarCD[]g[m,n]+T[m,n]

and everything should work fine.

Cheers,

Mario
Reply all
Reply to author
Forward
0 new messages