Covariance matrix $P$ and $Q$ for complex valued data
In general, the equations from your first code block work equally for real and complex values. 

Note that the ()' operation is the Hermitian Conjugate (i.e. transpose + conjugate). If you are in the real domain, it only becomes transpose (because conjugation on reals doesn't change them). Hence, you would not need to change anything in the code. 

Regarding your covariance matrices: Note that a covariance matrix is always positive (semi-)definite and Hermitian symmetric, i.e. $P^H=P$. This ensures that each single variance on the diagonal is a real value. Also, how would you imagine a e.g. Gaussian with complex variance?

However, there is one thing which might be important for you here: When considering white Gaussian noise in the real domain, you generate random values according to

noise_real = sqrt(sigma2) * randn(N,M);


where sigma2 is the variance of this random variable. If you are in the complex domain, you have to generate them via

noise_complex = sqrt(sigma2/2) * (randn(N,M) + 1j*randn(N,M))


i.e. the variance becomes halfed for real and imaginary domain. Then, when you calculate var(noise_complex) you will get exactly sigma2.

I see from your post that your P and Q denote uncorrelated complex variables. In this case, if they are supposed to have a variance of sigma2 on each element, this is the corresponding code:

P = sigma2*eye(3);