Inner product of position and momentum eigenkets Let's define $\hat{q},\ \hat{p}$ the positon and momentum quantum operators, $\hat{a}$ the annihilation operator and $\hat{a}_1,\ \hat{a}_2$ with its real and imaginary part, such that
$$ \hat{a} = \hat{a}_1 + j \hat{a}_2$$
with
$$\hat{a}_1 = \sqrt{\frac{\omega}{2 \hbar}}\hat{q},\ \hat{a}_2 = \sqrt{\frac{1}{2 \hbar \omega}}\hat{p}$$
(for a reference, see Shapiro Lectures on Quantum Optical Communication, lect.4)
Define $|a_1 \rangle,\ |a_2\rangle,\ |q\rangle,\ |p\rangle$ the eigenket of the operator $\hat{a}_1,\ \hat{a}_2,\ \hat{q},\ \hat{p}$ respectively. 
From the lecture, I know that 
$$ \langle a_2|a_1\rangle = \frac{1}{\sqrt{\pi}} e^{-2j a_1 a_2}$$
but I do not understand how to obtain 
$$ \langle p|q\rangle = \frac{1}{\sqrt{2\pi\hbar}} e^{-\frac{j}{\hbar}qp}$$
I thought that with a variable substitution would suffice, but substituting 
${a}_1 = \sqrt{\frac{\omega}{2 \hbar}}{q},\ a_2 = \sqrt{\frac{1}{2 \hbar \omega}}{p}$, I obtain
$$\frac{1}{\sqrt{\pi}} e^{-\frac{j}{\hbar}qp}$$
which does not have the correct factor $\frac{1}{\sqrt{2\pi\hbar}}$.
What am I missing?
 A: Inner scalar producs
Since $\hat{a}_1 = \sqrt{\frac{\omega}{2 \hbar}}\hat{q}$, then $\langle a_1|q\rangle=N_1\delta\left(a_1- \sqrt{\frac{\omega}{2 \hbar}}q\right).$
Also, since  $\hat{a}_2 = \sqrt{\frac{1}{2 \hbar\omega}}\hat{p}$, then $\langle a_2|p\rangle=N_2\delta\left(a_2- \sqrt{\frac{1}{2 \hbar\omega}}p\right).$
Normalization constants
We will use this property: $\int dx \delta\left(\alpha x-y\right) f(x)=\frac{f\left(\frac{y}{\alpha}\right)}{\alpha}.$
If we ask that $|a_1\rangle$ are normalized, we are asking that  $$\delta\left(a_1- \bar a_2\right)=\langle a_1|\bar a_1\rangle = \int dq \langle a_1| q\rangle \langle q|\bar a_1\rangle=\int dq \left|N_1\right|^2 \delta\left(a_1- \sqrt{\frac{\omega}{2 \hbar}}q\right) \delta\left(\bar a_1- \sqrt{\frac{\omega}{2 \hbar}}q\right).$$
So, $N_1= \left(\frac{\omega}{2\hbar}\right)^\frac{1}{4}.$
Doing the same thing for  $|a_2\rangle$ We then obtained that:
$\langle a_1|q\rangle= \left(\frac{\omega}{2\hbar}\right)^\frac{1}{4}\delta\left(a_1- \sqrt{\frac{\omega}{2 \hbar}}q\right).$
$\langle a_2|p\rangle= \left(\frac{1}{2\hbar\omega}\right)^\frac{1}{4}\delta\left(a_2- \sqrt{\frac{1}{2 \hbar\omega}}p\right).$
Computing $\langle p|q \rangle$
Then, as you know, $\langle p| q\rangle =\int da_1 da_2 \langle p| a_2\rangle \langle a_2| a_1\rangle \langle a_1| q\rangle .$
This whould be enough for you to find the right solution.
