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

Commit

Permalink
Added is_identity check for morphisms induced from a base ring morphism.
Browse files Browse the repository at this point in the history
  • Loading branch information
Travis Scrimshaw committed Sep 14, 2014
1 parent a86cf93 commit 4714ef6
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/sage/rings/morphism.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1557,6 +1557,21 @@ cdef class RingHomomorphism_from_base(RingHomomorphism):
except Exception:
raise TypeError, "invalid argument %s"%repr(x)

def is_identity(self):
"""
Return ``True`` if this morphism is the identity morphism.
EXAMPLES::
sage: K.<z> = GF(4)
sage: phi = End(K)([z^2])
sage: R.<t> = K[]
sage: psi = End(R)(phi)
sage: psi.is_identity()
False
"""
return self.__underlying.is_identity() and RingHomomorphism.is_identity(self)

cdef class RingHomomorphism_cover(RingHomomorphism):
r"""
A homomorphism induced by quotienting a ring out by an ideal.
Expand Down

0 comments on commit 4714ef6

Please sign in to comment.