Groups#
Group Base#
- class liesym.Group(group: str, dim: int)[source]#
The base class for all (lie) groups. The methods and properties in this class are basis independent and apply in a general sense. In order to write down the roots as matricies and vectors, we choose a representation.
Methods
conjugate(rep[, symbolic])Returns the conjugate representation.
generators(*args, **kwargs)Generalized matrix generators of the group.
irrep_lookup(irrep)Returns the mathematical representation to the common name.
product(*args, **kwargs)Calculates the product between several group representations.
- conjugate(rep, symbolic=False)[source]#
Returns the conjugate representation. If the incoming rep is symbolic/named then it will return as such.
Abstract
- property dimension: sympy.Basic#
Group dimension as sympy object
- property group: str#
Group type
Lie Group#
- class liesym.LieGroup(group: str, dim: int)[source]#
Group that has a Lie Algebra associated with it.
- Attributes:
algebraBacking Lie Algebra
Methods
conjugate(rep[, symbolic])Uses the underlying algebra to find the conjugate representation.
d_coeffecients(*idxs)Returns the d constants of the group.
dynkin_index([irrep])Returns the dykin index for the arbitrary irreducible representation.
generators([cartan_only])Returns the generators representations of the group.
irrep_lookup(irrep)Uses the underlying algebra to do a lookup on the common name to find the matrix representation.
product()Uses tensor product decomposition to find the products between the representations.
quadratic_casimir([irrep, basis])Returns the quadratic casimir for the arbitrary irreducible representation.
structure_constants(*idxs)Returns the structure constants of the group.
- property algebra: LieAlgebra#
Backing Lie Algebra
- conjugate(rep, symbolic=False)[source]#
Uses the underlying algebra to find the conjugate representation.
Examples
>>> from liesym import SU >>> from sympy import Matrix >>> su3 = SU(3) >>> su3.conjugate(Matrix([[1,0]])) Matrix([[0, 1]]) >>> su3.conjugate(3, symbolic=True) # sympy prints without quotes \bar{3}
- d_coeffecients(*idxs: int) sympy.Basic | sympy.Matrix[source]#
Returns the d constants of the group. Indexes start at 0 and constants maybe in different orderings than existing literature, but will still be in the Gell-Mann basis. d constants \(d_{abc}\) is defined as
\[{T_a, T_b} = \frac{1}{N}\delta_{ab} + d_{abc} T_c\]where the group generators are \(T\).
- Args:
idxs (int): Optional postional arguments of 3 indices to return structure constant. If omitted, will return array.
- Returns:
Union[Basic, Matrix]: If indicies are passed in, will return corresponding d constant. Otherwise returns the 3dArry for entire group.
- property dimension: sympy.Basic#
Group dimension as sympy object
- dynkin_index(irrep: sympy.Basic | sympy.Matrix | str | int | None = None, **kwargs) sympy.Basic[source]#
Returns the dykin index for the arbitrary irreducible representation. This method extends the underlying algebra method by allowing symbolic dim names to be passed.
- Args:
irrep (Union[Basic, Matrix, str, int], optional): If None is passed, will default to adjoint rep. Defaults to None. kwargs: Pass through to LieAlgebra.dynkin_index
- Returns:
Basic: The irrep’s dynkin index.
- generators(cartan_only: bool = False, **kwargs: bool)[source]#
Returns the generators representations of the group.
- Args:
cartan_only (bool, optional): Only return the cartan generators (diagonalized generators). Defaults to False.
Abstract
- property group: str#
Group type
- irrep_lookup(irrep: str) sympy.Matrix[source]#
Uses the underlying algebra to do a lookup on the common name to find the matrix representation.
- product(*args: sympy.Matrix, basis: Literal['ortho', 'omega', 'alpha'] = 'omega', return_type: None = None) List[sympy.Matrix][source]#
- product(*args: NumericSymbol | str, basis: Literal['ortho', 'omega', 'alpha'] = 'omega', return_type: None = None) List[NumericSymbol]
- product(*args: sympy.Matrix | NumericSymbol | str, basis: Literal['ortho', 'omega', 'alpha'] = 'omega', return_type: Literal['matrix']) List[sympy.Matrix]
- product(*args: sympy.Matrix | NumericSymbol | str, basis: Literal['ortho', 'omega', 'alpha'] = 'omega', return_type: Literal['rep']) List[NumericSymbol]
Uses tensor product decomposition to find the products between the representations. Supported kwargs can be found on LieAlgebra.tensor_product_decomposition
- Args:
args: Objects to take product of basis (“ortho” | “omega” | “alpha”, optional): Basis of incoming weights and result. If not set, will implicitly set. Defaults to ‘omega’. return_type (“matrix” | “rep” | None, optional): Returns either as matrices or symbolic representation. Will default to the type of the args unless explicitly set here. Defaults to None.
- Returns:
Union[List[Matrix], List[NumericSymbol]]: Tensor sum of the product.
Examples
>>> from liesym import SO >>> from sympy import Matrix >>> so10 = SO(10) >>> so10.product(Matrix([[1,0,0,0,0]]),Matrix([[1,0,0,0,0]])) [Matrix([[0, 0, 0, 0, 0]]), Matrix([[0, 1, 0, 0, 0]]), Matrix([[2, 0, 0, 0, 0]])]
- quadratic_casimir(irrep: sympy.Basic | sympy.Matrix | str | int | None = None, basis: Literal['ortho', 'omega', 'alpha'] = 'omega') sympy.Basic[source]#
Returns the quadratic casimir for the arbitrary irreducible representation. This method extends the underlying algebra method by allowing symbolic dim names to be passed.
- Args:
irrep (Union[Basic, Matrix, str, int], optional): If None is passed, will default to adjoint rep. Defaults to None. kwargs: Pass through to LieAlgebra.quadratic_casimir
- Returns:
Basic: The irrep’s quadratic casimir.
- structure_constants(*idxs: int) sympy.Basic | sympy.Matrix[source]#
Returns the structure constants of the group. Indexes start at 0 and constants maybe in different orderings than existing literature, but will still be in the Gell-Mann basis. Structure constants \(f_{abc}\) is defined as
\[[T_a, T_b] = i f_{abc} T_c\]where the group generators are \(T\).
- Args:
idxs (int): Optional postional arguments of 3 indices to return structure constant. If omitted, will return array.
- Returns:
Union[Basic, Matrix]: If indicies are passed in, will return corresponding structure constant. Otherwise returns the 3dArry for entire group.
SO#
- class liesym.SO(dim: int)[source]#
The Special Orthogonal Group
Methods
Generators for SO(N).
- property algebra: LieAlgebra#
Backing Lie Algebra
- conjugate(rep, symbolic=False)#
Uses the underlying algebra to find the conjugate representation.
Examples
>>> from liesym import SU >>> from sympy import Matrix >>> su3 = SU(3) >>> su3.conjugate(Matrix([[1,0]])) Matrix([[0, 1]]) >>> su3.conjugate(3, symbolic=True) # sympy prints without quotes \bar{3}
- d_coeffecients(*idxs: int) sympy.Basic | sympy.Matrix#
Returns the d constants of the group. Indexes start at 0 and constants maybe in different orderings than existing literature, but will still be in the Gell-Mann basis. d constants \(d_{abc}\) is defined as
\[{T_a, T_b} = \frac{1}{N}\delta_{ab} + d_{abc} T_c\]where the group generators are \(T\).
- Args:
idxs (int): Optional postional arguments of 3 indices to return structure constant. If omitted, will return array.
- Returns:
Union[Basic, Matrix]: If indicies are passed in, will return corresponding d constant. Otherwise returns the 3dArry for entire group.
- property dimension: sympy.Basic#
Group dimension as sympy object
- dynkin_index(irrep: sympy.Basic | sympy.Matrix | str | int | None = None, **kwargs) sympy.Basic#
Returns the dykin index for the arbitrary irreducible representation. This method extends the underlying algebra method by allowing symbolic dim names to be passed.
- Args:
irrep (Union[Basic, Matrix, str, int], optional): If None is passed, will default to adjoint rep. Defaults to None. kwargs: Pass through to LieAlgebra.dynkin_index
- Returns:
Basic: The irrep’s dynkin index.
- generators(*, cartan_only: bool = False, indexed: Literal[True]) List[Tuple[sympy.Matrix, tuple]][source]#
- generators(cartan_only: bool = False, indexed: Literal[False] = False) List[sympy.Matrix]
Generators for SO(N).
- Args:
cartan_only (bool, optional): Only return the cartan generators (diagonalized generators). Defaults to False. indexed (bool, Optional): For N > 3, there exists a naming scheme for generators. If True returns a tuple of the matrix and its (m,n) index.
- Returns:
list[Union[Matrix, Tuple[Matrix, tuple]]]: list of (mathematical) generators
- Sources:
- property group: str#
Group type
- irrep_lookup(irrep: str) sympy.Matrix#
Uses the underlying algebra to do a lookup on the common name to find the matrix representation.
- product(*args: sympy.Matrix | NumericSymbol | str, basis: Literal['ortho', 'omega', 'alpha'] = 'omega', return_type: Literal['matrix', 'rep'] | None = None) List[sympy.Matrix] | List[NumericSymbol]#
Uses tensor product decomposition to find the products between the representations. Supported kwargs can be found on LieAlgebra.tensor_product_decomposition
- Args:
args: Objects to take product of basis (“ortho” | “omega” | “alpha”, optional): Basis of incoming weights and result. If not set, will implicitly set. Defaults to ‘omega’. return_type (“matrix” | “rep” | None, optional): Returns either as matrices or symbolic representation. Will default to the type of the args unless explicitly set here. Defaults to None.
- Returns:
Union[List[Matrix], List[NumericSymbol]]: Tensor sum of the product.
Examples
>>> from liesym import SO >>> from sympy import Matrix >>> so10 = SO(10) >>> so10.product(Matrix([[1,0,0,0,0]]),Matrix([[1,0,0,0,0]])) [Matrix([[0, 0, 0, 0, 0]]), Matrix([[0, 1, 0, 0, 0]]), Matrix([[2, 0, 0, 0, 0]])]
- quadratic_casimir(irrep: sympy.Basic | sympy.Matrix | str | int | None = None, basis: Literal['ortho', 'omega', 'alpha'] = 'omega') sympy.Basic#
Returns the quadratic casimir for the arbitrary irreducible representation. This method extends the underlying algebra method by allowing symbolic dim names to be passed.
- Args:
irrep (Union[Basic, Matrix, str, int], optional): If None is passed, will default to adjoint rep. Defaults to None. kwargs: Pass through to LieAlgebra.quadratic_casimir
- Returns:
Basic: The irrep’s quadratic casimir.
- structure_constants(*idxs: int) sympy.Basic | sympy.Matrix#
Returns the structure constants of the group. Indexes start at 0 and constants maybe in different orderings than existing literature, but will still be in the Gell-Mann basis. Structure constants \(f_{abc}\) is defined as
\[[T_a, T_b] = i f_{abc} T_c\]where the group generators are \(T\).
- Args:
idxs (int): Optional postional arguments of 3 indices to return structure constant. If omitted, will return array.
- Returns:
Union[Basic, Matrix]: If indicies are passed in, will return corresponding structure constant. Otherwise returns the 3dArry for entire group.
Sp#
- class liesym.Sp(dim: int)[source]#
The Symplectic Group
Methods
generators([cartan_only])Generators for Sp(2N).
- property algebra: LieAlgebra#
Backing Lie Algebra
- conjugate(rep, symbolic=False)#
Uses the underlying algebra to find the conjugate representation.
Examples
>>> from liesym import SU >>> from sympy import Matrix >>> su3 = SU(3) >>> su3.conjugate(Matrix([[1,0]])) Matrix([[0, 1]]) >>> su3.conjugate(3, symbolic=True) # sympy prints without quotes \bar{3}
- d_coeffecients(*idxs: int) sympy.Basic | sympy.Matrix#
Returns the d constants of the group. Indexes start at 0 and constants maybe in different orderings than existing literature, but will still be in the Gell-Mann basis. d constants \(d_{abc}\) is defined as
\[{T_a, T_b} = \frac{1}{N}\delta_{ab} + d_{abc} T_c\]where the group generators are \(T\).
- Args:
idxs (int): Optional postional arguments of 3 indices to return structure constant. If omitted, will return array.
- Returns:
Union[Basic, Matrix]: If indicies are passed in, will return corresponding d constant. Otherwise returns the 3dArry for entire group.
- property dimension: sympy.Basic#
Group dimension as sympy object
- dynkin_index(irrep: sympy.Basic | sympy.Matrix | str | int | None = None, **kwargs) sympy.Basic#
Returns the dykin index for the arbitrary irreducible representation. This method extends the underlying algebra method by allowing symbolic dim names to be passed.
- Args:
irrep (Union[Basic, Matrix, str, int], optional): If None is passed, will default to adjoint rep. Defaults to None. kwargs: Pass through to LieAlgebra.dynkin_index
- Returns:
Basic: The irrep’s dynkin index.
- generators(cartan_only=False, **kwargs)[source]#
Generators for Sp(2N). There are a lot of possible choices, so we choose one based on existing literature for generators to be in Iachello’s basis.
- Sources:
Iachello, F (2006). Lie algebras and applications. ISBN 978-3-540-36236-4.
- property group: str#
Group type
- irrep_lookup(irrep: str) sympy.Matrix#
Uses the underlying algebra to do a lookup on the common name to find the matrix representation.
- product(*args: sympy.Matrix | NumericSymbol | str, basis: Literal['ortho', 'omega', 'alpha'] = 'omega', return_type: Literal['matrix', 'rep'] | None = None) List[sympy.Matrix] | List[NumericSymbol]#
Uses tensor product decomposition to find the products between the representations. Supported kwargs can be found on LieAlgebra.tensor_product_decomposition
- Args:
args: Objects to take product of basis (“ortho” | “omega” | “alpha”, optional): Basis of incoming weights and result. If not set, will implicitly set. Defaults to ‘omega’. return_type (“matrix” | “rep” | None, optional): Returns either as matrices or symbolic representation. Will default to the type of the args unless explicitly set here. Defaults to None.
- Returns:
Union[List[Matrix], List[NumericSymbol]]: Tensor sum of the product.
Examples
>>> from liesym import SO >>> from sympy import Matrix >>> so10 = SO(10) >>> so10.product(Matrix([[1,0,0,0,0]]),Matrix([[1,0,0,0,0]])) [Matrix([[0, 0, 0, 0, 0]]), Matrix([[0, 1, 0, 0, 0]]), Matrix([[2, 0, 0, 0, 0]])]
- quadratic_casimir(irrep: sympy.Basic | sympy.Matrix | str | int | None = None, basis: Literal['ortho', 'omega', 'alpha'] = 'omega') sympy.Basic#
Returns the quadratic casimir for the arbitrary irreducible representation. This method extends the underlying algebra method by allowing symbolic dim names to be passed.
- Args:
irrep (Union[Basic, Matrix, str, int], optional): If None is passed, will default to adjoint rep. Defaults to None. kwargs: Pass through to LieAlgebra.quadratic_casimir
- Returns:
Basic: The irrep’s quadratic casimir.
- structure_constants(*idxs: int) sympy.Basic | sympy.Matrix#
Returns the structure constants of the group. Indexes start at 0 and constants maybe in different orderings than existing literature, but will still be in the Gell-Mann basis. Structure constants \(f_{abc}\) is defined as
\[[T_a, T_b] = i f_{abc} T_c\]where the group generators are \(T\).
- Args:
idxs (int): Optional postional arguments of 3 indices to return structure constant. If omitted, will return array.
- Returns:
Union[Basic, Matrix]: If indicies are passed in, will return corresponding structure constant. Otherwise returns the 3dArry for entire group.
SU#
- class liesym.SU(dim: int)[source]#
The Special Unitary Group
Methods
generators([cartan_only])Returns the generators representations of the group.
- property algebra: LieAlgebra#
Backing Lie Algebra
- conjugate(rep, symbolic=False)#
Uses the underlying algebra to find the conjugate representation.
Examples
>>> from liesym import SU >>> from sympy import Matrix >>> su3 = SU(3) >>> su3.conjugate(Matrix([[1,0]])) Matrix([[0, 1]]) >>> su3.conjugate(3, symbolic=True) # sympy prints without quotes \bar{3}
- d_coeffecients(*idxs: int) sympy.Basic | sympy.Matrix#
Returns the d constants of the group. Indexes start at 0 and constants maybe in different orderings than existing literature, but will still be in the Gell-Mann basis. d constants \(d_{abc}\) is defined as
\[{T_a, T_b} = \frac{1}{N}\delta_{ab} + d_{abc} T_c\]where the group generators are \(T\).
- Args:
idxs (int): Optional postional arguments of 3 indices to return structure constant. If omitted, will return array.
- Returns:
Union[Basic, Matrix]: If indicies are passed in, will return corresponding d constant. Otherwise returns the 3dArry for entire group.
- property dimension: sympy.Basic#
Group dimension as sympy object
- dynkin_index(irrep: sympy.Basic | sympy.Matrix | str | int | None = None, **kwargs) sympy.Basic#
Returns the dykin index for the arbitrary irreducible representation. This method extends the underlying algebra method by allowing symbolic dim names to be passed.
- Args:
irrep (Union[Basic, Matrix, str, int], optional): If None is passed, will default to adjoint rep. Defaults to None. kwargs: Pass through to LieAlgebra.dynkin_index
- Returns:
Basic: The irrep’s dynkin index.
- generators(cartan_only=False, **kwargs)[source]#
Returns the generators representations of the group. Generators for SU(N). Based off the generalized Gell-Mann matrices \(\lambda_a\) the generators, \(T_a\) are
\[T_a = \frac{\lambda_a}{2}\]- Args:
cartan_only (bool, optional): Only return the cartan generators (diagonalized generators). Defaults to False.
- property group: str#
Group type
- irrep_lookup(irrep: str) sympy.Matrix#
Uses the underlying algebra to do a lookup on the common name to find the matrix representation.
- product(*args: sympy.Matrix | NumericSymbol | str, basis: Literal['ortho', 'omega', 'alpha'] = 'omega', return_type: Literal['matrix', 'rep'] | None = None) List[sympy.Matrix] | List[NumericSymbol]#
Uses tensor product decomposition to find the products between the representations. Supported kwargs can be found on LieAlgebra.tensor_product_decomposition
- Args:
args: Objects to take product of basis (“ortho” | “omega” | “alpha”, optional): Basis of incoming weights and result. If not set, will implicitly set. Defaults to ‘omega’. return_type (“matrix” | “rep” | None, optional): Returns either as matrices or symbolic representation. Will default to the type of the args unless explicitly set here. Defaults to None.
- Returns:
Union[List[Matrix], List[NumericSymbol]]: Tensor sum of the product.
Examples
>>> from liesym import SO >>> from sympy import Matrix >>> so10 = SO(10) >>> so10.product(Matrix([[1,0,0,0,0]]),Matrix([[1,0,0,0,0]])) [Matrix([[0, 0, 0, 0, 0]]), Matrix([[0, 1, 0, 0, 0]]), Matrix([[2, 0, 0, 0, 0]])]
- quadratic_casimir(irrep: sympy.Basic | sympy.Matrix | str | int | None = None, basis: Literal['ortho', 'omega', 'alpha'] = 'omega') sympy.Basic#
Returns the quadratic casimir for the arbitrary irreducible representation. This method extends the underlying algebra method by allowing symbolic dim names to be passed.
- Args:
irrep (Union[Basic, Matrix, str, int], optional): If None is passed, will default to adjoint rep. Defaults to None. kwargs: Pass through to LieAlgebra.quadratic_casimir
- Returns:
Basic: The irrep’s quadratic casimir.
- structure_constants(*idxs: int) sympy.Basic | sympy.Matrix#
Returns the structure constants of the group. Indexes start at 0 and constants maybe in different orderings than existing literature, but will still be in the Gell-Mann basis. Structure constants \(f_{abc}\) is defined as
\[[T_a, T_b] = i f_{abc} T_c\]where the group generators are \(T\).
- Args:
idxs (int): Optional postional arguments of 3 indices to return structure constant. If omitted, will return array.
- Returns:
Union[Basic, Matrix]: If indicies are passed in, will return corresponding structure constant. Otherwise returns the 3dArry for entire group.
Z#
- class liesym.Z(dim: int)[source]#
Cyclic Group
Methods
conjugate(rep[, symbolic])Finds the conjugate representation of the cyclic representation
The basis for the generators in the cyclic group are in the exponential imaginary basis.
irrep_lookup(irrep)Returns the symbol of irrep
product()Product of the Cyclic representations
- conjugate(rep, symbolic=False)[source]#
Finds the conjugate representation of the cyclic representation
Examples
>>> from liesym import Z >>> from sympy import sympify >>> z3 = Z(3) >>> g = z3.generators() >>> z3.conjugate(g[0]) 1 >>> assert z3.conjugate("Z_1", symbolic=True) == sympify("Z_2")
- property dimension: sympy.Basic#
Group dimension as sympy object
- generators(indexed: Literal[False] = False) List[exp][source]#
- generators(indexed: Literal[True]) List[Tuple[sympy.Symbol, exp]]
The basis for the generators in the cyclic group are in the exponential imaginary basis.
- Args:
indexed (bool, Optional): Returns tuple of named generators. Defaults to False.
Examples
>>> from liesym import Z >>> from sympy import I, pi >>> Z(3).generators() [1, exp(2*I*pi/3), exp(-2*I*pi/3)] >>> Z(3).generators(indexed=True) [(Z_0, 1), (Z_1, exp(2*I*pi/3)), (Z_2, exp(-2*I*pi/3))]
- property group: str#
Group type
- irrep_lookup(irrep)[source]#
Returns the symbol of irrep
Examples
>>> from liesym import Z >>> from sympy import sympify >>> z3 = Z(3) >>> z3.irrep_lookup("Z_1") exp(2*I*pi/3)
- product(as_tuple: Literal[False] = False) List[exp][source]#
- product(as_tuple: Literal[True]) List[Tuple[sympy.Symbol, exp]]
Product of the Cyclic representations
- Args:
args: A list of args to take product of as_tuple (bool, optional): Returns a tuple of their symbolic rep and exp val instead of just exp val
Examples
>>> from liesym import Z >>> z5 = Z(5) >>> g = z5.generators() >>> z5.product(g[0], g[1], g[2], g[3], g[4]) [1] >>> z5.product("Z_1", "Z_2") [Z_3] >>> z5.product("Z_3", "Z_4", as_tuple=True) [(Z_2, exp(4*I*pi/5))]
Functions#
- liesym.groups.commutator(A: sympy.Basic, B: sympy.Basic, anti=False) sympy.Basic[source]#
Performs commutation brackets on A,B.
If anti is False
\[[ A, B ] = A * B - B * A\]Otherwise
\[\{A, B\} = A * B + B * A\]- Args:
A (Basic): Any mathematical object B (Basic): Any mathematical object anti (bool, optional): Anticommutation. Defaults to False.
- Returns:
Basic: The (anti)commutation bracket result
- liesym.groups.generalized_gell_mann(dimension: int) Generator[source]#
Generator of generalized Gell-Mann Matrices. Note order may be different than usual because we generate symmetric, then antisymmetric, then diagonal.
- Args:
dimension (int): Dimension of group
- Yields:
Generator[Matrix]: Python Generator of (mathematical) generators
- Sources: