  An algebraic procedure to find extremal density matrices for any Hamiltonian
of a qudit system is established. The extremal density matrices for pure states
provide a complete description of the system, that is, the energy spectra of
the Hamiltonian and their corresponding projectors. For extremal density
matrices representing mixed states, one gets mean values of the energy in
between the maximum and minimum energies associated to the pure case. These
extremal densities give also the corresponding mixture of eigenstates that
yields the corresponding mean value of the energy. We enhance that the method
can be extended to any hermitian operator.
