Form of Kronecker Delta Not Recognized in Mathematica

In summary, the conversation discusses the use of the Kronecker Delta function and why Mathematica assumes that two integers, m and n, are not equal when simplifying expressions involving the function. The function returns 1 if m and n are equal and 0 if they are not, but Mathematica assumes they are not equal unless specifically told otherwise. This assumption can be overridden by using the Assumptions function.
  • #1
DocZaius
365
11
kron[m_,n_]:=\!\(
\*SubsuperscriptBox[\(\[Integral]\), \(0\), \(2\)]\(\(Sin[
\*FractionBox[\(n\ \[Pi]\ x\), \(2\)]]\ Sin[
\*FractionBox[\(m\ \[Pi]\ x\), \(2\)]]\) \[DifferentialD]x\)\)

This is the integral over x of sin(n pi x / 2) times sin(m pi x / 2) from 0 to 2. This is one way to define the Kronecker Delta function. Given m and n as integers and not both zero, if m = n then the output is 1, if m ≠ n the output is 0.

Why then is it that when I type:

Simplify[kron[m, n],
Element[m, Integers] && Element[n, Integers]]

that I get zero?

If I do kron[1, 1] I get 1! How can Mathematica say a function is 0 over the integers when I just put in two integers and got a non-zero ouput?

It is certainly not identical to zero right?
 

Attachments

  • other form.png
    other form.png
    1 KB · Views: 540
  • output.png
    output.png
    3.6 KB · Views: 576
Last edited:
Physics news on Phys.org
  • #2
When you force Mathematica to simplify expression it is assumed that m and n are not equal. This:

Code:
Assuming[{Element[m, Integers], Element[n, Integers], m == n}, kron[m, n]]
Assuming[{Element[m, Integers], Element[n, Integers], m != n}, kron[m, n]]

gives 1 and 0 respectively!
 
  • #3
Thank you for looking into it! I didn't know Mathematica assumed m and n are not equal. Why is Mathematica making that assumption? Given two integers m and n, the possibility that they are equal is always there.

Rather worrisome Mathematica assumption that I will keep in mind from now on! I will have to handhold Mathematica by separately asking it the = and ≠ cases.
 
  • #4
When you call Simplify[expression] Mathematica assumes that all symbols in expression have unique values, otherwise not!
 
  • #5


As a scientist, it is important to understand that Mathematica is a powerful mathematical software program, but it is not infallible. In this case, it seems that the simplification rule for the Kronecker Delta function may not be properly recognized by Mathematica. This could be due to a variety of reasons, such as a bug in the program or a limitation in its algorithms. It is also possible that the simplification rule for the Kronecker Delta function in Mathematica is different from the one that you have defined in your code.

It is important to carefully check the results and outputs of any software program, especially when dealing with complex mathematical functions. In this case, it seems that the simplification rule for the Kronecker Delta function may not be accurately represented in Mathematica. It is always a good idea to cross-check your results with other sources and to report any discrepancies to the developers of the software. As scientists, we must always critically evaluate our tools and methods to ensure accurate and reliable results.
 

1. What is the Kronecker delta function in mathematics?

The Kronecker delta function, denoted as Δ(i,j), is a mathematical function commonly used in physics and engineering to represent the discrete identity function. It takes on the value of 1 when i and j are equal, and 0 when they are not equal.

2. How is the Kronecker delta function represented in Mathematica?

In Mathematica, the Kronecker delta function is represented using the notation KroneckerDelta[i,j] or simply Δ[i,j]. It can also be accessed using the built-in function KroneckerDelta[i,j].

3. What does it mean when Mathematica does not recognize the form of Kronecker delta?

This means that there is an error in the syntax of the Kronecker delta function that you have entered. Mathematica is unable to interpret the function and will return an error message. Check your syntax and make sure you are using the correct notation for the Kronecker delta function.

4. How can I fix the error of Kronecker delta not being recognized in Mathematica?

To fix this error, you will need to correct the syntax of the Kronecker delta function. Make sure you are using the correct notation and that all parentheses and brackets are properly closed. You can also refer to Mathematica's documentation for more information on the correct syntax for the Kronecker delta function.

5. Are there any alternatives to using the Kronecker delta function in Mathematica?

Yes, there are alternative functions that can perform similar operations as the Kronecker delta function in Mathematica. These include the Unitize function, which returns 1 when its argument is nonzero and 0 otherwise, and the Piecewise function, which allows for more complex conditions to be evaluated. However, the Kronecker delta function is specifically designed for representing the discrete identity function and may be more efficient in certain situations.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
203
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
883
  • MATLAB, Maple, Mathematica, LaTeX
Replies
12
Views
4K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
13
Views
2K
Back
Top