def heat(dgm1, dgm2, sigma=0.4):
    """
    Return the pseudo-metric between two diagrams based on the continuous
    heat kernel as described in "A Stable Multi-Scale Kernel for Topological Machine Learning" by Jan Reininghaus, Stefan Huber, Ulrich Bauer, and Roland Kwitt (CVPR 2015)

    Parameters
    -----------

    dgm1: np.array (m,2)
        A persistence diagram
    dgm2: np.array (n,2)
        A persistence diagram
    sigma: float
        Heat diffusion parameter (larger sigma makes blurrier)
    Returns
    --------

    dist: float
        heat kernel distance between dgm1 and dgm2

    """
    return np.sqrt(
        evalHeatKernel(dgm1, dgm1, sigma)
        + evalHeatKernel(dgm2, dgm2, sigma)
        - 2 * evalHeatKernel(dgm1, dgm2, sigma)
    )
Return the pseudo-metric between two diagrams based on the continuous
    heat kernel as described in "A Stable Multi-Scale Kernel for Topological Machine Learning" by Jan Reininghaus, Stefan Huber, Ulrich Bauer, and Roland Kwitt (CVPR 2015)

    Parameters
    -----------

    dgm1: np.array (m,2)
        A persistence diagram
    dgm2: np.array (n,2)
        A persistence diagram
    sigma: float
        Heat diffusion parameter (larger sigma makes blurrier)
    Returns
    --------

    dist: float
        heat kernel distance between dgm1 and dgm2