[GAP Forum] addition of linear mappings

Thomas Breuer thomas.breuer at math.rwth-aachen.de
Wed Feb 23 12:24:07 GMT 2005


Dear GAP Forum,

Pasha Zusmanovich wrote

> I am trying to add two linear mappings.
> 
> gap> GAPInfo.Version;
> "4.4.4"
> gap> V := VectorSpace (Rationals, [[1,0],[0,1]]);
> <vector space over Rationals, with 2 generators>
> gap> A :=  LeftModuleHomomorphismByImagesNC (V, V, Basis(V),
> [[1,0],[0,0]]);   
> SemiEchelonBasis( <vector space over Rationals, with 2 generators>, 
> [ [ 1, 0 ], [ 0, 1 ] ] ) -> [ [ 1, 0 ], [ 0, 0 ] ]
> gap> B :=  LeftModuleHomomorphismByImagesNC (V, V, Basis(V),
> [[0,0],[0,1]]); 
> SemiEchelonBasis( <vector space over Rationals, with 2 generators>, 
> [ [ 1, 0 ], [ 0, 1 ] ] ) -> [ [ 0, 0 ], [ 0, 1 ] ]
> 
> So far, so good.
> 
> gap> A + B;
> Error, <map1> and <map2> must have same (pre)image called from
> <function>( <arguments> ) called from read-eval-loop
> Entering break read-eval-print loop ...
> you can 'quit;' to quit to outer loop, or
> you can 'return;' to continue
> brk> 
> 
> Indeed, Image(A) does not coincide with Image(B), but is it needed to be
> able to add two mappings? Image(A) and Image(B) are guaranteed to be
> subspaces of V, so their elements can be added safely. If one removes
> the corresponding checks from lib/vspchom.gi (lines with 
> 
> ImagesSource( map1 ) <> ImagesSource( map2 )
> 
> in two places), everything works like a charm:
> 
> gap> A + B;
> SemiEchelonBasis( <vector space over Rationals, with 2 generators>, 
> [ [ 1, 0 ], [ 0, 1 ] ] ) -> [ [ 1, 0 ], [ 0, 1 ] ]
> 
> Am I missing something?

The observation is correct,
the check for equal images is nonsense.
(In fact other methods are installed for this situation which would
return the mapping in question, but they are not called.)

This problem will be fixed in the next version.

Thanks very much for this report.

All the best,
Thomas





More information about the Forum mailing list