#11892: Extend singular_function to non-commutative polynomial rings
-----------------------------+----------------------------------------------
Reporter: SimonKing | Owner: tbd
Type: PLEASE CHANGE | Status: new
Priority: major | Milestone: sage-4.7.2
Component: PLEASE CHANGE | Keywords:
Work_issues: | Upstream: N/A
Reviewer: | Author:
Merged: | Dependencies: #4539
-----------------------------+----------------------------------------------
Old description:
> #4539 provides g-algebras (non-commutative polynomial rings). However,
> `sage.libs.singular.function.singular_function` doesn't accept them as
> input.
>
> Here is an example that works with usual polynomial rings
> {{{
> sage: from sage.libs.singular.function import singular_function
> sage: P.<x,y,z> = QQ[]
> sage: std = singular_function('std')
> sage: NF = singular_function('NF')
> sage: s_id = singular_function('ideal')
> sage: NF(P.2^2,std(s_id(P(0))))
> // ** _ is no standard basis
> z^2
> }}}
> The same example fails with a non-commutative polynomial ring:
> {{{
> sage: NF(H.2^2,std(s_id(H(0))))
> // ** _ is no standard basis
> ---------------------------------------------------------------------------
> TypeError Traceback (most recent call
> last)
>
> /mnt/local/king/SAGE/debug/sage-4.7.2.alpha3-prerelease/devel/sage-
> main/<ipython console> in <module>()
>
> /mnt/local/king/SAGE/debug/sage-4.7.2.alpha3-prerelease/local/lib/python2.6
> /site-packages/sage/libs/singular/function.so in
> sage.libs.singular.function.SingularFunction.__call__
> (sage/libs/singular/function.cpp:11123)()
> ...
> /mnt/local/king/SAGE/debug/sage-4.7.2.alpha3-prerelease/local/lib/python2.6
> /site-packages/sage/libs/singular/function.so in
> sage.libs.singular.function.call_function
> (sage/libs/singular/function.cpp:12682)()
>
> /mnt/local/king/SAGE/debug/sage-4.7.2.alpha3-prerelease/local/lib/python2.6
> /site-packages/sage/libs/singular/function.so in
> sage.libs.singular.function.Converter.to_python
> (sage/libs/singular/function.cpp:9580)()
>
> /mnt/local/king/SAGE/debug/sage-4.7.2.alpha3-prerelease/local/lib/python2.6
> /site-packages/sage/rings/polynomial/multi_polynomial_libsingular.so in
> sage.rings.polynomial.multi_polynomial_libsingular.MPolynomial_libsingular.__init__
> (sage/rings/polynomial/multi_polynomial_libsingular.cpp:13943)()
>
> TypeError: Argument 'parent' has incorrect type (expected
> sage.rings.polynomial.multi_polynomial_libsingular.MPolynomialRing_libsingular,
> got sage.rings.polynomial.plural.NCPolynomialRing_plural)
> }}}
>
> Apart from the misleading warning about the ideal otained from std not
> being a standard basis, I think the second example should work.
>
> Two approaches: Add
> `sage.rings.polynomial.plural.NCPolynomialRing_plural` as a special case
> to `sage.libs.singular.function`, or make the non-commutative rings
> inherit from the commutative (or probably better the other way around),
> such that isinstance is happy.
New description:
#4539 provides g-algebras (non-commutative polynomial rings). However,
`sage.libs.singular.function.singular_function` doesn't accept them as
input.
Here is an example that works with usual polynomial rings
{{{
sage: from sage.libs.singular.function import singular_function
sage: P.<x,y,z> = QQ[]
sage: std = singular_function('std')
sage: NF = singular_function('NF')
sage: s_id = singular_function('ideal')
sage: NF(P.2^2,std(s_id(P(0))))
// ** _ is no standard basis
z^2
}}}
The same example fails with a non-commutative polynomial ring:
{{{
sage: A.<x,y,z> = FreeAlgebra(QQ, 3)
sage: H.<x,y,z> = A.g_algebra({z*x:x*z+2*x, z*y:y*z-2*y})
sage: NF(H.2^2,std(s_id(H(0))))
// ** _ is no standard basis
---------------------------------------------------------------------------
TypeError Traceback (most recent call
last)
/mnt/local/king/SAGE/debug/sage-4.7.2.alpha3-prerelease/devel/sage-
main/<ipython console> in <module>()
/mnt/local/king/SAGE/debug/sage-4.7.2.alpha3-prerelease/local/lib/python2.6
/site-packages/sage/libs/singular/function.so in
sage.libs.singular.function.SingularFunction.__call__
(sage/libs/singular/function.cpp:11123)()
...
/mnt/local/king/SAGE/debug/sage-4.7.2.alpha3-prerelease/local/lib/python2.6
/site-packages/sage/libs/singular/function.so in
sage.libs.singular.function.call_function
(sage/libs/singular/function.cpp:12682)()
/mnt/local/king/SAGE/debug/sage-4.7.2.alpha3-prerelease/local/lib/python2.6
/site-packages/sage/libs/singular/function.so in
sage.libs.singular.function.Converter.to_python
(sage/libs/singular/function.cpp:9580)()
/mnt/local/king/SAGE/debug/sage-4.7.2.alpha3-prerelease/local/lib/python2.6
/site-packages/sage/rings/polynomial/multi_polynomial_libsingular.so in
sage.rings.polynomial.multi_polynomial_libsingular.MPolynomial_libsingular.__init__
(sage/rings/polynomial/multi_polynomial_libsingular.cpp:13943)()
TypeError: Argument 'parent' has incorrect type (expected
sage.rings.polynomial.multi_polynomial_libsingular.MPolynomialRing_libsingular,
got sage.rings.polynomial.plural.NCPolynomialRing_plural)
}}}
Apart from the misleading warning about the ideal otained from std not
being a standard basis, I think the second example should work.
Two approaches: Add `sage.rings.polynomial.plural.NCPolynomialRing_plural`
as a special case to `sage.libs.singular.function`, or make the non-
commutative rings inherit from the commutative (or probably better the
other way around), such that isinstance is happy.
--
Comment(by SimonKing):
I forgot to copy-and-paste two lines from the example...
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/11892#comment:1>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.