Madlad
Madlad

Reputation: 155

Is there a discrete dirac delta function in Julia?

The title sums it up. I have seen some mentions in the RatFun and SpectralMeasures package but I am mostly looking for a function analogous to the ones found in the Sympy module for Python.

Edit: Thanks everyone for your answers and comments. I was looking for the discrete version of a dirac delta. At first I was confused and wanted to look for a "function" but I actually was just looking for the Kronecker delta which exhibits the following behavior:

delta(x) = 1 if x=0

delta(x) = 0 otherwise

I quickly realized that I didn't even need a function, I just had to take care of the differences in the argument. Thanks again!

Upvotes: 2

Views: 1718

Answers (2)

Jeff Fessler
Jeff Fessler

Reputation: 86

The OP basically wants the Kronecker delta function [https://en.wikipedia.org/wiki/Kronecker_delta] which is trivial in julia:

delta(n) = n == 0

Upvotes: 0

Benoit Pasquier
Benoit Pasquier

Reputation: 2995

There is a Dirac type in MeasureTheory.jl, but unsure if it fits your needs.

Upvotes: 2

Related Questions