def _logm_superdiag_entry(l1, l2, t12):
 if (l1 == l2):
  f12 = (t12 / l1)
 elif (abs((l2 - l1)) > (abs((l1 + l2)) / 2)):
  f12 = ((t12 * (np.log(l2) - np.log(l1))) / (l2 - l1))
 else:
  z = ((l2 - l1) / (l2 + l1))
  u = _unwindk((np.log(l2) - np.log(l1)))
  if u:
   f12 = (((t12 * 2) * (np.arctanh(z) + ((np.pi * 1j) * u))) / (l2 - l1))
  else:
   f12 = (((t12 * 2) * np.arctanh(z)) / (l2 - l1))
 return f12

def _logm_superdiag_entry ( l1 , l2 , t12 ) : if ( l1 == l2 ) : f12 = ( t12 / l1 ) elif ( abs ( ( l2 - l1 ) ) > ( abs ( ( l1 + l2 ) ) / 2 ) ) : f12 = ( ( t12 * ( np . log ( l2 ) - np . log ( l1 ) ) ) / ( l2 - l1 ) ) else : z = ( ( l2 - l1 ) / ( l2 + l1 ) ) u = _unwindk ( ( np . log ( l2 ) - np . log ( l1 ) ) ) if u : f12 = ( ( ( t12 * 2 ) * ( np . arctanh ( z ) + ( ( np . pi * 1j ) * u ) ) ) / ( l2 - l1 ) ) else : f12 = ( ( ( t12 * 2 ) * np . arctanh ( z ) ) / ( l2 - l1 ) ) return f12
compute a superdiagonal entry of a matrix logarithm .