FullSimplification not working inside MakeRule

74 views
Skip to first unread message

Sukruti

unread,
Oct 18, 2024, 11:40:44 AM10/18/24
to xAct Tensor Computer Algebra
Hello,

I have noticed that the command FullSimplification[][expr] does not work inside MakeRule. An example is shown in the attached notebook. Does anyone know why it is so?

Is there any way to fix it? If not, is there an alternate route to define a rule with FullSimplification[] such that the defined rule is as general as MakeRule allows in general?

Cheers
Sukruti
FullSimplification in MakeRule.nb

Thomas Bäckdahl

unread,
Oct 18, 2024, 11:57:56 AM10/18/24
to xa...@googlegroups.com
Hi!

If you want to do computations that leads to a rule, I would recommend to do the computation as an equation first, and then transform that equation to a rule.
In your case
CommutationEq = CD[-\[Alpha]]@CD[\[Alpha]]@CD[-\[Beta]]@\[Phi][] == CD[-\[Beta]]@CD[-\[Alpha]]@CD[\[Alpha]]@\[Phi][] + FullSimplification[][CD[-\[Alpha]]@CD[\[Alpha]]@CD[-\[Beta]]@\[Phi][] - CD[-\[Beta]]@CD[-\[Alpha]]@CD[\[Alpha]]@\[Phi][]]

BoxRule = EqToRule@CommutationEq;

By the way. The function SortCovDsStart should be used as
SortCovDsStart[CD]

However, doing that here would automatically turn CommutationEq to True, which is not going to work as a replacement rule.
Perhaps you will not need the rule in the first place if you use SortCovDsStart[CD].

Personally, I always derive my replacement rules as equations and then use EqToRule to transform them into rules.

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/bd85b234-98bd-43a9-9923-121715d0f86en%40googlegroups.com.

Sukruti

unread,
Oct 21, 2024, 5:23:52 AM10/21/24
to xAct Tensor Computer Algebra
Hi Thomas,

Thanks! Your suggestion of first writing an equation and then using EqToRule, is a nice option for this purpose.

I'll use this for now.

Cheers
Sukruti

Sukruti

unread,
Oct 24, 2024, 5:25:58 AM10/24/24
to xAct Tensor Computer Algebra
Hi Thomas,

In your last email you suggested that on using SortCovDsStart[CD] I may not need to use a separate replacement rule for commuting the covariant derivatives in the desired way in a given term. While this is true for a certain set of terms, including the term in the notebook attached to my first email in this thread, I find that this doesn't work for all terms.

In the notebook attached to this email I have shown two lists, named 'SortYes' and 'SortNo'. SortCovDsStart[CD] works for the terms in the first list but not those in the second list. I wonder what criterion determines whether SortCovDsStart[CD] will work for a given term.

Is there any other Mathematica/xAct command that can push all the boxes in a given term to the right, and which works on all terms?

Cheers
Sukruti
SortCovDsStart[CD] Strange.nb

Thomas Bäckdahl

unread,
Oct 26, 2024, 3:54:08 AM10/26/24
to xa...@googlegroups.com
Hi!

The reason this worked for some cases, and not others is that SortCovDsStart[CD] sorts the indices alphabetically in postfix notation. This is not great when it comes to dummy indices because the names of the dummy indices have no meaning. One could in principle try to change the names of the dummy indices so the alphabetical sorting does what you want, but it is not a great idea.

There is a function that can do the sorting you want
SortCovDsToBox[\[Phi]][expression]
However, you can not use this together with SortCovDsStart[CD], so do SortCovDsStop[CD] or don't evaluate SortCovDsStart[CD].

Regards
Thomas

Sukruti

unread,
Nov 14, 2024, 2:11:38 PM11/14/24
to xAct Tensor Computer Algebra
Hi Thomas,

Thank you very much for your reply! It has been very helpful.

I have two questions. Firstly, if I have a couple of different equations, say CommuteEq1, CommuteEq2, and CommuteEq3, and I want to convert them into a single rule using EqToRule only once, is that possible?

Secondly, SortCovDsToBox[\[Phi]][expression] applies the command SortCovDsToBox only on the derivatives acting on \[Phi] in a given expression. Is it possible to write this command in such a way that it is applied to all the derivatives appearing in the expression and not just \[Phi]?

Cheers
Sukruti
Reply all
Reply to author
Forward
0 new messages