--
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 visit https://groups.google.com/d/msgid/xact/28481179-e304-4551-ae04-4be00a75e2bfn%40googlegroups.com.
Hi!
The reason that Iden2 is not doing anything apart from printing
is that the Print command returns Null, not True.
And[True, Null] returns Null, so the rule is never applied.
If you really want the Print command, you might want to write
something like (Print[\[Zeta], \[Eta], \[Alpha], \[Delta]] ==
Null) instead of just the Print command.
The main problem though is that the indices in the left and right
hand sides of the rule is rearranged for all the 736 cases in
Iden1. However, the condition is added without any rearrangement.
Hence, the rule is not doing what you intended it to do. By
accident your extra conditions might stop the rule being applied
in the cases you wanted to avoid, but it is not really checking
what you intended.
To actually remove some cases from MakeRule correctly is very
difficult. You might have to copy and rewrite the entire MakeRule
function. Unfortunately this is easier said than done because it
is a really complicated function.
In your case I would recommend to not use MakeRule with
conditions.
One possibility is to try MakeRule just with MetricOn->None and
no extra conditions, possibly using several starting versions of
the equation. I am not sure exactly what you wanted to avoid, so
this might or might not work for you.
Another possibility might be to manually figure out a minimal set
of replacement rules with conditions. These can then be written
without MakeRule.
Yet another possibility could be to use MakeCompareRule (in
SymManipulator) or a modified version of it.
The difference between MakeRule and MakeCompare rule is the
following.
MakeRule makes a list of all possible rearrangements that might be
needed to recognize the left hand side.
MakeCompareRule just makes one rule with a general pattern
ignoring the index positions. When the rule is applied, it checks
if the terms that matches the general pattern can be rewritten as
the left hand side using a special version of EqualExpressionsQ.
In that case the index replacement rule that was needed to rewrite
the left hand side to the found pattern is appled to the right
hand side and that is returned instead.
MakeCompareRule or the more convenient EqToCompareRule does not
find contractions of the left hand side, so you need to make rules
for all contracted versions you are interested in. It looked like
you wanted to avoid some contractions, so that might be a good
thing for you.
Just a warning. Try not to display the rule generated by
MakeCompareRule or EqToCompareRule, at least if you are using
$PrePrint = ScreenDollarIndices;. ScreenDollarIndices gets
confused and throws errors. The rule should still work. If you
want to look at it you can use InputForm on it. Due to
xAct`SymManipulator`Private` on all variable names, it might be
difficult to read though.
Regards
Thomas
To view this discussion visit https://groups.google.com/d/msgid/xact/d4ef3181-d551-438f-acb7-b19c8650ccdfn%40googlegroups.com.
Hi!
First of all it is PairQ, not Pair.
Secondly, as I said, you should not use conditions in MakeRule
like this because it is not going to do the right thing. \[Alpha]
and \[Beta] are not going to be in the indicated positions in all
512 rules that MakeRule is producing.
With MakeRule you can not in a good way tell if indices are
allowed to be contracted or not. MetricOn->All or
MetricOn->None only tells if indices are allowed to be raised
or lowered. It does not check if indices are contracted or not.
Due to the problems I described in my previous answers, this
really can not be done with MakeRule unless you rewrite the code
for it considerably.
What I would suggest instead is to define your substitution as an equation.
RelationEq1 =
RiemannCD[\[Alpha], \[Gamma], \[Delta], \[Epsilon]]*
RiemannCD[\[Beta], -\[Gamma], -\[Delta], -\[Epsilon]] ==
2*RicciCD[\[Alpha], \[Gamma]]*RicciCD[\[Beta], -\[Gamma]] -
g[\[Alpha], \[Beta]]*RicciCD[-\[Gamma], -\[Delta]]*
RicciCD[\[Gamma], \[Delta]] -
RicciCD[\[Alpha], \[Beta]]*
RicciScalarCD[] + (g[\[Alpha], \[Beta]]*RicciScalarCD[]^2)/4
+
2*RicciCD[\[Gamma], \[Delta]]*
RiemannCD[\[Alpha], -\[Gamma], \[Beta], -\[Delta]] + \
(g[\[Alpha], \[Beta]]*
RiemannCD[-\[Gamma], -\[Delta], -\[Epsilon], -\[Zeta]]*
RiemannCD[\[Gamma], \[Delta], \[Epsilon], \[Zeta]])/4;
Then you can make a replacement rule from the equation with EqToCompareRule.
ReplacementRule1 = EqToCompareRule@RelationEq1;
This rule can now be applied to your expressions. This will allow indices to be moved up or down, rearranged or renamed, but not contracted.
In this case there is only one possible contraction, and that is
the one you wanted to avoid. Hence, this is fine.
However, there might be more complicated cases where you want to
allow some contractions. In that case you have to make an equation
for each contracted case and apply EqToCompareRule to each case
and collected in a list. If it is difficult to figure out which
contractions are possible, the xTras function AllContractions can
help. Unfortunately, that function does not work for expressions
with dummy indices. Therefore, you would need define a new tensor
with the same number of free indices and symmetry group as your
left hand side. AllContractions on this new tensor will then give
you a list of all possible contractions. From that it is not too
difficult to construct a list of contracted relations. But in most
cases it is easy to manually figure out which contracted relations
one might want to use, so AllContractions are usually not needed.
Regards
Thomas
To view this discussion visit https://groups.google.com/d/msgid/xact/64451b8d-a8eb-48ea-97b2-9e0a359b4215n%40googlegroups.com.