How to solve a system of matrix equations involving commutator? I want to solve the following system of equations:
$$XY-YX=-aY+bZ$$
$$ZX-XZ=cY+aZ$$
$$YZ-ZY=dX$$
Where $X,Y,Z$ are all real $3\times3$ matrices which are all different and not a scalar multiple of eachother. $a,b,c,d$ are given and take the values of either $0,-1,1$. Moreover 
I desire $X,Y,Z$ to be as simple as possible, most likely having less then three entries, but this is not a necessity.      
The problem arises from trying to find a basis of the standard representation of a three dimensional Lie algebra with the above commutator relations.
Currently the best way for me to solve this is to write a program which iterates through possible matrices with coefficient $0,1,-1$ and while this usually gives a solution it takes a very long time. 
See here for an example of sage doing it.
 A: First of all this actually doesn't define a Lie algebra unless $a=0$ or $d=0$. The Jacobi identity is
$$[X,[Y,Z]] + [Y,[Z,X]] + [Z,[X,Y]] = 0$$ 
In this case the left hand side simplifies to
$$[X,dX] + [Y,cY+aZ] + [Z,-aY+bZ] = a[Y,Z] -a[Z,Y] = 2adX$$
(Note the example on sage has a positive $a$ where this question has negative.)

Presuming the Jacobi identity is satisfied, you can try the adjoint representation:
$$X = \begin{pmatrix}0&0&0\\0&-a&-c\\0&b&-a\end{pmatrix},\ \ Y = \begin{pmatrix}0&0&d\\a&0&0\\-b&0&0\end{pmatrix},\ \ Z = \begin{pmatrix}0&-d&0\\c&0&0\\a&0&0\end{pmatrix}$$


*

*If $d \neq 0$ and one of $a,b,c$ is nonzero, will be faithful (but $a=0$ for Jacobi)

*If $d = 0$ and its not the case that $a = \pm c = \mp b$, then it is faithful



When adjoint rep is not faithful:


*

*If $d\neq 0$ and all $a,b,c = 0$ then the Heisenberg algebra $X=E_{13},Y=dE_{12},Z=E_{23}$ is an example

*If all coefficients are zero then $X,Y,Z = E_{11},E_{22},E_{33}$

*If $d = 0$ and $a = \pm c = \mp b \neq 0$, the structure equations are $$[Z,X] = [Y,X] = aY+aZ,\ \ \ \ [Y,Z] = 0$$
and a simple solution is $$Y=E_{12},\ \ \ Z=E_{13},\ \ \ X = aE_{22} + aE_{33}$$
