Ask Your Question

multivariate polynomials, libsingular and polydict

asked 2019-10-14 14:22:36 +0200

Annavw gravatar image

When defining mutlivariate polynomial in two different ways, I cannot compare them because they seem to have a different type. On the one hand I have

R = PolynomialRing(QQ,'x', 3); x = R.gens()
f = x[0] + x[1] + x[2]

which gives <πšπš’πš™πšŽ'𝚜𝚊𝚐𝚎.πš›πš’πš—πšπšœ.πš™πš˜πš•πš’πš—πš˜πš–πš’πšŠπš•.πš–πšžπš•πšπš’βŽ―πš™πš˜πš•πš’πš—πš˜πš–πš’πšŠπš•βŽ―πš•πš’πš‹πšœπš’πš—πšπšžπš•πšŠπš›.π™Όπ™Ώπš˜πš•πš’πš—πš˜πš–πš’πšŠπš•βŽ―πš•πš’πš‹πšœπš’πš—πšπšžπš•πšŠπš›'>. On the other hand I define what is (to me) the same polynomial:

SF = SymmetricFunctions(F); SF.inject_shorthands(verbose=False)
g = h[1].expand(3, alphabet = R.gens())

which gives <πšŒπš•πšŠπšœπšœ'𝚜𝚊𝚐𝚎.πš›πš’πš—πšπšœ.πš™πš˜πš•πš’πš—πš˜πš–πš’πšŠπš•.πš–πšžπš•πšπš’βŽ―πš™πš˜πš•πš’πš—πš˜πš–πš’πšŠπš•βŽ―πšŽπš•πšŽπš–πšŽπš—πš.π™Όπ™Ώπš˜πš•πš’πš—πš˜πš–πš’πšŠπš•βŽ―πš™πš˜πš•πš’πšπš’πšŒπš'>

Thus when comparing f == g it gives false. How can get these two modules to talk to each other?

edit retag flag offensive close merge delete


What is F ? I got:

NameError: name 'F' is not defined
tmonteil gravatar imagetmonteil ( 2019-10-14 14:35:43 +0200 )edit

1 Answer

Sort by Β» oldest newest most voted

answered 2019-10-14 14:41:17 +0200

tmonteil gravatar image

updated 2019-10-14 14:46:12 +0200

Remove the verbose=False option and you will see the problem: f is redefined when you call SF.inject_shorthands() !

Note that, while f and g are not of the same type, they have the same parent:

sage: parent(f)
Multivariate Polynomial Ring in x0, x1, x2 over Rational Field
sage: parent(g)
Multivariate Polynomial Ring in x0, x1, x2 over Rational Field

And, if you redefine f after it has been overwritten by SF.inject_shorthands(), you get:

sage: f == g
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2019-10-14 14:22:36 +0200

Seen: 62 times

Last updated: Oct 14 '19