```python
import os
os.chdir("..")

import liesym as ls
from sympy import Matrix, Rational
```

#### Cartan Matrix


```python

A3 = ls.A(3)
A3.cartan_matrix


```




$\displaystyle \left[\begin{matrix}2 & -1 & 0\\-1 & 2 & -1\\0 & -1 & 2\end{matrix}\right]$



#### Positive Roots


```python
A3.positive_roots

```




    [Matrix([[1, 0, 0, -1]]),
     Matrix([[0, 1, 0, -1]]),
     Matrix([[1, 0, -1, 0]]),
     Matrix([[0, 1, -1, 0]]),
     Matrix([[0, 0, 1, -1]]),
     Matrix([[1, -1, 0, 0]])]



#### Simple Roots


```python
A3.simple_roots
```




    [Matrix([[1, -1, 0, 0]]), Matrix([[0, 1, -1, 0]]), Matrix([[0, 0, 1, -1]])]



#### Fundamental Weights


```python
A3.fundamental_weights # Orthogonal Basis
```




    [Matrix([[3/4, -1/4, -1/4, -1/4]]),
     Matrix([[1/2, 1/2, -1/2, -1/2]]),
     Matrix([[1/4, 1/4, 1/4, -3/4]])]



#### Dimension of representation
  


```python

print("Dim | Rep (Omega)")
print("---------")
for i in A3.fundamental_weights:
    print(" ", A3.dim(i), "|", A3.to_omega(i))
```

    Dim | Rep (Omega)
    ---------
      4 | Matrix([[1, 0, 0]])
      6 | Matrix([[0, 1, 0]])
      4 | Matrix([[0, 0, 1]])


#### Name of rep

Commonly in literature (especially physics), names of the reps are the dimension rather than the matrix rep.


```python
A3.dim_name(Matrix([[0, 0, 1]]))
```




$\displaystyle \bar{4}$




```python
A3.irrep_lookup(r"\bar{4}")
```




$\displaystyle \left[\begin{matrix}0 & 0 & 1\end{matrix}\right]$



#### Tensor product decomps

The decomp of irreps from a product of irreps


```python
results = A3.tensor_product_decomposition([
    Matrix([[1,0,0]]),
    Matrix([[1,0,0]]),
])

for i in results:
    print("Rep:", A3.to_omega(i),"Dim Name:", A3.dim_name(i))
```

    Rep: Matrix([[0, 1, 0]]) Dim Name: 6
    Rep: Matrix([[2, 0, 0]]) Dim Name: \bar{10}


#### Lie Groups

Currently supports SU(N), SO(N), Sp(N)


```python
su2 = ls.SU(2)
su2.generators()
```




    [Matrix([
     [  0, 1/2],
     [1/2,   0]]),
     Matrix([
     [  0, -I/2],
     [I/2,    0]]),
     Matrix([
     [1/2,    0],
     [  0, -1/2]])]



Structure constants. SU(2) structure constants are $e_{ijk}$


```python
su2.structure_constants()
```




$\displaystyle \left[\begin{matrix}\left[\begin{matrix}0 & 0 & 0\\0 & 0 & 1\\0 & -1 & 0\end{matrix}\right] & \left[\begin{matrix}0 & 0 & -1\\0 & 0 & 0\\1 & 0 & 0\end{matrix}\right] & \left[\begin{matrix}0 & 1 & 0\\-1 & 0 & 0\\0 & 0 & 0\end{matrix}\right]\end{matrix}\right]$




```python
A1 = ls.A(1)
[A1.to_omega(x) for x in A1.simple_roots]
```




    [Matrix([[2]])]



Quadratic Casimir


```python
s = ls.Sp(6)
r = s.algebra.fundamental_weights[0]
s.quadratic_casimir(r)
```




$\displaystyle \frac{7}{2}$




```python
from liesym.algebras._backend import _rust_wrapper
```

3f4c2297d78e8f9de85f8ce856ab324df47f5778
ipynb
Jupyter Notebook
notebooks/Example.ipynb
npapapietro/liesym
56bce3290e35d111b86413191516c41a09f0a07d
MIT
2021-09-09T22:25:25.000Z
2022-01-22T01:15:47.000Z
notebooks/Example.ipynb
npapapietro/liesym
56bce3290e35d111b86413191516c41a09f0a07d
MIT
2021-12-20T00:15:26.000Z
2021-12-20T01:54:07.000Z
notebooks/Example.ipynb
npapapietro/liesym
56bce3290e35d111b86413191516c41a09f0a07d
MIT
2021-09-09T22:25:31.000Z
2021-09-09T22:25:31.000Z
Qwen/Qwen-72B
1. YES
2. YES