Skip to content

DiscreteDelta ​

The Kronecker-delta-like discrete delta: 1 when every argument is exactly 0, 0 otherwise.

✓ checked against that system · ! checked, with disagreements (hover a chip)Wolfram LanguageDiscreteDelta!
DiscreteDelta(x1, x2, …)1 if every argument is exactly 0; 0 if any argument is a nonzero real; unevaluated if any argument is undecided and none is a nonzero real.
Typed signatures
TypePackageApplies
(real, real*) -> numberanalyticalways

Domain: Elementary functions

Examples

Basic #
live ↗
InDiscreteDelta(0)\mathrm{DiscreteDelta}(0)Out11
live ↗
InDiscreteDelta(1)\mathrm{DiscreteDelta}(1)Out00
Scope #

Multi-argument -- 1 only when every argument is 0

live ↗
InDiscreteDelta(0,0)\mathrm{DiscreteDelta}(0, 0)Out11
live ↗
InDiscreteDelta(1,0)\mathrm{DiscreteDelta}(1, 0)Out00

Equals 1 when every argument is 0, however many there are

live ↗
InDiscreteDelta(0,0,0)\mathrm{DiscreteDelta}(0, 0, 0)Out11

Four zero arguments still give 1

live ↗
InDiscreteDelta(0,0,0,0)\mathrm{DiscreteDelta}(0, 0, 0, 0)Out11

Sign assumptions on the arguments do not decide whether they are all zero, so it stays

live ↗
InAssuming(x<0∧y>0,Refine(DiscreteDelta(x,x,y)))\mathrm{Assuming}(x\lt0∧y\gt0, \mathrm{Refine}(\mathrm{DiscreteDelta}(x, x, y)))OutDiscreteDelta(x,x,y)\mathrm{DiscreteDelta}(x, x, y)
live ↗
InFullSimplify(MatrixFunction(DiscreteDelta,[[1,0],[5,1]]))\mathrm{FullSimplify}(\mathrm{MatrixFunction}(\mathrm{DiscreteDelta}, \bigl\lbrack\bigl\lbrack1, 0\bigr\rbrack, \bigl\lbrack5, 1\bigr\rbrack\bigr\rbrack))Out[[0,0],[5DiscreteDelta′(1),0]]\bigl\lbrack\bigl\lbrack0, 0\bigr\rbrack, \bigl\lbrack5\mathrm{DiscreteDelta}^{\prime}(1), 0\bigr\rbrack\bigr\rbrack
live ↗
InDiscreteDelta(e,G⁡,12)\mathrm{DiscreteDelta}(e, \operatorname{G}, \frac{1}{2})Out00
live ↗
InFullSimplify(Series⁡(DiscreteDelta(x1,x2),x1,x0,2))\mathrm{FullSimplify}(\operatorname{Series}(\mathrm{DiscreteDelta}(\mathrm{x1}, \mathrm{x2}), \mathrm{x1}, \mathrm{x0}, 2))OutDiscreteDelta(x0,x2)+(x1−x0)∂∂x0DiscreteDelta(x0,x2)+12(∂2∂x02DiscreteDelta(x0,x2)(x1−x0)2)+O((x1−x0)3)\mathrm{DiscreteDelta}(\mathrm{x0}, \mathrm{x2})+(\mathrm{x1}-\mathrm{x0})\frac{∂}{∂\mathrm{x0}} \mathrm{DiscreteDelta}(\mathrm{x0}, \mathrm{x2})+\frac{1}{2}(\frac{∂^{2}}{∂\mathrm{x0}^{2}} \mathrm{DiscreteDelta}(\mathrm{x0}, \mathrm{x2})(\mathrm{x1}-\mathrm{x0})^2)+O\left((\mathrm{x1}-\mathrm{x0})^3\right)
Possible issues #

The argument is exactly 00 by a trigonometric identity, but its double is 2.5×10−172.5\times10^{-17}: it stays unevaluated rather than guess, as Wolfram leaves it

live ↗
InDiscreteDelta(12(2−(2+21/2)1/2)−sin⁡(π16))\mathrm{DiscreteDelta}(\frac{1}{2}(\sqrt{2-(2+2^{1/2})^{1/2}})-\sin(\frac{π}{16}))OutDiscreteDelta(12(2−(2+21/2)1/2)−sin⁡(π16))\mathrm{DiscreteDelta}(\frac{1}{2}(\sqrt{2-(2+2^{1/2})^{1/2}})-\sin(\frac{π}{16}))
About
Examples11
Checked againstWolfram Language 8 agree2 differ1 unevaluated
CrosswalkWolfram Language