Yes. Now ZZ[0].coefficients() works. Thanks.
On Jul 22, 2:22 am, Marc Mezzarobba <[email protected]> wrote: > Ben a crit : > > > > > I'm trying to take a rational map on P^1 (i.e. f(x,y) = [deg 2 poly, > > deg 2 poly] and conjugate, but I can't seem to get sage to cooperate. > > > I would like to take a generic degree 2 map on P^1, and conjugate by > > an element of PGL_2. For example, I can do > > > R.<X,Y> = PolynomialRing(QQ,2) > > def f(A,B): > > return A[0]*B[0]^2 + A[1]*B[1]^2 + A[2]*B[0]*B[1],A[3]*B[0]^2 + > > A[4]*B[1]^2 + A[5]*B[0]*B[1] > > > x1,x2,x3,y1,y2,y3=var('x1,x2,x3,y1,y2,y3') > > Avar=[x1,x2,x3,y1,y2,y3] > > > M= matrix([[0, -1],[1, -1]]) > > Z=f(Avar,M*vector([R.0,R.1])) > > ZZ=M.inverse()*vector(Z) > > > Where ZZ is now a 2-tuple where I have conjugated f by M. Now, I > > would like to extract the coefficients of the monomials (X^2,XY,Y^2) > > from each entry of ZZ, but I can't seem to get that done using > > the .coefficients() functions. I think I'm not doing a good job with > > difference between symbolic expressions, functions, and polynomials. > > I think what you want is to replace the first line by > > R.<X,Y> = PolynomialRing(SR, 2) > > Then the elements of R will be allowed to contain symbolic variables. > > -- > Marc Mezzarobba -- To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org
