the Kronecker delta - Maple Programming Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Physics : Physics/KroneckerDelta

Physics[KroneckerDelta] - the Kronecker delta

Calling Sequence

KroneckerDelta[m, n]

Parameters

m, n

-

the indices, as names representing integer numbers or the numbers themselves

Description

• 

KroneckerDelta[m, n], displayed as δ__m,n, is a computational representation for the Kronecker Delta, that is: it returns 1 or 0, according to whether the indices are equal or different, or so assumed using assuming. When equality cannot be proved or disproved KroneckerDelta[m, n] returns unevaluated, echoing the input.

• 

Note: since Maple 2019, KroneckerDelta[m, n] is not implemented as a tensor (of type Physics:-Library:-PhysicsType:-Tensor), even if m and n are letters representing spacetime or space tensor indices, unless one of such indices is contravariant, preceded with ~, as in ~n, while the other remains covariant (in which case KroneckerDelta[m, ~n] is automatically transformed into the spacetime metric g_[m, n] which is a tensor). Consequently, δ__m,m with the two indices covariant, returns the number 1 in all cases, and Einstein's sum rule for repeated indices is not applied to δ__m,n even when m or n appear repeated in a product of an algebraic expression.

• 

If, on the other hand, you prefer to work with KroneckerDelta[m, n] as a tensor, for example in quantum mechanics by setting the spacetime to be Euclidean and of dimension 3 (something you can accomplish using Setup), you can set a macro, or Define a tensor representing the Kronecker δ tensor. See the example at the end of the Examples section.

• 

The %KroneckerDelta command is the inert form of KroneckerDelta, so it represents the same mathematical operation but without performing it. To perform the operation, use value.

• 

Some automatic checking and normalization are carried out each time you enter KroneckerDelta[...]. The checking is concerned with possible syntax errors. The automatic normalization takes into account the symmetry of KroneckerDelta[m,n] with respect to interchanging the positions of the indices m and n.

• 

The %KroneckerDelta command is the inert form of KroneckerDelta, so it represents the same thing but entering it does not result in performing any computation. To perform the related computations as if %KroneckerDelta were KroneckerDelta, use value.

Examples

withPhysics:

Setupmathematicalnotation=true

mathematicalnotation=true

(1)

KroneckerDelta2,2=KroneckerDeltam,m

1=1

(2)

KroneckerDelta2,3

0

(3)

KroneckerDeltam,n

δm,n

(4)

KroneckerDelta is sensitive to assumptions:

assumingm=n

1

(5)

assumingmn

0

(6)

The symmetry property of KroneckerDelta is automatically taken into account when the indices have symbolic values

KroneckerDeltam,nKroneckerDeltan,m

0

(7)

By default, spacetime indices are represented by greek letters and the dimension of spacetime is 4 - you can query about that via

Setupspacetimeindices,dimension

dimension=4,spacetimeindices=greek

(8)

Note: since Maple 2019, KroneckerDelta[mu, nu] is not considered a tensor (of type Physics:-Library:-PhysicsType:-Tensor), even if μ and ν are letters representing tensor indices. Consequently, in all cases, the following does not return the trace, but the number 1

KroneckerDeltaμ,μ

1

(9)

%KroneckerDeltaμ,μ

%KroneckerDeltaμ,μ

(10)

value

1

(11)

KroneckerDeltaμ,ν

δμ,ν

(12)

type,Physics:-Library:-PhysicsType:-Tensor

false

(13)

Care should be taken, however, if you happen to index KroneckerDelta with one index covariant and the other contravariant (preceded by ~), in which case KroneckerDelta[mu, ~nu] is automatically transformed into the spacetime metric g_[mu, ~nu] (both displayed with the δ greek letter as is standard in physics textbooks), for which g[mu, ~mu], with the index repeated, represents its trace, equal to the spacetime dimension

KroneckerDeltaμ,`~nu`=g_μ,`~nu`

g_μνμν=g_μνμν

(14)

lprint

Physics:-g_[mu,~nu] = Physics:-g_[mu,~nu]

μ=ν|μ=ν

4=4

(15)

assumingμ=ν

4=4

(16)

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,

Setupmetric=Euclidean,dimension=3,spacetimeindices=lowercaselatin

The dimension and signature of the tensor space are set to 3,- - +

The Euclidean metric in cartesian coordinates

Changing the signature of the tensor spacetime to: + + +

dimension=3,metric=1,1=1,2,2=1,3,3=1,spacetimeindices=lowercaselatin

(17)

Define now qj and pk as tensors respectively representing position and momentum

Setupquantumoperators=p,q,tensors=qj,pk,metric=Euclidean,dimension=3,spacetimeindices=lowercase

The Euclidean metric in cartesian coordinates

dimension=3,metric=1,1=1,2,2=1,3,3=1,quantumoperators=p,q,spacetimeindices=lowercaselatin,tensors=γa,σa,a,ga,b,pk,qj,εa,b,c

(18)

Set the standard commutator rules using tensor notation pj,qk=KroneckerDeltaj,k there the right-hand side is expressed using KroneckerDelta[j,k]

Setup%Commutatorpj,qk=KroneckerDeltaj,k

Warning, since Maple 2019 KroneckerDelta is not implemented as a tensor. Thus, the right-hand side of the algebra rule `?`=δj,k has for free tensor indices , while the left-hand side has j,k, of which j,k appear in δj,k. To resolve this problem you can: 1. Use the spacetime metric g_, or the space metric gamma_, instead of KroneckerDelta. If so, check the value of: Setupsignature. 2. Enter: macroKroneckerDelta=g_; or use gamma_ instead of g_. 3. Define a Kronecker δ tensor. In the following, type 'delta' on the left and 'KroneckerDelta' on the right, or copy and paste: Defineδa,b=Matrix3,3,j,kδj,k. After any of the above it is recommended that you set this algebra rule again, with the corrected right-hand side, to avoid problems due to having different free indices on each side of the rule.

algebrarules=%Commutatorpj,qk=KroneckerDeltaj,k

(19)

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 remain equal to the identity matrix. From the three options indicated, if you are adapting a worksheet written before Maple 2019, the simplest is option 2:

macroKroneckerDelta=g_:

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:

KroneckerDeltam,m

3

(20)

You can undo this mapping of KroneckerDelta into g_ at any time via

macroKroneckerDelta=KroneckerDelta:

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,

Defineδa,b=Matrix3,3,j,k→KroneckerDeltaj,k

Defined objects with tensor properties

γa,σa,a,δa,b,ga,b,pk,qj,εa,b,c

(21)

Check now the components and behavior of this Kronecker delta tensor

δ[]

δa,b=100010001

(22)

δ1,1

1

(23)

SumOverRepeatedIndicesδm,m

3

(24)

while you still have the non-tensor version

KroneckerDeltam,m

1

(25)

You can now reenter the algebra rules in tensor notation, with the right-hand side corrected using the tensor version delta[j, k]

Setup%Commutatorpj,qk=δj,k

algebrarules=%Commutatorpj,qk=δj,k

(26)

Matrix3,m,n→%Commutator=Commutatorpm,qn

%Commutatorp1,q1=1%Commutatorp1,q2=0%Commutatorp1,q3=0%Commutatorp2,q1=0%Commutatorp2,q2=1%Commutatorp2,q3=0%Commutatorp3,q1=0%Commutatorp3,q2=0%Commutatorp3,q3=1

(27)

%Commutator=Commutatorpa,qb

%Commutatorpa,qb=δa,b

(28)

expanda=b|a=b

pbqbqbpb=δb,b

(29)

SumOverRepeatedIndices

p1q1+p2q2+p3q3q1p1q2p2q3p3=3

(30)

Simplify

3=3

(31)

See Also

`.`, Commutator, g_, gamma_, Physics, Physics conventions, Physics examples, Physics Updates, Tensors - a complete guide, Mini-Course Computer Algebra for Physicists, Setup

Compatibility

• 

The Physics[KroneckerDelta] command was updated in Maple 2019.