Skip to content

Commit

Permalink
Ignore components which are not independent because of anti-symmetry
Browse files Browse the repository at this point in the history
  • Loading branch information
barrywardell committed Mar 10, 2014
1 parent 3d3596e commit f1d27a0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Tools/CodeGen/xTensorKranc.m
Expand Up @@ -270,7 +270,8 @@
];

(* Pick out the independent components *)
rules = krancForm[DeleteDuplicates[Thread[lhsC -> rhsC], #1[[1]] == #2[[1]] &]] /. (0->0) -> Sequence[];
rules = Thread[lhsC -> rhsC] /. {(0 -> _) -> Sequence[], (- _ -> _) -> Sequence[]};
rules = krancForm[DeleteDuplicates[rules, #1[[1]] == #2[[1]] &]];
InfoMessage[InfoFull, "Expanded to: ", Map[InputForm, rules, {2}]];
Sequence @@ rules
];
Expand All @@ -285,7 +286,7 @@
Check[Quiet[Validate[expr], Validate::unknown], ThrowError["Invalid tensor expression"]];
Sequence @@ krancForm[
DeleteDuplicates[
Flatten[{ComponentArray[TraceBasisDummy[expr]]}]]]
Flatten[{ComponentArray[TraceBasisDummy[expr]]}] /. {-t_?xTensorQ[i___] :> t[i], 0 -> Sequence[]}]]
];

(*************************************************************)
Expand Down

0 comments on commit f1d27a0

Please sign in to comment.