Hi David - 

This is a consistent design decision across Sage: when you invert a 
> ring element, it automatically returns the inverse as an element of 
> the fraction field. 


It seems to me that this violates the principle of "least surprise":  if I 
have 
a unit in a ring, and I invert it, I can reasonably expect answer to be a 
unit, 
in that ring... 

Here is (a reconstruction of) what happened to me:  I was
preparing a question on Smith normal forms for my class 
on homology.  I computed 

sage: A = matrix(ZZ, [[-6, -26, -82], [0, 4, 3], [1, 0, 7], [0, 2, 5], [2, 
10, 30]])
sage: D, U, V = A.smith_form()
sage: U*A*V == D
True
sage: D == (U.inverse()*D).smith_form()[0]
False

I was thrown by this.  The theorem for Smith normal form tells me that U 
lies 
in GL(5,ZZ) so multiplying by U.inverse() cannot change the Smith normal 
form...  Indeed, I print U and U.inverse() and both are integer matrices... 
  

Generally the idea is that the parent of the result of an operation should 

depend only on the parents of the operands (not on their actual values). 

I don't know exactly what the arguments for and against this are, 


Ah, ok.  I'm interested to know the for and the against here. 

best,

saul

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to