Complex energy eigenstates of the harmonic oscillator Given the Hamiltonian for the the harmonic oscillator (HO) as
$$
\hat H=\frac{\hat P^2}{2m}+\frac{m}{2}\omega^2\hat x^2\,,
$$
the Schroedinger equation can be reduced to:
$$
\left[
\frac{d^2}{dz^2}-\left(\frac{z^2}{4}+a\right)\right]\Psi=0~,
$$
where $a=-\frac{E}{\hbar\omega}$, $z=\sqrt{\frac{2m\omega}{\hbar}}$.
Now, the two independent solutions to this equation are the Wittaker's functions (Abramowitz section 19.3., or Gradshteyn at the beginning, where he defines the Wittaker's functions) $D_{-a-1/2}(z)$ and $D_{-a-1/2}(-z)$.
Apparently, there is no constraint on the values for $a$. In Abramowitz, especially, there is written "both variable $z$ and $a$ can take on general complex values".
Therefore my first question is: 
Let us fix $a=i$ and let us therefore take the Wittaker's function $D_{-i-1/2}(z)$. This functions is solution of the time independent Schroedinger equation, and, therefore, is an eigenfunction of the ho hamiltonian. Since its value for the parameter $a$ is $i$, it follows that its eigenvalue $E$ must be $E=-i\hbar\omega$. However, this result is contradictory, since the hamiltonian must have only real eigenvalues, since it is hermitian. What do I do wrong?
My second question is:
Since the functions $D_n(z)$ form a complete set for $n$ positive integer with zero, I can expand my function $D_{-i-1/2}(z)$ onto the basis set $D_n(z)$. 
$$
D_{-i-1/2}(z)=\sum_n C_n D_n(z)~.
$$
But, evidently, if $D_{-i-1/2}(z)$ is itself an eigenfunction with a different eigenvalue with respect to any of the $D_n(z)$, the expansion above does not make sense. 
This question is somewhat correlated to the previous one. So, I believe I do something 
wrong which is in common to both of them.
 A: "the hamiltonian must have only real eigenvalues, since it is hermitian." - only for physically meaningful systems.  You have put $a=i$, meaning $m$ or $\omega$ is negative - or maybe in some bizarre alternate universe, $\hbar$.  Or $m$ and $\omega$ could each be imaginary.  Boundary conditions must be met.  You are, in effect, exploring solutions that don't persist in time with a $exp(i\omega t)$ dependence, but decaying (or growing) exponentially.  A quantum system's wavefunction shouldn't be allowed to do that!
A: Filippo Fratini's wavefunction $D_{-i-1/2}(z)$ is an eigenfunction of the harmonic oscillator with energy eigenvalue $E=-i$ (in units $\omega, \hbar, m$ are all unity). However, the asymptotic expansion of this wavefunction goes like,
$$
D_{-i-1/2}(z) \rightarrow \exp(-z^{2}/4) \  as \ z \rightarrow \infty
$$
and,
$$
D_{-i-1/2}(z) \rightarrow \exp(z^{2}/4) \  as \ z \rightarrow -\infty \ .
$$
The actual asymptotic expansions are in chapter XVI of Whittaker and Watson's book "A Course of Modern Analysis". So,  $D_{-i-1/2}(z)$ is not physically sensible because the particle has disappeared to $z=-\infty$. This is also considered in the section 12.3 on solutions of Schroedinger's equation in part II of Morse and Feshbach's "Methods of Theoretical Physics".
An eigenvector $|E\rangle$ which solves $\hat{H}|E\rangle=E|E\rangle$ need not have a real eigenvalue $E$ if $\langle E|E\rangle=\infty$ because,
$$
\langle E|H|E\rangle=E\langle E|E \rangle
$$
says nothing about E since both sides are infinite.
A:  So does that mean that "non quadratically integrable wave functions with real (complex) eigenvalues are (are not) physical?" At the end of the day I can still expand a plane wave into the ho basis set, though it is not quadratically integrable, right?
It is difficult to agree on what "physical" means, but if we ask if such functions have the same meaning as the quadratically integrable functions, the answer is No. 
Quadratically integrable functions can be normalized to 1 and interpreted according to Born as giving probability of certain configuration.
Functions such as $e^{ipx/\hbar}$ do not belong into this set, so we either reject them as we rejected the functions above; or we include them, as Dirac did, but then we have to ascribe them different meaning. Many physicists take the second option, but I have always felt that then the meaning of the function $\psi$ becomes unclear and its application ambiguous. Dirac explains his point of view on this problem in his book "Principles of Quantum Mechanics" when dealing with scattering.
Beware, one cannot expand $e^{ipx}$ as a sum of standard eigenfunctions of the HO Hamiltonian! The latter functions fall of exponentially with $x$,  while the function $e^{ipx}$ oscillates on the whole real line.
