Opened 3 months ago

Last modified 2 months ago

## #31989 new defect

# Implement homomorphisms from GroupAlgebra over FreeGroup to MatrixSpace

Reported by: | rburing | Owned by: | |
---|---|---|---|

Priority: | major | Milestone: | sage-9.5 |

Component: | algebra | Keywords: | GroupAlgebra, FreeGroup, MatrixSpace, homomorphism, hom |

Cc: | Merged in: | ||

Authors: | Reviewers: | ||

Report Upstream: | N/A | Work issues: | |

Branch: | Commit: | ||

Dependencies: | Stopgaps: |

### Description

In Ask SageMath question #57568 it was pointed out that homomorphisms from a `GroupAlgebra`

over a `FreeGroup`

to a `MatrixSpace`

are not implemented, e.g.:

sage: F = FreeGroup(4, names='A,B,C,D') sage: G = GroupAlgebra(F, ZZ) sage: A,B,C,D = G.gens() sage: A1 = matrix(CC,[[0,I],[I,0]]) sage: B1 = matrix(CC,[[I,0],[0,-I]]) sage: C1 = matrix(CC,[[0,1],[-1,0]]) sage: G.hom([A1,B1,C1,C1]) ... NotImplementedError: Verification of correctness of homomorphisms from Algebra of Free Group on generators {A, B, C, D} over Integer Ring not yet implemented. sage: f = G.hom([A1,B1,C1,C1], check=False) sage: f(A^2 + B^3 + C) ... NotImplementedError:

As mentioned in my answer there, we have the following straightforward workaround:

def my_im_gens_(self, codomain, im_gens, base_map=None): result = codomain.zero() for (g,c) in self._monomial_coefficients.items(): if base_map: c = base_map(c) result += c*g(im_gens) return result G.element_class._im_gens_ = my_im_gens_

Then it works:

sage: f(A^2 + B^3 + C) == A1^2 + B1^3 + C1 True

For a proper fix, the `_im_gens_`

method of `GroupAlgebra.element_class`

should be implemented, in a way similar to the workaround. Probably it works more generally than the case described in the title.

Also, it would be nice not to have to specify `check=False`

in this particular case, because there is nothing to check.

**Note:**See TracTickets for help on using tickets.