Hi,

Okay, I got the domain thing figured out, but now I am running into a
separate problem when the polynomial in sdp form is inside of a
matrix.

All this is fine:

from sympy.polys.monomialtools import monomial_lex_key as O_lex
from sympy.polys.groebnertools import *
from sympy.polys.polytools import basic_from_dict
gens = symbols('xyz')
f = x**3 + 2 * y**2 - z
F = Poly(f, *gens)
FF = sdp_from_dict(F.as_dict(), O_lex)
Poly(dict(FF), *gens) == F # True

But not this:

M = Matrix(1, 1, [FF])
Poly(dict(M[0,0]), *gens) == F # False

because the left-hand side becomes the zero polynomial for some reason

In [45]: Poly(dict(M[0,0]), *gens)
Out[45]: Poly(0, x, y, z, domain='ZZ')

It appears to be something related to the coercion to a dictionary

M[0,0] == FF # True
dict(M[0,0]) == dict(FF) # False

even though they look identical

In [50]: dict(M[0,0])
Out[50]: {(0, 0, 1): -1, (0, 2, 0): 2, (3, 0, 0): 1}

In [51]: dict(FF)
Out[51]: {(0, 0, 1): -1, (0, 2, 0): 2, (3, 0, 0): 1}

Any ideas?

Thanks,
Ben

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To post to this group, send email to sy...@googlegroups.com.
To unsubscribe from this group, send email to 
sympy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sympy?hl=en.

Reply via email to