KroneckerDelta[n1,n2,…]
gives the Kronecker delta
, equal to 1 if all the
are equal, and 0 otherwise.
KroneckerDelta
KroneckerDelta[n1,n2,…]
gives the Kronecker delta
, equal to 1 if all the
are equal, and 0 otherwise.
Details
- KroneckerDelta[0] gives 1; KroneckerDelta[n] gives 0 for other numeric n.
- KroneckerDelta has attribute Orderless.
- An empty template
can be entered as
kd
. Arguments in the subscript should be separated by commas. - The comma can be made invisible by using the character \[InvisibleComma] or
,
. - KroneckerDelta automatically threads over lists. »
Examples
open all close allBasic Examples (4)
KroneckerDelta[1, 0]Table[KroneckerDelta[x, y], {x, 3}, {y, 3}]//MatrixFormUse in sums to pick out elements:
Sum[KroneckerDelta[a, 3] f[a], {a, Infinity}]Plot over a subset of the integers:
DiscretePlot[KroneckerDelta[x], {x, -2, 2}, PlotMarkers -> {Automatic, 12}]Scope (26)
Numerical Evaluation (6)
KroneckerDelta[-3, -3]KroneckerDelta[2.5, 3.5]KroneckerDelta[E, Catalan, (1/2)]KroneckerDelta[I]KroneckerDelta[2 - I, 2 - I]KroneckerDelta[2 - I, Pi - (1/4), 0.5I]KroneckerDelta always returns an exact result irrespective of the precision of the input:
KroneckerDelta[0.12345]Evaluate efficiently at high precision:
KroneckerDelta[2, 5, 10`100]//TimingKroneckerDelta[0``10000]//TimingCompute the elementwise values of an array using automatic threading:
KroneckerDelta[{{1 / 2, -1}, {-5 / 3, 1 / 2}}]//FullSimplifyOr compute the matrix KroneckerDelta function using MatrixFunction:
MatrixFunction[KroneckerDelta, {{1 / 2, -1}, {-5 / 3, 1 / 2}}]//FullSimplifyCompute average-case statistical intervals using Around:
KroneckerDelta[ Around[2 / 3, 0.001]]Specific Values (3)
KroneckerDelta[0]The multi-argument form gives 1 when all inputs are equal:
KroneckerDelta[1, 1]KroneckerDelta[2, 2, 2]KroneckerDelta[3, 3, 3, 3]Assuming[x < 0 && y > 0, Refine[KroneckerDelta[x, x, y]]]PiecewiseExpand[KroneckerDelta[ x, y], -2 < x < 2]Visualization (3)
Plot the single-argument KroneckerDelta using integer-width bins:
DiscretePlot[KroneckerDelta[x], {x, -2, 2}, ExtentSize -> Full]Visualize KroneckerDelta over the reals. Except for a jump at
, it is indistinguishable from a zero function:
Plot[{KroneckerDelta[x], 0}, {x, -2, 2}, PlotStyle -> {StandardBlue, StandardRed}, AxesOrigin -> {-2, -1}, PlotLegends -> "Expressions", Epilog -> {StandardBlue, PointSize[Large], Point[{0, KroneckerDelta[0]}]}]Plot KroneckerDelta in three dimensions:
DiscretePlot3D[KroneckerDelta[x, y], {x, -2, 2}, {y, -2, 2},
ExtentSize -> Full, ColorFunction -> "TemperatureMap"]Function Properties (10)
KroneckerDelta is defined for all real and complex inputs:
FunctionDomain[KroneckerDelta[x1, x2, x3], {x1, x2, x3}]FunctionDomain[KroneckerDelta[x1, x2, x3], {x1, x2, x3}, Complexes]Function range of KroneckerDelta:
FunctionRange[KroneckerDelta[x1, x2, x3], {x1, x2, x3}, y]The function range for complex values is the same:
FunctionRange[KroneckerDelta[x1, x2, x3], {x1, x2, x3}, y, Complexes]KroneckerDelta accepts list inputs:
KroneckerDelta[{1, 0}, {0, 1}]KroneckerDelta[{1, 0}, {1, 0}]The traditional notation is used in both StandardForm and TraditionalForm:
KroneckerDelta[n, m]KroneckerDelta[n, m]//TraditionalFormKroneckerDelta is not an analytic function:
FunctionAnalytic[KroneckerDelta[x, y], {x, y}]It has both singularities and discontinuities:
FunctionSingularities[KroneckerDelta[x, y], {x, y}]FunctionDiscontinuities[KroneckerDelta[x, y], {x, y}]KroneckerDelta is neither nondecreasing nor nonincreasing:
FunctionMonotonicity[KroneckerDelta[x], x]KroneckerDelta is not injective:
FunctionInjective[KroneckerDelta[x, y], {x, y}]KroneckerDelta is not surjective:
FunctionSurjective[KroneckerDelta[x, y], {x, y}]KroneckerDelta is non-negative:
FunctionSign[KroneckerDelta[x], x]KroneckerDelta is neither convex nor concave:
FunctionConvexity[KroneckerDelta[x], x]Differentiation and Integration (4)
First derivative with respect to
:
D[KroneckerDelta[x, y], x]Series expansion at a generic point:
Series[KroneckerDelta[x1, x2], {x1, x0, 2}]// FullSimplifyCompute the indefinite integral using Integrate:
Integrate[KroneckerDelta[x, y, z], x]FullSimplify[D[%, x] == KroneckerDelta[x, y, z]]Integrate[KroneckerDelta[x, y], {x, 0, 5}]Integrate[KroneckerDelta[x, y]KroneckerDelta[x, z], x]Applications (5)
Use in sums to pick out terms:
Sum[KroneckerDelta[k - j, 3] / j ^ 2, {k, Infinity}, {j, Infinity}]Generate a banded matrix with two superdiagonals:
Table[(KroneckerDelta[i - j + 1] + KroneckerDelta[i - j + 2])i j ^ 2, {i, 5}, {j, 5}]//MatrixFormArrayPlot[Table[KroneckerDelta[n, EulerPhi[m] + 1], {n, 60}, {m, 60}]]Compute MoebiusMu using KroneckerDelta and LiouvilleLambda:
μ[n_] := KroneckerDelta[PrimeNu[n], PrimeOmega[n]]LiouvilleLambda[n];Table[μ[n], {n, 1, 10}]Table[MoebiusMu[n], {n, 1, 10}]Decompose a spherical harmonic into a sum of products of two spherical harmonics:
With[{j = 5, m = 3, j1 = 2, j2 = 3}, Sqrt[(4 π (2 j + 1)/(2 j1 + 1) (2 j2 + 1))] Underoverscript[∑, m1 = -j1, j1]Underoverscript[∑, m2 = -j2, j2]KroneckerDelta[m1 + m2 - m] ClebschGordan[{j1, m1}, {j2, m2}, {j, m1 + m2}] SphericalHarmonicY[j1, m1, θ, ϕ] SphericalHarmonicY[j2, m2, θ, ϕ] == ClebschGordan[{j1, 0}, {j2, 0}, {j, 0}] SphericalHarmonicY[j, m, θ, ϕ]]Simplify[%]Properties & Relations (2)
Reduce an equation containing KroneckerDelta:
Reduce[a - KroneckerDelta[a, 3] == 2 && -10 < a < 10, a, Integers]The support of KroneckerDelta has measure zero:
Integrate[KroneckerDelta[x], {x, -1, 1}]Possible Issues (2)
KroneckerDelta can stay unevaluated for numeric arguments:
KroneckerDelta[1, 1 - (1/2) Sqrt[2 + Sqrt[2 + Sqrt[2]]] + Cos[(π/16)] + 10^-100]A larger setting for $MaxExtraPrecision can be needed:
N[%, 20]Block[{$MaxExtraPrecision = 100}, KroneckerDelta[1, 1 - (1/2) Sqrt[2 + Sqrt[2 + Sqrt[2]]] + Cos[(π/16)] + (1/10^100)]]Equality testing of the arguments takes numerical precision into account:
KroneckerDelta[1, 1.00000000000001]Neat Examples (1)
Express products of signatures as sums of products of Kronecker deltas:
signatureExpand[HoldPattern[Signature[{Longest[a___], b___}]Signature[{Longest[a___], c___}]]] := With[{d = Length[{a, b}]}, Length[{a}]!Total[(Signature[#]Times @@(KroneckerDelta@@@Transpose[{{b}, #}]))& /@ Permutations[{c}]]]Special cases for 3D; summation over repeated indices is assumed:
signatureExpand[Unevaluated[Signature[{a1, a2, a3}]Signature[{a1, a2, a3}]]]signatureExpand[Unevaluated[Signature[{a1, a2, b3}]Signature[{a1, a2, c3}]]]//TraditionalFormsignatureExpand[Unevaluated[Signature[{a1, b2, b3}]Signature[{a1, c2, c3}]]]//TraditionalFormsignatureExpand[Unevaluated[Signature[{b1, b2, b3}]Signature[{c1, c2, c3}]]]//TraditionalFormTech Notes
Related Guides
Related Links
History
Introduced in 1999 (4.0) | Updated in 2017 (11.1)
Text
Wolfram Research (1999), KroneckerDelta, Wolfram Language function, https://reference.wolfram.com/language/ref/KroneckerDelta.html (updated 2017).
CMS
Wolfram Language. 1999. "KroneckerDelta." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2017. https://reference.wolfram.com/language/ref/KroneckerDelta.html.
APA
Wolfram Language. (1999). KroneckerDelta. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/KroneckerDelta.html
BibTeX
@misc{reference.wolfram_2026_kroneckerdelta, author="Wolfram Research", title="{KroneckerDelta}", year="2017", howpublished="\url{https://reference.wolfram.com/language/ref/KroneckerDelta.html}", note=[Accessed: 12-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_kroneckerdelta, organization={Wolfram Research}, title={KroneckerDelta}, year={2017}, url={https://reference.wolfram.com/language/ref/KroneckerDelta.html}, note=[Accessed: 12-June-2026]}