In the context of information theory, entropy is a measure of uncertainty of a random variable. In quantum mechanics, the uncertainty principle states that $\Delta x\Delta k \ge 1/2$. The same can be expressed in terms of information entropy as $S_x + S_k \ge 1 + \ln\pi$. The information entropy $S_x$ is defined as:
$$ S_x = \int_{-\infty}^{\infty} {\rho(x) \ln\rho(x) dx} $$
where $\rho(x)$ is the probability density function of the variable $x$.
In continuation[1,2,3] of my study of the infinite square well problem, I'd like to check whether the informational version of uncertainty principle holds. For that, I need to calculate $S_x$ and $S_k$, for various numbers of $n=1,2,3,\ldots$, and check if their sum is bounded, knowing the respective probability density functions for position $x$ and momentum $k$.
Here is my code for $S_x$:
ClearAll["Global`*"];
(* The length of the well *)
L = 1;
(* The eigenfunctions, n=1,2,3,... u[n,x] is zero outside of [0,L] *)
u[n_, x_] := Sqrt[2/L] Sin[n π x/L]
(* Probability density function for the x(=particle position) variable *)
(* Again, the domain of ρ(n,x) is the [0,L] interval *)
ρ[n_, x_] := u[n, x]\[Conjugate] u[n, x]
integrand =
Simplify[-ρ[n, x] Log[ρ[n, x]],
n ∈ Integers && x ∈ Reals]
(* Out= -2 Log[2 Sin[n π x]^2] Sin[n π x]^2 *)
(* Integrate over [0,L] since we haven't defined u[n,x] outside of [0,L] *)
(* We could have defined it though and then we would be integrating from -inf to +inf *)
Integrate[integrand, {x, 0, L}]
(* Out= -(1/(6 n π))(π (6 n - I π + 6 I n^2 π + n Log[64] -
12 n Log[1 - E^(2 I n π)] + 6 n Log[Sin[n π]^2]) +
6 I PolyLog[2, E^(2 I n π)] -
3 (-1 + Log[2 Sin[n π]^2]) Sin[2 n π]) *)
At this point it's already obvious that the value of the integral cannot be determined, since the terms $\sin(n\pi)$ equal zero and $\ln{0}$ is undefined.
FullSimplify[%, n ∈ Integers]
During evaluation of In[72]:= FullSimplify::infd: Expression Log[1-E^(2 I n [Pi])] simplified to -[Infinity]. >>
During evaluation of In[72]:= FullSimplify::infd: Expression Log[Sin[n [Pi]]^2] simplified to -[Infinity]. >>
During evaluation of In[72]:= FullSimplify::infd: Expression Log[2 Sin[n [Pi]]^2] simplified to -[Infinity]. >>
During evaluation of In[72]:= General::stop: Further output of FullSimplify::infd will be suppressed during this calculation. >>
Out[72]= Indeterminate
My book says that $S_x = \ln(2L) - 1$. Any ideas on how to trick Mathematica to calculate the integral ?
Mathematica.SE related (to the physical problem) questions:
Is there a more mathematica-y way to label these plots?
Why does FourierTransform converge while same integral manually written does not?
Calculate integral for arbitrary parameter n in infinite square well problem
Out=
lines so that it's easier to copy-and-paste your code. $\endgroup$ – user484 Nov 10 '13 at 20:50