cartan_matrix.py 524 B

12345678910111213141516171819202122232425
  1. from .cartan_type import CartanType
  2. def CartanMatrix(ct):
  3. """Access the Cartan matrix of a specific Lie algebra
  4. Examples
  5. ========
  6. >>> from sympy.liealgebras.cartan_matrix import CartanMatrix
  7. >>> CartanMatrix("A2")
  8. Matrix([
  9. [ 2, -1],
  10. [-1, 2]])
  11. >>> CartanMatrix(['C', 3])
  12. Matrix([
  13. [ 2, -1, 0],
  14. [-1, 2, -1],
  15. [ 0, -2, 2]])
  16. This method works by returning the Cartan matrix
  17. which corresponds to Cartan type t.
  18. """
  19. return CartanType(ct).cartan_matrix()