Skip to content
This repository was archived by the owner on Jan 30, 2023. It is now read-only.

Commit 80a0e1f

Browse files
committed
Refine category of quotient rings isomorphic to number fields
1 parent f9e393b commit 80a0e1f

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

src/sage/rings/polynomial/polynomial_quotient_ring.py

+14-4
Original file line numberDiff line numberDiff line change
@@ -1605,10 +1605,20 @@ def _isomorphic_ring(self):
16051605

16061606
from sage.categories.all import NumberFields
16071607
if self.base_ring() in NumberFields():
1608-
isomorphic_ring = self.base_ring().extension(self.modulus(), names=self.variable_names())
1609-
from_isomorphic_ring = isomorphic_ring.hom([self.gen()])
1610-
to_isomorphic_ring = self.hom([isomorphic_ring.gen()])
1611-
return from_isomorphic_ring, to_isomorphic_ring, isomorphic_ring
1608+
try:
1609+
isomorphic_ring = self.base_ring().extension(self.modulus(), names=self.variable_names())
1610+
except ValueError:
1611+
pass # modulus is not irreducible
1612+
else:
1613+
if not isomorphic_ring in NumberFields():
1614+
raise NotImplementedError("can not handle extensions of number fields that do not produce number fields")
1615+
# refine the category of self
1616+
if not self.is_field():
1617+
assert False, "self is isomorphic to a field"
1618+
1619+
from_isomorphic_ring = isomorphic_ring.hom([self.gen()])
1620+
to_isomorphic_ring = self.hom([isomorphic_ring.gen()])
1621+
return from_isomorphic_ring, to_isomorphic_ring, isomorphic_ring
16121622

16131623
raise NotImplementedError("can not rewrite %r as an isomorphic ring"%(self,))
16141624

0 commit comments

Comments
 (0)