#16485: "TypeError: keys do not match self's parent" computing variety of
MPolynomialIdeal_singular_repr
---------------------------+------------------------
Reporter: gagern | Owner:
Type: defect | Status: new
Priority: major | Milestone: sage-6.3
Component: algebra | Resolution:
Keywords: | Merged in:
Authors: | Reviewers:
Report Upstream: N/A | Work issues:
Branch: | Commit:
Dependencies: | Stopgaps:
---------------------------+------------------------
Old description:
> {{{
> PR.<q0, q1, q2, q3, c1, c2, c3, o1, o2, o3, f> = PolynomialRing(QQ,
> order='lex')
> i1 = PR.ideal([
> 2*q0*q1*c2*f - 2*q0*q1*o2*f + 2*q1^2*c3*f - 2*q1^2*o3*f +
> 2*q2*q3*c2*f - 2*q2*q3*o2*f + 2*q3^2*c3*f - 2*q3^2*o3*f - c3*f + o3*f -
> 47,
> -2*q0*q1*c1*f + 2*q0*q1*o1*f - 2*q0*q3*c3*f + 2*q0*q3*o3*f +
> 2*q1*q2*c3*f - 2*q1*q2*o3*f - 2*q2*q3*c1*f + 2*q2*q3*o1*f + 54,
> 2*q0*q1*c1*o2*f - 2*q0*q1*c2*o1*f - 2*q0*q3*c2*o3*f +
> 2*q0*q3*c3*o2*f + 2*q1^2*c1*o3*f - 2*q1^2*c3*o1*f + 2*q1*q2*c2*o3*f -
> 2*q1*q2*c3*o2*f + 2*q2*q3*c1*o2*f - 2*q2*q3*c2*o1*f + 2*q3^2*c1*o3*f -
> 2*q3^2*c3*o1*f - c1*o3*f + c3*o1*f + 121,
> 2*q0*q2*c2*f - 2*q0*q2*o2*f + 2*q0*q3*c3*f - 2*q0*q3*o3*f +
> 2*q1*q2*c3*f - 2*q1*q2*o3*f - 2*q1*q3*c2*f + 2*q1*q3*o2*f + 4,
> -2*q0*q2*c1*f + 2*q0*q2*o1*f + 2*q1*q3*c1*f - 2*q1*q3*o1*f +
> 2*q2^2*c3*f - 2*q2^2*o3*f + 2*q3^2*c3*f - 2*q3^2*o3*f - c3*f + o3*f + 22,
> 2*q0*q2*c1*o2*f - 2*q0*q2*c2*o1*f + 2*q0*q3*c1*o3*f -
> 2*q0*q3*c3*o1*f + 2*q1*q2*c1*o3*f - 2*q1*q2*c3*o1*f - 2*q1*q3*c1*o2*f +
> 2*q1*q3*c2*o1*f + 2*q2^2*c2*o3*f - 2*q2^2*c3*o2*f + 2*q3^2*c2*o3*f -
> 2*q3^2*c3*o2*f - c2*o3*f + c3*o2*f + 3,
> 2*q0*q2*f + 2*q1*q3*f + 20,
> -2*q0*q1*f + 2*q2*q3*f - 15,
> 2*q0*q1*c2*f - 2*q0*q2*c1*f + 2*q1^2*c3*f - 2*q1*q3*c1*f +
> 2*q2^2*c3*f - 2*q2*q3*c2*f - c3*f - 85,
> q0^2 + q1^2 + q2^2 + q3^2 - 1,
> c3 - 3,
> ])
> i1.variety(QQbar)
> }}}
>
> Trying to compute a variety of some ideal, I get an error message
> instead:
>
> {{{
> Traceback (most recent call last):
> File "/projects/3629be9c-
> d6c4-4013-a305-69c083e264d0/.sagemathcloud/sage_server.py", line 734, in
> execute
> exec compile(block+'\n', '', 'single') in namespace, locals
> File "", line 1, in <module>
> File "/usr/local/sage/sage-6.2.rc0/local/lib/python2.7/site-
> packages/sage/rings/polynomial/multi_polynomial_ideal.py", line 604, in
> __call__
> return self.f(self._instance, *args, **kwds)
> File "/usr/local/sage/sage-6.2.rc0/local/lib/python2.7/site-
> packages/sage/rings/polynomial/multi_polynomial_ideal.py", line 2647, in
> variety
> Vbar = _variety(list(t),[])
> File "/usr/local/sage/sage-6.2.rc0/local/lib/python2.7/site-
> packages/sage/rings/polynomial/multi_polynomial_ideal.py", line 2620, in
> _variety
> _variety(Tbar,V,vbar)
> File "/usr/local/sage/sage-6.2.rc0/local/lib/python2.7/site-
> packages/sage/rings/polynomial/multi_polynomial_ideal.py", line 2620, in
> _variety
> _variety(Tbar,V,vbar)
> File "/usr/local/sage/sage-6.2.rc0/local/lib/python2.7/site-
> packages/sage/rings/polynomial/multi_polynomial_ideal.py", line 2620, in
> _variety
> _variety(Tbar,V,vbar)
> File "/usr/local/sage/sage-6.2.rc0/local/lib/python2.7/site-
> packages/sage/rings/polynomial/multi_polynomial_ideal.py", line 2620, in
> _variety
> _variety(Tbar,V,vbar)
> File "/usr/local/sage/sage-6.2.rc0/local/lib/python2.7/site-
> packages/sage/rings/polynomial/multi_polynomial_ideal.py", line 2620, in
> _variety
> _variety(Tbar,V,vbar)
> File "/usr/local/sage/sage-6.2.rc0/local/lib/python2.7/site-
> packages/sage/rings/polynomial/multi_polynomial_ideal.py", line 2620, in
> _variety
> _variety(Tbar,V,vbar)
> File "/usr/local/sage/sage-6.2.rc0/local/lib/python2.7/site-
> packages/sage/rings/polynomial/multi_polynomial_ideal.py", line 2620, in
> _variety
> _variety(Tbar,V,vbar)
> File "/usr/local/sage/sage-6.2.rc0/local/lib/python2.7/site-
> packages/sage/rings/polynomial/multi_polynomial_ideal.py", line 2620, in
> _variety
> _variety(Tbar,V,vbar)
> File "/usr/local/sage/sage-6.2.rc0/local/lib/python2.7/site-
> packages/sage/rings/polynomial/multi_polynomial_ideal.py", line 2619, in
> _variety
> Tbar = [ f.subs({variable:root}) for f in T ]
> File "multi_polynomial_libsingular.pyx", line 3298, in
> sage.rings.polynomial.multi_polynomial_libsingular.MPolynomial_libsingular.subs
> (sage/rings/polynomial/multi_polynomial_libsingular.cpp:22723)
> TypeError: keys do not match self's parent
> }}}
>
> So far I haven't managed to find a smaller reproducing example.
New description:
Trying to compute a variety, I get an error instead. The code snippets are
from
[http://git.sagemath.org/sage.git/tree/src/sage/rings/polynomial/multi_polynomial_ideal.py?h=develop&id=6.3.beta3#n2384
multi_polynomial_ideal as of Sage version 6.3.beta3].
{{{
sage: Qabcd.<a,b,c,d> = PolynomialRing(QQ, order='lex')
sage: ideal(2*d^2 - 1, 5*c - 3*d, 5*b + 4*d, a).variety(QQbar)
---------------------------------------------------------------------------
TypeError Traceback (most recent call
last)
<ipython-input-2-1f88209af548> in <module>()
----> 1 ideal(Integer(2)*d**Integer(2) - Integer(1), Integer(5)*c -
Integer(3)*d, Integer(5)*b + Integer(4)*d, a).variety(QQbar)
sage/local/lib/python2.7/site-
packages/sage/rings/polynomial/multi_polynomial_ideal.pyc in
__call__(self, *args, **kwds)
602 if not R.base_ring().is_field():
603 raise ValueError("Coefficient ring must be a field for
function '%s'."%(self.f.__name__))
--> 604 return self.f(self._instance, *args, **kwds)
605
606 require_field = RequireField
sage/local/lib/python2.7/site-
packages/sage/rings/polynomial/multi_polynomial_ideal.pyc in variety(self,
ring)
2647 V = []
2648 for t in T:
-> 2649 Vbar = _variety(list(t),[])
2650 #Vbar = _variety(list(t.gens()),[])
2651
sage/local/lib/python2.7/site-
packages/sage/rings/polynomial/multi_polynomial_ideal.pyc in _variety(T,
V, v)
2620 vbar[variable] = root
2621 Tbar = [ f.subs({variable:root}) for f in T ]
-> 2622 _variety(Tbar,V,vbar)
2623
2624 return V
sage/local/lib/python2.7/site-
packages/sage/rings/polynomial/multi_polynomial_ideal.pyc in _variety(T,
V, v)
2619 vbar = v.copy()
2620 vbar[variable] = root
-> 2621 Tbar = [ f.subs({variable:root}) for f in T ]
2622 _variety(Tbar,V,vbar)
2623
sage/local/lib/python2.7/site-
packages/sage/rings/polynomial/multi_polynomial_libsingular.so in
sage.rings.polynomial.multi_polynomial_libsingular.MPolynomial_libsingular.subs
(sage/rings/polynomial/multi_polynomial_libsingular.cpp:22728)()
TypeError: keys do not match self's parent
}}}
--
Comment (by gagern):
I found a shorter reproducing example.
--
Ticket URL: <http://trac.sagemath.org/ticket/16485#comment:2>
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 unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.