Quantcast
Channel: ASKSAGE: Sage Q&A Forum - RSS feed
Browsing latest articles
Browse All 10 View Live

Comment by tdstephens3 for Hello,Here is a possibilitysage: R.<a,b> =...

What about the efficiency of each/any of the above methods? In particular, is unpacking the dictionary quicker than unpacking the list?

View Article



Comment by niles for Hello,Here is a possibilitysage: R.<a,b> =...

And for the many-variable case, you can use `d = dict(zip(R.gens(),v))` and `h.subs(d)` (I think the post above forgot to mention this last part). If v really has to be a vector, you could probably...

View Article

Comment by ccanonc for Hello,Here is a possibilitysage: R.<a,b> =...

Digression: flatten() is useful in related use-cases. The max_level keyword argument is very useful when there is multiple nesting.

View Article

Comment by niles for Hello,Here is a possibilitysage: R.<a,b> =...

vdelecroix: I think you have to pass the dictionary object to `subs()`

View Article

Comment by vdelecroix for Hello,Here is a possibilitysage: R.<a,b> =...

Niles: for me P.subs(a=5,b=6) does not work for an element of a polynomial ring (but does for symbolic expressions).

View Article


Answer by vdelecroix for I can't find any support documentation on this, but...

Hello, Here is a possibility sage: R. = PolynomialRing(QQ,['a','b']) sage: R Multivariate Polynomial Ring in a, b over Rational Field sage: P = a^3*b^5+3*a^2+2*b^4 sage: P sage: P(5,6) # standard way...

View Article

Comment by Evgeny for I can't find any support documentation on this, but I'm...

if you select a span of text and click "code formatting" button - the selection will be "backticked" and as a result displayed with a fixed width font.

View Article

Comment by niles for I can't find any support documentation on this, but I'm...

you can put <pre> ... </pre> around the code block to make it more readable (prevent markdown formatting)

View Article


Comment by Evgeny for I can't find any support documentation on this, but I'm...

the same effect has selecting a block of text and clicking the editor button with zeroes and ones.

View Article


How do I Pass a tuple as an argument for a multivariate polynomial?

I can't find any support documentation on this, but I'm sure it must be possible. To give some context, I'm working on a module for invariant theory which allows for computing matrices acting on...

View Article
Browsing latest articles
Browse All 10 View Live


Latest Images