Simulate and benchmark two-qubit XEB circuits.
cirq.experiments.xeb_fitting.benchmark_2q_xeb_fidelities(
sampled_df: pd.DataFrame,
circuits: Sequence['cirq.Circuit'],
cycle_depths: Optional[Sequence[int]] = None,
param_resolver: 'cirq.ParamResolverOrSimilarType' = None,
pool: Optional['multiprocessing.pool.Pool'] = None
) -> pd.DataFrame
Used in the notebooks
This uses the estimator from
cirq.experiments.fidelity_estimation.least_squares_xeb_fidelity_from_expectations
, but
adapted for use on pandas DataFrames for efficient vectorized operation.
Args |
sampled_df
|
The sampled results to benchmark. This is likely produced by a call to
sample_2q_xeb_circuits .
|
circuits
|
The library of circuits corresponding to the sampled results in sampled_df .
|
cycle_depths
|
The sequence of cycle depths to benchmark the circuits. If not provided,
we use the cycle depths found in sampled_df . All requested cycle_depths must be
present in sampled_df .
|
param_resolver
|
If circuits contain parameters, resolve according to this ParamResolver
prior to simulation
|
pool
|
If provided, execute the simulations in parallel.
|
Returns |
A DataFrame with columns 'cycle_depth' and 'fidelity'.
|
Raises |
ValueError
|
If cycle_depths is not a non-empty array or if the cycle_depths provided
includes some values not available in sampled_df .
|