code: def distance_harmonic(A, B, squared=False):
      r"""Harmonic distance between invertible matrices.
  
      The harmonic distance between two invertible matrices :math:`\mathbf{A}`
      and :math:`\mathbf{B}` is:
  
      .. math::
          d(\mathbf{A},\mathbf{B}) =
          \Vert \mathbf{A}^{-1} - \mathbf{B}^{-1} \Vert_F
  
      Parameters
      ----------
      A : ndarray, shape (..., n, n)
          First invertible matrices, at least 2D ndarray.
      B : ndarray, shape (..., n, n)
          Second invertible matrices, same dimensions as A.
      squared : bool, default False
          Return squared distance.
  
          .. versionadded:: 0.5
  
      Returns
      -------
      d : float or ndarray, shape (...,)
          Harmonic distance between A and B.
  
      See Also
      --------
      distance
      """
      return distance_euclid(
          np.linalg.inv(A), np.linalg.inv(B), squared=squared
      )
  
imports: import numpy
  from scipy.linalg import eigvalsh, solve
  from sklearn.metrics import euclidean_distances
  from .base import logm, sqrtm, invsqrtm
label_desc: Use image node_id 4 for calling a global function with example usage: distance_harmonic(A, B, squared) and returns: distance_euclid