On 13.04.2021 11:35, Prof. Dr. Johannes Grabmeier privat wrote: > the FriCAS code for inverting matrices over R is not correct. If wished > I can provide the necessary changes to matfuns.spad
From my side, please do ;) (2) -> IU := inverse(U)@Matrix(R) An expression involving @ Matrix(IntegerMod(26)) actually evaluated to one of type Union(Matrix(Fraction(Integer)),"failed") . Perhaps you should use :: Matrix(IntegerMod(26)) . (2) -> IU := inverse(U)::Matrix(R) +1 24+ (2) | | +0 1 + Type: Matrix(IntegerMod(26)) )sh Matrix(R) => provides no inverse, indeed. > > Problem: recip returns "failed", inverse coerces to Fraction Integer: > > (1) -> R := IntegerMod 26 > > (1) IntegerMod(26) > > > Type: Type > > (2) -> U : Matrix R := [[1,2],[0,1]] > > +1 2+ > (2) | | > +0 1+ > > Type: Matrix(IntegerMod(26)) > (3) -> recip U > > (3) "failed" > > Type: Union("failed",...) > (4) -> inverse U > > +1 - 2+ > (4) | | > +0 1 + > Type: > Union(Matrix(Fraction(Integer)),...) > > > The desired result should be the following: > > (72) -> inverse U > > +1 24+ > (72) | | > +0 1 + > Type: > Union(Matrix(IntegerMod(26)),...) > > -- You received this message because you are subscribed to the Google Groups "FriCAS - computer algebra system" group. To unsubscribe from this group and stop receiving emails from it, send an email to fricas-devel+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/fricas-devel/94649bb7-c3dc-07b3-d27e-2038de129d2c%40gmail.com.