Suppose we have a fat matrix $\boldsymbol{E} \in \mathbb{R}^{p \times t}$ and we conduct SVD as follows
\begin{eqnarray}
\boldsymbol{E} = \boldsymbol{U}\boldsymbol{\Sigma}\boldsymbol{V}^\top.
\end{eqnarray}
We extract the first q columns to build a basis matrix $\boldsymbol{B} \in \mathbb{R}^{p \times q}$. Based on this basis matrix, we want to obtain a non-zero solution of a homogeneous linear system $\boldsymbol{Dx} = \boldsymbol{0}$,
\begin{eqnarray}
\label{eq:solve_linear}
\underbrace{
\left[
-\rm{diag}(\boldsymbol{m})\boldsymbol{B} | \boldsymbol{K}
\right]}_{\boldsymbol{D} \in \mathbb{R}^{p \times (q + 3)}}
\boldsymbol{x}
=
\boldsymbol{0},
\end{eqnarray}
where $\rm{diag}(\cdot)$ denotes diagonal operator, $\boldsymbol{K} \in \mathbb{R}^{p \times 3}$ has full column rank, $p > q + 3$. Also $\boldsymbol{m} \in \mathbb{R}^{p}$ is a non-zero vector.
The necessary condition to obtain a non-trivial solution for $\boldsymbol{Dx} = \boldsymbol{0}$ is ${\rm null}(\boldsymbol{D}) = 1$, i.e. $\boldsymbol{D}$ has $1d$ nullspace.
Question:
Given $\boldsymbol{U}, \boldsymbol{L}, \boldsymbol{m}$, can we automaticaly determine q such that ${\rm null}(\boldsymbol{D}) = 1$?
Note
One direct method is gradually increasing q from $1$ to $p$ until ${\rm rank}(\boldsymbol{D}) = q+3-1$. However, this strategy is time-consuming, I wonder if there is a smart method to solve this problem?