This repository was archived by the owner on Jan 30, 2023. It is now read-only.
Commit 80a0e1f 1 parent f9e393b commit 80a0e1f Copy full SHA for 80a0e1f
File tree 1 file changed +14
-4
lines changed
src/sage/rings/polynomial
1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -1605,10 +1605,20 @@ def _isomorphic_ring(self):
1605
1605
1606
1606
from sage .categories .all import NumberFields
1607
1607
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
1612
1622
1613
1623
raise NotImplementedError ("can not rewrite %r as an isomorphic ring" % (self ,))
1614
1624
You can’t perform that action at this time.
0 commit comments