Faithful linear representation of a nilpotent Lie algebra Let 
\begin{align}
\mathfrak{g} = Span_{\mathbb{C}}\{ e_1, e_2, e_3, e_4, e_5: \text{ non-zero brackets are } [e_1, e_i]=e_{i+1}, i=2,3,4, [e_2, e_3]=e_5 \}
\end{align}
be a $5$-dimensional Lie algebra. I want to write $e_1, \ldots, e_5$ as matrices. That is, I need to find an injective homomorphism of Lie algebras: $\mathfrak{g} \to \mathfrak{gl}(V)$, $V$ is some vector space. Are there some general method to do this? I know that Ado's theorem says that this homomorphism always exists. But I don't know how to construct these matrices explicitly. Can some software like GAP compute the matrices of $e_1, \ldots, e_5$? Thank you very much.
 A: The Lie algebra is filiform nilpotent and is generated by $e_1$ and $e_2$. It is known that any faithful Lie algebra representation $\rho:\mathfrak{f}_n\rightarrow \mathbb{gl}(V)$ of a $n$-dimensional filiform Lie algebra $\mathfrak{f}_n$ is of degree at least $n$. In the above example, we do not need to invoke Ado's theorem. It is enough to construct a faithful $5$-dimensional Lie algebra representation as follows. By Lie's theorem, we may assume that the operators $\rho(e_i)$ are simultaneously upper-triangular. We may even assume that $\rho(e_1)$ satisfies further properties. Then it is easy to compute explicit matrices $\rho(e_1)$ and $\rho(e_2)$, which determine a faithful representation of degree $5$. For details on this construction see, e.g., here, and for computational aspects and other methods in general see here, with references to GAP programs.
Edit: A short computation shows that
$$
\rho(e_1)=\begin{pmatrix} 0  & 1 & 0 & 0 & 0 \\
0 & 0 & 1 & 0 & 0 \\
0 & 0 & 0 & 0 & 0 \\
0 & 0 & 0 & 0 & 1 \\
0 & 0 & 0 & 0 & 0 
 \end{pmatrix},\;
\rho(e_2)=\begin{pmatrix} 0  & 0 & 3 & 0 & 0 \\
0 & 0 & 0 & 0 & 0 \\
0 & 0 & 0 & 1 & 0 \\
0 & 0 & 0 & 0 & 0 \\
0 & 0 & 0 & 0 & 0 
 \end{pmatrix}
$$
defines a representation of the above filiform Lie algebra, where the center is represented nontrivially, i.e., $\rho(e_5)\neq 0$, so that the representation is faithful.
