Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
replaced is_endomorphism in conversions
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Brandhorst committed Feb 1, 2018
1 parent 61236d7 commit 707824c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/sage/groups/abelian_gps/abelian_aut.py
Expand Up @@ -299,8 +299,10 @@ def _element_constructor_(self, x, check=True):
# Also conversions between the domains use the smith gens.
if x.domain().invariants() != self.domain().gens_orders():
raise ValueError("Invariants of domains must agree.")
if not x.is_endomorphism() or not x.kernel().invariants() == ():
raise ValueError("Not an automorphism of an abelian group.")
if not x.domain()==x.codomain():
raise ValueError("Domain and codomain do not agree.")
if not x.kernel().invariants() == ():
raise ValueError("Not an automorphism.")
dom = self._domain
images = [dom(x(a)).gap() for a in x.domain().smith_form_gens()]
x = dom.gap().GroupHomomorphismByImages(dom.gap(), images)
Expand Down

0 comments on commit 707824c

Please sign in to comment.