Ask Your Question

krishna's profile - activity

2017-10-09 14:10:23 +0200 received badge  Popular Question (source)
2017-06-30 03:03:24 +0200 commented answer Vertices of Polytope

This is very helpful, thanks for your detailed response!

2017-06-27 23:57:32 +0200 asked a question Vertices of Polytope

Hi!

I have a list of points that I'm using to construct a convex, finite-sided, compact polytope:

P1 = Polyhedron(vertices = [list_of_points])

I know how to extract from P1 the list of vertices that define it:

vertex_list=[]
for q in P1.Vrepresentation():
    vertex_list.append(q)
print('vertices ='), vertex_list

This returns the following output:

vertices = [A vertex at (0.5, 0.0), A vertex at (-0.5, 0.0), A vertex at (-0.5, 1.0), A vertex at (0.5, -1.0)]

But what I'd like to do is have a list of the coordinates of the vertices only: i.e have sage tell me a list of the form [(.5,0), (-.5, 0), (-.5, 1), (.5, -1)], so that I can do some computations about P1 that are dependent on the coordinates of the vertices. Is there a way to do this?

Thanks!

2017-06-12 16:23:22 +0200 commented question Recasting Laurent polynomials

Also, I have already seen (https://ask.sagemath.org/question/33260/gcd-of-multivariable-polynomials-and-conversion-of-laurent-polynomials-to-ordinary-polynomials/ (https://ask.sagemath.org/question/332...)), but it didn't help me fix the issue at hand. Thanks again!

2017-06-12 16:23:22 +0200 asked a question Recasting Laurent polynomials

Hi,

I have 2 Laurent polynomials, f and g, and I'm trying to recast them into multivariable polynomials over ZZ (I'm eventually going to take their gcd).

However, I'm not able to do so on the Sage Cloud.

So far, I've tried the following:

  1. Extracting the monomials of f and g, and their coefficients, and reconstructed f by:

sum(map(mul,zip(f.coefficients(),f.monomials())))

However, this didn't help, because SAGE thinks the type is:

<type 'sage.rings.polynomial.multi_polynomial_libsingular.MPolynomial_libsingular'>

so I still can't take the gcd.

  1. I also tried to recast into R.<x,y> = ZZ[], but this didn't work either: when I do sage: f.change_ring(R), I get the following error:

    AttributeError: 'sage.rings.polynomial.laurent_polynomial.LaurentPolynomial_mpair' object has no attribute 'change_ring'

Any suggestions would be greatly appreciated!! Thanks so much.