Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
Fix spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
kwankyu committed Aug 8, 2022
1 parent 3f1d1c3 commit ab725f2
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 32 deletions.
29 changes: 14 additions & 15 deletions src/sage/homology/free_resolution.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@
sage: from sage.homology.free_resolution import FreeResolution
sage: S.<x,y,z,w> = 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
Expand All @@ -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
Expand Down Expand Up @@ -57,6 +53,7 @@
AUTHORS:
- Kwankyu Lee (2022-05-13): initial version
"""

# ****************************************************************************
Expand All @@ -83,17 +80,24 @@

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.
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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions src/sage/homology/graded_resolution.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
AUTHORS:
- Kwankyu Lee (2022-05): initial version
"""

# ****************************************************************************
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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::
Expand Down
7 changes: 1 addition & 6 deletions src/sage/libs/singular/function.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -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
"""
Expand Down Expand Up @@ -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)
Expand Down
13 changes: 2 additions & 11 deletions src/sage/libs/singular/singular.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit ab725f2

Please sign in to comment.