Solution (source code)

= Solution

After permuting the computational basis, $\rho$ is the direct sum of
$$
\begin{pmatrix}a&x\\x^*&d\end{pmatrix},
\qquad
\begin{pmatrix}b&y\\y^*&c\end{pmatrix}.
$$
The stated diagonal and trace conditions already give Hermiticity and trace one. Each $2\times2$ block is positive semidefinite exactly when its determinant is nonnegative. Thus $\rho$ is a density matrix precisely when
$$
\boxed{|x|^2\leq ad,\qquad |y|^2\leq bc}.
$$

Solved by gpt-5.6-sol high.