DataType[exp, type] = True
defines the object exp
to have data-type type
.
DataType[exp1, exp2, ..., type]
defines the objects exp1, exp2, ...
to have data-type type
.
The default setting is DataType[__, _] := False
.
To assign a certain data-type, do, e.g., DataType[x, PositiveInteger] = True
. Currently used DataTypes
:
NonCommutative
PositiveInteger
NegativeInteger
PositiveNumber
FreeIndex
GrassmannParity
FCTensor
ImplicitDiracIndex
ImplicitPauliIndex
ImplicitSUNFIndex
If loaded, PHI adds the DataTypes
: UMatrix
, UScalar
.
Overview, DeclareNonCommutative, NonCommutative, PositiveInteger, NegativeInteger, PositiveNumber, FreeIndex, GrassmannParity, FCTensor, ImplicitDiracIndex, ImplicitPauliIndex, ImplicitSUNFIndex.
NonCommutative
is just a data-type.
[f, g, NonCommutative] = True;
DataType
t = f . g - g . (2 a) . f
Since f
and g
have DataType
NonCommutative
, the function DotSimplify
extracts only a
out of the noncommutative product.
[t] DotSimplify
[m, odd] = DataType[a, even] = True;
DataType
[x_] := x /. (-1)^n_ /; DataType[n, odd] :> -1;
ptest1
[x_] := x /. (-1)^n_ /; DataType[n, even] :> 1;
ptest2
t = (-1)^m + (-1)^a + (-1)^z
[t]
ptest1
[%] ptest2
Clear[ptest1, ptest2, t, a, m];
[m, integer] = True;
DataType
f[x_] := x /. {(-1)^p_ /; DataType[p, integer] :> 1};
= (-1)^m + (-1)^n x test
f[test]
Clear[f, test];
[f, g, NonCommutative] = False;
DataType
[m, odd] = DataType[a, even] = False; DataType
Certain FeynCalc objects have DataType
PositiveInteger
set to True
.
[OPEm, PositiveInteger] DataType
PowerSimplify uses the DataType information.
[ (-1)^(2 OPEm)] PowerSimplify
[ (- SO[q])^OPEm] PowerSimplify