Hey! I am studying group theory for particle physicists right now and I came across the following general question (Tell me if you think this rather belongs to the homework section, I am new here.) Say I am given a set of matrices which represent the generators of an algebra, but I don't know which algebra, i.e. I don't know the commutation relations nor anything like roots or similar about the algebra. Now I wonder how I could reconstruct the algebra in a smart way. I guess the first step is finding the Cartan subalgebra. Once I have that I should be ready to reconstruct all the rest. So it all boils down to the question: How can I find the Cartan subalgebra, in particular how can I find out what its dimension (i.e. the rank of the algebra) is, so that I know how many generators I can simultaneously diagonalise? I suppose this is an undergrad linear algebra question, but I would nevertheless appreciate some hint!