Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Not able to generate a simple list of polynomial. I am getting list of list.

 def quad_polynomial(field, n,m):
    Polynomial_Ring1=PolynomialRing(K,['x%s'%p for p in range(1,n+1)])
    gen_Polynomial_Ring1 = matrix(x1)
    list_of_quadratic_part=[0 for i in range(m)]
    for i in range(m):

    return list_of_quadratic_part

The output I am getting is like this:

[[x1*x2 + (a + 1)*x2^2], [x1^2 + (a + 1)*x1*x2], [x1^2 + (a + 1)*x2^2]]

It is giving me list of list. I want a output like

 [x1*x2 + (a + 1)*x2^2, x1^2 + (a + 1)*x1*x2, x1^2 + (a + 1)*x2^2]

How can I do it?