I would have thought that A.monomial(L) where L is either a listor tuple of the right length would be a very natural thing to add for multivariate polynomial rings. You could define your own as a work-around:
sage: def monomial(A,L): return A({tuple(L): A.base_ring().one_element()}) sage: monomial(A,[2,3,4]) x^2*y^3*z^4 John On 1 October 2013 15:58, Ursula Whitcher <whitc...@uwec.edu> wrote: > On 10/1/2013 8:51 AM, John Cremona wrote: > >>> Can somebody explain this syntax to me? I understand tuple([1,1,1]), but >>> what are the curly brackets and the colon doing? >> >> >> The argument is a python dict, which you should read up about for more >> details. > > > Thanks, that's exactly what I needed to know! > >>> Also, is there a reason that A.monomial([1,1,1]) does not return the same >>> result? >> >> >> You did not make precise what type your A is but if I define >> >> sage: A.<x,y,z> = QQ[] >> sage: A >> Multivariate Polynomial Ring in x, y, z over Rational Field >> sage: type(A) >> <type >> 'sage.rings.polynomial.multi_polynomial_libsingular.MPolynomialRing_libsingular'> >> >> then A has no method called "monomial". > > > Very true. I suppose what I was asking was, would it be useful to human > beings who are not me to wrap the python-esque syntax in a Sage function? > And if so, is "monomial" the right thing to call the function, or should > A.monomial() naturally refer to some other operation? > > > --Ursula. > > -- > 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 sage-support+unsubscr...@googlegroups.com. > To post to this group, send email to sage-support@googlegroups.com. > Visit this group at http://groups.google.com/group/sage-support. > For more options, visit https://groups.google.com/groups/opt_out. -- 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 sage-support+unsubscr...@googlegroups.com. To post to this group, send email to sage-support@googlegroups.com. Visit this group at http://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/groups/opt_out.