Fit exponential decay curves to a fidelities DataFrame.

Used in the notebooks

Used in the tutorials

fidelities_df A DataFrame that is the result of benchmark_2q_xeb_fidelities. It may contain results for multiple pairs of qubits identified by the "pair" column. Each pair will be fit separately. At minimum, this dataframe must contain "cycle_depth", "fidelity", and "pair" columns.

A new, aggregated dataframe with index given by (pair, layer_i, pair_i); columns for the fit parameters "a" and "layer_fid"; and nested "cycles_depths" and "fidelities" lists (now grouped by pair).