libSingular: Conversion Routines and Initialisation

AUTHOR:

sage.libs.singular.singular.get_resource(id)[source]

Return a Singular “resource”.

INPUT:

OUTPUT: string or None

EXAMPLES:

sage: from sage.libs.singular.singular import get_resource
sage: get_resource('D')            # SINGULAR_DATA_DIR
'...'
sage: get_resource('i')            # SINGULAR_INFO_FILE
'.../singular...'
sage: get_resource('7') is None    # not defined
True
>>> from sage.all import *
>>> from sage.libs.singular.singular import get_resource
>>> get_resource('D')            # SINGULAR_DATA_DIR
'...'
>>> get_resource('i')            # SINGULAR_INFO_FILE
'.../singular...'
>>> get_resource('7') is None    # not defined
True
sage.libs.singular.singular.si2sa_resolution(res)[source]

Pull the data from Singular resolution res to construct a Sage resolution.

INPUT:

  • res – Singular resolution

The procedure is destructive and res is not usable afterward.

EXAMPLES:

sage: from sage.libs.singular.singular import si2sa_resolution
sage: from sage.libs.singular.function import singular_function
sage: module = singular_function("module")
sage: mres = singular_function('mres')

sage: S.<x,y,z,w> = PolynomialRing(QQ)
sage: I = S.ideal([y*w - z^2, -x*w + y*z, x*z - y^2])
sage: mod = module(I)
sage: r = mres(mod, 0)
sage: si2sa_resolution(r)
[
                                 [ y  x]
                                 [-z -y]
[z^2 - y*w y*z - x*w y^2 - x*z], [ w  z]
]
>>> from sage.all import *
>>> from sage.libs.singular.singular import si2sa_resolution
>>> from sage.libs.singular.function import singular_function
>>> module = singular_function("module")
>>> mres = singular_function('mres')

>>> S = PolynomialRing(QQ, names=('x', 'y', 'z', 'w',)); (x, y, z, w,) = S._first_ngens(4)
>>> I = S.ideal([y*w - z**Integer(2), -x*w + y*z, x*z - y**Integer(2)])
>>> mod = module(I)
>>> r = mres(mod, Integer(0))
>>> si2sa_resolution(r)
[
                                 [ y  x]
                                 [-z -y]
[z^2 - y*w y*z - x*w y^2 - x*z], [ w  z]
]
sage.libs.singular.singular.si2sa_resolution_graded(res, degrees)[source]

Pull the data from Singular resolution res to construct a Sage resolution.

INPUT:

  • res – Singular resolution

  • degrees – list of integers or integer vectors

The procedure is destructive, and res is not usable afterward.

EXAMPLES:

sage: from sage.libs.singular.singular import si2sa_resolution_graded
sage: from sage.libs.singular.function import singular_function
sage: module = singular_function("module")
sage: mres = singular_function('mres')

sage: S.<x,y,z,w> = PolynomialRing(QQ)
sage: I = S.ideal([y*w - z^2, -x*w + y*z, x*z - y^2])
sage: mod = module(I)
sage: r = mres(mod, 0)
sage: res_mats, res_degs = si2sa_resolution_graded(r, (1, 1, 1, 1))
sage: res_mats
[
                                 [ y  x]
                                 [-z -y]
[z^2 - y*w y*z - x*w y^2 - x*z], [ w  z]
]
sage: res_degs
[[[2], [2], [2]], [[1, 1, 1], [1, 1, 1]]]
>>> from sage.all import *
>>> from sage.libs.singular.singular import si2sa_resolution_graded
>>> from sage.libs.singular.function import singular_function
>>> module = singular_function("module")
>>> mres = singular_function('mres')

>>> S = PolynomialRing(QQ, names=('x', 'y', 'z', 'w',)); (x, y, z, w,) = S._first_ngens(4)
>>> I = S.ideal([y*w - z**Integer(2), -x*w + y*z, x*z - y**Integer(2)])
>>> mod = module(I)
>>> r = mres(mod, Integer(0))
>>> res_mats, res_degs = si2sa_resolution_graded(r, (Integer(1), Integer(1), Integer(1), Integer(1)))
>>> res_mats
[
                                 [ y  x]
                                 [-z -y]
[z^2 - y*w y*z - x*w y^2 - x*z], [ w  z]
]
>>> res_degs
[[[2], [2], [2]], [[1, 1, 1], [1, 1, 1]]]