Ask Your Question

krishna's profile - activity

2017-10-09 07:10:23 -0500 received badge  Popular Question (source)
2017-06-29 20:03:24 -0500 commented answer Vertices of Polytope

This is very helpful, thanks for your detailed response!

2017-06-27 16:57:32 -0500 asked a question Vertices of Polytope


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:

for q in P1.Vrepresentation():
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?


2017-06-12 09:23:22 -0500 commented question Recasting Laurent polynomials

Also, I have already seen ( (, but it didn't help me fix the issue at hand. Thanks again!

2017-06-12 09:23:22 -0500 asked a question Recasting Laurent polynomials


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:


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.