def METHOD_NAME(ptm_0, ptm_1, d: int=None):
    """
    Calculates the average average gate 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_gate (float): Average gate fidelity
    """
    if d == None:
        d = np.shape(ptm_0)[0]**0.5
    F_pro = process_fidelity(ptm_0, ptm_1, d)
    F_avg_gate = process_fid_to_avg_gate_fid(F_pro, d)
    return F_avg_gate