def parallel_two_qubit_xeb(
    sampler: cirq.Sampler,
    target: _TARGET_T | dict[_QUBIT_PAIR_T, _TARGET_T],
    ideal_target: _TARGET_T | dict[_QUBIT_PAIR_T, _TARGET_T] | None = None,
    qubits: Sequence[cirq.GridQubit] | None = None,
    pairs: Sequence[_QUBIT_PAIR_T] | None = None,
    parameters: XEBParameters = XEBParameters(),
    rng: np.random.Generator | None = None,
    pool: futures.Executor | None = None,
) -> tqxeb.TwoQubitXEBResult:
    """A convenience method that runs the full XEB workflow.

    Args:
        sampler: The quantum engine or simulator to run the circuits.
        target: The entangling gate, op, circuit or dict mapping pairs to ops.
        ideal_target: The ideal target(s) to branch mark against. If None, use `target`.
        qubits: Qubits under test. If None, uses all qubits on the sampler's device.
        pairs: Pairs to use. If not specified, use all pairs between adjacent qubits.
        parameters: An `XEBParameters` containing the parameters of the XEB experiment.
        rng: The random number generator to use.
        pool: An optional `concurrent.futures.Executor` pool.

    Returns:
        A `TwoQubitXEBResult` object representing the result.

    Raises:
        ValueError: If qubits are not specified and the sampler has no device.
    """
    estimated_fidelities = parallel_xeb_workflow(
        sampler, target, ideal_target, qubits, pairs, parameters, rng, pool
    )
    df = pd.DataFrame.from_records([attrs.asdict(ef) for ef in estimated_fidelities])
    return tqxeb.TwoQubitXEBResult(xeb_fitting.fit_exponential_decays(df))
A convenience method that runs the full XEB workflow.

    Args:
        sampler: The quantum engine or simulator to run the circuits.
        target: The entangling gate, op, circuit or dict mapping pairs to ops.
        ideal_target: The ideal target(s) to branch mark against. If None, use `target`.
        qubits: Qubits under test. If None, uses all qubits on the sampler's device.
        pairs: Pairs to use. If not specified, use all pairs between adjacent qubits.
        parameters: An `XEBParameters` containing the parameters of the XEB experiment.
        rng: The random number generator to use.
        pool: An optional `concurrent.futures.Executor` pool.

    Returns:
        A `TwoQubitXEBResult` object representing the result.

    Raises:
        ValueError: If qubits are not specified and the sampler has no device.
    
cirq-core/cirq/experiments/benchmarking/parallel_xeb.py