On Monday, July 4, 2016 at 6:09:59 AM UTC+1, saad khalid wrote:
>
> So, after fixing a small typo, here is the output from an example:
>
> sage: macaulay2.eval("""
> ....: K = toField(QQ[zet]/(zet^8 - zet^7 +zet^5 - zet^4 +zet^3 -zet + 1))
> ....: A=matrix{{zet^1,0},{0,zet^14}}
> ....: needsPackage "InvariantRing"
> ....: G=generateGroup({A},K)
> ....: P = molienSeries G
> ....:  """)
>
> sage: macaulay2('P').to_sage()
>
>
>
> '(1-T+T**2-T**3+T**4-T**5+T**6-T**7+T**8-T**9+T**10-T**11+T**12-T**13+T**14)/((1-T)^2*(1-T+T^3-T^4+T^5-T^7+T^8)^1*(1+T+T^2)^1*(1+T+T^2+T^3+T^4)^1)'
>

sage: R.<T>=QQ[]
sage: Rf=FractionField(R)
sage: f=Rf('(1+T)/(1-T)^2'); f # your string comes here 
(T + 1)/(T^2 - 2*T + 1)
sage: [f.derivative(T,j)(0)/factorial(j) for j in [0..10]]
[1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21]


# you can instead create a symbolic function:

sage: var('T')
T
sage: ff(T)=SR('(1+T)/(1-T)^2')
sage: ff.taylor(T,0,10)
T |--> 21*T^10 + 19*T^9 + 17*T^8 + 15*T^7 + 13*T^6 + 11*T^5 + 9*T^4 + 7*T^3 
+ 5*T^2 + 3*T + 1




>
> That's the output from the last command, anyways. Now, what I don't 
> understand is how to make it into like... a function, or a Sage object or 
> something like that. Like, I'd want to be able to compute its Taylor series 
> just by doing something like "macaulay2('P').to_sage().taylor()" or 
> something, but I'm not sure how to convert the string. 
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to