passagemath-homfly 10.6.35__cp314-cp314t-macosx_13_0_arm64.whl
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.
- passagemath_homfly-10.6.35.dist-info/METADATA +112 -0
- passagemath_homfly-10.6.35.dist-info/RECORD +10 -0
- passagemath_homfly-10.6.35.dist-info/WHEEL +6 -0
- passagemath_homfly-10.6.35.dist-info/top_level.txt +2 -0
- passagemath_homfly.dylibs/libgc.1.dylib +0 -0
- passagemath_homfly.dylibs/libhomfly.0.0.0.dylib +0 -0
- sage/all__sagemath_homfly.py +4 -0
- sage/libs/all__sagemath_homfly.py +1 -0
- sage/libs/homfly.cpython-314t-darwin.so +0 -0
- sage/libs/homfly.pyx +104 -0
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: passagemath-homfly
|
|
3
|
+
Version: 10.6.35
|
|
4
|
+
Summary: passagemath: Homfly polynomials of knots/links with libhomfly
|
|
5
|
+
Author-email: The Sage Developers <sage-support@googlegroups.com>
|
|
6
|
+
Maintainer: Matthias Köppe, passagemath contributors
|
|
7
|
+
License-Expression: GPL-2.0-or-later
|
|
8
|
+
Project-URL: release notes, https://github.com/passagemath/passagemath/releases
|
|
9
|
+
Project-URL: repo (upstream), https://github.com/sagemath/sage
|
|
10
|
+
Project-URL: repo, https://github.com/passagemath/passagemath
|
|
11
|
+
Project-URL: documentation, https://passagemath.org/docs/latest
|
|
12
|
+
Project-URL: homepage (upstream), https://www.sagemath.org
|
|
13
|
+
Project-URL: discourse, https://passagemath.discourse.group
|
|
14
|
+
Project-URL: tracker (upstream), https://github.com/sagemath/sage/issues
|
|
15
|
+
Project-URL: tracker, https://github.com/passagemath/passagemath/issues
|
|
16
|
+
Classifier: Development Status :: 6 - Mature
|
|
17
|
+
Classifier: Intended Audience :: Education
|
|
18
|
+
Classifier: Intended Audience :: Science/Research
|
|
19
|
+
Classifier: Operating System :: POSIX
|
|
20
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
21
|
+
Classifier: Operating System :: MacOS :: MacOS X
|
|
22
|
+
Classifier: Operating System :: Microsoft :: Windows
|
|
23
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
24
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
25
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
26
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
27
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
28
|
+
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
29
|
+
Classifier: Topic :: Scientific/Engineering :: Mathematics
|
|
30
|
+
Requires-Python: <3.15,>=3.10
|
|
31
|
+
Description-Content-Type: text/x-rst
|
|
32
|
+
Requires-Dist: cysignals<1.12.4; sys_platform == "win32"
|
|
33
|
+
Requires-Dist: cysignals!=1.12.0,>=1.11.2
|
|
34
|
+
Provides-Extra: test
|
|
35
|
+
Requires-Dist: passagemath-graphs; extra == "test"
|
|
36
|
+
Requires-Dist: passagemath-repl; extra == "test"
|
|
37
|
+
|
|
38
|
+
==========================================================================================
|
|
39
|
+
passagemath: Homfly polynomials of knots/links with libhomfly
|
|
40
|
+
==========================================================================================
|
|
41
|
+
|
|
42
|
+
`passagemath <https://github.com/passagemath/passagemath>`__ is open
|
|
43
|
+
source mathematical software in Python, released under the GNU General
|
|
44
|
+
Public Licence GPLv2+.
|
|
45
|
+
|
|
46
|
+
It is a fork of `SageMath <https://www.sagemath.org/>`__, which has been
|
|
47
|
+
developed 2005-2025 under the motto “Creating a Viable Open Source
|
|
48
|
+
Alternative to Magma, Maple, Mathematica, and MATLAB”.
|
|
49
|
+
|
|
50
|
+
The passagemath fork uses the motto "Creating a Free Passage Between the
|
|
51
|
+
Scientific Python Ecosystem and Mathematical Software Communities."
|
|
52
|
+
It was created in October 2024 with the following goals:
|
|
53
|
+
|
|
54
|
+
- providing modularized installation with pip,
|
|
55
|
+
- establishing first-class membership in the scientific Python
|
|
56
|
+
ecosystem,
|
|
57
|
+
- giving `clear attribution of upstream
|
|
58
|
+
projects <https://groups.google.com/g/sage-devel/c/6HO1HEtL1Fs/m/G002rPGpAAAJ>`__,
|
|
59
|
+
- providing independently usable Python interfaces to upstream
|
|
60
|
+
libraries,
|
|
61
|
+
- offering `platform portability and integration testing
|
|
62
|
+
services <https://github.com/passagemath/passagemath/issues/704>`__
|
|
63
|
+
to upstream projects,
|
|
64
|
+
- inviting collaborations with upstream projects,
|
|
65
|
+
- `building a professional, respectful, inclusive
|
|
66
|
+
community <https://groups.google.com/g/sage-devel/c/xBzaINHWwUQ>`__,
|
|
67
|
+
- `empowering Sage users to participate in the scientific Python ecosystem
|
|
68
|
+
<https://github.com/passagemath/passagemath/issues/248>`__ by publishing packages,
|
|
69
|
+
- developing a port to `Pyodide <https://pyodide.org/en/stable/>`__ for
|
|
70
|
+
serverless deployment with Javascript,
|
|
71
|
+
- developing a native Windows port.
|
|
72
|
+
|
|
73
|
+
`Full documentation <https://passagemath.org/docs/latest/html/en/index.html>`__ is
|
|
74
|
+
available online.
|
|
75
|
+
|
|
76
|
+
passagemath attempts to support and provides binary wheels suitable for
|
|
77
|
+
all major Linux distributions and recent versions of macOS.
|
|
78
|
+
|
|
79
|
+
Binary wheels for native Windows (x86_64) are are available for a subset of
|
|
80
|
+
the passagemath distributions. Use of the full functionality of passagemath
|
|
81
|
+
on Windows currently requires the use of Windows Subsystem for Linux (WSL)
|
|
82
|
+
or virtualization.
|
|
83
|
+
|
|
84
|
+
The supported Python versions in the passagemath 10.6.x series are 3.10.x-3.13.x.
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
About this pip-installable distribution package
|
|
88
|
+
-----------------------------------------------
|
|
89
|
+
|
|
90
|
+
This pip-installable distribution ``passagemath-homfly`` provides a Cython interface
|
|
91
|
+
to the `libhomfly <https://github.com/miguelmarco/libhomfly>`_ library.
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
What is included
|
|
95
|
+
----------------
|
|
96
|
+
|
|
97
|
+
* `sage.libs.homfly <https://github.com/passagemath/passagemath/blob/main/src/sage/libs/homfly.pyx>`_
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
Examples
|
|
101
|
+
--------
|
|
102
|
+
|
|
103
|
+
::
|
|
104
|
+
|
|
105
|
+
$ pipx run --pip-args="--prefer-binary" --spec "passagemath-homfly[test]" ipython
|
|
106
|
+
|
|
107
|
+
In [1]: from sage.libs.homfly import homfly_polynomial_dict
|
|
108
|
+
|
|
109
|
+
In [2]: trefoil = '1 6 0 1 1 -1 2 1 0 -1 1 1 2 -1 0 1 1 1 2 1'
|
|
110
|
+
|
|
111
|
+
In [3]: homfly_polynomial_dict(trefoil)
|
|
112
|
+
Out[3]: {(-4, 0): -1, (-2, 0): -2, (-2, 2): 1}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
passagemath_homfly-10.6.35.dist-info/RECORD,,
|
|
2
|
+
passagemath_homfly-10.6.35.dist-info/WHEEL,sha256=nEAtTEo8zKB0Etf0OcFBf11mfJfxrhFw5PZkKHw0p5k,154
|
|
3
|
+
passagemath_homfly-10.6.35.dist-info/top_level.txt,sha256=Kmzulf9WsphADFQuqgvdy5mvTLDj_V2zkFHU2s3UXos,6
|
|
4
|
+
passagemath_homfly-10.6.35.dist-info/METADATA,sha256=ng6qWpy8CBeAcUqaSpw5Iw3KoWkqiU6VYCnxAFHnxLk,4916
|
|
5
|
+
passagemath_homfly.dylibs/libgc.1.dylib,sha256=fpzijQacq2YOhUPQ3i0AC00e80R-MUbsK2BGE-MFKOk,263360
|
|
6
|
+
passagemath_homfly.dylibs/libhomfly.0.0.0.dylib,sha256=ThpAhOw5tBTtNv8Jkb6gXD1sxfvKdPJMB1x7sMNKYK0,72216
|
|
7
|
+
sage/all__sagemath_homfly.py,sha256=F63UPkJOfraoStQNe-1tYDqhjd-siF5P04FcMv4yRcg,106
|
|
8
|
+
sage/libs/homfly.cpython-314t-darwin.so,sha256=vPUmKTTDhItCIngLpgnf_H-lPE7cPZJaiMbozsPYqu8,77136
|
|
9
|
+
sage/libs/homfly.pyx,sha256=RKaj10MXyfdAIqnDec18931GnQrOSPATo92NsdPNCe8,2988
|
|
10
|
+
sage/libs/all__sagemath_homfly.py,sha256=acUGFX0Wx4P0uJwgj5m9ANtfRaZriA7rgY4-VlJE8xc,45
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# sage_setup: distribution = sagemath-homfly
|
|
Binary file
|
sage/libs/homfly.pyx
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
# sage_setup: distribution = sagemath-homfly
|
|
2
|
+
# distutils: libraries = homfly gc
|
|
3
|
+
r"""
|
|
4
|
+
Cython wrapper for libhomfly library
|
|
5
|
+
|
|
6
|
+
This is used to call the libhomfly library directly from python. Knots
|
|
7
|
+
and links are passed following the convention in libhomfly. It is basically
|
|
8
|
+
the oriented Gauss code, represented as a string of integers separated
|
|
9
|
+
by spaces as follows:
|
|
10
|
+
|
|
11
|
+
- how many strings,
|
|
12
|
+
|
|
13
|
+
- for each string, how many crossings, then
|
|
14
|
+
|
|
15
|
+
- for each crossing, the cross name, then `1` if over, `-1` if under
|
|
16
|
+
|
|
17
|
+
- for each crossing, the name of the crossing and `1` if right, `-1` if left.
|
|
18
|
+
|
|
19
|
+
If there are `n` crossings, they must be named `0, 1, ..., n-1`.
|
|
20
|
+
|
|
21
|
+
AUTHORS:
|
|
22
|
+
|
|
23
|
+
- Miguel Marco (2015-03-24): initial version.
|
|
24
|
+
"""
|
|
25
|
+
|
|
26
|
+
# ****************************************************************************
|
|
27
|
+
# Copyright (C) 2015 Miguel Marco <mmarco@unizar.es>
|
|
28
|
+
#
|
|
29
|
+
# Distributed under the terms of the GNU General Public License (GPL)
|
|
30
|
+
# as published by the Free Software Foundation; either version 2 of
|
|
31
|
+
# the License, or (at youroption) any later version.
|
|
32
|
+
# https://www.gnu.org/licenses/
|
|
33
|
+
# ****************************************************************************
|
|
34
|
+
|
|
35
|
+
from cysignals.signals cimport sig_on, sig_off
|
|
36
|
+
|
|
37
|
+
from sage.cpython.string cimport str_to_bytes, char_to_str
|
|
38
|
+
|
|
39
|
+
cdef extern from "homfly.h":
|
|
40
|
+
ctypedef int word
|
|
41
|
+
ctypedef signed long int sb4
|
|
42
|
+
ctypedef unsigned short int ub2
|
|
43
|
+
ctypedef signed short int sb2
|
|
44
|
+
struct Term:
|
|
45
|
+
sb4 coef
|
|
46
|
+
sb2 m
|
|
47
|
+
sb2 l
|
|
48
|
+
struct Poly:
|
|
49
|
+
Term* term
|
|
50
|
+
sb4 len
|
|
51
|
+
Poly* homfly(char *argv)
|
|
52
|
+
char* homfly_str(char *argv)
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
def homfly_polynomial_string(link):
|
|
56
|
+
r"""
|
|
57
|
+
Return the HOMFLY polynomial of a link.
|
|
58
|
+
|
|
59
|
+
INPUT:
|
|
60
|
+
|
|
61
|
+
- ``link`` -- string of space-separated integers representing the link
|
|
62
|
+
|
|
63
|
+
OUTPUT: string with the HOMFLY polynomial in the variables `M` and `L`
|
|
64
|
+
|
|
65
|
+
EXAMPLES::
|
|
66
|
+
|
|
67
|
+
sage: from sage.libs.homfly import homfly_polynomial_string
|
|
68
|
+
sage: trefoil = '1 6 0 1 1 -1 2 1 0 -1 1 1 2 -1 0 1 1 1 2 1'
|
|
69
|
+
sage: homfly_polynomial_string(trefoil)
|
|
70
|
+
' - L^-4 - 2L^-2 + M^2L^-2'
|
|
71
|
+
"""
|
|
72
|
+
link = str_to_bytes(link)
|
|
73
|
+
sig_on()
|
|
74
|
+
cdef char* c_output = homfly_str(link)
|
|
75
|
+
sig_off()
|
|
76
|
+
return char_to_str(c_output)
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
def homfly_polynomial_dict(link):
|
|
80
|
+
"""
|
|
81
|
+
Return a dictionary representing the HOMFLY polynomial of a link.
|
|
82
|
+
|
|
83
|
+
INPUT:
|
|
84
|
+
|
|
85
|
+
- ``link`` -- string of space-separated integers representing the link
|
|
86
|
+
|
|
87
|
+
EXAMPLES::
|
|
88
|
+
|
|
89
|
+
sage: from sage.libs.homfly import homfly_polynomial_dict
|
|
90
|
+
sage: trefoil = '1 6 0 1 1 -1 2 1 0 -1 1 1 2 -1 0 1 1 1 2 1'
|
|
91
|
+
sage: homfly_polynomial_dict(trefoil)
|
|
92
|
+
{(-4, 0): -1, (-2, 0): -2, (-2, 2): 1}
|
|
93
|
+
"""
|
|
94
|
+
link = str_to_bytes(link)
|
|
95
|
+
cdef Term ter
|
|
96
|
+
sig_on()
|
|
97
|
+
cdef Poly* c_output = homfly(link)
|
|
98
|
+
sig_off()
|
|
99
|
+
cdef int l = c_output.len
|
|
100
|
+
d = {}
|
|
101
|
+
for i in range(l):
|
|
102
|
+
ter = c_output.term[i]
|
|
103
|
+
d[(int(ter.l), int(ter.m))] = int(ter.coef)
|
|
104
|
+
return d
|