maximize $\det(I+\Lambda Q\Lambda)$, where $Q$ is p.s.d. with $\mathrm{rank}(Q)\le 2$ and $\mathrm{tr}(Q)\le 2$ Suppose $\Lambda=\left[ \begin{array}{ccc} 4 & 0 & 0 \\ 0 & 2 & 0 \\ 0 & 0 & 1 \end{array}\right]$ is diagonal, and $Q$ is a 3-by-3 positive semi-definite (psd) matrix, with $\mathrm{rank}(Q)\le 2$ and $\mathrm{tr}(Q)\le 2$.  How should we choose $Q$ to maximize $\det(I+\Lambda Q\Lambda)$?
Without the rank constraint, the answer is simply a diagonal $Q$, with the diagonal elements being $Q_{ii}=\mu-\frac{1}{\Lambda_{ii}^2}$, where $\mu$ is determined by $\mathrm{tr}(Q)=2,$ i.e. $\mu=1\frac{5}{48}.$  This can be proved using the Hadamard's inequality, i.e. $\det(I+\Lambda Q\Lambda)\le \underset{i}\Pi (1+\Lambda_{ii}^2Q_{ii}),$ and maximizing the RHS with Lagrange multipliers.  (This is essentially the "beamforming" problem in wireless communication.)
However, when we constrain the rank of $Q$ to be 2 or less, the answer is not so clear to me.  Is the optimal $Q$ still diagonal (with $Q_{33}=0$)?

1st argument. I removed my first attempt to show this using the Hadarmard's Inequality. As user8675309 pointed out in the comments below, we cannot conclude that $Q$ is still diagonal with $Q_{3,3} = 0$ from Hadarmard's Determinant Inequality.
2nd argument. Denote $X = I + \Lambda Q \Lambda$ and consider the problem of maximizing the determinant of $X$.
The off-diagonal entries of $X$ should be equal to 0 as a necessary condition since they decrease the objective value. Implying that optimal $Q$ is diagonal matrix.
To satisfy $\text{rank}(Q) \leq 2$, at least one diagonal entry of $Q$ should be $0$. Since determinant of $X$ is a monotone increasing function in its diagonal entries. And, by looking at the values in $\Lambda = \text{diag}([4, 2, 1])$, the maximum is achieved at $Q_{3, 3} = 0$.
All in all, the optimal $Q$ is the solution of the relaxed problem where $\text{rank}(Q)$ is replaced by constraint $Q_{3,3} = 0$.
Solution. Instead of maximizing the determinant of $X$, we can maximize the SDP representable concave function log determinant of $X$ and rewrite the problem as:
\begin{align*}
& \text{maximize} \ \text{log} \ \text{det}\left(I + \Lambda Q \Lambda\right) \\
& \text{subject to:} \\
& \qquad \text{trace}(Q) \leq 2 \\
& \qquad Q_{3,3} = 0 \\
& \qquad \, Q \succeq 0
\end{align*}
I got the same result as @RiverLi by solving the corresponding relaxation with added constraint $Q_{3,3} = 0$, here is the code, using CVXPY in Python:
import numpy as np
import cvxpy as cp

I = np.identity(3)
L = np.diag(np.array([4, 2, 1]))
Q = cp.Variable((3, 3), symmetric=True)

objective = cp.log_det(I + L @ Q @ L)
constraints = [cp.trace(Q) <= 2]
constraints += [Q[2, 2] == 0]
constraints += [Q >> 0]
prob = cp.Problem(cp.Maximize(objective), constraints)
prob.solve()
Q = np.round(Q.value, 2)

print('rank(Q) = %.2f' % np.linalg.matrix_rank(Q))
print('objective(Q) = %.2f' % np.linalg.det(I + L @ Q @ L))
print('trace(Q) = %.2f' % np.trace(Q))
print('Q = '); Q

Gives:
rank(Q) = 2.00
objective(Q) = 85.56
trace(Q) = 2.00
Q =
array([[1.09, 0.  , 0.],
       [0.  , 0.91, 0.],
       [0.  , 0.  , 0.]])

