def length_from_matrix(m): t = m.trace() if t.real().center() < 0: # Trace only determined up to sign # We prefer the one with positive real part because # SageMath's acosh has undesirable branching behavior. t = -t return 2 * acosh(t / 2)
def _sage_(self): import sage.all as sage return sage.acosh(self.args[0]._sage_())