Hi,

I can reproduce the OP's problem on
Sage Version 6.0, Release Date: 2013-12-17
on Ubuntu 13.10, 3.8.0-35-generic.

In fact, I ran into the same problem.

The reason seems to be that the polynomial ring is over QQ, while the the 
root-extraction in the variety(ring=QQbar) command is over QQbar. During 
the computation of the variety, polynomials over both rings occur, and 
mixing them leads to the error.

A fix is to convert all polynomials to QQbar before attempting the 
extraction. On my system, the following change works:

        for t in T:
+            t = [P(p) for p in t]
            Vbar = _variety(list(t),[])
            #Vbar = _variety(list(t.gens()),[])

            for v in Vbar:
                V.append(dict([(P(var),val) for var,val in v.iteritems()]))
        V.sort()

(in rings/polynomial/multi_polynomial_ideal.py, function variety).

Best wishes,
Dominique.



On Thursday, May 2, 2013 4:44:12 PM UTC+3, Pierre wrote:
>
> hi all,
>
> the following happens with both sage 5.5 and sage 5.8 on a macbook, osx 
> 10.7. 
>
> Consider first these computations, which work fine:
>
> B= PolynomialRing(QQ, ["c", "b1", "b2", "v1", "v2", "v3", "v4", "b0"], 
> order= "lex")  
> #making sure we use "lex", so not using B.<c, ...>= QQ[]
> c, b1, b2, v1, v2, v3, v4, b0= B.gens()
> A.<z>= B[]
>
> FF= c*(z-b0)^4*(z-b1)*(z-b2)^2
> FFto= c*(z-1)^2*(z-v1)^2*(z^3 + v2*z^2 + v3*z + v4)
>
> rel= FFto - (FF-1)
>
> J= ( [b0]+rel.coefficients() ) * B
>
> if J.dimension() == 0:
>     V= J.variety(ring= QQbar)
> else:
>     print "not even of dimension 0!"
>
> This produces 8 points on the variety, great. Now if I only change the 
> order in which I put the variables in the polynomial ring, as follows:
>
> B= PolynomialRing(QQ, ["c", "b0", "b1", "b2", "v1", "v2", "v3", "v4"], 
> order= "lex")
> c, b0, b1, b2, v1, v2, v3, v4= B.gens()
> A.<z>= B[]
>
> FF= c*(z-b0)^4*(z-b1)*(z-b2)^2
> FFto= c*(z-1)^2*(z-v1)^2*(z^3 + v2*z^2 + v3*z + v4)
>
> rel= FFto - (FF-1)
>
> J= ( [b0]+rel.coefficients() ) * B
>
> if J.dimension() == 0:
>     V= J.variety(ring= QQbar)
> else:
>     print "not even of dimension 0!"
>
> ...the whole thing now fails with
>
> TypeError: keys do not match self's parent
>
> Of course this is a "minimal" example, and in practice I just cannot try 
> to reorder the variables until things work!!...
>
> any idea, anyone?
>
> thanks!
> Pierre
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" 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-support.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to