Skip to content

Getting started

Installation

Python 3.10–3.13. Runtime dependencies: SymPy ≥ 1.10, NetworkX ≥ 2.6, Matplotlib ≥ 3.5 (installed automatically). Distribution name quantum-group, import name quantum_group.

From PyPI:

python3 -m pip install quantum-group==1.1.2

From this repository (for development, or to install a specific commit):

git clone https://github.com/TerekliTahaBerk/quantum-groups.git
cd quantum-groups
python3 -m venv .venv
source .venv/bin/activate
python3 -m pip install -e ".[test]"

Without cloning: python3 -m pip install "git+https://github.com/TerekliTahaBerk/quantum-groups". For the notebook in notebooks/, install ".[test,notebooks]" (equivalent to pip install -r requirements.txt).

Quickstart

The script below is examples/quickstart.py; CI runs it from outside the source tree against an installed wheel.

examples/quickstart.py
"""README quickstart, kept as a script so CI can run it verbatim.

Run from any directory after installing the package:

    python examples/quickstart.py
"""

from quantum_group import (
    build_representation,
    verify_on_representation,
    R_matrix_V1_coproduct,
    intertwining_holds_V1,
    qybe_holds,
    graded_yang_baxter_residual_GLq21,
    is_zero_matrix,
)

# U_q(sl_2): the 3-dimensional module V_2 satisfies the defining relations.
rep = build_representation(2)
checks = verify_on_representation(rep.E, rep.F, rep.K, rep.K_inv)
assert all(check.holds for check in checks.values())

# The fundamental R-matrix compatible with the package coproduct satisfies
# the QYBE and intertwines the coproduct for every generator.
assert qybe_holds(R_matrix_V1_coproduct())
assert all(intertwining_holds_V1(X) for X in ("E", "F", "K", "K_inv"))

# GL_q(2|1): the graded Yang-Baxter residual is an exact 27x27 zero matrix.
residual = graded_yang_baxter_residual_GLq21()
assert residual.shape == (27, 27) and is_zero_matrix(residual)

print("quickstart: all checks passed")

examples/sample_verification.py is a slightly longer example that prints each result, including a negative control. Its expected output is examples/sample_verification_expected.txt, and CI checks that the two agree.

Every *_residual function returns the exact SymPy difference matrix, so a failing identity can be inspected entry by entry: a nonzero entry shows exactly where two sides of an identity differ.

Validation

One command runs the complete test suite and the package doctests; it is what CI runs on Python 3.10–3.13 and with the oldest supported dependency versions:

python3 -m pytest          # or: make check

Plots use Matplotlib's noninteractive Agg backend in the tests. The GL_q(2|1) checks use symbolic 81x81 matrices; the full suite took about 15 s when prepared for 1.1.0 (Python 3.12, SymPy 1.14, x86-64 Linux; the tests are unchanged in substance through 1.1.2). Targeted runs, e.g. python3 -m pytest tests/test_supergroup_gl21.py, also work.