diff --git a/src/sage/homology/free_resolution.py b/src/sage/homology/free_resolution.py index 82e7e91af28..4468585c4f6 100644 --- a/src/sage/homology/free_resolution.py +++ b/src/sage/homology/free_resolution.py @@ -16,9 +16,8 @@ sage: from sage.homology.free_resolution import FreeResolution sage: S. = PolynomialRing(QQ) - sage: m1 = matrix(S, 1, [z^2 - y*w, y*z - x*w, y^2 - x*z]).transpose() - sage: m2 = matrix(S, 3, [-y, x, z, -y, -w, z]) - sage: r = FreeResolution(m1, name='S') + sage: m = matrix(S, 1, [z^2 - y*w, y*z - x*w, y^2 - x*z]).transpose() + sage: r = FreeResolution(m, name='S') sage: r S^1 <-- S^3 <-- S^2 <-- 0 @@ -27,9 +26,6 @@ sage: r S^1 <-- S^3 <-- S^2 <-- 0 - sage: FreeResolution(m2, name='S') - S^2 <-- S^6 <-- S^5 <-- 0 - :: sage: from sage.homology.graded_resolution import GradedFreeResolution @@ -57,6 +53,7 @@ AUTHORS: - Kwankyu Lee (2022-05-13): initial version + """ # **************************************************************************** @@ -83,10 +80,13 @@ class FreeResolution_generic(SageObject): r""" - Abstract base class of finite free resolutions. + Generic base class of finite free resolutions. + + A subclass must provide a ``_maps`` attribute that contains a list of the + maps defining the resolution. The matrix at index `i` in the list defines the differential map from - `(i+1)`-th free module to the `i`-th free module over the base ring by + `(i + 1)`-th free module to the `i`-th free module over the base ring by multiplication on the left. The number of matrices in the list is the length of the resolution. The number of rows and columns of the matrices define the ranks of the free modules in the resolution. @@ -94,6 +94,10 @@ class FreeResolution_generic(SageObject): Note that the first matrix in the list defines the differential map at homological index `1`. + A subclass can define ``_initial_differential`` attribute that + contains the `0`-th differential map whose codomain is the target + of the free resolution. + EXAMPLES:: sage: from sage.homology.free_resolution import FreeResolution @@ -115,13 +119,6 @@ def __init__(self, base_ring, name='F'): """ Initialize. - Subclasses must provide a ``_maps`` attribute that contains the - maps defining the resolution. - - A subclass can define ``_initial_differential`` attribute that - contains the `0`-th differential map whose codomain is the target - of the free resolution. - INPUT: - ``base_ring`` -- a ring @@ -421,7 +418,9 @@ class FreeResolution(FreeResolution_generic): - ``module`` -- a submodule of a free module `M` of rank `n` over `S` or an ideal of a multi-variate polynomial ring + - ``name`` -- a string; name of the base ring + - ``algorithm`` -- Singular algorithm to compute a resolution of ``ideal`` OUTPUT: a minimal free resolution of the ideal diff --git a/src/sage/homology/graded_resolution.py b/src/sage/homology/graded_resolution.py index bfa9354ff4c..a73aa7f5c9f 100644 --- a/src/sage/homology/graded_resolution.py +++ b/src/sage/homology/graded_resolution.py @@ -60,6 +60,7 @@ AUTHORS: - Kwankyu Lee (2022-05): initial version + """ # **************************************************************************** @@ -92,12 +93,16 @@ class GradedFreeResolution(FreeResolution): - ``module`` -- a homogeneous submodule of a free module `M` of rank `n` over `S` or a homogeneous ideal of a multivariate polynomial ring `S` + - ``degrees`` -- (default: a list with all entries `1`) a list of integers or integer vectors giving degrees of variables of `S` + - ``shifts`` -- a list of integers or integer vectors giving shifts of degrees of `n` summands of the free module `M`; this is a list of zero degrees of length `n` by default + - ``name`` -- a string; name of the base ring + - ``algorithm`` -- Singular algorithm to compute a resolution of ``ideal`` If ``module`` is an ideal of `S`, it is considered as a submodule of a @@ -347,6 +352,7 @@ def betti(self, i, a=None): INPUT: - ``i`` -- nonnegative integer + - ``a`` -- a degree; if ``None``, return Betti numbers in all degrees EXAMPLES:: diff --git a/src/sage/libs/singular/function.pyx b/src/sage/libs/singular/function.pyx index 7557f6ee026..d7255b34440 100644 --- a/src/sage/libs/singular/function.pyx +++ b/src/sage/libs/singular/function.pyx @@ -56,15 +56,10 @@ TESTS:: AUTHORS: - Michael Brickenstein (2009-07): initial implementation, overall design - - Martin Albrecht (2009-07): clean up, enhancements, etc - - Michael Brickenstein (2009-10): extension to more Singular types - - Martin Albrecht (2010-01): clean up, support for attributes - - Simon King (2011-04): include the documentation provided by Singular as a code block - - Burcin Erocal, Michael Brickenstein, Oleksandr Motsak, Alexander Dreyer, Simon King (2011-09): plural support """ @@ -757,7 +752,7 @@ cdef class Converter(SageObject): for j from 0 <= j < IDELEMS(i): p = self.to_sage_vector_destructive(i.m[j], free_module) - i.m[j]=NULL # save it from getting freed + i.m[j] = NULL # save it from getting freed l.append( p ) return Sequence(l, check=False, immutable=True) diff --git a/src/sage/libs/singular/singular.pyx b/src/sage/libs/singular/singular.pyx index 2a08d698580..82d83e01212 100644 --- a/src/sage/libs/singular/singular.pyx +++ b/src/sage/libs/singular/singular.pyx @@ -750,6 +750,7 @@ cpdef tuple si2sa_resolution_graded(Resolution res, tuple degrees): INPUT: - ``res`` -- Singular resolution + - ``degrees`` -- list of integers or integer vectors The procedure is destructive, and ``res`` is not usable afterward. @@ -868,7 +869,6 @@ cdef number *sa2si_QQ(Rational r, ring *_ring): - ``_ ring`` - a (pointer to) a singular ring, where the resul will live - OUTPUT: - A (pointer to) a singular number @@ -899,7 +899,6 @@ cdef number *sa2si_GFqGivaro(int quo, ring *_ring): - ``_ ring`` - a (pointer to) a singular ring, where the resul will live - OUTPUT: - A (pointer to) a singular number @@ -908,7 +907,6 @@ cdef number *sa2si_GFqGivaro(int quo, ring *_ring): generator. In this case, ``quo`` is the integer resulting from evaluating that polynomial in the characteristic of the field. - TESTS:: sage: F = FiniteField(5^2) @@ -969,7 +967,6 @@ cdef number *sa2si_GFqNTLGF2E(FFgf2eE elem, ring *_ring): - ``_ ring`` - a (pointer to) a singular ring, where the resul will live - OUTPUT: - A (pointer to) a singular number @@ -1035,7 +1032,6 @@ cdef number *sa2si_GFq_generic(object elem, ring *_ring): - ``_ ring`` - a (pointer to) a singular ring, where the resul will live - OUTPUT: - A (pointer to) a singular number @@ -1102,7 +1098,6 @@ cdef number *sa2si_transext_QQ(object elem, ring *_ring): - ``_ ring`` - a (pointer to) a singular ring, where the resul will live - OUTPUT: - A (pointer to) a singular number @@ -1150,7 +1145,6 @@ cdef number *sa2si_transext_QQ(object elem, ring *_ring): sage: R(f) x + y + 1 """ - cdef int j cdef number *n1 cdef number *a @@ -1255,7 +1249,6 @@ cdef number *sa2si_transext_FF(object elem, ring *_ring): - ``_ ring`` - a (pointer to) a singular ring, where the resul will live - OUTPUT: - A (pointer to) a singular number @@ -1357,7 +1350,6 @@ cdef number *sa2si_NF(object elem, ring *_ring): - ``_ ring`` - a (pointer to) a singular ring, where the resul will live - OUTPUT: - A (pointer to) a singular number @@ -1449,7 +1441,6 @@ cdef number *sa2si_ZZ(Integer d, ring *_ring): - ``_ ring`` - a (pointer to) a singular ring, where the resul will live - OUTPUT: - A (pointer to) a singular number @@ -1659,7 +1650,7 @@ cdef object si2sa_intvec(intvec *v): INPUT: - - ``v`` - a (pointer to) a singular intvec + - ``v`` -- a (pointer to) a singular intvec OUTPUT: