passagemath-meataxe 10.6.1rc10__cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.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.

Potentially problematic release.


This version of passagemath-meataxe might be problematic. Click here for more details.

@@ -0,0 +1,90 @@
1
+ Metadata-Version: 2.4
2
+ Name: passagemath-meataxe
3
+ Version: 10.6.1rc10
4
+ Summary: passagemath: Matrices over small finite fields with meataxe
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://doc.sagemath.org
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: Programming Language :: Python :: 3 :: Only
23
+ Classifier: Programming Language :: Python :: 3.10
24
+ Classifier: Programming Language :: Python :: 3.11
25
+ Classifier: Programming Language :: Python :: 3.12
26
+ Classifier: Programming Language :: Python :: 3.13
27
+ Classifier: Programming Language :: Python :: Implementation :: CPython
28
+ Classifier: Topic :: Scientific/Engineering :: Mathematics
29
+ Requires-Python: <3.14,>=3.10
30
+ Description-Content-Type: text/x-rst
31
+ Requires-Dist: passagemath-modules==10.6.1rc10
32
+
33
+ ========================================================================================
34
+ passagemath: Matrices over small finite fields with meataxe
35
+ ========================================================================================
36
+
37
+ `passagemath <https://github.com/passagemath/passagemath>`__ is open
38
+ source mathematical software in Python, released under the GNU General
39
+ Public Licence GPLv2+.
40
+
41
+ It is a fork of `SageMath <https://www.sagemath.org/>`__, which has been
42
+ developed 2005-2025 under the motto “Creating a Viable Open Source
43
+ Alternative to Magma, Maple, Mathematica, and MATLAB”.
44
+
45
+ The passagemath fork was created in October 2024 with the following
46
+ goals:
47
+
48
+ - providing modularized installation with pip, thus completing a `major
49
+ project started in 2020 in the Sage
50
+ codebase <https://github.com/sagemath/sage/issues/29705>`__,
51
+ - establishing first-class membership in the scientific Python
52
+ ecosystem,
53
+ - giving `clear attribution of upstream
54
+ projects <https://groups.google.com/g/sage-devel/c/6HO1HEtL1Fs/m/G002rPGpAAAJ>`__,
55
+ - providing independently usable Python interfaces to upstream
56
+ libraries,
57
+ - providing `platform portability and integration testing
58
+ services <https://github.com/passagemath/passagemath/issues/704>`__
59
+ to upstream projects,
60
+ - inviting collaborations with upstream projects,
61
+ - `building a professional, respectful, inclusive
62
+ community <https://groups.google.com/g/sage-devel/c/xBzaINHWwUQ>`__,
63
+ - developing a port to `Pyodide <https://pyodide.org/en/stable/>`__ for
64
+ serverless deployment with Javascript,
65
+ - developing a native Windows port.
66
+
67
+ `Full documentation <https://doc.sagemath.org/html/en/index.html>`__ is
68
+ available online.
69
+
70
+ passagemath attempts to support all major Linux distributions and recent versions of
71
+ macOS. Use on Windows currently requires the use of Windows Subsystem for Linux or
72
+ virtualization.
73
+
74
+ Complete sets of binary wheels are provided on PyPI for Python versions 3.10.x-3.13.x.
75
+ Python 3.13.x is also supported, but some third-party packages are still missing wheels,
76
+ so compilation from source is triggered for those.
77
+
78
+
79
+ About this pip-installable distribution package
80
+ -----------------------------------------------
81
+
82
+ This pip-installable distribution ``passagemath-meataxe`` is a small
83
+ optional distribution for use with ``passagemath-standard``.
84
+
85
+ This distribution provides the SageMath modules ``sage.libs.meataxe``
86
+ and ``sage.matrix.matrix_gfpn_dense``.
87
+
88
+ It provides a specialized implementation of matrices over the finite field F_q, where
89
+ q <= 255, using the `SharedMeatAxe <http://users.minet.uni-jena.de/~king/SharedMeatAxe/>`
90
+ library.
@@ -0,0 +1,14 @@
1
+ passagemath_meataxe.libs/libmtx-842173ac.so.0.0.0,sha256=B_bzfuHCq4D-n7jIthJRUcq85eEnfU-CivxFXUXEgVA,1053169
2
+ sage/all__sagemath_meataxe.py,sha256=bJKIZgWmLYLh-2IhrpKDQMoVtc2ryVmIVkPfzZk7-og,66
3
+ sage/libs/all__sagemath_meataxe.py,sha256=isUgdlh6SqmFirYA2LvA-IFIJXW-fyhZrXsbt3PifDY,46
4
+ sage/libs/meataxe.cpython-311-aarch64-linux-gnu.so,sha256=vBgkWLh2YHoZh7M88xJ4BOqJlWF1y8VQNrJ-HyB3lqw,526961
5
+ sage/libs/meataxe.pxd,sha256=FqAwBUCWeeJpp4UjeWxWWhRgStywZP8jmCK0tTvxhTs,6643
6
+ sage/libs/meataxe.pyx,sha256=fRhRX3270t1cC1dRab1H2UHeCRTeMi0WjT9521gblmE,3585
7
+ sage/matrix/all__sagemath_meataxe.py,sha256=isUgdlh6SqmFirYA2LvA-IFIJXW-fyhZrXsbt3PifDY,46
8
+ sage/matrix/matrix_gfpn_dense.cpython-311-aarch64-linux-gnu.so,sha256=6jEH7T2Tqk6TymHkwls3wLl-XIx6IiHRagxTnkZaDUU,2233449
9
+ sage/matrix/matrix_gfpn_dense.pxd,sha256=IMkNNnShKEOvkr-5khmC17O0f4c6PiXvmtYc4Ka62rQ,1708
10
+ sage/matrix/matrix_gfpn_dense.pyx,sha256=tLDSzmtPeBc0ZKv5Jw6FmLk3WicuSNd7CVA82EehEyc,71640
11
+ passagemath_meataxe-10.6.1rc10.dist-info/METADATA,sha256=Anebh0lG5ANm4wWR9cO5UGdj_jVGmHDle3MsA4ur2MI,4243
12
+ passagemath_meataxe-10.6.1rc10.dist-info/WHEEL,sha256=nENvFvUt2sTxh7qTwFTbrHft1Jd6WkcTog-2x3-pWGY,193
13
+ passagemath_meataxe-10.6.1rc10.dist-info/top_level.txt,sha256=Kmzulf9WsphADFQuqgvdy5mvTLDj_V2zkFHU2s3UXos,6
14
+ passagemath_meataxe-10.6.1rc10.dist-info/RECORD,,
@@ -0,0 +1,7 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (80.9.0)
3
+ Root-Is-Purelib: false
4
+ Tag: cp311-cp311-manylinux_2_17_aarch64
5
+ Tag: cp311-cp311-manylinux2014_aarch64
6
+ Tag: cp311-cp311-manylinux_2_28_aarch64
7
+
@@ -0,0 +1,2 @@
1
+ # sage_setup: distribution = sagemath-meataxe
2
+ # delvewheel: patch
@@ -0,0 +1 @@
1
+ # sage_setup: distribution = sagemath-meataxe
sage/libs/meataxe.pxd ADDED
@@ -0,0 +1,156 @@
1
+ # sage_setup: distribution = sagemath-meataxe
2
+
3
+ #*****************************************************************************
4
+ # Copyright (C) 2015 Simon King <simon.king@uni-jena.de>
5
+ #
6
+ # This program is free software: you can redistribute it and/or modify
7
+ # it under the terms of the GNU General Public License as published by
8
+ # the Free Software Foundation, either version 2 of the License, or
9
+ # (at your option) any later version.
10
+ # http://www.gnu.org/licenses/
11
+ #*****************************************************************************
12
+
13
+ #
14
+ # Import SOME features from meataxe.h
15
+ # (most types are not needed, but listed here
16
+ # in the comments, for completeness)
17
+ #
18
+ cdef extern from "meataxe.h":
19
+ # general ctype emulations
20
+ # ctypedef int size_t # size_t should be a standard type!
21
+ # ctypedef unsigned long Ulong
22
+ # ctypedef unsigned short Ushort
23
+ # ctypedef unsigned char Uchar
24
+ ctypedef unsigned char FEL
25
+ ctypedef FEL *PTR
26
+
27
+ # global constants
28
+ cdef extern int FfOrder # Current field order
29
+ cdef extern int FfChar # Current characteristic
30
+ cdef extern FEL FfGen # Generator
31
+ cdef extern int FfNoc # Number of columns for row ops
32
+ cdef extern int MPB # Number of marks stored in a single byte
33
+ cdef extern size_t FfCurrentRowSize # The byte size of a single row in memory,
34
+ # always a multiple of sizeof(long)
35
+ cdef extern size_t FfCurrentRowSizeIo # The number of bytes actually used in a row
36
+ cdef extern char MtxLibDir[1024] # Where to search/create multiplication tables
37
+
38
+ # we only wrap MeatAxe for small fields (size < 255)
39
+ cdef extern FEL mtx_tmult[256][256]
40
+ cdef extern FEL mtx_tadd[256][256]
41
+ cdef extern FEL mtx_taddinv[256]
42
+ cdef extern FEL mtx_tmultinv[256]
43
+ cdef extern FEL mtx_tinsert[8][256]
44
+ cdef extern FEL mtx_textract[8][256]
45
+ cdef extern FEL FF_ONE, FF_ZERO
46
+
47
+ #########################################
48
+ # function prototypes
49
+ ## global parameters
50
+ size_t FfRowSize(int noc)
51
+ size_t FfTrueRowSize(int noc) # Difference to FfRowSize: Doesn't count padding bytes
52
+ int FfSetField(int field) except -1
53
+ int FfSetNoc(int ncols) except -1
54
+
55
+ ## Finite Fields
56
+ FEL FfAdd(FEL a, FEL b)
57
+ FEL FfSub(FEL a, FEL b)
58
+ FEL FfNeg(FEL a)
59
+ FEL FfMul(FEL a, FEL b)
60
+ FEL FfDiv(FEL a, FEL b)
61
+ FEL FfInv(FEL a)
62
+ # FEL FfEmbed(FEL a, int subfield) except 255
63
+ # FEL FfRestrict(FEL a, int subfield) except 255
64
+ FEL FfFromInt(int l)
65
+ int FfToInt(FEL f)
66
+
67
+ ## Rows
68
+ void FfMulRow(PTR row, FEL mark)
69
+ void FfAddMulRow(PTR dest, PTR src, FEL f)
70
+ void FfAddMulRowPartial(PTR dest, PTR src, FEL f, int first, int len)
71
+ PTR FfAddRow(PTR dest, PTR src)
72
+ PTR FfAddRowPartial(PTR dest, PTR src, int first, int len)
73
+ PTR FfSubRow(PTR dest, PTR src)
74
+ PTR FfSubRowPartial(PTR dest, PTR src, int first, int len)
75
+ FEL FfExtract(PTR row, int col)
76
+ void FfInsert(PTR row, int col, FEL mark)
77
+ int FfFindPivot(PTR row, FEL *mark)
78
+ FEL FfScalarProduct(PTR a, PTR b)
79
+ void FfSwapRows(PTR dest, PTR src)
80
+ void FfPermRow(PTR row, long *perm, PTR result)
81
+ int FfCmpRows(PTR p1, PTR p2)
82
+
83
+ ## multiple rows
84
+ PTR FfAlloc(int nor) except NULL
85
+ void FfExtractColumn(PTR mat,int nor,int col,PTR result)
86
+ int FfStepPtr(PTR *x) # Advance to next row
87
+ PTR FfGetPtr(PTR base, int row) # Advance to "row" rows after base
88
+ void FfInsert(PTR row, int col, FEL mark)
89
+ void FfMapRow(PTR row, PTR matrix, int nor, PTR result)
90
+
91
+ ############
92
+ ## Skip: Application, error handling, i/o
93
+
94
+ ############
95
+ ## Matrices
96
+ ############
97
+ ctypedef struct Matrix_t:
98
+ int Field, Nor, Noc # Field, #rows, #columns
99
+ PTR Data # Pointer to data area
100
+ int RowSize # Size (in bytes) of one row
101
+ int *PivotTable # Pivot table (if matrix is in echelon form)
102
+
103
+ ## Basic memory operations
104
+ Matrix_t *MatAlloc(int field, int nor, int noc) except NULL
105
+ int MatFree(Matrix_t *mat)
106
+ PTR MatGetPtr(Matrix_t *mat, int row) except NULL
107
+ int MatCompare(Matrix_t *a, Matrix_t *b) except -2
108
+ int MatCopyRegion(Matrix_t *dest, int destrow, int destcol, Matrix_t *src, int row1, int col1, int nrows, int ncols) except -1
109
+ Matrix_t *MatCut(Matrix_t *src, int row1, int col1, int nrows, int ncols) except NULL
110
+ Matrix_t *MatCutRows(Matrix_t *src, int row1, int nrows) except NULL
111
+ Matrix_t *MatDup(Matrix_t *src) except NULL
112
+ Matrix_t *MatId(int fl, int nor) except NULL
113
+ Matrix_t *MatLoad(char *fn) except? NULL
114
+ int MatSave(Matrix_t *mat, char *fn) except -1
115
+
116
+ ## Basic Arithmetic ## general rule: dest is changed, src/mat are unchanged!
117
+ Matrix_t *MatTransposed(Matrix_t *src) except NULL
118
+ Matrix_t *MatAdd(Matrix_t *dest, Matrix_t *src) except NULL
119
+ Matrix_t *MatAddMul(Matrix_t *dest, Matrix_t *src, FEL coeff) except NULL
120
+ Matrix_t *MatMul(Matrix_t *dest, Matrix_t *src) except NULL
121
+ Matrix_t *MatMulScalar(Matrix_t *dest, FEL coeff) except NULL
122
+ Matrix_t *MatPower(Matrix_t *mat, long n) except NULL
123
+ int StablePower(Matrix_t *mat, int *pwr, Matrix_t **ker) except -1
124
+ FEL MatTrace(Matrix_t *mat) except 255
125
+ Matrix_t *MatMulStrassen(Matrix_t *dest, Matrix_t *A, Matrix_t *B) except NULL
126
+ void StrassenSetCutoff(size_t size)
127
+
128
+ ## "Higher" Arithmetic
129
+ Matrix_t *MatTensor(Matrix_t *m1, Matrix_t *m2) except NULL
130
+ Matrix_t *TensorMap(Matrix_t *vec, Matrix_t *a, Matrix_t *b) except NULL
131
+
132
+ int MatClean(Matrix_t *mat, Matrix_t *sub) except -1
133
+ int MatEchelonize(Matrix_t *mat) except -1
134
+ int MatOrder(Matrix_t *mat) except? -1
135
+ long MatNullity(Matrix_t *mat)
136
+ Matrix_t *MatInverse(Matrix_t *src) except NULL
137
+ Matrix_t *MatNullSpace(Matrix_t *mat) except NULL
138
+ Matrix_t *MatNullSpace__(Matrix_t *mat) except NULL
139
+
140
+ ## Error handling
141
+ cdef extern int MTX_ERR_NOMEM, MTX_ERR_GAME_OVER, MTX_ERR_DIV0, MTX_ERR_FILEFMT, MTX_ERR_BADARG
142
+ cdef extern int MTX_ERR_RANGE, MTX_ERR_NOTECH, MTX_ERR_NOTSQUARE, MTX_ERR_INCOMPAT
143
+ cdef extern int MTX_ERR_BADUSAGE, MTX_ERR_OPTION, MTX_ERR_NARGS, MTX_ERR_NOTMATRIX, MTX_ERR_NOTPERM
144
+ ctypedef struct MtxFileInfo_t:
145
+ char *Name
146
+ char *BaseName
147
+
148
+ ctypedef struct MtxErrorRecord_t:
149
+ MtxFileInfo_t *FileInfo
150
+ int LineNo
151
+ char *Text
152
+
153
+ ctypedef void MtxErrorHandler_t(MtxErrorRecord_t*)
154
+ MtxErrorHandler_t *MtxSetErrorHandler(MtxErrorHandler_t *h)
155
+
156
+ cdef Matrix_t *rawMatrix(int Field, list entries) except NULL
sage/libs/meataxe.pyx ADDED
@@ -0,0 +1,95 @@
1
+ # distutils: libraries = mtx
2
+ # sage_setup: distribution = sagemath-meataxe
3
+
4
+ # ****************************************************************************
5
+ # Copyright (C) 2017 Simon King <simon.king@uni-jena.de>
6
+ #
7
+ # This program is free software: you can redistribute it and/or modify
8
+ # it under the terms of the GNU General Public License as published by
9
+ # the Free Software Foundation, either version 2 of the License, or
10
+ # (at your option) any later version.
11
+ # https://www.gnu.org/licenses/
12
+ # ****************************************************************************
13
+
14
+ from cpython.exc cimport PyErr_SetObject
15
+ from cysignals.signals cimport sig_block, sig_unblock
16
+ cdef dict ErrMsg = {
17
+ "Not enough memory": MemoryError,
18
+ "Time limit exceeded": RuntimeError,
19
+ "Division by zero": ZeroDivisionError,
20
+ "Bad file format": OSError,
21
+ "No such file or directory": OSError,
22
+ "Bad argument": ValueError,
23
+ "Argument out of range": IndexError,
24
+
25
+ "Matrix not in echelon form": ValueError,
26
+ "Matrix not square": ArithmeticError,
27
+ "Incompatible objects": TypeError,
28
+
29
+ "Bad syntax, try `-help'": SyntaxError,
30
+ "Bad usage of option, try `-help'": ValueError,
31
+ "Bad number of arguments, try `-help'": ValueError,
32
+
33
+ "Not a matrix": TypeError,
34
+ "Not a permutation": TypeError
35
+ }
36
+
37
+
38
+ cdef Matrix_t *rawMatrix(int Field, list entries) except NULL:
39
+ """
40
+ Return a meataxe matrix.
41
+
42
+ INPUT:
43
+
44
+ - ``Field`` -- integer; the field size
45
+ - ``entries`` -- list of lists, the entries of the matrix, also
46
+ defining the matrix dimensions. It is *not* tested that all rows
47
+ in ``entries`` have the same length, and it is assumed that both
48
+ the number of rows and the number of columns is positive. All
49
+ elements are given by ints, they are automatically interpreted as
50
+ field elements.
51
+ """
52
+ cdef Matrix_t *M = MatAlloc(Field, len(entries), len(entries[0]))
53
+ cdef PTR x = M.Data
54
+ cdef int idx, i, j
55
+ cdef list dt_i
56
+ for i in range(M.Nor):
57
+ idx = 0
58
+ dt_i = entries[i]
59
+ for j in range(M.Noc):
60
+ FfInsert(x, j, FfFromInt(dt_i[j]))
61
+ FfStepPtr(&(x))
62
+ return M
63
+
64
+ ###############################################################
65
+ ## It is needed to do some initialisation. Since the meataxe
66
+ ## version used in Sage (SharedMeatAxe) is a dynamic (shared)
67
+ ## library, it sufficed to do this initialisation only once.
68
+ ## For convenience, the meataxe_init() function is called in
69
+ ## this module. Hence, `import sage.libs.meataxe` is enough
70
+ ## to make sure that MeatAxe is initialised.
71
+
72
+ from sage.cpython.string cimport str_to_bytes, char_to_str
73
+
74
+ cdef void sage_meataxe_error_handler(const MtxErrorRecord_t *err) noexcept:
75
+ sig_block()
76
+ ErrText = char_to_str(err.Text)
77
+ BaseName = char_to_str(err.FileInfo.BaseName)
78
+ LineNo = err.LineNo
79
+ PyErr_SetObject(ErrMsg.get(ErrText.split(': ')[-1], RuntimeError), f"{ErrText} in file {BaseName} (line {LineNo})")
80
+ sig_unblock()
81
+
82
+ cdef inline meataxe_init() noexcept:
83
+ ## Assign to a variable that enables MeatAxe to find
84
+ ## its multiplication tables.
85
+ global MtxLibDir
86
+ from sage import env
87
+ mtxdir = str_to_bytes(env.MTXLIB)
88
+ if len(mtxdir) >= 1024:
89
+ raise RuntimeError(f"the path for the meataxe library {mtxdir!r} is too long, it needs to be of length < 1024")
90
+ MtxLibDir[:len(mtxdir)] = mtxdir
91
+ MtxLibDir[len(mtxdir)] = c'\0'
92
+ ## Error handling for MeatAxe, to prevent immediate exit of the program
93
+ MtxSetErrorHandler(sage_meataxe_error_handler)
94
+
95
+ meataxe_init()
@@ -0,0 +1 @@
1
+ # sage_setup: distribution = sagemath-meataxe
@@ -0,0 +1,37 @@
1
+ # sage_setup: distribution = sagemath-meataxe
2
+
3
+ # ***************************************************************************
4
+ # Copyright (C) 2015 Simon King <simon.king@uni-jena.de>
5
+ #
6
+ # This program is free software: you can redistribute it and/or modify
7
+ # it under the terms of the GNU General Public License as published by
8
+ # the Free Software Foundation, either version 2 of the License, or
9
+ # (at your option) any later version.
10
+ # https://www.gnu.org/licenses/
11
+ # ***************************************************************************
12
+
13
+ from sage.matrix.matrix_dense cimport Matrix_dense
14
+ from sage.structure.element cimport Matrix
15
+ from sage.libs.meataxe cimport *
16
+
17
+
18
+ cdef class FieldConverter_class:
19
+ cdef field # A function converting an int to a field element
20
+ cdef FEL zero_FEL # the FEL representation of zero
21
+ cpdef fel_to_field(self, FEL x) noexcept
22
+ cpdef FEL field_to_fel(self, x) except 255
23
+
24
+ cdef FieldConverter_class FieldConverter(field) noexcept
25
+
26
+ cdef class Matrix_gfpn_dense(Matrix_dense):
27
+ cdef Matrix_t *Data
28
+ cdef readonly FieldConverter_class _converter
29
+
30
+ cdef set_slice_unsafe(self, Py_ssize_t i, Matrix_gfpn_dense S) noexcept
31
+ cdef inline int get_unsafe_int(self, Py_ssize_t i, Py_ssize_t j) noexcept
32
+ cpdef Matrix_gfpn_dense get_slice(self, Py_ssize_t i, Py_ssize_t j) noexcept
33
+ cpdef list _rowlist_(self, i, j=*) noexcept
34
+ cpdef Matrix_gfpn_dense _multiply_classical(Matrix_gfpn_dense self, Matrix_gfpn_dense right) noexcept
35
+ cpdef Matrix_gfpn_dense _multiply_strassen(Matrix_gfpn_dense self, Matrix_gfpn_dense right, cutoff=*) noexcept
36
+
37
+ cdef Matrix_gfpn_dense new_mtx(Matrix_t* mat, Matrix_gfpn_dense template) noexcept