I am currently in the process of familiarizing myself with linear algebra, so there may be inaccuracies in my question.
The method of constructing nilpotent matrices is as follows:
- Randomly pick a monic polynomial $f(x)=x^n+a_{n-1}\cdot x^{n-1}+...+a_0$;
- Find the companion matrix $C$ associated with the polynomial $g(x)=f(x)^k$;
- Let the nilpotent matrix $B=f(C)$.
The above inspiration is derived from the answer of this question. I am uncertain whether taking the companion matrix $C$ as the input of $f(x)$ would result in $B^k=0$, due to some related thoerems that I have not yet come across.
Yes, your matrix $\ B\ $ will always be nilpotent. This follows from the fact that the companion matrix $\ C\ $ of a polynomial $\ g(x)\ $ must satisfy the equation $\ g(C)=0\ .$ In fact $\ g(x)\ $ is its characteristic polynomial, as has been proved in this answer, and the fact that $\ g(C)=0\ $ then follows from the Cayley-Hamilton theorem. Thus, if $\ g(x)= f(x)^k\ $ where $\ k\ge2\ $, then \begin{align} 0&=g(C)\\ &=(f(C))^k\ . \end{align} Therefore $\ B=f(C)\ $ is nilpotent. It's also trivially nilpotent when $\ k=1\ ,$ because $\ B\ $ must be the zero matrix in that case, which is normally of no interest.