Spherogram
raw JSON → 2.4.1 verified Fri May 01 auth: no python
A Python library for spherical diagrams in 3-manifold topology, including links, knots, braids, tangles, and planar diagrams. Current version 2.4.1 supports ribbon concordance tools, bridge number bounds, and knot Floer homology. Release cadence is irregular, with major features in even-numbered versions.
pip install spherogram Common errors
error ModuleNotFoundError: No module named 'spherogram' ↓
cause spherogram not installed or installed in wrong environment.
fix
Run
pip install spherogram in the target Python environment. error ImportError: cannot import name 'Link' from 'spherogram.links' ↓
cause Using incorrect submodule import path. The correct symbol is at top level.
fix
Change to
from spherogram import Link. error ValueError: Unrecognized knot name ↓
cause Knot name not in the internal database or string malformed.
fix
Use standard notation like 'K11n34' (K = knot, 11 crossings, n = non-alternating, 34th in table). Check spherogram's knot_table for available names.
Warnings
breaking Version 2.0 changed the sign convention for knot signature (positive knots now have negative signature) and braid generator signs (positive generators give positive crossings). Older code expecting old signs will produce wrong results. ↓
fix Update any code relying on signature signs or braid generator orientation.
breaking The function `Link.simplify()` was significantly improved in 2.1 but may change the diagram representation; do not depend on stable crossing order after simplification. ↓
fix Do not assume crossing indices or ordering remain constant after simplify().
deprecated Automatic import of `snappy_16_knots` in 2.4.1 may be removed in future; always import explicitly if needed. ↓
fix Use `from snappy_16_knots import ...` explicitly.
gotcha Many functions return `Link` objects that may have duplicate crossings or be non-minimal; always call `simplify()` before computing invariants if diagram size matters. ↓
fix After constructing a Link, call L.simplify() for a reduced diagram.
Imports
- Link wrong
from spherogram.links import Linkcorrectfrom spherogram import Link - Knot
from spherogram import Knot - Tangle wrong
from spherogram.tangles import Tanglecorrectfrom spherogram import Tangle
Quickstart
from spherogram import Link
L = Link('K11n34')
print(L.bridge_number())
print(L.jones_polynomial())