Re-opening of #19. Here again the reasoning from the comment there:
Our eigenfunctions have the form
\left\langle x \mid p \right\rangle = Ce^{ipx}
for some yet to determine normalisation constant $C$. Now, we want
1 = \left\langle p \mid p \right\rangle = |C|^2 \int_0^L \mathrm{d}x\; e^{-ipx}e^{ipx} = C^2 L \quad \Leftrightarrow |C| = \frac{1}{\sqrt{L}}
This fixes the normalisation of the continuum eigenfunctions. Now, the weight in the quadrature could be computed from the general formulae but is quite simply guessed if you just approximate the integral by a Riemann sum:
\int_0^L\mathrm{d}x\; \dots \longrightarrow \sum_{i=0}^{N-1}\Delta x \; \dots
Expansion:
The missing piece in the old version was the following: The FFT (with norm='ortho') projects onto a basis with $C = 1/\sqrt{N}$, so assumes $\Delta x = 1$. So, if given a periodic function $f:[0,L]\to C$ we have
f(x) = \sum_p \left\langle x\mid p \right\rangle\left\langle p \mid f\right\rangle = \frac{1}{\sqrt{L}}\sum_p e^{ipx} f_p
while the inverse FFT convention yields
f(x) = \frac{1}{\sqrt{N}}\sum_p e^{ipx} f_p
and we can see that we lack a factor of $1/\sqrt{\Delta x}$ because $L = N\Delta x$. The factor for the forward transformation is obviously the inverse because
Re-opening of #19. Here again the reasoning from the comment there:
Our eigenfunctions have the form
for some yet to determine normalisation constant $C$. Now, we want
This fixes the normalisation of the continuum eigenfunctions. Now, the weight in the quadrature could be computed from the general formulae but is quite simply guessed if you just approximate the integral by a Riemann sum:
Expansion:
The missing piece in the old version was the following: The FFT (with
norm='ortho'
) projects onto a basis with $C = 1/\sqrt{N}$, so assumes $\Delta x = 1$. So, if given a periodic function $f:[0,L]\to C$ we havewhile the inverse FFT convention yields
and we can see that we lack a factor of $1/\sqrt{\Delta x}$ because $L = N\Delta x$. The factor for the forward transformation is obviously the inverse because
In particular, we can see that we can only ever get a unitary transformation if $\Delta x=1$.
Please review and merge at your earliest convenience.