link-rep-to-pd-code
Evaluate a textual link representation as one canonically numbered PD code.
Installation
pip install link-rep-to-pd-code
Usage example
from link_rep_to_pd_code import link_rep_to_pd_code
text = """K3a1: [[1,5,2,4],[3,1,4,6],[5,3,6,2]]
[K3a1, K3a1]
L[1, 1]#L[2, 1]
"""
pd = link_rep_to_pd_code(text)
print(pd)
Algorithm
The parser resolves every factor name to its PD definition and records a representative label for every original component. Join terms are processed in order. Each oriented connected sum returns old-to-new label maps; those maps update every representative in both merged clusters, including factors merged earlier. The final PD code is topologically normalized, sorted, and relabelled contiguously.
Input conventions
A PD code is represented as a list of four-entry crossings. Arc labels normally occur exactly twice. Public functions validate inputs and return new values rather than mutating caller-owned data unless their API explicitly says otherwise.
External software
No external software is required.
Development
Run examples and package checks before release. Python packages require Python 3.10 or newer. Build PyPI artifacts with:
poetry check
poetry build
License
MIT. See LICENSE.
Metadata
Release files for link-rep-to-pd-code 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| link_rep_to_pd_code-0.1.1.tar.gz | 4.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| link_rep_to_pd_code-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 10.2 kB
Release files / link_rep_to_pd_code-0.1.1.tar.gz
| Download URL | link_rep_to_pd_code-0.1.1.tar.gz |
|---|---|
| Size | 4.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
97b2ca3c0cda33efddabf60bcf1af1d8f86f77a9c9936d17488d1bd6578b3114
|
|
BLAKE2b-256 checksum How to use checksums |
538d4289a3c8f18d668814880ce4881dde6c0399cfa0b45a4f1f45479e13dbd6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.4.1 CPython/3.11.15 Windows/10
|
Release files / link_rep_to_pd_code-0.1.1-py3-none-any.whl
| Download URL | link_rep_to_pd_code-0.1.1-py3-none-any.whl |
|---|---|
| Size | 5.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d3a8626b1d15b9be734dcb23ca00ea97c7b3b67a04e63a42a791b3824beee30c
|
|
BLAKE2b-256 checksum How to use checksums |
81bd77c7fd74c3f5b85ac2e09aed1f94bf57a68c0beb596500efedac499e66c6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.4.1 CPython/3.11.15 Windows/10
|