# HG changeset patch
# User David Roe <roed@math.harvard.edu>
# Date 1310537833 25200
# Node ID 0c83894159f3334dd922a58a827ebd16d6549919
# Parent 45c2d3a5d11d5f7431a3283c6e5e1c6a7d69a0e2
#11586: fix a bug in norms for unramified padic extensions.
diff git a/sage/rings/padics/padic_ZZ_pX_element.pyx b/sage/rings/padics/padic_ZZ_pX_element.pyx
a

b


377  377  1 + 5^2 + O(5^5) 
378  378  sage: ((1+2*w)).norm()^5 
379  379  1 + 5^2 + O(5^5) 
 380  
 381  TESTS: 
 382  
 383  Check that #11586 has been resolved:: 
 384  
 385  sage: R.<x> = QQ[] 
 386  sage: f = x^2 + 3*x + 1 
 387  sage: M.<a> = Qp(7).extension(f) 
 388  sage: M(7).norm() 
 389  7^2 + O(7^22) 
 390  sage: b = 7*a + 35 
 391  sage: b.norm() 
 392  4*7^2 + 7^3 + O(7^22) 
 393  sage: b*b.frobenius() 
 394  4*7^2 + 7^3 + O(7^22) 
380  395  """ 
381  396  if base is not None: 
382  397  if base is self.parent(): 
… 
… 

387  402  return self.parent().ground_ring()(0) 
388  403  elif self._is_inexact_zero(): 
389  404  return self.ground_ring(0, self.valuation()) 
390   norm_of_uniformizer = (1)**self.parent().degree() * self.parent().defining_polynomial()[0] 
391  405  if self.valuation() == 0: 
392   return self.parent().ground_ring()(self.unit_part().matrix_mod_pn().det()) 
 406  return self.parent().ground_ring()(self.matrix_mod_pn().det()) 
393  407  else: 
 408  if self.parent().e() == 1: 
 409  norm_of_uniformizer = self.parent().ground_ring().uniformizer_pow(self.parent().degree()) 
 410  else: 
 411  norm_of_uniformizer = (1)**self.parent().degree() * self.parent().defining_polynomial()[0] 
394  412  return self.parent().ground_ring()(self.unit_part().matrix_mod_pn().det()) * norm_of_uniformizer**self.valuation() 
395  413  
396  414  def trace(self, base = None): 