Hello,

Computing the inverse of the identity matrix is not possible. Ok, it works for rings using RingElement class for the elements (like ZZ, QQ, RR, CC, ...).

sage: SF = SymmetricFunctions(QQ).schur(); SF
Symmetric Functions over Rational Field in the Schur basis
sage: one = SF.one()
sage: zero = SF.zero()
sage: M = Matrix([[one, zero], [zero, one]])
sage: M
[s[]   0]
[  0 s[]]
sage: M.det()
s[]
sage: M.is_invertible()
True
sage: M.inverse()
...
AttributeError: 'SymmetricFunctionAlgebra_schur_with_category' object has no attribute 'fraction_field'
sage: M = Matrix([[one]])
...
AttributeError: 'tuple' object has no attribute 'parent'
sage: M*M
[s[]   0]
[  0 s[]]
sage: SteenrodAlgebra(7)
mod 7 Steenrod algebra, milnor basis
sage: A = SteenrodAlgebra(7)
sage: M = Matrix([[A.one(), A.zero()], [A.zero(), A.one()]])
sage: M^2
[1 0]
[0 1]
sage: M.inverse()
AttributeError: 'SteenrodAlgebra_generic_with_category' object has no attribute 'fraction_field'

For the curious, defining a fraction_field for these rings is not enought. The good fix should be more serious than that.

More generally, there is no any linear algebra in Sage for general rings. As I worked (the last 6 months) around the coinvariants of the symmetric group (with a module of rank n! over the symmetric polynomials in n variables), I only work locally on my machine with a hard hack that breaks linear algebra over classical rings. I REALLY do not know how to fix that... ( see http://trac.sagemath.org/ticket/15160 for curious people, the fix proposed in attachment breaks scalar multiplication for vector whose element use RingElement class, so it breaks Sage horribly... ).

Sage is able to model impressively my ring as an abstract free module over the symmetric functions with 5 different bases (Parent with multiples realizations : Harmonic polynomials, Schubert polynomials, Descents monomials, monomials under the staircase and higher Specht polynomials are the available bases). I have most of basis changes implemented on my machine but I do need my hack for inverse the coercions between these bases (since inverting a matrix with unital determinant over general ring need a fix).

I am ok with the fact that such a bug concerns only people working with exotic rings or people needing to defined their own rings (like in algebraic combinatorics, we do need vectors spaces indexed by anything....). My problems can't be easily translated as problem of linear algebra over QQ.

Cheers,
Nicolas B.

--
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to