Skip to main content

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)

Source distribution for link-rep-to-pd-code 0.1.1
File Size Uploaded
link_rep_to_pd_code-0.1.1.tar.gz 4.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for link-rep-to-pd-code 0.1.1
File Interpreter ABI Platform
link_rep_to_pd_code-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 10.2 kB

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page