Solution (source code)

= Solution

If $q\in\mathcal Q$ and $\phi\in\mathcal A$, then
$$
q^TP\phi=(P^Tq)^T\phi=0,
$$
but strict positivity of $q$ and the nonzero <vector> $P\phi\geq0$ make the left side positive. Thus the two sets cannot both be nonempty.

Conversely, suppose $\mathcal A=\varnothing$. The subspace $L=\operatorname{Im}P$ is disjoint from the compact simplex
$$
\Delta=\{x\in\mathbb R^n:x_i\geq0,\ \sum_i x_i=1\}.
$$
Strict separation gives a <vector> $q$ that vanishes on $L$ and is positive on all of $\Delta$. The first property says $P^Tq=0$; testing the vertices of $\Delta$ shows every $q_i>0$. After normalization $\sum_iq_i=1$, this gives $q\in\mathcal Q$. This is <Stiemke theorem> in normalized form. Therefore
$$
\boxed{\mathcal Q=\varnothing\quad\Longleftrightarrow\quad\mathcal A\ne\varnothing.}
$$