pyw-algebra 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pyw_algebra-0.1.0/LICENSE +21 -0
- pyw_algebra-0.1.0/PKG-INFO +220 -0
- pyw_algebra-0.1.0/README.md +161 -0
- pyw_algebra-0.1.0/pyproject.toml +97 -0
- pyw_algebra-0.1.0/pyw/__init__.py +30 -0
- pyw_algebra-0.1.0/pyw/algorithms/__init__.py +11 -0
- pyw_algebra-0.1.0/pyw/algorithms/nilpotent_orbits.py +667 -0
- pyw_algebra-0.1.0/pyw/core/__init__.py +88 -0
- pyw_algebra-0.1.0/pyw/core/affine_lie_algebra.py +1908 -0
- pyw_algebra-0.1.0/pyw/core/affine_weight.py +1358 -0
- pyw_algebra-0.1.0/pyw/core/bruhat.py +690 -0
- pyw_algebra-0.1.0/pyw/core/character.py +1496 -0
- pyw_algebra-0.1.0/pyw/core/hybrid_affine_character.py +820 -0
- pyw_algebra-0.1.0/pyw/core/kazhdan_lusztig.py +1358 -0
- pyw_algebra-0.1.0/pyw/core/root_system.py +292 -0
- pyw_algebra-0.1.0/pyw/core/weight_space.py +193 -0
- pyw_algebra-0.1.0/pyw/core/weyl_group.py +1607 -0
- pyw_algebra-0.1.0/pyw/embedding/__init__.py +19 -0
- pyw_algebra-0.1.0/pyw/embedding/sl2_triple.py +812 -0
- pyw_algebra-0.1.0/pyw/fractional/__init__.py +17 -0
- pyw_algebra-0.1.0/pyw/fractional/admissible.py +188 -0
- pyw_algebra-0.1.0/pyw/fractional/boundary_admissible.py +302 -0
- pyw_algebra-0.1.0/pyw/fractional/level.py +255 -0
- pyw_algebra-0.1.0/pyw/fractional/nondegenerate.py +279 -0
- pyw_algebra-0.1.0/pyw/fractional/principal.py +492 -0
- pyw_algebra-0.1.0/pyw/fractional/translation_conventions.py +307 -0
- pyw_algebra-0.1.0/pyw/fractional/verify_sl2_boundary.py +217 -0
- pyw_algebra-0.1.0/pyw/utils/__init__.py +32 -0
- pyw_algebra-0.1.0/pyw/utils/predicates.py +400 -0
- pyw_algebra-0.1.0/pyw/utils/theta_functions.py +286 -0
- pyw_algebra-0.1.0/pyw_algebra.egg-info/PKG-INFO +220 -0
- pyw_algebra-0.1.0/pyw_algebra.egg-info/SOURCES.txt +34 -0
- pyw_algebra-0.1.0/pyw_algebra.egg-info/dependency_links.txt +1 -0
- pyw_algebra-0.1.0/pyw_algebra.egg-info/requires.txt +17 -0
- pyw_algebra-0.1.0/pyw_algebra.egg-info/top_level.txt +1 -0
- pyw_algebra-0.1.0/setup.cfg +4 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 panyw5
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: pyw-algebra
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: SageMath-based root system and affine Lie algebra computations
|
|
5
|
+
Author: pyw contributors
|
|
6
|
+
License: MIT License
|
|
7
|
+
|
|
8
|
+
Copyright (c) 2026 panyw5
|
|
9
|
+
|
|
10
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
11
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
12
|
+
in the Software without restriction, including without limitation the rights
|
|
13
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
14
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
15
|
+
furnished to do so, subject to the following conditions:
|
|
16
|
+
|
|
17
|
+
The above copyright notice and this permission notice shall be included in all
|
|
18
|
+
copies or substantial portions of the Software.
|
|
19
|
+
|
|
20
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
21
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
22
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
23
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
24
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
25
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
26
|
+
SOFTWARE.
|
|
27
|
+
|
|
28
|
+
Project-URL: Homepage, https://github.com/panyw5/pyw
|
|
29
|
+
Project-URL: Documentation, https://github.com/panyw5/pyw/tree/main/docs
|
|
30
|
+
Project-URL: Repository, https://github.com/panyw5/pyw
|
|
31
|
+
Project-URL: Issues, https://github.com/panyw5/pyw/issues
|
|
32
|
+
Keywords: kac-moody,lie-algebra,affine-lie-algebra,w-algebra,root-system,weyl-group,fractional-level,sagemath
|
|
33
|
+
Classifier: Development Status :: 3 - Alpha
|
|
34
|
+
Classifier: Intended Audience :: Science/Research
|
|
35
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
36
|
+
Classifier: Programming Language :: Python :: 3
|
|
37
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
38
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
39
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
40
|
+
Classifier: Topic :: Scientific/Engineering :: Mathematics
|
|
41
|
+
Requires-Python: >=3.10
|
|
42
|
+
Description-Content-Type: text/markdown
|
|
43
|
+
License-File: LICENSE
|
|
44
|
+
Requires-Dist: sagemath-standard>=10.0
|
|
45
|
+
Provides-Extra: dev
|
|
46
|
+
Requires-Dist: pytest>=7.0; extra == "dev"
|
|
47
|
+
Requires-Dist: pytest-cov>=4.0; extra == "dev"
|
|
48
|
+
Requires-Dist: black>=23.0; extra == "dev"
|
|
49
|
+
Requires-Dist: mypy>=1.0; extra == "dev"
|
|
50
|
+
Requires-Dist: ruff>=0.1.0; extra == "dev"
|
|
51
|
+
Provides-Extra: docs
|
|
52
|
+
Requires-Dist: sphinx>=6.0; extra == "docs"
|
|
53
|
+
Requires-Dist: sphinx-rtd-theme>=1.0; extra == "docs"
|
|
54
|
+
Requires-Dist: sphinx-autodoc-typehints; extra == "docs"
|
|
55
|
+
Provides-Extra: jupyter
|
|
56
|
+
Requires-Dist: jupyter>=1.0; extra == "jupyter"
|
|
57
|
+
Requires-Dist: ipywidgets>=8.0; extra == "jupyter"
|
|
58
|
+
Dynamic: license-file
|
|
59
|
+
|
|
60
|
+
# pyw
|
|
61
|
+
|
|
62
|
+
Distribution name: **pyw-algebra**. The Python import name remains **pyw**.
|
|
63
|
+
|
|
64
|
+
**Root System & Affine Lie Algebra Computation Library**
|
|
65
|
+
|
|
66
|
+
A SageMath-based Python library for computing with root systems, affine Lie algebras,
|
|
67
|
+
Weyl groups, and fractional levels/weights. This is an experimental research library.
|
|
68
|
+
W-algebra constructions are a longer-term goal, not a currently available module.
|
|
69
|
+
|
|
70
|
+
## Features
|
|
71
|
+
|
|
72
|
+
- **Root Systems**: Finite and affine root systems, (co-)roots
|
|
73
|
+
- **Weyl Groups**: Finite, affine, and extended affine Weyl groups
|
|
74
|
+
- **Weight Spaces**: Support for fractional weights and levels
|
|
75
|
+
- **Admissible Weights**: Kac-Wakimoto admissible weight criteria
|
|
76
|
+
- **Principal Admissible Weights / Nondegeneracy**: Incomplete experimental APIs; not validated for this release
|
|
77
|
+
- **Embeddings**: $sl_2$-triples, grading, centralizers, Levi subalgebras
|
|
78
|
+
- **Characters**: Experimental integrable, boundary-admissible, and Kazhdan-Lusztig character computations
|
|
79
|
+
|
|
80
|
+
Support varies by Cartan type and algorithm. An API being present does not imply
|
|
81
|
+
that all finite, affine, or twisted types are supported. See the tests and module
|
|
82
|
+
docstrings for the currently exercised cases.
|
|
83
|
+
|
|
84
|
+
Principal-admissible weight construction and nondegeneracy checking are still
|
|
85
|
+
under development. Their current tests have known failures; do not rely on
|
|
86
|
+
these APIs for verified results. They are retained for experimentation, not
|
|
87
|
+
included in the release-preparation validation guarantees.
|
|
88
|
+
|
|
89
|
+
## Installation
|
|
90
|
+
|
|
91
|
+
Install SageMath first using the [official installation guide](https://doc.sagemath.org/html/en/installation/).
|
|
92
|
+
Use SageMath's Python interpreter, not an unrelated system Python. A PyPI release
|
|
93
|
+
is being prepared; until it is published, install from a local checkout:
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
git clone https://github.com/panyw5/pyw.git
|
|
97
|
+
cd pyw
|
|
98
|
+
sage -python -m pip install -e . --no-deps
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
`--no-deps` assumes that a complete SageMath installation already provides the
|
|
102
|
+
required `sage` modules. The package metadata declares `sagemath-standard`, but
|
|
103
|
+
installing that dependency with ordinary pip can require substantial native
|
|
104
|
+
libraries and build tools; it is not a portable one-command SageMath installer.
|
|
105
|
+
|
|
106
|
+
For development, add the test tools in the same environment:
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
sage -python -m pip install pytest pytest-cov
|
|
110
|
+
sage -python -m pytest
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
Once a release is available, the corresponding installation command in an
|
|
114
|
+
existing SageMath environment will be `sage -python -m pip install pyw-algebra --no-deps`.
|
|
115
|
+
|
|
116
|
+
## Requirements
|
|
117
|
+
|
|
118
|
+
- Python >= 3.10
|
|
119
|
+
- SageMath >= 10.0
|
|
120
|
+
|
|
121
|
+
The release-preparation checks currently use SageMath 10.4 with Python 3.12.4
|
|
122
|
+
on macOS. Other combinations are not yet verified. Some Kazhdan-Lusztig backends
|
|
123
|
+
also require SageMath's optional Coxeter support or a `coxeter` executable; the
|
|
124
|
+
executable can be selected with `PYW_COXETER_COMMAND`.
|
|
125
|
+
|
|
126
|
+
Run Python examples with `sage -python`, or use a SageMath notebook kernel.
|
|
127
|
+
In Python files, use `Fraction`, `QQ`, or explicit Sage rationals rather than
|
|
128
|
+
floating-point division for exact fractional computations.
|
|
129
|
+
|
|
130
|
+
## Quick Start
|
|
131
|
+
|
|
132
|
+
```python
|
|
133
|
+
from pyw import FractionalLevel, AdmissibleWeight, FractionalWeightSpace
|
|
134
|
+
|
|
135
|
+
# Create a fractional level k = -h^∨ + p/u
|
|
136
|
+
level = FractionalLevel(['A', 2, 1], p=4, u=3)
|
|
137
|
+
print(f"Level k = {level.level}") # k = -3 + 4/3 = -5/3
|
|
138
|
+
|
|
139
|
+
# Create a vacuum weight at the same central level
|
|
140
|
+
ws = FractionalWeightSpace(['A', 2, 1])
|
|
141
|
+
weight = ws.create_fractional_weight({0: level.level})
|
|
142
|
+
print(f"Weight = {weight}") # -5/3*Lambda[0]
|
|
143
|
+
|
|
144
|
+
# Check admissibility
|
|
145
|
+
admissible = AdmissibleWeight(['A', 2, 1], weight, level)
|
|
146
|
+
print(f"Is admissible: {admissible.is_admissible()}")
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
`AdmissibleWeight` currently supports finite and untwisted affine types. For
|
|
150
|
+
affine input, the weight's central level must match the supplied level. Twisted
|
|
151
|
+
affine admissibility is not implemented. To construct other fractional weights,
|
|
152
|
+
coefficients may be integers, `Fraction` instances, Sage rationals, or pairs
|
|
153
|
+
such as `(3, 4)` for three quarters.
|
|
154
|
+
|
|
155
|
+
### Weight and Coweight Operations
|
|
156
|
+
|
|
157
|
+
Weights and coweights live in different mathematical spaces, but you can convert between them:
|
|
158
|
+
|
|
159
|
+
```python
|
|
160
|
+
from pyw.core import AffineLieAlgebra
|
|
161
|
+
|
|
162
|
+
alg = AffineLieAlgebra(['A', 1, 1])
|
|
163
|
+
|
|
164
|
+
# Get weights and coweights
|
|
165
|
+
Lambda = alg.fundamental_weights()
|
|
166
|
+
Lambda_check = alg.fundamental_coweights()
|
|
167
|
+
|
|
168
|
+
# Convert coweight to weight space for arithmetic
|
|
169
|
+
cw = -2 * Lambda_check[1]
|
|
170
|
+
cw_as_weight = alg.coweight_to_weight(cw)
|
|
171
|
+
|
|
172
|
+
# Now can mix with weights
|
|
173
|
+
from pyw.core.affine_weight import AffineWeight
|
|
174
|
+
w_finite = AffineWeight.affine_fundamental_weight(alg, 0).finite_part
|
|
175
|
+
mixed = cw_as_weight + w_finite
|
|
176
|
+
|
|
177
|
+
# Use in translations with fractional coefficients
|
|
178
|
+
trans = alg.extended_affine_weyl_group().translation
|
|
179
|
+
from sage.all import QQ
|
|
180
|
+
result = trans(cw).action(QQ(-4) / 3 * Lambda[0])
|
|
181
|
+
print(f"Result: {result}")
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
## Project Structure
|
|
185
|
+
|
|
186
|
+
```
|
|
187
|
+
pyw/
|
|
188
|
+
├── core/ # SageMath wrappers for root systems, Weyl groups, weight spaces
|
|
189
|
+
├── fractional/ # Fractional level and admissible weight support
|
|
190
|
+
├── embedding/ # Lie algebra embeddings (sl2-triples, Levi subalgebras)
|
|
191
|
+
├── algorithms/ # Algorithms from research papers
|
|
192
|
+
└── utils/ # Predicates and theta-function helpers
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
## Documentation
|
|
196
|
+
|
|
197
|
+
See [docs/](docs/) for implementation notes and release guidance. API details
|
|
198
|
+
are currently documented in module docstrings; a complete hosted manual is not
|
|
199
|
+
yet available.
|
|
200
|
+
|
|
201
|
+
## References
|
|
202
|
+
|
|
203
|
+
1. Kac, V. G., Wakimoto, M. "On rationality of W-algebras"
|
|
204
|
+
2. Shan, D., Xie, D., Yan, W. "Mirror symmetry for circle compactified 4d N=2 SCFTs"
|
|
205
|
+
3. Kac, V. G. "Infinite-dimensional Lie algebras" (3rd ed.)
|
|
206
|
+
|
|
207
|
+
## License
|
|
208
|
+
|
|
209
|
+
Licensed under the [MIT License](LICENSE). Copyright (c) 2026 panyw5.
|
|
210
|
+
|
|
211
|
+
## Status
|
|
212
|
+
|
|
213
|
+
**Version**: 0.1.0 (Alpha)
|
|
214
|
+
|
|
215
|
+
This project is under active development. API may change.
|
|
216
|
+
|
|
217
|
+
## Release checks
|
|
218
|
+
|
|
219
|
+
See [the release checklist](docs/releasing.md) for build, metadata, and installed-package
|
|
220
|
+
verification. Passing a build alone does not establish mathematical correctness.
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
# pyw
|
|
2
|
+
|
|
3
|
+
Distribution name: **pyw-algebra**. The Python import name remains **pyw**.
|
|
4
|
+
|
|
5
|
+
**Root System & Affine Lie Algebra Computation Library**
|
|
6
|
+
|
|
7
|
+
A SageMath-based Python library for computing with root systems, affine Lie algebras,
|
|
8
|
+
Weyl groups, and fractional levels/weights. This is an experimental research library.
|
|
9
|
+
W-algebra constructions are a longer-term goal, not a currently available module.
|
|
10
|
+
|
|
11
|
+
## Features
|
|
12
|
+
|
|
13
|
+
- **Root Systems**: Finite and affine root systems, (co-)roots
|
|
14
|
+
- **Weyl Groups**: Finite, affine, and extended affine Weyl groups
|
|
15
|
+
- **Weight Spaces**: Support for fractional weights and levels
|
|
16
|
+
- **Admissible Weights**: Kac-Wakimoto admissible weight criteria
|
|
17
|
+
- **Principal Admissible Weights / Nondegeneracy**: Incomplete experimental APIs; not validated for this release
|
|
18
|
+
- **Embeddings**: $sl_2$-triples, grading, centralizers, Levi subalgebras
|
|
19
|
+
- **Characters**: Experimental integrable, boundary-admissible, and Kazhdan-Lusztig character computations
|
|
20
|
+
|
|
21
|
+
Support varies by Cartan type and algorithm. An API being present does not imply
|
|
22
|
+
that all finite, affine, or twisted types are supported. See the tests and module
|
|
23
|
+
docstrings for the currently exercised cases.
|
|
24
|
+
|
|
25
|
+
Principal-admissible weight construction and nondegeneracy checking are still
|
|
26
|
+
under development. Their current tests have known failures; do not rely on
|
|
27
|
+
these APIs for verified results. They are retained for experimentation, not
|
|
28
|
+
included in the release-preparation validation guarantees.
|
|
29
|
+
|
|
30
|
+
## Installation
|
|
31
|
+
|
|
32
|
+
Install SageMath first using the [official installation guide](https://doc.sagemath.org/html/en/installation/).
|
|
33
|
+
Use SageMath's Python interpreter, not an unrelated system Python. A PyPI release
|
|
34
|
+
is being prepared; until it is published, install from a local checkout:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
git clone https://github.com/panyw5/pyw.git
|
|
38
|
+
cd pyw
|
|
39
|
+
sage -python -m pip install -e . --no-deps
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
`--no-deps` assumes that a complete SageMath installation already provides the
|
|
43
|
+
required `sage` modules. The package metadata declares `sagemath-standard`, but
|
|
44
|
+
installing that dependency with ordinary pip can require substantial native
|
|
45
|
+
libraries and build tools; it is not a portable one-command SageMath installer.
|
|
46
|
+
|
|
47
|
+
For development, add the test tools in the same environment:
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
sage -python -m pip install pytest pytest-cov
|
|
51
|
+
sage -python -m pytest
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Once a release is available, the corresponding installation command in an
|
|
55
|
+
existing SageMath environment will be `sage -python -m pip install pyw-algebra --no-deps`.
|
|
56
|
+
|
|
57
|
+
## Requirements
|
|
58
|
+
|
|
59
|
+
- Python >= 3.10
|
|
60
|
+
- SageMath >= 10.0
|
|
61
|
+
|
|
62
|
+
The release-preparation checks currently use SageMath 10.4 with Python 3.12.4
|
|
63
|
+
on macOS. Other combinations are not yet verified. Some Kazhdan-Lusztig backends
|
|
64
|
+
also require SageMath's optional Coxeter support or a `coxeter` executable; the
|
|
65
|
+
executable can be selected with `PYW_COXETER_COMMAND`.
|
|
66
|
+
|
|
67
|
+
Run Python examples with `sage -python`, or use a SageMath notebook kernel.
|
|
68
|
+
In Python files, use `Fraction`, `QQ`, or explicit Sage rationals rather than
|
|
69
|
+
floating-point division for exact fractional computations.
|
|
70
|
+
|
|
71
|
+
## Quick Start
|
|
72
|
+
|
|
73
|
+
```python
|
|
74
|
+
from pyw import FractionalLevel, AdmissibleWeight, FractionalWeightSpace
|
|
75
|
+
|
|
76
|
+
# Create a fractional level k = -h^∨ + p/u
|
|
77
|
+
level = FractionalLevel(['A', 2, 1], p=4, u=3)
|
|
78
|
+
print(f"Level k = {level.level}") # k = -3 + 4/3 = -5/3
|
|
79
|
+
|
|
80
|
+
# Create a vacuum weight at the same central level
|
|
81
|
+
ws = FractionalWeightSpace(['A', 2, 1])
|
|
82
|
+
weight = ws.create_fractional_weight({0: level.level})
|
|
83
|
+
print(f"Weight = {weight}") # -5/3*Lambda[0]
|
|
84
|
+
|
|
85
|
+
# Check admissibility
|
|
86
|
+
admissible = AdmissibleWeight(['A', 2, 1], weight, level)
|
|
87
|
+
print(f"Is admissible: {admissible.is_admissible()}")
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
`AdmissibleWeight` currently supports finite and untwisted affine types. For
|
|
91
|
+
affine input, the weight's central level must match the supplied level. Twisted
|
|
92
|
+
affine admissibility is not implemented. To construct other fractional weights,
|
|
93
|
+
coefficients may be integers, `Fraction` instances, Sage rationals, or pairs
|
|
94
|
+
such as `(3, 4)` for three quarters.
|
|
95
|
+
|
|
96
|
+
### Weight and Coweight Operations
|
|
97
|
+
|
|
98
|
+
Weights and coweights live in different mathematical spaces, but you can convert between them:
|
|
99
|
+
|
|
100
|
+
```python
|
|
101
|
+
from pyw.core import AffineLieAlgebra
|
|
102
|
+
|
|
103
|
+
alg = AffineLieAlgebra(['A', 1, 1])
|
|
104
|
+
|
|
105
|
+
# Get weights and coweights
|
|
106
|
+
Lambda = alg.fundamental_weights()
|
|
107
|
+
Lambda_check = alg.fundamental_coweights()
|
|
108
|
+
|
|
109
|
+
# Convert coweight to weight space for arithmetic
|
|
110
|
+
cw = -2 * Lambda_check[1]
|
|
111
|
+
cw_as_weight = alg.coweight_to_weight(cw)
|
|
112
|
+
|
|
113
|
+
# Now can mix with weights
|
|
114
|
+
from pyw.core.affine_weight import AffineWeight
|
|
115
|
+
w_finite = AffineWeight.affine_fundamental_weight(alg, 0).finite_part
|
|
116
|
+
mixed = cw_as_weight + w_finite
|
|
117
|
+
|
|
118
|
+
# Use in translations with fractional coefficients
|
|
119
|
+
trans = alg.extended_affine_weyl_group().translation
|
|
120
|
+
from sage.all import QQ
|
|
121
|
+
result = trans(cw).action(QQ(-4) / 3 * Lambda[0])
|
|
122
|
+
print(f"Result: {result}")
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
## Project Structure
|
|
126
|
+
|
|
127
|
+
```
|
|
128
|
+
pyw/
|
|
129
|
+
├── core/ # SageMath wrappers for root systems, Weyl groups, weight spaces
|
|
130
|
+
├── fractional/ # Fractional level and admissible weight support
|
|
131
|
+
├── embedding/ # Lie algebra embeddings (sl2-triples, Levi subalgebras)
|
|
132
|
+
├── algorithms/ # Algorithms from research papers
|
|
133
|
+
└── utils/ # Predicates and theta-function helpers
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
## Documentation
|
|
137
|
+
|
|
138
|
+
See [docs/](docs/) for implementation notes and release guidance. API details
|
|
139
|
+
are currently documented in module docstrings; a complete hosted manual is not
|
|
140
|
+
yet available.
|
|
141
|
+
|
|
142
|
+
## References
|
|
143
|
+
|
|
144
|
+
1. Kac, V. G., Wakimoto, M. "On rationality of W-algebras"
|
|
145
|
+
2. Shan, D., Xie, D., Yan, W. "Mirror symmetry for circle compactified 4d N=2 SCFTs"
|
|
146
|
+
3. Kac, V. G. "Infinite-dimensional Lie algebras" (3rd ed.)
|
|
147
|
+
|
|
148
|
+
## License
|
|
149
|
+
|
|
150
|
+
Licensed under the [MIT License](LICENSE). Copyright (c) 2026 panyw5.
|
|
151
|
+
|
|
152
|
+
## Status
|
|
153
|
+
|
|
154
|
+
**Version**: 0.1.0 (Alpha)
|
|
155
|
+
|
|
156
|
+
This project is under active development. API may change.
|
|
157
|
+
|
|
158
|
+
## Release checks
|
|
159
|
+
|
|
160
|
+
See [the release checklist](docs/releasing.md) for build, metadata, and installed-package
|
|
161
|
+
verification. Passing a build alone does not establish mathematical correctness.
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=61.0", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "pyw-algebra"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "SageMath-based root system and affine Lie algebra computations"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = {file = "LICENSE"}
|
|
11
|
+
authors = [
|
|
12
|
+
{name = "pyw contributors"}
|
|
13
|
+
]
|
|
14
|
+
keywords = [
|
|
15
|
+
"kac-moody",
|
|
16
|
+
"lie-algebra",
|
|
17
|
+
"affine-lie-algebra",
|
|
18
|
+
"w-algebra",
|
|
19
|
+
"root-system",
|
|
20
|
+
"weyl-group",
|
|
21
|
+
"fractional-level",
|
|
22
|
+
"sagemath",
|
|
23
|
+
]
|
|
24
|
+
classifiers = [
|
|
25
|
+
"Development Status :: 3 - Alpha",
|
|
26
|
+
"Intended Audience :: Science/Research",
|
|
27
|
+
"License :: OSI Approved :: MIT License",
|
|
28
|
+
"Programming Language :: Python :: 3",
|
|
29
|
+
"Programming Language :: Python :: 3.10",
|
|
30
|
+
"Programming Language :: Python :: 3.11",
|
|
31
|
+
"Programming Language :: Python :: 3.12",
|
|
32
|
+
"Topic :: Scientific/Engineering :: Mathematics",
|
|
33
|
+
]
|
|
34
|
+
requires-python = ">=3.10"
|
|
35
|
+
dependencies = [
|
|
36
|
+
"sagemath-standard >= 10.0",
|
|
37
|
+
]
|
|
38
|
+
|
|
39
|
+
[project.optional-dependencies]
|
|
40
|
+
dev = [
|
|
41
|
+
"pytest >= 7.0",
|
|
42
|
+
"pytest-cov >= 4.0",
|
|
43
|
+
"black >= 23.0",
|
|
44
|
+
"mypy >= 1.0",
|
|
45
|
+
"ruff >= 0.1.0",
|
|
46
|
+
]
|
|
47
|
+
docs = [
|
|
48
|
+
"sphinx >= 6.0",
|
|
49
|
+
"sphinx-rtd-theme >= 1.0",
|
|
50
|
+
"sphinx-autodoc-typehints",
|
|
51
|
+
]
|
|
52
|
+
jupyter = [
|
|
53
|
+
"jupyter >= 1.0",
|
|
54
|
+
"ipywidgets >= 8.0",
|
|
55
|
+
]
|
|
56
|
+
|
|
57
|
+
[project.urls]
|
|
58
|
+
Homepage = "https://github.com/panyw5/pyw"
|
|
59
|
+
Documentation = "https://github.com/panyw5/pyw/tree/main/docs"
|
|
60
|
+
Repository = "https://github.com/panyw5/pyw"
|
|
61
|
+
Issues = "https://github.com/panyw5/pyw/issues"
|
|
62
|
+
|
|
63
|
+
[tool.setuptools.packages.find]
|
|
64
|
+
where = ["."]
|
|
65
|
+
include = ["pyw", "pyw.*"]
|
|
66
|
+
exclude = ["pyw.tests", "pyw.tests.*"]
|
|
67
|
+
|
|
68
|
+
[tool.black]
|
|
69
|
+
line-length = 100
|
|
70
|
+
target-version = ["py310", "py311", "py312"]
|
|
71
|
+
|
|
72
|
+
[tool.ruff]
|
|
73
|
+
line-length = 100
|
|
74
|
+
target-version = "py310"
|
|
75
|
+
|
|
76
|
+
[tool.ruff.lint]
|
|
77
|
+
select = ["E", "F", "W", "I", "N", "B"]
|
|
78
|
+
ignore = ["E501"] # Line too long (handled by black)
|
|
79
|
+
|
|
80
|
+
[tool.mypy]
|
|
81
|
+
python_version = "3.10"
|
|
82
|
+
ignore_missing_imports = true
|
|
83
|
+
warn_return_any = true
|
|
84
|
+
warn_unused_configs = true
|
|
85
|
+
|
|
86
|
+
[tool.pytest.ini_options]
|
|
87
|
+
testpaths = ["pyw/tests"]
|
|
88
|
+
python_files = ["test_*.py"]
|
|
89
|
+
addopts = "-v --cov=pyw --cov-report=term-missing"
|
|
90
|
+
|
|
91
|
+
[tool.coverage.run]
|
|
92
|
+
source = ["pyw"]
|
|
93
|
+
branch = true
|
|
94
|
+
|
|
95
|
+
[tool.coverage.report]
|
|
96
|
+
precision = 2
|
|
97
|
+
fail_under = 80
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"""
|
|
2
|
+
pyw - Root System & Affine Lie Algebra Computation Library
|
|
3
|
+
|
|
4
|
+
A Python library for computing with root systems and affine Lie algebras,
|
|
5
|
+
with special support for fractional levels/weights. W-algebra constructions
|
|
6
|
+
are a future goal, not a currently available module.
|
|
7
|
+
|
|
8
|
+
Based on SageMath's root system and Lie algebra implementations.
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
__version__ = "0.1.0"
|
|
12
|
+
__author__ = "pyw contributors"
|
|
13
|
+
|
|
14
|
+
from pyw.core.root_system import AffineRootSystem
|
|
15
|
+
from pyw.core.weyl_group import AffineWeylGroup
|
|
16
|
+
from pyw.core.weight_space import FractionalWeightSpace
|
|
17
|
+
from pyw.fractional.level import FractionalLevel
|
|
18
|
+
from pyw.fractional.admissible import AdmissibleWeight
|
|
19
|
+
from pyw.fractional.principal import PrincipalAdmissibleWeight
|
|
20
|
+
from pyw.fractional.nondegenerate import NondegenerateChecker
|
|
21
|
+
|
|
22
|
+
__all__ = [
|
|
23
|
+
"AffineRootSystem",
|
|
24
|
+
"AffineWeylGroup",
|
|
25
|
+
"FractionalWeightSpace",
|
|
26
|
+
"FractionalLevel",
|
|
27
|
+
"AdmissibleWeight",
|
|
28
|
+
"PrincipalAdmissibleWeight",
|
|
29
|
+
"NondegenerateChecker",
|
|
30
|
+
]
|