Opened 4 years ago
Closed 19 months ago
#18606 closed defect (fixed)
padic extensions created with "the same" polynomials may not be the same
Reported by:  mmasdeu  Owned by:  

Priority:  major  Milestone:  sage8.1 
Component:  padics  Keywords:  padics, extensions, hash, sd87 
Cc:  roed, cremona  Merged in:  
Authors:  David Roe  Reviewers:  Frédéric Chapoton 
Report Upstream:  N/A  Work issues:  
Branch:  c1cfe4a (Commits)  Commit:  c1cfe4a898ea67805a1e21e2bf5c9752ea80330b 
Dependencies:  Stopgaps: 
Description
The follow snippet of code shows the bug:
sage: x = QQ['x'].gen() sage: F = Qp(5,20) sage: K = F.extension(x^2F(13),names = 'g') sage: R = MatrixSpace(K,1,1) sage: K1 = F.extension(x^213,names = 'g') sage: Matrix(K1,1,1,[K1(0)])
You would expect the last line to never fail, but it does in this case, and the exception raised is not informative:
NotImplementedError: Conversion from different padic extensions not yet supported
The reason is the following:
sage: K is K1 False sage: hash(K) == hash(K1) True
Since MatrixSpace? has unique representation, the second time that it is called it returns the space over K, not over K1 (this uses the hash of the key values). In the same initialization, it refuses to see K1(0) as an element of K, and the exception is raised.
I think that what should be done to avoid this problem is to convert the defining polynomial of the extension to a polynomial over the base when sanitising the keys.
Change History (5)
comment:1 Changed 21 months ago by
 Keywords sd87 added
comment:2 Changed 19 months ago by
 Branch set to u/roed/same_poly
comment:3 Changed 19 months ago by
 Commit set to c1cfe4a898ea67805a1e21e2bf5c9752ea80330b
 Status changed from new to needs_review
New commits:
c1cfe4a  Add doctest to show 18606 resolved

comment:4 Changed 19 months ago by
 Milestone changed from sage6.8 to sage8.1
 Reviewers set to Frédéric Chapoton
 Status changed from needs_review to positive_review
ok
comment:5 Changed 19 months ago by
 Branch changed from u/roed/same_poly to c1cfe4a898ea67805a1e21e2bf5c9752ea80330b
 Resolution set to fixed
 Status changed from positive_review to closed
Also see #23331