# HG changeset patch
# User Igor Tolkov <itolkov@gmail.com>
# Date 1367552918 25200
# Node ID a91ee327fa367ed79e91718bb27788d98066f23b
# Parent c8ae9724d3cfad1837a130d50ac5c83a811ec221
Trac 14508: bugfix in jordan_form
diff git a/sage/matrix/matrix2.pyx b/sage/matrix/matrix2.pyx
a

b


8541  8541  Traceback (most recent call last): 
8542  8542  ... 
8543  8543  ValueError: Jordan normal form not implemented over inexact rings. 
 8544  
 8545  Here we need to specify a field (#14508). 
 8546  
 8547  :: 
 8548  
 8549  sage: c = matrix([[0,1,0],[0,0,1],[1,0,0]]); 
 8550  sage: c.jordan_form(CyclotomicField(3)) 
 8551  [ 1 0 0] 
 8552  [++] 
 8553  [ 0 zeta3 0] 
 8554  [++] 
 8555  [ 0 0zeta3  1] 
8544  8556  
8545  8557  If you need the transformation matrix as well as the Jordan form of 
8546  8558  ``self``, then pass the option ``transformation=True``. 
… 
… 

8786  8798  else: 
8787  8799  return self, self.parent().identity_matrix() 
8788  8800  
8789   if (base_ring is None and not self.base_ring().is_exact()) or \ 
8790   (not base_ring is None and not base_ring.is_exact()): 
 8801  if base_ring is None: 
 8802  base_ring = self.base_ring() 
 8803  
 8804  if not base_ring.is_exact(): 
8791  8805  raise ValueError("Jordan normal form not implemented over inexact rings.") 
8792  8806  
8793   if base_ring is None: 
8794   A = self 
8795   base_ring = self.base_ring() 
8796   
8797   # make sure we're working with a field.. 
8798   if not base_ring.is_field(): 
 8807  # Make sure we're working with a field. 
 8808  if base_ring.is_field(): 
 8809  A = self.change_ring(base_ring) 
 8810  else: 
8799  8811  try: 
8800  8812  base_field = base_ring.fraction_field() 
8801  8813  except (NotImplementedError, TypeError, AttributeError): 