Skip to content

Commit

Permalink
Allow partial derivative components to be given as positive integers
Browse files Browse the repository at this point in the history
They are still assumed to be covariant components
  • Loading branch information
barrywardell committed Mar 7, 2014
1 parent efbd372 commit 3cd00bd
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions Tools/CodeGen/xTensorKranc.m
Expand Up @@ -122,6 +122,7 @@
pd[-i_?AbstractIndexQ][t_] := nd[PDKrancBasis[{-i, -KrancBasis}][t]];
pd[t_, -i_?AbstractIndexQ] := nd[PDKrancBasis[{-i, -KrancBasis}][t]];
pd[t_, i_Integer?Negative] := nd[PDKrancBasis[{-i, -KrancBasis}][t]];
pd[t_, i_Integer?Positive] := nd[PDKrancBasis[{i, -KrancBasis}][t]];

(* Distribute the nd wrapper over Plus, e.g. expand
nd[pd[t[0],0] + pd[t[1],1]] out to nd[pd[t[0],0]] + nd[pd[t[1],1]].
Expand Down

0 comments on commit 3cd00bd

Please sign in to comment.