id summary reporter owner description type status priority milestone component resolution keywords cc merged author reviewer upstream work_issues branch commit dependencies stopgaps
28770 Polyhedra coercion of base rings fails for number fields gh-kliem "Currently coercion of polyhedra with number fields does not work. The following results in a type error:
{{{
sage: z = QQ['z'].0
sage: K = NumberField(z^2 - 2,'s')
sage: K.gen()*polytopes.simplex(backend='field')
}}}
But the backend can surely handle it, as the following does work:
{{{
sage: z = QQ['z'].0
sage: K = NumberField(z^2 - 2,'s')
sage: K.gen()*polytopes.simplex(backend='field', base_ring=K)
A 3-dimensional polyhedron in (Number Field in s with defining polynomial z^2 - 2)^4 defined as the convex hull of 4 vertices
}}}
The underlying error:
{{{
sage: z = QQ['z'].0
sage: K = NumberField(z^2 - 2,'s')
sage: parent = polytopes.simplex().parent()
sage: parent._coerce_base_ring(K)
Rational Field
}}}
But it should be `K`.
The problem is that `_coerce_base_ring` of `Polyhedra_base` just takes the base ring of `K`, which are the rationals.
We fix this, by not taking the base ring, if the object is already a ring." defect closed major sage-9.0 geometry fixed jipilab gh-LaisRast Jonathan Kliem Léo Brunswic N/A a0068ccbab09b0102a64c5fbe4ffaffa71b44086 a0068ccbab09b0102a64c5fbe4ffaffa71b44086