The matrix $Q$ with dimensions $n\times2*n*m$ is structured by $$Q=[B|AB|\cdots|A^{2*n-1}B]$$ where $Q$ is an augmented matrix built from a $3\times3$ matrix, $A$, and a $3\times2$ matrix, $B$.
I need $\DeclareMathOperator{\rank}{rank}\rank(Q)<n$ but I get $\rank(Q)=n$.
If I RowReduce
matrices $A$ and $B$ before that calculation the $Q$ matrix has $\rank<n$ as I want, but its elements aren't the ones I need to continue, but 0's and 1's.
Any Idea on how to get the desired $Q$ matrix?
If I multiply $Q$ by $Q_\text{reduced}$ (with dimensions $2*n*m\times n$) I get an $n\times n$ matrix, $W$ with $\rank(W)=n$, so that's not what I want.
I've no Idea how to implement the Mathematica code here. Any suggestions would be helpful.
CellGroupData[{
A0 = RandomInteger[{1, 10}, {4, 4}],
B0 = RandomInteger[{1, 10}, {4, 3}],
A1 = RowReduce[A0],
B1 = RowReduce[B0],
m = 3,
n = 4,
(*Original Matrices Proc *)
Do[Lnn[j] = MatrixPower[A0, j - 1].B0, {j, 2*n}],
Do[Flatten[Lnn[j][[i]], m], {i, n}, {j, 2*n}],
M222 = Table[Lnn[j][[i]], {i, n}, {j, 2*n}],
R222 = Flatten[M222],
Qnn = Partition[R222, 2*n*m],
η1 = MatrixRank[Qnn],
{p1, r1} = Dimensions[Qnn],
QN11 = RowReduce[Qnn],
(*RowReduced Matrices used now *)
Do[Lnn1[j] = MatrixPower[A1, j - 1].B1, {j, 2*n}],
Do[Flatten[Lnn1[j][[i]], m], {i, n}, {j, 2*n}],
M22 = Table[Lnn1[j][[i]], {i, n}, {j, 2*n}],
R22 = Flatten[M22],
Qn = Partition[R22, 2*n*m],
η = MatrixRank[Qn],
{p, r} = Dimensions[Qn],
QN = RowReduce[Qn],
Print[MatrixForm[Qnn], MatrixForm[QN11]],
Print[MatrixForm[Qn], MatrixForm[QN]]}];