def METHOD_NAME(ptm_0, ptm_1, d: int=None):
    """
    Calculates the average process fidelity between two pauli transfer matrices
    Args:
        ptm_0 (array) : n*n array specifying the first pauli transfer matrix
        ptm_1 (array) : n*n array specifying the second pauli transfer matrix
        d    (int)    : dimension of the Hilbert space
    returns:
        F (float)     : Process fidelity
    """
    if d == None:
        d = np.shape(ptm_0)[0]**0.5
    return np.dot(ptm_0.T, ptm_1).trace()/(d**2)