QM: Linear operator, conditions on kets to make operator Hermitian I've just started my first quantum mechanics course, and I'm not quite sure how to attack this homework task:
We suppose the Hamiltonian $\hat{H}$ is linear and acts as follows:
$\hat{H}\vert{\psi}\rangle$ = $g\vert{\phi}\rangle$, $\hat{H}\vert{\phi}\rangle$ = $g^{*}\vert{\psi}\rangle$, $\hat{H}\vert{\psi_n}\rangle  = 0$
where $g$ is an arbitrary complex number, $\vert{\psi}\rangle$ and $\vert{\phi}\rangle$ is a pair of linearly independent states, both normalized to unity, but not necessarily orthogonal. $\vert{\psi_n}\rangle$ where $ n \in [1,N]$ are all states orthogonal to both $\vert{\psi}\rangle$ and $\vert{\phi}\rangle$. What are the conditions that $\vert{\psi}\rangle$ and $\vert{\phi}\rangle $ must satisfy for $\hat{H}$ to be hermitian?
I know that for a operator to be Hermitian, it can only admit real eigenvalues and that eigenvectors corresponding to distinct eigenvalues are orthogonal. As I have not been able to wrap my head around this, I've googled some, and also found that it must be diagonalizable? Im not sure if this is something I can take use of... I really appreciate all answers and help!! :)
 A: Note : I am writing this answer late at night, so I apologize in advance if the explanation is unclear or unnecessarily complicated. I will probably edit it in the future to make it clearer.
$|\phi\rangle $and $|\psi\rangle$ span a subspace of dimension $\leq 2$. We can therefore find a ket $|\tilde \psi\rangle $and angles $\theta,\varphi$ such that $(|\phi\rangle,|\tilde\psi\rangle)$ is orthonormal and :
$$|\psi\rangle = e^{i\varphi}\cos(\theta)|\phi\rangle +\sin(\theta)|\tilde \psi\rangle$$
Then, we have :
$$H|\phi\rangle = g^*e^{i\varphi}\cos(\theta)|\phi\rangle +g^*\sin(\theta)|\tilde \psi\rangle$$
and :
\begin{align}
H|\tilde\psi\rangle &= \frac{1}{\sin(\theta)}H(|\psi\rangle-e^{i\varphi}\cos(\theta)|\phi\rangle) \\
&= \frac{g}{\sin\theta}|\phi\rangle-\frac{g^*e^{i\varphi}\cos\theta}{\sin\theta}|\psi\rangle\\
&= \frac{g}{\sin\theta}|\phi\rangle-\frac{g^*e^{i\varphi}\cos\theta}{\sin\theta}(e^{i\varphi}\cos(\theta)|\phi\rangle +\sin(\theta)|\tilde \psi\rangle) \\
&=\frac{1}{\sin(\theta)}(g - g^*e^{2i\varphi}\cos^2(\theta))|\phi\rangle - g^*e^{i\varphi}\cos(\theta)|\tilde\psi\rangle
\end{align}
If $H$ is to be Hermitian, we need $\langle \phi|H|\phi\rangle = g^*\langle\phi|\psi\rangle= g^*e^{i\varphi}\cos(\theta)$ to be real. This means that $g = e^{2i\varphi}g^*$ and we have :
$$\langle \phi|H|\tilde\psi\rangle =\frac{1}{\sin(\theta)}(g - g^*e^{2i\varphi}\cos^2(\theta)) = \frac{g}{\sin(\theta)}(1-\cos^2(\theta)) =g \sin(\theta) = \langle \tilde\psi|H|\phi\rangle^*$$
as we expect for a Hermitian operator. We also see that $\langle \tilde\psi|H|\tilde\psi\rangle$ is real, so $H$ is Hermitian.
To recap, $H$ is hermitian if, and only if, $g\langle\psi|\phi\rangle \in\mathbb R$.

Edit : Here is a simpler and (hopefully) clearer answer.
First, if $H$ is hermitian, then $\langle \psi|H|\psi\rangle = g\langle\psi|\phi\rangle \in \mathbb R$.
Now, let us assume that this condition holds.Then $(g\langle \psi|\phi\rangle)^*= g\langle \psi|\phi\rangle$ and $(g^*\langle \phi|\psi\rangle)^*= g^*\langle \phi|\psi\rangle$
Take two arbitrary kets :
\begin{align}|1\rangle &= a_0|\psi\rangle + a_1 |\phi\rangle + \sum_{n\geq 2} a_n|\psi_n\rangle\\
|2\rangle &= b_0|\psi\rangle +b_1 |\phi\rangle + \sum_{n\geq 2} b_n|\psi_n\rangle
\end{align}
and compute :
\begin{align}
\langle 1 |H|2 \rangle &= \Big( a_0^* \langle \psi| + a_1^*\langle \phi|\Big)\Big(b_0 g|\phi\rangle  + b_1 g^*|\psi\rangle\Big) \\
&= a_0^*b_1g^* \|\psi\|^2  + a_1^*b_0g\|\phi\|^2 + a_0^*b_0 g \langle \psi|\phi\rangle  + a_1^*b_1 g^*\langle \phi|\psi\rangle\\
&= \Big[a_0b_1^*g \|\psi\|^2  + a_1b_0^*g^*\|\phi\|^2 + a_0b_0^* g \langle \psi|\phi\rangle  + a_1b_1^*  g^*\langle \phi|\psi\rangle \Big]^* \\
&= \Big[\Big( b_0^* \langle \psi| + b_1^*\langle \phi|\Big)\Big(a_0 g|\phi\rangle  + a_1 g^*|\psi\rangle\Big) \Big]^*\\
&=(\langle 2 |H|1\rangle)^*
&=  \langle 1 |H^\dagger\rangle
\end{align}
