KroneckerDelta is sensitive to assumptions:
The symmetry property of KroneckerDelta is automatically taken into account when the indices have symbolic values
By default, spacetime indices are represented by greek letters and the dimension of spacetime is 4 - you can query about that via
Note: Since Maple 2019, KroneckerDelta[m, n] is not considered a tensor (of type Physics:-Library:-PhysicsType:-Tensor), even if and are letters representing space or spacetime tensor indices, unless the indices are of type Physics:-Library:-PhysicsType:-<spinorindex, su2index, su2matrixindex, su3index, su3matrixindex, or genericindex>. Consequently, the following calls to KroneckerDelta with repeated indices return the dimension
and the following does not return the trace, but the number 1
Care should be taken, however, if you happen to index KroneckerDelta with a space or spacetime index such that one index is covariant and the other contravariant (preceded by ~). In those cases KroneckerDelta is automatically transformed, respectively into the space or spacetime metric, gamma_ or g_ (all displayed with the greek letter as is standard in physics textbooks), for which the index repeated represents the trace, respectively equal to the space or spacetime dimension.
Physics:-g_[mu,~nu] = Physics:-g_[mu,~nu]
| |
There is one scenario, typical in quantum mechanics, in which KroneckerDelta is however used as a tensor to represent the metric of an Euclidean space, often of dimension 3, and that representation is used when expressing commutator rules. For example,
Define now and as tensors respectively representing position and momentum
Set the standard commutator rules using tensor notation there the right-hand side is expressed using KroneckerDelta[j,k]
The warning message explains the problem: the free indices are not the same at each side of the algebra rule because KroneckerDelta[j, k] is not representing a tensor, even when in an Euclidean space (only) its components do transform like tensor components and are equal to the identity matrix. From the four options indicated, if you are adapting a worksheet written before Maple 2019, the simplest is option 3:
After that, all occurrences of KroneckerDelta[m, m], now representing g_[m, m] with Einstein's sum over the repeated indices, will automatically return the trace of the metric instead of the number 1:
You can undo this mapping of KroneckerDelta into g_ at any time via
If you are not adapting worksheets of previous releases, however, the best is option 3, because it gives you access to both the tensor and the non-tensor versions of Kronecker . Directly copying from the message above and pasting on an input line,
Check now the components and behavior of this Kronecker tensor
while you still have the non-tensor version
You can now reenter the algebra rules in tensor notation, with the right-hand side corrected using the tensor version delta[j, k]