{"id":21686,"library":"passagemath-homfly","title":"passagemath-homfly","description":"passagemath-homfly provides computation of Homfly polynomials for knots and links using libhomfly, integrated with the passagemath ecosystem. Current version 10.8.4, requiring Python ≥3.11 and <3.15. Follows passagemath release cadence; stable maintenance.","status":"active","version":"10.8.4","language":"python","source_language":"en","source_url":"https://github.com/passagemath/passagemath-homfly","tags":["knot-theory","homfly","libhomfly","passagemath"],"install":[{"cmd":"pip install passagemath-homfly","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Required for SageMath/Python integration and knot/link data structures","package":"passagemath-sage","optional":false},{"reason":"Core library for Homfly polynomial computation (installed automatically on most systems, but may need separate system install on macOS/Linux)","package":"libhomfly","optional":false}],"imports":[{"note":"Old SageMath import path may not include libhomfly; use passagemath namespace","wrong":"from sage.knots import homfly_polynomial","symbol":"link_homfly_polynomial","correct":"from passagemath.homfly import link_homfly_polynomial"},{"note":"Knot class is in sage.knots; passagemath-homfly uses this for input","symbol":"Knot","correct":"from sage.knots.knot import Knot"}],"quickstart":{"code":"from sage.knots.knot import Knot\nfrom passagemath.homfly import link_homfly_polynomial\n\n# Create a trefoil knot (3_1)\ntrefoil = Knot('3_1')\n# Compute Homfly polynomial\npoly = link_homfly_polynomial(trefoil)\nprint(poly)","lang":"python","description":"Compute the Homfly polynomial of a trefoil knot. Requires SageMath environment."},"warnings":[{"fix":"Always use 'from passagemath.homfly import link_homfly_polynomial'","message":"Direct import from 'passagemath.homfly' may be deprecated in future releases. Use full import path as shown in quickstart.","severity":"deprecated","affected_versions":">=10.8"},{"fix":"Wrap knot name in Knot('3_1') or Link().","message":"Knot/link must be a SageMath Knot or Link object, not a string. Common mistake: passing a knot name as string directly.","severity":"gotcha","affected_versions":"all"},{"fix":"Upgrade to 10.8.4 and use Python 3.11-3.14.","message":"Python 3.11+ required. Versions prior to 10.8 may fail on Python 3.12+ due to C library incompatibility.","severity":"breaking","affected_versions":"<10.8"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Run 'pip install passagemath-homfly' then use 'from passagemath.homfly import link_homfly_polynomial'","cause":"Incorrect import path or passagemath-homfly not installed.","error":"ImportError: cannot import name 'link_homfly_polynomial' from 'passagemath.homfly'"},{"fix":"Create a Knot object: Knot('3_1') before passing.","cause":"Passing a string (e.g., '3_1') directly to link_homfly_polynomial.","error":"TypeError: expected a Sage knot or link, got str"},{"fix":"Install passagemath-sage or full SageMath, or run within a SageMath environment (e.g., 'sage -python').","cause":"SageMath environment not installed or not activated.","error":"ModuleNotFoundError: No module named 'sage'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}