def parallel_two_qubit_xeb(
    sampler: cirq.Sampler,
    qubits: Sequence[cirq.GridQubit] | None = None,
    entangling_gate: cirq.Gate = ops.CZ,
    n_repetitions: int = 10**4,
    n_combinations: int = 10,
    n_circuits: int = 20,
    cycle_depths: Sequence[int] = (5, 25, 50, 100, 200, 300),
    random_state: cirq.RANDOM_STATE_OR_SEED_LIKE = None,
    ax: plt.Axes | None = None,
    pairs: Sequence[tuple[cirq.GridQubit, cirq.GridQubit]] | None = None,
    batch_size: int = 9,
    tags: Sequence[Any] = (),
    **plot_kwargs,
) -> TwoQubitXEBResult:
    """A convenience method that runs the full XEB workflow.

    Args:
        sampler: The quantum engine or simulator to run the circuits.
        qubits: Qubits under test. If none, uses all qubits on the sampler's device.
        entangling_gate: The entangling gate to use.
        n_repetitions: The number of repetitions to use.
        n_combinations: The number of combinations to generate.
        n_circuits: The number of circuits to generate.
        cycle_depths: The cycle depths to use.
        random_state: The random state to use.
        ax: the plt.Axes to plot the device layout on. If not given,
            no plot is created.
        pairs: Pairs to use. If not specified, use all pairs between adjacent qubits.
        batch_size: We call `run_batch` on the sampler, which can speed up execution in certain
            environments. The number of (circuit, cycle_depth) tasks to be run in each batch
            is given by this number.
        tags: Tags to add to two qubit operations.
        **plot_kwargs: Arguments to be passed to 'plt.Axes.plot'.
    Returns:
        A TwoQubitXEBResult object representing the results of the experiment.
    Raises:
        ValueError: If qubits are not specified and the sampler has no device.
    """
    fids, *_ = parallel_xeb_workflow(
        sampler=sampler,
        qubits=qubits,
        pairs=pairs,
        entangling_gate=entangling_gate,
        n_repetitions=n_repetitions,
        n_combinations=n_combinations,
        n_circuits=n_circuits,
        cycle_depths=cycle_depths,
        random_state=random_state,
        ax=ax,
        batch_size=batch_size,
        tags=tags,
        **plot_kwargs,
    )
    return TwoQubitXEBResult(fit_exponential_decays(fids))
A convenience method that runs the full XEB workflow.

    Args:
        sampler: The quantum engine or simulator to run the circuits.
        qubits: Qubits under test. If none, uses all qubits on the sampler's device.
        entangling_gate: The entangling gate to use.
        n_repetitions: The number of repetitions to use.
        n_combinations: The number of combinations to generate.
        n_circuits: The number of circuits to generate.
        cycle_depths: The cycle depths to use.
        random_state: The random state to use.
        ax: the plt.Axes to plot the device layout on. If not given,
            no plot is created.
        pairs: Pairs to use. If not specified, use all pairs between adjacent qubits.
        batch_size: We call `run_batch` on the sampler, which can speed up execution in certain
            environments. The number of (circuit, cycle_depth) tasks to be run in each batch
            is given by this number.
        tags: Tags to add to two qubit operations.
        **plot_kwargs: Arguments to be passed to 'plt.Axes.plot'.
    Returns:
        A TwoQubitXEBResult object representing the results of the experiment.
    Raises:
        ValueError: If qubits are not specified and the sampler has no device.
    
cirq-core/cirq/experiments/two_qubit_xeb.py