Random Matrix Generation with range of Eigenvalues, using Eigendecomposition

linear algebra

I am generating some random matrix $A$ via eigendecomposition:

$$
A = Q \Lambda Q^{-1}
$$

where $\Lambda = diag(\lambda_i)$ is the diagonal matrix of eigenvalues of $A$ and $Q=[v_1, \dots,v_n]$ is a matrix composed of eigenvectors of $A$.
This way, $\lambda_i$ can be chosen to be in $\mathbb{C}$ with respect to some random distribution, e.g. uniform. Let $Q$ be some full rank matrix.

How does one guarantee $A$ to be real ($A\in\mathbb{R}^{n\times n}$), instead of complex ($A\in\mathbb{C}^{n\times n}$) while maintaining complex eigenvalues?

Best Answer

To back up the method outlined in my comment:

Claim: Suppose that $A$ is diagonalizable with the property that for any real eigenvalue $\lambda$ there is a real eigenvector, and for any complex eigenpair $(\lambda,v)$ we also have the conjugate $(\bar \lambda, \bar v)$. Then $A$ must be a real matrix.

Proof: Let $x$ be an arbitrary real vector. It suffices to show that $Ax$ is also real.

$x$ can be written as a linear combination (with real coefficients) of eigenvectors associated with real eigenvalues and of sums $v + \bar v$ where $v$ is an eigenvector associated with a complex eigenvalue.

It suffices then to note that for any complex eigenpair $(\lambda,v)$, we have $$ A(v + \bar v) = \lambda v + \bar \lambda \bar v = \lambda v + \overline{\lambda v} \in \Bbb R^n. $$ We may now conclude that $Ax$ will also be a real linear combination of these real vectors.

Related Question