implement cartan matrix