Sympy Lie Algebra extensions powered by rust.
Project description
liesym
Lie Algebras using Sympy and backend powered by Rust's pyO3 and ndarray
Overview
In an effort to supply python with the same computer algebra software (CAS)
capabilities, SymPy was written. This python
library is well written and allows an open source alternative to proprietary
choices like Mathematica/WolframLanguage and Maple. Due to the nature of
how SymPy was written, certain symbolic calculation can be extremely unoptimized
in python. Even using numpy could offer little speed ups as it is not geared
towards rational numbers (fractions). Sympy does currently offer a liealgebras
module, but due to the performance limitations, certain tradeoffs had to be
made such as locking the basis for the classic lie algebras in favor of speed.
This is a fair trade off, but would require anyone using a different basis
to hand calculate the representations of the algebra all over again.
An alternative to solve this problem would be to use a compiled
backend that supports generics (and isn't a pain to build with python).
Rust has good python binding support through py03 and allows easy communication through numpy using rust-numpy as well as numpy like api inside rust using ndarray.
Repo Layout
If you are new to how python and rust are tied together with py03, below
is a simple top level layout of this repository. When the rust code is
build into a lib binary, it is put into into ./liesym
so it can be
imported in ./liesym/__init__.py
.
├── Cargo.toml # rust config file
├── README.md # you are here
├── liesym # python module
├── notebooks # jupyter notebooks
├── src # rust source code
├── tests # python tests
└── ... # other stuff
Example use
from liesym import A, G2
su3 = A(2)
pr3 = su3.positive_roots
assert pr3 == [Matrix([[1, 1]]), Matrix([[-1, 2]]), Matrix([[2, -1]])]
g2 = G2()
prg = g2.positive_roots
assert prg == [
Matrix([[0, 1]]),
Matrix([[3, -1]]),
Matrix([[1, 0]]),
Matrix([[-1, 1]]),
Matrix([[-3, 2]]),
Matrix([[2, -1]])
]
Docs
Read the documentation at https://npapapietro.github.io/liesym/
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for liesym-0.1.0-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2ab45f9b42b7beaeedd1e0e82c494cfd236ecbef29936594ad62e6a57f2ff08a |
|
MD5 | ee20ae4f9798020d1960fd134f6ee226 |
|
BLAKE2b-256 | b7c04621195d41b62068b654ac72192b158036d7b515c9421754a4bda4b9f9d1 |
Hashes for liesym-0.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b8b348150f7dd26571fbe3d52013ea23404e6b01f0041634a58fdc3377b645a4 |
|
MD5 | 3acb2efabfef7be0bcc4893ba1a971d2 |
|
BLAKE2b-256 | ab3d7cc1d8fc0c4d5ab98f0f82d04336321b749df7133c370c74bdeef51bdbf9 |
Hashes for liesym-0.1.0-cp39-cp39-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a404568a830be3658a38fe4c7f344e681aee30ab26e6669df62bb543145358e8 |
|
MD5 | 7ce26e7a367804c2c5b050bb787a8b42 |
|
BLAKE2b-256 | 7d02bd1c0b3ab0023316cfa3a443f194a6cae64df2273d24fa79598246f4571d |
Hashes for liesym-0.1.0-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7d428473265711319d2a920f5e3173fe2356cae47fe592abfb02f0b361a772a5 |
|
MD5 | a7e13d566df91857fba4c9c841afee3d |
|
BLAKE2b-256 | a3f232b9818a00c7274f047253d02f36b80fc8f648aaa4f4dc5b593ba8d81fb1 |
Hashes for liesym-0.1.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 183020b36c8b8b0ca3d94073da9c04b0f459f4a91c8a820266d5b314292e761c |
|
MD5 | 282f4f628cdbc5acab0402750c9ee3f4 |
|
BLAKE2b-256 | baa0da4625d4bf9ac71e2d6b9e429df2a5cc637ec2edecfeee0badb0d2a0ac36 |
Hashes for liesym-0.1.0-cp38-cp38-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6271f7c3cb79e09a163c003cccb9d11a80d08ad80fe9c098b1162272ec7e7e10 |
|
MD5 | 69c8de6971f7ce9961e537ef7e5f9345 |
|
BLAKE2b-256 | 0cb0bff45de43d2f285917519ec4faf3635e83fdc67ff4ae652f930defc3aae2 |
Hashes for liesym-0.1.0-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 015c99bf88fd17bc10a5d72b93cc47098fa2db89cb35f1a72f48177adfe7d2cc |
|
MD5 | 219800dc246fc59c615828f2a625168b |
|
BLAKE2b-256 | 874ee9587891f414233897367e526af979d560e8a0d6be265dac5c5e5200a83c |
Hashes for liesym-0.1.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 123775f01f046e1249d79d4287c943feb7a156eae9e1e950d527c08f0f44e51b |
|
MD5 | 4bc706c11ccb3a7940fe74aeee1d83bf |
|
BLAKE2b-256 | 95c214f176890c930e6285193df637ad288ae158659b1f82d335dd5afe7870ef |
Hashes for liesym-0.1.0-cp37-cp37m-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6abe2aed4b04238e91f0270dcae77c6bd3829fab613530815546611cc26a86ca |
|
MD5 | db923afa1b07ba285ce6edd9f411b0c1 |
|
BLAKE2b-256 | bb39520dcee473938b94ddfe3a08848fca0fa2043a67dcf41c49c341584a00c8 |